node_type() in terraform_analyzer.py returns "module" as a catch-all fallback for any .tf file that has neither resources nor data sources. This means a root-level outputs.tf (which only declares output blocks) gets type="module" — the same type as a file physically inside a modules/ directory.
File: codeindex/analyzers/terraform_analyzer.py:82
def node_type(path: Path, has_resources: bool, has_data: bool) -> str:
...
if has_resources or has_data:
return "service"
return "module" # ← catches outputs.tf, locals.tf, etc.
Impact: Output-only files at the repo root are visually rendered as sub-modules in the explorer, misrepresenting their role in the graph. Note: "outputs" is not in _CONFIG_STEMS, so a root-level outputs.tf won't be caught by the "config" branch either.
Fix: Add "outputs" to _CONFIG_STEMS, or introduce a dedicated "output" node type for files that only contain output definitions.
node_type()interraform_analyzer.pyreturns"module"as a catch-all fallback for any.tffile that has neither resources nor data sources. This means a root-leveloutputs.tf(which only declaresoutputblocks) getstype="module"— the same type as a file physically inside amodules/directory.File:
codeindex/analyzers/terraform_analyzer.py:82Impact: Output-only files at the repo root are visually rendered as sub-modules in the explorer, misrepresenting their role in the graph. Note:
"outputs"is not in_CONFIG_STEMS, so a root-leveloutputs.tfwon't be caught by the"config"branch either.Fix: Add
"outputs"to_CONFIG_STEMS, or introduce a dedicated"output"node type for files that only contain output definitions.