Skip to content

chore(graph_builder): remove shadowed and orphaned method definitions #1604

Description

@Shashankss1205

Split out of #1595 (reports 2 and 6b of 9) — filed by @rrodriguesNutrium, credit to them. Related to #1538.

graph_builder.py carries several shadowed method definitions, left behind when the file was split into indexing/persistence/writer.py and indexing/resolution/.

At least three independently shadowed names:

  • add_file_to_graph — defined twice; the later definition wins
  • _create_all_function_calls — separately shadowed by a later definition
  • add_repository_to_graph — also defined twice

Plus two orphaned methods whose live equivalents now live elsewhere:

  • _resolve_inheritance_link — zero call sites in src/; live equivalent is the free function at indexing/resolution/inheritance.py:9
  • _create_csharp_inheritance_and_interfaces — zero call sites here; the live one is on GraphWriter (writer.py:891)

Why this is more than tidiness: the dead add_file_to_graph's item_mappings has drifted from the live one — the live list handles objects, mixins, extensions, modules and enum_members; the dead one handles none of them. Anyone reading the file top-to-bottom to learn which node types reach the graph gets a wrong answer, and nothing in the file signals which copy wins.

The reporter verified that deleting the unreachable region is behaviour-preserving (unit suite byte-identical before and after, every removed name traced to a live equivalent or zero call sites).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status
    Backlog tasks
    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions