feat: build AST-based Python analyzer using built-in ast module (closes #169)#242
Open
antharya05 wants to merge 8 commits into
Open
feat: build AST-based Python analyzer using built-in ast module (closes #169)#242antharya05 wants to merge 8 commits into
antharya05 wants to merge 8 commits into
Conversation
…into feat/ast-python-analyzer-166
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
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.
Description
Implemented an AST-based Python analyzer using Python’s built-in
astmodule for deeper and more accurate bug detection beyond the existing regex-based approach.Changes made
Added
backend/app/services/ast_analyzer.pyImplemented
PythonASTAnalyzerusingast.NodeVisitorAdded AST-based detections for:
except:eval()/exec()usagereturn/raiseAdded graceful syntax error handling
Integrated AST analysis into
run_bug_detection()for PythonPreserved existing regex pipeline for compatibility
Added comprehensive AST analyzer test suite
Added rate-limit reset fixture to prevent test leakage between endpoint tests
Related Issue
Fixes #169
Type of change
Checklist
mainpytest -vand all tests passfeat/fix/docs/test: short descriptionScreenshots (if frontend change)
N/A — backend feature only.