Skip to content

Phase 2b: jscan adopts core/cfg + core/graph + core/lsh (CFG analyses, coupling, MinHash) #11

Description

@DaisukeYoda

Adopt the remaining language-independent kernels: CFG data structures and analyses (reachability, complexity, dead code), dependency graph algorithms (Tarjan SCC, Martin metrics), and LSH/MinHash.

Blocked by #8.

Tasks

  • CFG: keep cfg_builder.go (JS control-flow semantics, hoisting) building core/cfg.CFG; implement StatementClassifier + NoOpClassifier (bare ;) on jscan's parser nodes
  • Dead code: adopt core/cfg.DetectDeadCode + LineFinding/MergeContiguousFindings/SortLineFindings; keep line/snippet enrichment language-side
  • Complexity: adopt core/cfg.ComputeComplexity with a ComplexityContributor for JS logical operators (&&, ||, ??, ternary)
  • Coupling/cycles: adopt core/graph (DirectedGraph impl on jscan's dependency graph, Martin metrics with export-ratio AbstractnessFunc, Tarjan cycles)
  • LSH/MinHash: adopt core/lsh (should be a drop-in; zero drift expected)
  • Scoring: adopt core/domain/scoring.go shared calculators + grade mapping; keep jscan's count-ratio complexity penalty and per-file dead-code penalty composing with them
  • Update tests; delete superseded code

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions