Skip to content

Conversation

@shivasurya
Copy link
Owner

Implements BuildDefUseChains algorithm for O(1) variable lookup.

  • BuildDefUseChains: Single-pass construction from statements
  • ComputeStats: Diagnostics for variables, defs, uses
  • 100% test coverage (20+ tests)

Part of intra-procedural dataflow analysis. Stacked on PR #2.

🤖 Generated with Claude Code

@safedep
Copy link

safedep bot commented Nov 4, 2025

SafeDep Report Summary

Green Malicious Packages Badge Green Vulnerable Packages Badge Green Risky License Badge

No dependency changes detected. Nothing to scan.

This report is generated by SafeDep Github App

@shivasurya shivasurya closed this Nov 4, 2025
@shivasurya shivasurya reopened this Nov 4, 2025
@codecov
Copy link

codecov bot commented Nov 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.93%. Comparing base (29eb111) to head (46b5d3a).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #345      +/-   ##
==========================================
+ Coverage   75.79%   75.93%   +0.14%     
==========================================
  Files          50       50              
  Lines        5929     5964      +35     
==========================================
+ Hits         4494     4529      +35     
  Misses       1244     1244              
  Partials      191      191              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@shivasurya shivasurya self-assigned this Nov 4, 2025
@shivasurya shivasurya added enhancement New feature or request go Pull requests that update go code labels Nov 4, 2025
@shivasurya shivasurya changed the base branch from main to feat/intra-procedural-dataflow-pr2-statement-extraction November 4, 2025 00:49
Copy link
Owner Author

shivasurya commented Nov 4, 2025

Merge activity

  • Nov 4, 1:51 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Nov 4, 1:54 AM UTC: Graphite rebased this pull request as part of a merge.
  • Nov 4, 1:55 AM UTC: @shivasurya merged this pull request with Graphite.

@shivasurya shivasurya changed the base branch from feat/intra-procedural-dataflow-pr2-statement-extraction to graphite-base/345 November 4, 2025 01:52
@shivasurya shivasurya changed the base branch from graphite-base/345 to main November 4, 2025 01:53
Implement BuildDefUseChains algorithm and ComputeStats diagnostics:

Core Implementation:
- BuildDefUseChains: O(n×m) single-pass construction from statements
- ComputeStats: Computes statistics (variables, defs, uses, max per var)
- GetDefs/GetUses: Return empty slices (not nil) for consistency

Test Coverage:
- 20+ comprehensive tests in defuse_test.go
- 100% coverage for BuildDefUseChains and ComputeStats
- Tests cover: empty cases, single/multiple defs/uses, complex flows
- Fixed statement_test.go to expect empty slices (per spec)

This implements PR #3 from the intra-procedural dataflow plan.
Enables efficient "where is X defined/used?" queries for taint analysis.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@shivasurya shivasurya force-pushed the feat/intra-procedural-dataflow-pr3-defuse-chains branch from ebe3ae6 to 46b5d3a Compare November 4, 2025 01:54
@shivasurya shivasurya merged commit b6cfaf7 into main Nov 4, 2025
3 checks passed
@shivasurya shivasurya deleted the feat/intra-procedural-dataflow-pr3-defuse-chains branch November 4, 2025 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request go Pull requests that update go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants