-
Notifications
You must be signed in to change notification settings - Fork 10
feat(dataflow): Add core data structures for intra-procedural taint analysis #343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
shivasurya
merged 1 commit into
main
from
feat/intra-procedural-dataflow-pr1-data-structures
Nov 4, 2025
Merged
feat(dataflow): Add core data structures for intra-procedural taint analysis #343
shivasurya
merged 1 commit into
main
from
feat/intra-procedural-dataflow-pr1-data-structures
Nov 4, 2025
+1,477
−0
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…nalysis Implements the foundation for intra-procedural taint tracking with two new core data structures: ## Statement (`statement.go`) - StatementType enum with 11 Python statement types - Statement struct for representing code statements with def-use information - DefUseChain for tracking variable definitions and uses - Full API for def-use chain construction and querying ## TaintSummary (`taint_summary.go`) - TaintInfo struct for detailed taint tracking (source, sink, propagation path) - Confidence scoring (0.0-1.0) for detection quality - TaintSummary for complete function-level analysis results - Support for parameter and return value tainting ## Test Coverage - 100% code coverage (37 test cases) - statement_test.go: 16 comprehensive tests - taint_summary_test.go: 21 comprehensive tests - Complex scenario tests simulating real security issues This is PR #1 of 5 in the intra-procedural dataflow feature stack. Next: PR #2 will implement statement extraction from Python AST. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Owner
Author
SafeDep Report SummaryNo dependency changes detected. Nothing to scan. This report is generated by SafeDep Github App |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #343 +/- ##
==========================================
+ Coverage 74.91% 75.50% +0.58%
==========================================
Files 47 49 +2
Lines 5566 5699 +133
==========================================
+ Hits 4170 4303 +133
Misses 1221 1221
Partials 175 175 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This was referenced Nov 4, 2025
Owner
Author
Merge activity
|
shivasurya
added a commit
that referenced
this pull request
Nov 4, 2025
… dataflow (#344) ## Summary Implements Python statement extraction from AST to support intra-procedural dataflow analysis. This is part 2 of the intra-procedural dataflow feature. ## Changes - Add statement extraction for Python functions - Extract assignments, calls, and returns with def-use information - Comprehensive test coverage (87.3%) ## Testing - 20+ tests covering all statement types - All tests passing - Build and lint clean Stacked on #343 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

Summary
This PR implements the foundation for intra-procedural taint tracking by adding core data structures. This is PR #1 of 5 in the intra-procedural dataflow feature stack.
Changes
New Files
graph/callgraph/statement.go(208 lines)StatementTypeenum with 11 Python statement types (assignment, call, return, if, for, while, with, try, raise, import, expression)Statementstruct for representing code statements with def-use informationDefUseChainfor tracking variable definitions and uses across a functiongraph/callgraph/taint_summary.go(238 lines)TaintInfostruct for detailed taint tracking (source/sink locations, propagation paths)TaintSummaryfor complete function-level analysis resultsgraph/callgraph/statement_test.go(444 lines)graph/callgraph/taint_summary_test.go(397 lines)Test Coverage
✅ 100% code coverage (all 36 functions tested)
Quality Checks
✅ All tests pass (
gradle testGo)✅ Lint passes with 0 issues (
gradle lintGo)✅ Build succeeds (
gradle buildGo)✅ 100% code coverage
Technical Details
Statement Representation
Taint Tracking
Design Decisions
Next Steps
This PR provides the foundational data structures. Future PRs will implement:
🤖 Generated with Claude Code
Co-Authored-By: Claude [email protected]