Environment
- graphify 0.9.7 (PyPI
graphifyy), macOS, Python 3.10
- Extraction invoked directly via
graphify.extract.extract(files, parallel=False)
Summary
Enum constants are not extracted as nodes in either Kotlin or Java. The enum class itself gets a node, but its members (ChatType.SYSTEM, ErrorCode.GAME_DONE, …) do not exist anywhere in the graph, so queries like "where is this error code used" / "who branches on ChatType.SYSTEM" are unanswerable — the constant name simply isn't in the node table.
Reproducer (3 files)
ChatType.kt
package demo
enum class ChatType {
NORMAL,
GROUP,
SYSTEM
}
TypeCheck.kt
package demo
class TypeCheck {
fun isSystem(type: ChatType): Boolean {
return type == ChatType.SYSTEM
}
}
ErrorCode.java
package demo;
public enum ErrorCode {
OK(0),
GAME_DONE(1001);
private final int code;
ErrorCode(int code) {
this.code = code;
}
}
Current behavior (0.9.7)
Complete node list for the three files:
chattype_kt_chattype (file)
chattype_chattype (enum class — no children besides the file)
typecheck (file)
typecheck_typecheck (class)
typecheck_typecheck_issystem (method)
boolean
errorcode (file)
errorcode_errorcode (enum class)
NORMAL / GROUP / SYSTEM / OK / GAME_DONE appear nowhere. TypeCheck.isSystem gets a references edge to the ChatType class, but the fact that it specifically tests SYSTEM is lost. (Aside: the Java enum also emits its errorcode --contains--> errorcode_errorcode edge twice.)
Expected
Enum constants extracted as child nodes of the enum class (analogous to methods), e.g.:
chattype_chattype --constant--> chattype_chattype_system
typecheck_typecheck_issystem --references--> chattype_chattype_system
Even without the usage edge, just having the constant as a searchable node would let downstream tooling find the definition and fall back to text search for usages.
Real-world impact
Hit twice in one week on two different production codebases: (1) a Java backend where a newly added error-code constant (the subject of the change) couldn't be located in the graph at all — the class was indexed, the constant wasn't; (2) an Android app where "which places branch on the SYSTEM chat type" (the exact subject of a bugfix commit) had no graph answer. Enum-driven branching (message types, error codes, feature states) is one of the most common "find all usages before changing behavior" queries in app/backend codebases.
Environment
graphifyy), macOS, Python 3.10graphify.extract.extract(files, parallel=False)Summary
Enum constants are not extracted as nodes in either Kotlin or Java. The enum class itself gets a node, but its members (
ChatType.SYSTEM,ErrorCode.GAME_DONE, …) do not exist anywhere in the graph, so queries like "where is this error code used" / "who branches on ChatType.SYSTEM" are unanswerable — the constant name simply isn't in the node table.Reproducer (3 files)
ChatType.ktTypeCheck.ktErrorCode.javaCurrent behavior (0.9.7)
Complete node list for the three files:
NORMAL/GROUP/SYSTEM/OK/GAME_DONEappear nowhere.TypeCheck.isSystemgets areferencesedge to theChatTypeclass, but the fact that it specifically testsSYSTEMis lost. (Aside: the Java enum also emits itserrorcode --contains--> errorcode_errorcodeedge twice.)Expected
Enum constants extracted as child nodes of the enum class (analogous to methods), e.g.:
Even without the usage edge, just having the constant as a searchable node would let downstream tooling find the definition and fall back to text search for usages.
Real-world impact
Hit twice in one week on two different production codebases: (1) a Java backend where a newly added error-code constant (the subject of the change) couldn't be located in the graph at all — the class was indexed, the constant wasn't; (2) an Android app where "which places branch on the SYSTEM chat type" (the exact subject of a bugfix commit) had no graph answer. Enum-driven branching (message types, error codes, feature states) is one of the most common "find all usages before changing behavior" queries in app/backend codebases.