Skip to content

Capturing location and parent namespace - #229

Merged
jimbethancourt merged 2 commits into
mainfrom
capture-source-hierarchy
Oct 17, 2026
Merged

jimbethancourt merged 2 commits into
mainfrom
capture-source-hierarchy

Conversation

@jimbethancourt

@jimbethancourt jimbethancourt commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

Capturing a vertex's location relative to repo root for classes and packages and a vertex's parent namespace

Summary by CodeRabbit

  • New Features
    • Dependency graphs now include parent namespaces and repository-relative source locations for classes and packages, including nested and anonymous classes.
    • Analysis results and reports retain readable class and package names while using richer graph information.
  • Improvements
    • Package locations are derived from mapped source files, and graph merging avoids creating cross-package relationships for empty or identical package names.

Capturing parent namespace and location relative to repo root for classes and packages
@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c3b41837-77da-467c-8677-0e4db6d6afa7
📥 Commits

Reviewing files that changed from the base of the PR and between 2e476ed and e8460e8.

📒 Files selected for processing: 30
  • codebase-graph-builder/src/main/java/org/hjug/graphbuilder/CompositeGraphBuilder.java
  • codebase-graph-builder/src/main/java/org/hjug/graphbuilder/GraphDependencyCollector.java
  • codebase-graph-builder/src/main/java/org/hjug/graphbuilder/VertexInfo.java
  • codebase-graph-builder/src/main/java/org/hjug/graphbuilder/VertexInfoHydrator.java
  • codebase-graph-builder/src/main/java/org/hjug/graphbuilder/graphbuilder/KotlinSourceFileGraphBuilder.java
  • codebase-graph-builder/src/main/java/org/hjug/graphbuilder/metrics/GraphMetricsCollector.java
  • codebase-graph-builder/src/test/java/org/hjug/graphbuilder/CompositeGraphBuilderJavaOnlyTest.java
  • codebase-graph-builder/src/test/java/org/hjug/graphbuilder/CompositeGraphBuilderTest.java
  • codebase-graph-builder/src/test/java/org/hjug/graphbuilder/GraphDependencyCollectorTest.java
  • codebase-graph-builder/src/test/java/org/hjug/graphbuilder/Java25AnalysisIntegrationTest.java
  • codebase-graph-builder/src/test/java/org/hjug/graphbuilder/JavaGraphBuilderTest.java
  • codebase-graph-builder/src/test/java/org/hjug/graphbuilder/KotlinGraphBuilderTest.java
  • codebase-graph-builder/src/test/java/org/hjug/graphbuilder/TypeParameterReferenceTest.java
  • codebase-graph-builder/src/test/java/org/hjug/graphbuilder/VertexInfoHydratorTest.java
  • codebase-graph-builder/src/test/java/org/hjug/graphbuilder/VertexInfoTest.java
  • codebase-graph-builder/src/test/java/org/hjug/graphbuilder/graphbuilder/JavaSourceFileGraphBuilderPrunesClassesNotInCodebaseTest.java
  • codebase-graph-builder/src/test/java/org/hjug/graphbuilder/graphbuilder/KotlinSourceFileGraphBuilderPartialParseTest.java
  • codebase-graph-builder/src/test/java/org/hjug/graphbuilder/graphbuilder/SourceFileGraphBuilderTestPathExclusionTest.java
  • codebase-graph-builder/src/test/java/org/hjug/graphbuilder/visitor/DependencyVisitorLogicJavaKotlinParityTest.java
  • codebase-graph-builder/src/test/java/org/hjug/graphbuilder/visitor/JavaVisitorTest.java
  • cost-benefit-calculator/src/main/java/org/hjug/cbc/CostBenefitCalculator.java
  • cost-benefit-calculator/src/main/java/org/hjug/cbc/CycleRanker.java
  • cost-benefit-calculator/src/test/java/org/hjug/cbc/CostBenefitCalculatorTest.java
  • cost-benefit-calculator/src/test/java/org/hjug/cbc/CycleRankerGraphGenerationTest.java
  • cost-benefit-calculator/src/test/java/org/hjug/cbc/CycleRankerKotlinTest.java
  • graph-algorithms/src/main/java/org/hjug/dsm/EdgeRemovalCalculator.java
  • graph-algorithms/src/main/java/org/hjug/dsm/SparseIntDWGEdgeRemovalCalculator.java
  • graph-algorithms/src/main/java/org/hjug/feedback/CycleRemovalComputer.java
  • report/src/main/java/org/hjug/refactorfirst/report/HtmlReport.java
  • report/src/test/java/org/hjug/refactorfirst/report/HtmlReportTest.java
🚧 Files skipped from review as they are similar to previous changes: 30
  • codebase-graph-builder/src/test/java/org/hjug/graphbuilder/CompositeGraphBuilderJavaOnlyTest.java
  • cost-benefit-calculator/src/test/java/org/hjug/cbc/CycleRankerKotlinTest.java
  • codebase-graph-builder/src/test/java/org/hjug/graphbuilder/VertexInfoHydratorTest.java
  • graph-algorithms/src/main/java/org/hjug/feedback/CycleRemovalComputer.java
  • cost-benefit-calculator/src/test/java/org/hjug/cbc/CycleRankerGraphGenerationTest.java
  • codebase-graph-builder/src/main/java/org/hjug/graphbuilder/graphbuilder/KotlinSourceFileGraphBuilder.java
  • codebase-graph-builder/src/test/java/org/hjug/graphbuilder/JavaGraphBuilderTest.java
  • codebase-graph-builder/src/test/java/org/hjug/graphbuilder/TypeParameterReferenceTest.java
  • codebase-graph-builder/src/test/java/org/hjug/graphbuilder/Java25AnalysisIntegrationTest.java
  • graph-algorithms/src/main/java/org/hjug/dsm/SparseIntDWGEdgeRemovalCalculator.java
  • codebase-graph-builder/src/test/java/org/hjug/graphbuilder/graphbuilder/JavaSourceFileGraphBuilderPrunesClassesNotInCodebaseTest.java
  • codebase-graph-builder/src/test/java/org/hjug/graphbuilder/CompositeGraphBuilderTest.java
  • codebase-graph-builder/src/test/java/org/hjug/graphbuilder/graphbuilder/KotlinSourceFileGraphBuilderPartialParseTest.java
  • codebase-graph-builder/src/test/java/org/hjug/graphbuilder/KotlinGraphBuilderTest.java
  • codebase-graph-builder/src/main/java/org/hjug/graphbuilder/metrics/GraphMetricsCollector.java
  • codebase-graph-builder/src/test/java/org/hjug/graphbuilder/VertexInfoTest.java
  • cost-benefit-calculator/src/main/java/org/hjug/cbc/CycleRanker.java
  • codebase-graph-builder/src/test/java/org/hjug/graphbuilder/graphbuilder/SourceFileGraphBuilderTestPathExclusionTest.java
  • report/src/test/java/org/hjug/refactorfirst/report/HtmlReportTest.java
  • codebase-graph-builder/src/test/java/org/hjug/graphbuilder/visitor/JavaVisitorTest.java
  • cost-benefit-calculator/src/main/java/org/hjug/cbc/CostBenefitCalculator.java
  • codebase-graph-builder/src/main/java/org/hjug/graphbuilder/VertexInfoHydrator.java
  • codebase-graph-builder/src/main/java/org/hjug/graphbuilder/VertexInfo.java
  • codebase-graph-builder/src/test/java/org/hjug/graphbuilder/GraphDependencyCollectorTest.java
  • cost-benefit-calculator/src/test/java/org/hjug/cbc/CostBenefitCalculatorTest.java
  • graph-algorithms/src/main/java/org/hjug/dsm/EdgeRemovalCalculator.java
  • report/src/main/java/org/hjug/refactorfirst/report/HtmlReport.java
  • codebase-graph-builder/src/test/java/org/hjug/graphbuilder/visitor/DependencyVisitorLogicJavaKotlinParityTest.java
  • codebase-graph-builder/src/main/java/org/hjug/graphbuilder/GraphDependencyCollector.java
  • codebase-graph-builder/src/main/java/org/hjug/graphbuilder/CompositeGraphBuilder.java

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

📝 Walkthrough

Class and package reference graphs now use VertexInfo vertices. The change adds name-based identity, parent namespaces, and source-location metadata. Graph construction, reconciliation, algorithms, cost-benefit calculations, reports, and tests use the updated vertex type.

Changes: VertexInfo graph migration

Layer / File(s) Summary
Vertex model and graph construction
codebase-graph-builder/src/main/java/org/hjug/graphbuilder/*, codebase-graph-builder/src/main/java/org/hjug/graphbuilder/graphbuilder/*, codebase-graph-builder/src/main/java/org/hjug/graphbuilder/metrics/*, codebase-graph-builder/src/test/java/org/hjug/graphbuilder/*, codebase-graph-builder/src/test/java/org/hjug/graphbuilder/{graphbuilder,metrics,visitor}/*, plans/vertex-info-implementation-plan.md
VertexInfo provides name-based identity and a derived parent namespace. Collectors and builders use VertexInfo graph vertices. The hydrator assigns class and package locations from source-path mappings. Tests cover identity, namespace derivation, hydration, and graph construction.
Graph merge and reconciliation
codebase-graph-builder/src/main/java/org/hjug/graphbuilder/CompositeGraphBuilder.java, codebase-graph-builder/src/test/java/org/hjug/graphbuilder/CompositeGraphBuilder*Test.java
Graph merging and reconciliation operate on VertexInfo values. Existing edge redirection, weight aggregation, and relationship rebuilding remain. Package edges are skipped when either package name is empty.
Analysis and report consumers
graph-algorithms/src/main/java/org/hjug/{dsm,feedback}/*, cost-benefit-calculator/src/main/java/org/hjug/cbc/*, report/src/main/java/org/hjug/refactorfirst/report/*, cost-benefit-calculator/src/test/java/org/hjug/cbc/*, report/src/test/java/org/hjug/refactorfirst/report/*
Graph algorithms now support generic vertex types. Cost-benefit calculations and report consumers use VertexInfo vertices and obtain vertex names where string values are required.

Priority: ⬇️ Low

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to e8460

No merge-blocking issue was established; the change is ready for normal checks.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main changes: capturing vertex locations and parent namespaces.
Docstring Coverage Passed Docstring coverage is 82.68% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 254 functions across 48 files.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Completed: Fix pre-merge checks in PR #229 — View commit e8460e8

@jimbethancourt
jimbethancourt merged commit d693d64 into main Oct 17, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant