In src/lib/analysis/analyzers/shared.ts the methodClass map is keyed by method name only (Map<functionName, className>, line 80; methodClass.set(name, cls) line 105; lookup methodClass.get(name) line 245).
When two classes in the same file define a method with the same name (e.g. __init__, render, toString), the second overwrites the first, so the method node is attached to the wrong class. This is the common case in Python (every class has __init__).
Fix: key by a qualified id like `${cls}::${name}` (or invert the lookup). Add a test with two classes sharing a method name.
En src/lib/analysis/analyzers/shared.ts el mapa methodClass se indexa solo por el nombre del método (Map<nombreFunción, clase>, línea 80; set(name, cls) línea 105; lectura get(name) línea 245).
Si dos clases del mismo archivo definen un método con el mismo nombre (__init__, render, toString), la segunda pisa a la primera y el nodo queda asignado a la clase equivocada. Es el caso común en Python (todas las clases tienen __init__).
Fix: usar una clave cualificada tipo `${cls}::${name}` (o invertir la búsqueda). Añadir un test con dos clases que compartan método.
In
src/lib/analysis/analyzers/shared.tsthemethodClassmap is keyed by method name only (Map<functionName, className>, line 80;methodClass.set(name, cls)line 105; lookupmethodClass.get(name)line 245).When two classes in the same file define a method with the same name (e.g.
__init__,render,toString), the second overwrites the first, so the method node is attached to the wrong class. This is the common case in Python (every class has__init__).Fix: key by a qualified id like
`${cls}::${name}`(or invert the lookup). Add a test with two classes sharing a method name.En
src/lib/analysis/analyzers/shared.tsel mapamethodClassse indexa solo por el nombre del método (Map<nombreFunción, clase>, línea 80;set(name, cls)línea 105; lecturaget(name)línea 245).Si dos clases del mismo archivo definen un método con el mismo nombre (
__init__,render,toString), la segunda pisa a la primera y el nodo queda asignado a la clase equivocada. Es el caso común en Python (todas las clases tienen__init__).Fix: usar una clave cualificada tipo
`${cls}::${name}`(o invertir la búsqueda). Añadir un test con dos clases que compartan método.