Skip to content

feat: add C# detection and bug pattern support#184

Open
AnubhavC-001 wants to merge 6 commits into
imDarshanGK:mainfrom
AnubhavC-001:feature-csharp-support
Open

feat: add C# detection and bug pattern support#184
AnubhavC-001 wants to merge 6 commits into
imDarshanGK:mainfrom
AnubhavC-001:feature-csharp-support

Conversation

@AnubhavC-001
Copy link
Copy Markdown
Contributor

@AnubhavC-001 AnubhavC-001 commented May 20, 2026

Summary

This PR adds full C# language support to the rule-based analysis engine.

Changes made

  • Added C# language detection patterns to LANG_SIGNATURES
  • Added 3 C#-specific bug detection patterns:
    • Empty Catch Block
    • Hardcoded Connection String
    • Thread.Sleep in Async Method
  • Improved multiline regex detection in the bug analysis engine
  • Refactored bug detection flow to support multiline pattern matching correctly
  • Added automated backend tests for:
    • C# language detection
    • C# bug pattern detection
  • Fixed rate limiting issues affecting backend test execution and CI pipelines

Challenges faced

While implementing multiline C# bug pattern detection, the existing detection engine only scanned code line-by-line using regex checks. This caused multiline patterns like empty catch blocks to fail detection during testing.

To resolve this:

  • The regex matching logic was updated to analyze the full code block instead of isolated lines
  • Accurate line number calculation was preserved using regex match positions
  • Test failures caused by middleware rate limiting were debugged and fixed by excluding the FastAPI testclient from rate-limit checks during automated testing

All backend tests now pass successfully.

Closes #96

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactor

Testing

  • I ran backend tests (pytest -v)
  • I tested frontend behavior manually

Checklist

  • Code is readable and beginner-friendly
  • No fake or placeholder behavior introduced
  • Documentation updated if needed

@AnubhavC-001
Copy link
Copy Markdown
Contributor Author

Hi @imDarshanGK , my PR #102 and PR #153 have been merged successfully. I just wanted to confirm whether the required GSSoC labels/tags have been added correctly so the contributions can reflect on the dashboard. Thank you!

@imDarshanGK
Copy link
Copy Markdown
Owner

@AnubhavC-001 Please update the PR with screenshots or implementation proof so the changes can be verified easily.
and resolve conflicts

@AnubhavC-001 AnubhavC-001 requested a review from imDarshanGK as a code owner May 21, 2026 12:23
@AnubhavC-001 AnubhavC-001 force-pushed the feature-csharp-support branch from db86f16 to e694ba7 Compare May 21, 2026 12:36
@AnubhavC-001
Copy link
Copy Markdown
Contributor Author

image image

Implemented complete C# support for the QyverixAI detection engine and improved regex-based bug analysis.

Changes Made

  • Added C# language detection signatures
  • Added C# specific bug patterns:
    • Empty Catch Block
    • Hardcoded Connection String
    • Thread.Sleep in Async Method
  • Improved multiline regex matching support in the bug detection engine
  • Updated backend tests for C# detection and CI stability
  • Fixed rate-limit test inconsistencies for testclient middleware bypass

Testing

  • Verified all backend tests successfully
  • Final test result: 53 passed

GSSoC Contributor 🚀
PR #184 FOR ISSUE #118

@AnubhavC-001
Copy link
Copy Markdown
Contributor Author

AnubhavC-001 commented May 21, 2026

Implemented the requested CLI improvements and updated the branch with the latest changes.

Added Features

  • Added --mode support for dynamic endpoint selection (analyze, debug, suggest)
  • Added --output support to save JSON analysis reports into files
  • Added recursive directory analysis using --recursive
  • Added handling for both single file and directory inputs
  • Added directory safety validation to prevent accidental recursive scans
  • Added support for analyzing multiple supported file types recursively

Testing Performed

Successfully tested:

  • single file analysis
  • recursive folder scanning
  • debug mode execution
  • JSON response output
  • output file generation
  • backend integration with local API server

Additional Work

  • Synced branch with latest upstream changes
  • Resolved rebase/update conflicts
  • Verified CLI execution after branch synchronization

Requesting re-review whenever possible.

GSSoC Contributor

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.

Add 5 new JavaScript/TypeScript bug detection patterns

2 participants