# sebastianbergmann/code-unit-reverse-lookup

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/sebastianbergmann-code-unit-reverse-lookup).**

6,690 stars · 6 forks · PHP · BSD-3-Clause

## Links

- GitHub: https://github.com/sebastianbergmann/code-unit-reverse-lookup
- awesome-repositories: https://awesome-repositories.com/repository/sebastianbergmann-code-unit-reverse-lookup.md

## Description

This project is a static code analysis tool that functions as a code unit resolver and source code line mapper. It identifies the specific function or method that contains a given line of code by analyzing the structure of source files without executing the program.

The utility maps line numbers to their parent code units by examining the organization of source files and identifying the ownership of specific lines. It determines the boundaries of functions and methods through text-based structural parsing and range detection.

These capabilities support source code analysis and static analysis tooling for developer tool integration and code navigation workflows.

## Tags

### Development Tools & Productivity

- [Line-to-Unit Mapping](https://awesome-repositories.com/f/development-tools-productivity/line-to-unit-mapping.md) — Associates specific line numbers with the parent code block that encompasses them.
- [Code Unit Boundary Detection](https://awesome-repositories.com/f/development-tools-productivity/code-unit-boundary-detection.md) — Determines containing units by comparing target line numbers against function start and end positions.
- [Code Unit Ownership Resolution](https://awesome-repositories.com/f/development-tools-productivity/code-unit-ownership-resolution.md) — Maps a specific line of code to its parent function or method by examining the source file organization. ([source](https://github.com/sebastianbergmann/code-unit-reverse-lookup#readme))
- [Code Unit Resolvers](https://awesome-repositories.com/f/development-tools-productivity/code-unit-resolvers.md) — Identifies the function or method ownership of a line of code for debugging and reporting.
- [Line-to-Block Ownership Mapping](https://awesome-repositories.com/f/development-tools-productivity/line-to-block-ownership-mapping.md) — Determines unit ownership by checking if a target line falls between the start and end positions of a block.
- [Line-to-Unit Resolvers](https://awesome-repositories.com/f/development-tools-productivity/line-to-unit-resolvers.md) — Identifies the function or method containing a specific line of code by analyzing the source file structure. ([source](https://github.com/sebastianbergmann/code-unit-reverse-lookup/blob/main/README.md))
- [Source Code Line Mappers](https://awesome-repositories.com/f/development-tools-productivity/source-code-line-mappers.md) — Identifies the specific function or method containing a given line of code by analyzing source files.
- [Static Analysis Tools](https://awesome-repositories.com/f/development-tools-productivity/static-analysis-tools.md) — Automates the mapping of line numbers to parent logic blocks for use in debugging and reporting systems.
- [Code Exploration Tools](https://awesome-repositories.com/f/development-tools-productivity/code-exploration-tools.md) — Provides utilities to resolve source code locations to functions for enhanced code exploration.
- [Structural Code Navigation](https://awesome-repositories.com/f/development-tools-productivity/structural-code-navigation.md) — Supports code navigation by identifying the function responsible for a specific operation via structural analysis.
- [Structural Marker Detection](https://awesome-repositories.com/f/development-tools-productivity/structural-marker-detection.md) — Scans source text for opening and closing symbols to define the boundaries of code units.
- [Textual Range Detection](https://awesome-repositories.com/f/development-tools-productivity/textual-range-detection.md) — Scans the source text for opening and closing markers to define the extent of a code unit.

### Programming Languages & Runtimes

- [Source Code Analysis Tools](https://awesome-repositories.com/f/programming-languages-runtimes/source-code-analysis-tools.md) — Analyzes the structure of source files to identify which function or method contains a specific line of code.
- [Structural Boundary Analysis](https://awesome-repositories.com/f/programming-languages-runtimes/source-code-analysis-tools/structural-boundary-analysis.md) — Parses raw source code to identify the boundaries of function and method definitions.

### Testing & Quality Assurance

- [Static Code Analysis Tools](https://awesome-repositories.com/f/testing-quality-assurance/code-quality-review/code-quality-tools/static-code-analysis-tools.md) — Examines source code structure to determine the ownership of specific lines without executing the code.
- [Code Unit Identification](https://awesome-repositories.com/f/testing-quality-assurance/static-code-analysis/code-unit-identification.md) — Locates the specific function or method that encompasses a line of code through analysis of the source file. ([source](https://github.com/sebastianbergmann/code-unit-reverse-lookup/blob/main/phpstan.neon))
- [Structural Static Analysis](https://awesome-repositories.com/f/testing-quality-assurance/static-code-analysis/structural-static-analysis.md) — Analyzes the physical structure of code files to identify functions and methods without executing the program.

### Part of an Awesome List

- [Keyword-Based Structural Parsing](https://awesome-repositories.com/f/awesome-lists/devtools/text-processing-and-parsing/keyword-based-structural-parsing.md) — Identifies logical code blocks by searching for specific keywords and patterns within the raw source text.

### User Interface & Experience

- [Code Offset Mapping](https://awesome-repositories.com/f/user-interface-experience/cursor-position-mapping/document-range-mapping/code-offset-mapping.md) — Associates specific integer line numbers with parent code units based on defined text offsets.
