Skip to content

Conversation

@djinn09
Copy link
Owner

@djinn09 djinn09 commented Jan 20, 2026

No description provided.

Implements advanced semantic detection features to improve accuracy and reduce
false positives in complex Python codebases.

Core Analysis Improvements:
- Added ABC class and abstract method tracking to prevent flagging them as dead.
- Implemented a Protocol duck-typing engine to identify classes structurally
  implementing protocols.
- Refined Enum member matching to prioritize qualified attribute references
  (Enum.Member) and removed bare-name fallback to prevent false matches.
- Added detection for optional dependency flags (HAS_*/HAVE_*) within
  try...except ImportError blocks.
- Implemented confidence penalties for lifecycle methods (on_*, watch_*, compose)
  and Adapter classes.
- Set confidence to 0 for methods that only raise NotImplementedError.

API & Integration:
- Achieved parity between [process_single_file](cci:1://file:///e:/Github/CytoScnPy/cytoscnpy/src/analyzer/single_file.rs:26:4-363:5) and the [analyze_code](cci:1://file:///e:/Github/CytoScnPy/cytoscnpy/src/analyzer/single_file.rs:365:4-614:5) API
  by porting enum and duck-typing logic.
- Fixed optional-dependency import aliasing to correctly record references
  for simple aliases (e.g., 'pd' for pandas).
- Improved CFG data flow precision by using accurate line numbers for elif tests.

Benchmark & Verification:
- Expanded benchmark suite with modern Python examples (ABC, Protocols,
  TypeAliases, Enums).
- Updated ground truth to reflect new features and maintain a rigorous
  evaluation baseline.
- Verified F1 score improvement to ~0.75 on the expanded test corpus.

Maintenance:
- Updated documentation navigation and dependencies.
- Refactored visitor logic to use more efficient string operations.
Implements advanced semantic detection features to improve accuracy and reduce
false positives in complex Python codebases.

Core Analysis Improvements:
- Added ABC class and abstract method tracking to prevent flagging them as dead.
- Implemented a Protocol duck-typing engine to identify classes structurally
  implementing protocols.
- Refined Enum member matching to prioritize qualified attribute references
  (Enum.Member) and removed bare-name fallback to prevent false matches.
- Added detection for optional dependency flags (HAS_*/HAVE_*) within
  try...except ImportError blocks.
- Implemented confidence penalties for lifecycle methods (on_*, watch_*, compose)
  and Adapter classes.
- Set confidence to 0 for methods that only raise NotImplementedError.

API & Integration:
- Achieved parity between [process_single_file](cci:1://file:///e:/Github/CytoScnPy/cytoscnpy/src/analyzer/single_file.rs:26:4-363:5) and the [analyze_code](cci:1://file:///e:/Github/CytoScnPy/cytoscnpy/src/analyzer/single_file.rs:365:4-614:5) API
  by porting enum and duck-typing logic.
- Fixed optional-dependency import aliasing to correctly record references
  for simple aliases (e.g., 'pd' for pandas).
- Improved CFG data flow precision by using accurate line numbers for elif tests.

Benchmark & Verification:
- Expanded benchmark suite with modern Python examples (ABC, Protocols,
  TypeAliases, Enums).
- Updated ground truth to reflect new features and maintain a rigorous
  evaluation baseline.
- Verified F1 score improvement to ~0.75 on the expanded test corpus.

Maintenance:
- Updated documentation navigation and dependencies.
- Refactored visitor logic to use more efficient string operations.
…, taint analysis, and extensive testing infrastructure.
…alysis, type inference, and security rules, alongside new benchmarks and documentation.
…ation, and initial Rust analyzer components.
…is, including basic blocks, fingerprinting, and data flow, alongside new analysis components and tests.
…d initial dangerous code detection rules for injection, network, and filesystem vulnerabilities.
…d initial dangerous code detection rules for injection, network, and filesystem vulnerabilities.
…nd taint analysis rules, comprehensive testing, reporting, and VS Code integration.
@github-actions
Copy link

github-actions bot commented Jan 20, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@github-actions
Copy link

Benchmark Results

Failed to read benchmark results.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @djinn09, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request delivers a substantial upgrade to the project's security analysis capabilities, specifically by overhauling the 'danger' rule set and its integration with taint analysis. The changes introduce a more robust and maintainable rule system, refine the accuracy of unused code detection, and provide comprehensive documentation for all security and quality checks. Additionally, it includes updates to development tooling and editor integration for a smoother developer experience.

Highlights

  • Modular Danger Rule Architecture: The security 'danger' rules have been completely refactored into a modular, category-based structure, making them more organized and extensible. This includes new rules for async subprocesses, ML model deserialization, and logging sensitive data.
  • Enhanced Taint Analysis Integration: Taint analysis is now deeply integrated with the danger rules, allowing for more accurate severity assignments and filtering of findings. This reduces false positives by only flagging issues when tainted data flows into dangerous sinks.
  • Improved Unused Code Detection Heuristics: Significant improvements have been made to the heuristics for detecting unused code, particularly for Python's Abstract Base Classes (ABC), Protocols, Enum members, and optional dependency flags. This aims to reduce false positives in complex codebases.
  • Comprehensive Documentation Updates: The documentation has been extensively updated to reflect the new danger rule structure, providing detailed explanations for each rule, including their categories, severity, and remediation advice. New documentation pages for quality rules and CLI usage have also been added.
  • VS Code Extension Enhancements: New VS Code configuration files and updates to the extension's package.json indicate ongoing development and improvements for editor integration, including better handling of diagnostics and quick fixes.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link

Benchmark Results

CytoScnPy Benchmark & Verification Utility
==========================================

[+] Checking tool availability...

    Tool Availability: 11/11 tools ready
------------------------------------------------------------
    [OK] CytoScnPy (Rust): Binary found
    [OK] CytoScnPy (Python): Module importable
    [OK] Skylos: Found at /opt/hostedtoolcache/Python/3.11.14/x64/bin/skylos
    [OK] Vulture (0%): Installed
    [OK] Vulture (60%): Installed
    [OK] Flake8: Installed
    [OK] Pylint: Installed
    [OK] Ruff: Installed
    [OK] uncalled: Installed
    [OK] dead: Installed
    [OK] deadcode: Command configured
------------------------------------------------------------

[+] Building Rust project...
[+] Rust build successful.

[+] Loading Ground Truth recursively from /home/runner/work/CytoScnPy/CytoScnPy/benchmark/examples...

[+] Running 11 tools...

[+] Running CytoScnPy (Rust)...
    Command: ['/home/runner/work/CytoScnPy/CytoScnPy/target/release/cytoscnpy-bin', '/home/runner/work/CytoScnPy/CytoScnPy/benchmark/examples', '--json']
    [OK] Completed in 0.01s (Memory: 0.6 MB)

[+] Running CytoScnPy (Python)...
    Command: ['/opt/hostedtoolcache/Python/3.11.14/x64/bin/python', '-m', 'cytoscnpy.cli', '/home/runner/work/CytoScnPy/CytoScnPy/benchmark/examples', '--json']
    [OK] Completed in 0.04s (Memory: 15.3 MB)

[+] Running Skylos...
    Command: ['/opt/hostedtoolcache/Python/3.11.14/x64/bin/skylos', '/home/runner/work/CytoScnPy/CytoScnPy/benchmark/examples', '--json', '--confidence', '0']
    [OK] Completed in 0.79s (Memory: 47.6 MB)

[+] Running Vulture (0%)...
    Command: ['/opt/hostedtoolcache/Python/3.11.14/x64/bin/python', '-m', 'vulture', '/home/runner/work/CytoScnPy/CytoScnPy/benchmark/examples', '--min-confidence', '0']
    [OK] Completed in 0.09s (Memory: 14.9 MB)

[+] Running Vulture (60%)...
    Command: ['/opt/hostedtoolcache/Python/3.11.14/x64/bin/python', '-m', 'vulture', '/home/runner/work/CytoScnPy/CytoScnPy/benchmark/examples', '--min-confidence', '60']
    [OK] Completed in 0.09s (Memory: 14.9 MB)

[+] Running Flake8...
    Command: ['/opt/hostedtoolcache/Python/3.11.14/x64/bin/python', '-m', 'flake8', '/home/runner/work/CytoScnPy/CytoScnPy/benchmark/examples']
    [OK] Completed in 0.26s (Memory: 100.7 MB)

[+] Running Pylint...
    Command: ['/opt/hostedtoolcache/Python/3.11.14/x64/bin/python', '-m', 'pylint', '/home/runner/work/CytoScnPy/CytoScnPy/benchmark/examples', '--output-format=json', '-j', '4']
    [OK] Completed in 3.95s (Memory: 365.1 MB)

[+] Running Ruff...
    Command: ['/opt/hostedtoolcache/Python/3.11.14/x64/bin/python', '-m', 'ruff', 'check', '/home/runner/work/CytoScnPy/CytoScnPy/benchmark/examples', '--output-format=json']
    [OK] Completed in 0.04s (Memory: 41.6 MB)

[+] Running uncalled...
    Command: ['/opt/hostedtoolcache/Python/3.11.14/x64/bin/python', '-m', 'uncalled', '/home/runner/work/CytoScnPy/CytoScnPy/benchmark/examples']
    [OK] Completed in 0.05s (Memory: 13.6 MB)

[+] Running dead...
    Command: ['/opt/hostedtoolcache/Python/3.11.14/x64/bin/python', '-m', 'dead', '--files', '.*\\.py$']
    [OK] Completed in 0.09s (Memory: 15.0 MB)

[+] Running deadcode...
    Command: ['/opt/hostedtoolcache/Python/3.11.14/x64/bin/deadcode', '/home/runner/work/CytoScnPy/CytoScnPy/benchmark/examples', '--no-color']
    [OK] Completed in 0.13s (Memory: 18.8 MB)

[=] Benchmark Results
Tool                 | Time (s)   | Mem (MB)   | Issues (Est)
------------------------------------------------------------
CytoScnPy (Rust)     | 0.014      | 0.57       | 169         
CytoScnPy (Python)   | 0.040      | 15.27      | 169         
Skylos               | 0.786      | 47.65      | 112         
Vulture (0%)         | 0.092      | 14.86      | 176         
Vulture (60%)        | 0.092      | 14.86      | 176         
Flake8               | 0.263      | 100.70     | 206         
Pylint               | 3.950      | 365.06     | 372         
Ruff                 | 0.041      | 41.62      | 258         
uncalled             | 0.053      | 13.57      | 87          
dead                 | 0.091      | 15.02      | 126         
deadcode             | 0.130      | 18.77      | 159         
------------------------------------------------------------

[=] Verification Results (Ground Truth Comparison)

--- Overall Detection ---
Tool                 | TP    | FP    | FN    | Precision  | Recall     | F1 Score  
--------------------------------------------------------------------------------
CytoScnPy (Rust)     | 110   | 46    | 38    | 0.7051     | 0.7432     | 0.7237    
CytoScnPy (Python)   | 110   | 46    | 38    | 0.7051     | 0.7432     | 0.7237    
Skylos               | 76    | 36    | 72    | 0.6786     | 0.5135     | 0.5846    
Vulture (0%)         | 102   | 67    | 46    | 0.6036     | 0.6892     | 0.6435    
Vulture (60%)        | 102   | 67    | 46    | 0.6036     | 0.6892     | 0.6435    
Flake8               | 17    | 19    | 131   | 0.4722     | 0.1149     | 0.1848    
Pylint               | 17    | 23    | 131   | 0.4250     | 0.1149     | 0.1809    
Ruff                 | 26    | 23    | 122   | 0.5306     | 0.1757     | 0.2640    
uncalled             | 64    | 23    | 84    | 0.7356     | 0.4324     | 0.5447    
dead                 | 44    | 67    | 104   | 0.3964     | 0.2973     | 0.3398    
deadcode             | 103   | 56    | 45    | 0.6478     | 0.6959     | 0.6710    
--------------------------------------------------------------------------------

--- Class Detection ---
Tool                 | TP    | FP    | FN    | Precision  | Recall     | F1 Score  
--------------------------------------------------------------------------------
CytoScnPy (Rust)     | 15    | 5     | 3     | 0.7500     | 0.8333     | 0.7895    
CytoScnPy (Python)   | 15    | 5     | 3     | 0.7500     | 0.8333     | 0.7895    
Skylos               | 15    | 7     | 3     | 0.6818     | 0.8333     | 0.7500    
Vulture (0%)         | 15    | 8     | 3     | 0.6522     | 0.8333     | 0.7317    
Vulture (60%)        | 15    | 8     | 3     | 0.6522     | 0.8333     | 0.7317    
Flake8               | 0     | 0     | 18    | 0.0000     | 0.0000     | 0.0000    
Pylint               | 0     | 0     | 18    | 0.0000     | 0.0000     | 0.0000    
Ruff                 | 0     | 0     | 18    | 0.0000     | 0.0000     | 0.0000    
uncalled             | 0     | 0     | 18    | 0.0000     | 0.0000     | 0.0000    
dead                 | 0     | 0     | 18    | 0.0000     | 0.0000     | 0.0000    
deadcode             | 15    | 8     | 3     | 0.6522     | 0.8333     | 0.7317    
--------------------------------------------------------------------------------

--- Function Detection ---
Tool                 | TP    | FP    | FN    | Precision  | Recall     | F1 Score  
--------------------------------------------------------------------------------
CytoScnPy (Rust)     | 42    | 20    | 14    | 0.6774     | 0.7500     | 0.7119    
CytoScnPy (Python)   | 42    | 20    | 14    | 0.6774     | 0.7500     | 0.7119    
Skylos               | 31    | 7     | 25    | 0.8158     | 0.5536     | 0.6596    
Vulture (0%)         | 51    | 25    | 5     | 0.6711     | 0.9107     | 0.7727    
Vulture (60%)        | 51    | 25    | 5     | 0.6711     | 0.9107     | 0.7727    
Flake8               | 0     | 0     | 56    | 0.0000     | 0.0000     | 0.0000    
Pylint               | 0     | 0     | 56    | 0.0000     | 0.0000     | 0.0000    
Ruff                 | 0     | 0     | 56    | 0.0000     | 0.0000     | 0.0000    
uncalled             | 44    | 23    | 12    | 0.6567     | 0.7857     | 0.7154    
dead                 | 32    | 67    | 24    | 0.3232     | 0.5714     | 0.4129    
deadcode             | 51    | 25    | 5     | 0.6711     | 0.9107     | 0.7727    
--------------------------------------------------------------------------------

--- Import Detection ---
Tool                 | TP    | FP    | FN    | Precision  | Recall     | F1 Score  
--------------------------------------------------------------------------------
CytoScnPy (Rust)     | 9     | 5     | 14    | 0.6429     | 0.3913     | 0.4865    
CytoScnPy (Python)   | 9     | 5     | 14    | 0.6429     | 0.3913     | 0.4865    
Skylos               | 7     | 5     | 16    | 0.5833     | 0.3043     | 0.4000    
Vulture (0%)         | 8     | 4     | 15    | 0.6667     | 0.3478     | 0.4571    
Vulture (60%)        | 8     | 4     | 15    | 0.6667     | 0.3478     | 0.4571    
Flake8               | 17    | 19    | 6     | 0.4722     | 0.7391     | 0.5763    
Pylint               | 10    | 18    | 13    | 0.3571     | 0.4348     | 0.3922    
Ruff                 | 18    | 18    | 5     | 0.5000     | 0.7826     | 0.6102    
uncalled             | 0     | 0     | 23    | 0.0000     | 0.0000     | 0.0000    
dead                 | 0     | 0     | 23    | 0.0000     | 0.0000     | 0.0000    
deadcode             | 9     | 3     | 14    | 0.7500     | 0.3913     | 0.5143    
--------------------------------------------------------------------------------

--- Method Detection ---
Tool                 | TP    | FP    | FN    | Precision  | Recall     | F1 Score  
--------------------------------------------------------------------------------
CytoScnPy (Rust)     | 24    | 9     | 4     | 0.7273     | 0.8571     | 0.7869    
CytoScnPy (Python)   | 24    | 9     | 4     | 0.7273     | 0.8571     | 0.7869    
Skylos               | 17    | 12    | 11    | 0.5862     | 0.6071     | 0.5965    
Vulture (0%)         | 20    | 9     | 8     | 0.6897     | 0.7143     | 0.7018    
Vulture (60%)        | 20    | 9     | 8     | 0.6897     | 0.7143     | 0.7018    
Flake8               | 0     | 0     | 28    | 0.0000     | 0.0000     | 0.0000    
Pylint               | 0     | 0     | 28    | 0.0000     | 0.0000     | 0.0000    
Ruff                 | 0     | 0     | 28    | 0.0000     | 0.0000     | 0.0000    
uncalled             | 20    | 0     | 8     | 1.0000     | 0.7143     | 0.8333    
dead                 | 12    | 0     | 16    | 1.0000     | 0.4286     | 0.6000    
deadcode             | 20    | 9     | 8     | 0.6897     | 0.7143     | 0.7018    
--------------------------------------------------------------------------------

--- Variable Detection ---
Tool                 | TP    | FP    | FN    | Precision  | Recall     | F1 Score  
--------------------------------------------------------------------------------
CytoScnPy (Rust)     | 20    | 7     | 3     | 0.7407     | 0.8696     | 0.8000    
CytoScnPy (Python)   | 20    | 7     | 3     | 0.7407     | 0.8696     | 0.8000    
Skylos               | 6     | 5     | 17    | 0.5455     | 0.2609     | 0.3529    
Vulture (0%)         | 8     | 21    | 15    | 0.2759     | 0.3478     | 0.3077    
Vulture (60%)        | 8     | 21    | 15    | 0.2759     | 0.3478     | 0.3077    
Flake8               | 0     | 0     | 23    | 0.0000     | 0.0000     | 0.0000    
Pylint               | 7     | 5     | 16    | 0.5833     | 0.3043     | 0.4000    
Ruff                 | 8     | 5     | 15    | 0.6154     | 0.3478     | 0.4444    
uncalled             | 0     | 0     | 23    | 0.0000     | 0.0000     | 0.0000    
dead                 | 0     | 0     | 23    | 0.0000     | 0.0000     | 0.0000    
deadcode             | 8     | 11    | 15    | 0.4211     | 0.3478     | 0.3810    
--------------------------------------------------------------------------------

[+] Comparing against baseline: benchmark/baseline_linux.json

[!] WARNING: Comparison tool regressions detected (informational only):
    - Flake8 F1 Score: 0.1916 -> 0.1848 (-0.0068)
    - Pylint F1 Score: 0.1988 -> 0.1809 (-0.0180)
    - Ruff Memory: 9.3MB -> 41.6MB (+347.9%)
    - Ruff F1 Score: 0.2778 -> 0.2640 (-0.0138)
    - uncalled F1 Score: 0.5741 -> 0.5447 (-0.0294)
    - dead F1 Score: 0.3621 -> 0.3398 (-0.0223)

[OK] No CytoScnPy regressions detected.

@github-actions
Copy link

Benchmark Results

CytoScnPy Benchmark & Verification Utility
==========================================

[+] Checking tool availability...

    Tool Availability: 11/11 tools ready
------------------------------------------------------------
    [OK] CytoScnPy (Rust): Binary found
    [OK] CytoScnPy (Python): Module importable
    [OK] Skylos: Found at /opt/hostedtoolcache/Python/3.11.14/x64/bin/skylos
    [OK] Vulture (0%): Installed
    [OK] Vulture (60%): Installed
    [OK] Flake8: Installed
    [OK] Pylint: Installed
    [OK] Ruff: Installed
    [OK] uncalled: Installed
    [OK] dead: Installed
    [OK] deadcode: Command configured
------------------------------------------------------------

[+] Building Rust project...
[+] Rust build successful.

[+] Loading Ground Truth recursively from /home/runner/work/CytoScnPy/CytoScnPy/benchmark/examples...

[+] Running 11 tools...

[+] Running CytoScnPy (Rust)...
    Command: ['/home/runner/work/CytoScnPy/CytoScnPy/target/release/cytoscnpy-bin', '/home/runner/work/CytoScnPy/CytoScnPy/benchmark/examples', '--json']
    [OK] Completed in 0.01s (Memory: 0.6 MB)

[+] Running CytoScnPy (Python)...
    Command: ['/opt/hostedtoolcache/Python/3.11.14/x64/bin/python', '-m', 'cytoscnpy.cli', '/home/runner/work/CytoScnPy/CytoScnPy/benchmark/examples', '--json']
    [OK] Completed in 0.04s (Memory: 15.3 MB)

[+] Running Skylos...
    Command: ['/opt/hostedtoolcache/Python/3.11.14/x64/bin/skylos', '/home/runner/work/CytoScnPy/CytoScnPy/benchmark/examples', '--json', '--confidence', '0']
    [OK] Completed in 0.79s (Memory: 47.7 MB)

[+] Running Vulture (0%)...
    Command: ['/opt/hostedtoolcache/Python/3.11.14/x64/bin/python', '-m', 'vulture', '/home/runner/work/CytoScnPy/CytoScnPy/benchmark/examples', '--min-confidence', '0']
    [OK] Completed in 0.09s (Memory: 14.9 MB)

[+] Running Vulture (60%)...
    Command: ['/opt/hostedtoolcache/Python/3.11.14/x64/bin/python', '-m', 'vulture', '/home/runner/work/CytoScnPy/CytoScnPy/benchmark/examples', '--min-confidence', '60']
    [OK] Completed in 0.09s (Memory: 14.9 MB)

[+] Running Flake8...
    Command: ['/opt/hostedtoolcache/Python/3.11.14/x64/bin/python', '-m', 'flake8', '/home/runner/work/CytoScnPy/CytoScnPy/benchmark/examples']
    [OK] Completed in 0.29s (Memory: 100.1 MB)

[+] Running Pylint...
    Command: ['/opt/hostedtoolcache/Python/3.11.14/x64/bin/python', '-m', 'pylint', '/home/runner/work/CytoScnPy/CytoScnPy/benchmark/examples', '--output-format=json', '-j', '4']
    [OK] Completed in 4.25s (Memory: 378.4 MB)

[+] Running Ruff...
    Command: ['/opt/hostedtoolcache/Python/3.11.14/x64/bin/python', '-m', 'ruff', 'check', '/home/runner/work/CytoScnPy/CytoScnPy/benchmark/examples', '--output-format=json']
    [OK] Completed in 0.04s (Memory: 41.9 MB)

[+] Running uncalled...
    Command: ['/opt/hostedtoolcache/Python/3.11.14/x64/bin/python', '-m', 'uncalled', '/home/runner/work/CytoScnPy/CytoScnPy/benchmark/examples']
    [OK] Completed in 0.05s (Memory: 13.6 MB)

[+] Running dead...
    Command: ['/opt/hostedtoolcache/Python/3.11.14/x64/bin/python', '-m', 'dead', '--files', '.*\\.py$']
    [OK] Completed in 0.10s (Memory: 15.1 MB)

[+] Running deadcode...
    Command: ['/opt/hostedtoolcache/Python/3.11.14/x64/bin/deadcode', '/home/runner/work/CytoScnPy/CytoScnPy/benchmark/examples', '--no-color']
    [OK] Completed in 0.13s (Memory: 18.8 MB)

[=] Benchmark Results
Tool                 | Time (s)   | Mem (MB)   | Issues (Est)
------------------------------------------------------------
CytoScnPy (Rust)     | 0.014      | 0.60       | 169         
CytoScnPy (Python)   | 0.040      | 15.32      | 169         
Skylos               | 0.789      | 47.73      | 112         
Vulture (0%)         | 0.091      | 14.86      | 176         
Vulture (60%)        | 0.091      | 14.86      | 176         
Flake8               | 0.288      | 100.07     | 206         
Pylint               | 4.248      | 378.42     | 372         
Ruff                 | 0.041      | 41.91      | 258         
uncalled             | 0.052      | 13.58      | 87          
dead                 | 0.105      | 15.05      | 126         
deadcode             | 0.131      | 18.77      | 159         
------------------------------------------------------------

[=] Verification Results (Ground Truth Comparison)

--- Overall Detection ---
Tool                 | TP    | FP    | FN    | Precision  | Recall     | F1 Score  
--------------------------------------------------------------------------------
CytoScnPy (Rust)     | 110   | 46    | 38    | 0.7051     | 0.7432     | 0.7237    
CytoScnPy (Python)   | 110   | 46    | 38    | 0.7051     | 0.7432     | 0.7237    
Skylos               | 76    | 36    | 72    | 0.6786     | 0.5135     | 0.5846    
Vulture (0%)         | 102   | 67    | 46    | 0.6036     | 0.6892     | 0.6435    
Vulture (60%)        | 102   | 67    | 46    | 0.6036     | 0.6892     | 0.6435    
Flake8               | 17    | 19    | 131   | 0.4722     | 0.1149     | 0.1848    
Pylint               | 17    | 23    | 131   | 0.4250     | 0.1149     | 0.1809    
Ruff                 | 26    | 23    | 122   | 0.5306     | 0.1757     | 0.2640    
uncalled             | 64    | 23    | 84    | 0.7356     | 0.4324     | 0.5447    
dead                 | 44    | 67    | 104   | 0.3964     | 0.2973     | 0.3398    
deadcode             | 103   | 56    | 45    | 0.6478     | 0.6959     | 0.6710    
--------------------------------------------------------------------------------

--- Class Detection ---
Tool                 | TP    | FP    | FN    | Precision  | Recall     | F1 Score  
--------------------------------------------------------------------------------
CytoScnPy (Rust)     | 15    | 5     | 3     | 0.7500     | 0.8333     | 0.7895    
CytoScnPy (Python)   | 15    | 5     | 3     | 0.7500     | 0.8333     | 0.7895    
Skylos               | 15    | 7     | 3     | 0.6818     | 0.8333     | 0.7500    
Vulture (0%)         | 15    | 8     | 3     | 0.6522     | 0.8333     | 0.7317    
Vulture (60%)        | 15    | 8     | 3     | 0.6522     | 0.8333     | 0.7317    
Flake8               | 0     | 0     | 18    | 0.0000     | 0.0000     | 0.0000    
Pylint               | 0     | 0     | 18    | 0.0000     | 0.0000     | 0.0000    
Ruff                 | 0     | 0     | 18    | 0.0000     | 0.0000     | 0.0000    
uncalled             | 0     | 0     | 18    | 0.0000     | 0.0000     | 0.0000    
dead                 | 0     | 0     | 18    | 0.0000     | 0.0000     | 0.0000    
deadcode             | 15    | 8     | 3     | 0.6522     | 0.8333     | 0.7317    
--------------------------------------------------------------------------------

--- Function Detection ---
Tool                 | TP    | FP    | FN    | Precision  | Recall     | F1 Score  
--------------------------------------------------------------------------------
CytoScnPy (Rust)     | 42    | 20    | 14    | 0.6774     | 0.7500     | 0.7119    
CytoScnPy (Python)   | 42    | 20    | 14    | 0.6774     | 0.7500     | 0.7119    
Skylos               | 31    | 7     | 25    | 0.8158     | 0.5536     | 0.6596    
Vulture (0%)         | 51    | 25    | 5     | 0.6711     | 0.9107     | 0.7727    
Vulture (60%)        | 51    | 25    | 5     | 0.6711     | 0.9107     | 0.7727    
Flake8               | 0     | 0     | 56    | 0.0000     | 0.0000     | 0.0000    
Pylint               | 0     | 0     | 56    | 0.0000     | 0.0000     | 0.0000    
Ruff                 | 0     | 0     | 56    | 0.0000     | 0.0000     | 0.0000    
uncalled             | 44    | 23    | 12    | 0.6567     | 0.7857     | 0.7154    
dead                 | 32    | 67    | 24    | 0.3232     | 0.5714     | 0.4129    
deadcode             | 51    | 25    | 5     | 0.6711     | 0.9107     | 0.7727    
--------------------------------------------------------------------------------

--- Import Detection ---
Tool                 | TP    | FP    | FN    | Precision  | Recall     | F1 Score  
--------------------------------------------------------------------------------
CytoScnPy (Rust)     | 9     | 5     | 14    | 0.6429     | 0.3913     | 0.4865    
CytoScnPy (Python)   | 9     | 5     | 14    | 0.6429     | 0.3913     | 0.4865    
Skylos               | 7     | 5     | 16    | 0.5833     | 0.3043     | 0.4000    
Vulture (0%)         | 8     | 4     | 15    | 0.6667     | 0.3478     | 0.4571    
Vulture (60%)        | 8     | 4     | 15    | 0.6667     | 0.3478     | 0.4571    
Flake8               | 17    | 19    | 6     | 0.4722     | 0.7391     | 0.5763    
Pylint               | 10    | 18    | 13    | 0.3571     | 0.4348     | 0.3922    
Ruff                 | 18    | 18    | 5     | 0.5000     | 0.7826     | 0.6102    
uncalled             | 0     | 0     | 23    | 0.0000     | 0.0000     | 0.0000    
dead                 | 0     | 0     | 23    | 0.0000     | 0.0000     | 0.0000    
deadcode             | 9     | 3     | 14    | 0.7500     | 0.3913     | 0.5143    
--------------------------------------------------------------------------------

--- Method Detection ---
Tool                 | TP    | FP    | FN    | Precision  | Recall     | F1 Score  
--------------------------------------------------------------------------------
CytoScnPy (Rust)     | 24    | 9     | 4     | 0.7273     | 0.8571     | 0.7869    
CytoScnPy (Python)   | 24    | 9     | 4     | 0.7273     | 0.8571     | 0.7869    
Skylos               | 17    | 12    | 11    | 0.5862     | 0.6071     | 0.5965    
Vulture (0%)         | 20    | 9     | 8     | 0.6897     | 0.7143     | 0.7018    
Vulture (60%)        | 20    | 9     | 8     | 0.6897     | 0.7143     | 0.7018    
Flake8               | 0     | 0     | 28    | 0.0000     | 0.0000     | 0.0000    
Pylint               | 0     | 0     | 28    | 0.0000     | 0.0000     | 0.0000    
Ruff                 | 0     | 0     | 28    | 0.0000     | 0.0000     | 0.0000    
uncalled             | 20    | 0     | 8     | 1.0000     | 0.7143     | 0.8333    
dead                 | 12    | 0     | 16    | 1.0000     | 0.4286     | 0.6000    
deadcode             | 20    | 9     | 8     | 0.6897     | 0.7143     | 0.7018    
--------------------------------------------------------------------------------

--- Variable Detection ---
Tool                 | TP    | FP    | FN    | Precision  | Recall     | F1 Score  
--------------------------------------------------------------------------------
CytoScnPy (Rust)     | 20    | 7     | 3     | 0.7407     | 0.8696     | 0.8000    
CytoScnPy (Python)   | 20    | 7     | 3     | 0.7407     | 0.8696     | 0.8000    
Skylos               | 6     | 5     | 17    | 0.5455     | 0.2609     | 0.3529    
Vulture (0%)         | 8     | 21    | 15    | 0.2759     | 0.3478     | 0.3077    
Vulture (60%)        | 8     | 21    | 15    | 0.2759     | 0.3478     | 0.3077    
Flake8               | 0     | 0     | 23    | 0.0000     | 0.0000     | 0.0000    
Pylint               | 7     | 5     | 16    | 0.5833     | 0.3043     | 0.4000    
Ruff                 | 8     | 5     | 15    | 0.6154     | 0.3478     | 0.4444    
uncalled             | 0     | 0     | 23    | 0.0000     | 0.0000     | 0.0000    
dead                 | 0     | 0     | 23    | 0.0000     | 0.0000     | 0.0000    
deadcode             | 8     | 11    | 15    | 0.4211     | 0.3478     | 0.3810    
--------------------------------------------------------------------------------

[+] Comparing against baseline: benchmark/baseline_linux.json

[!] WARNING: Comparison tool regressions detected (informational only):
    - Flake8 F1 Score: 0.1916 -> 0.1848 (-0.0068)
    - Pylint F1 Score: 0.1988 -> 0.1809 (-0.0180)
    - Ruff Memory: 9.3MB -> 41.9MB (+351.0%)
    - Ruff F1 Score: 0.2778 -> 0.2640 (-0.0138)
    - uncalled F1 Score: 0.5741 -> 0.5447 (-0.0294)
    - dead F1 Score: 0.3621 -> 0.3398 (-0.0223)

[OK] No CytoScnPy regressions detected.

@github-actions
Copy link

Benchmark Results

CytoScnPy Benchmark & Verification Utility
==========================================

[+] Checking tool availability...

    Tool Availability: 11/11 tools ready
------------------------------------------------------------
    [OK] CytoScnPy (Rust): Binary found
    [OK] CytoScnPy (Python): Module importable
    [OK] Skylos: Found at /opt/hostedtoolcache/Python/3.11.14/x64/bin/skylos
    [OK] Vulture (0%): Installed
    [OK] Vulture (60%): Installed
    [OK] Flake8: Installed
    [OK] Pylint: Installed
    [OK] Ruff: Installed
    [OK] uncalled: Installed
    [OK] dead: Installed
    [OK] deadcode: Command configured
------------------------------------------------------------

[+] Building Rust project...
[+] Rust build successful.

[+] Loading Ground Truth recursively from /home/runner/work/CytoScnPy/CytoScnPy/benchmark/examples...

[+] Running 11 tools...

[+] Running CytoScnPy (Rust)...
    Command: ['/home/runner/work/CytoScnPy/CytoScnPy/target/release/cytoscnpy-bin', '/home/runner/work/CytoScnPy/CytoScnPy/benchmark/examples', '--json']
    [OK] Completed in 0.03s (Memory: 7.6 MB)

[+] Running CytoScnPy (Python)...
    Command: ['/opt/hostedtoolcache/Python/3.11.14/x64/bin/python', '-m', 'cytoscnpy.cli', '/home/runner/work/CytoScnPy/CytoScnPy/benchmark/examples', '--json']
    [OK] Completed in 0.04s (Memory: 15.3 MB)

[+] Running Skylos...
    Command: ['/opt/hostedtoolcache/Python/3.11.14/x64/bin/skylos', '/home/runner/work/CytoScnPy/CytoScnPy/benchmark/examples', '--json', '--confidence', '0']
    [OK] Completed in 0.99s (Memory: 47.6 MB)

[+] Running Vulture (0%)...
    Command: ['/opt/hostedtoolcache/Python/3.11.14/x64/bin/python', '-m', 'vulture', '/home/runner/work/CytoScnPy/CytoScnPy/benchmark/examples', '--min-confidence', '0']
    [OK] Completed in 0.09s (Memory: 14.7 MB)

[+] Running Vulture (60%)...
    Command: ['/opt/hostedtoolcache/Python/3.11.14/x64/bin/python', '-m', 'vulture', '/home/runner/work/CytoScnPy/CytoScnPy/benchmark/examples', '--min-confidence', '60']
    [OK] Completed in 0.09s (Memory: 14.9 MB)

[+] Running Flake8...
    Command: ['/opt/hostedtoolcache/Python/3.11.14/x64/bin/python', '-m', 'flake8', '/home/runner/work/CytoScnPy/CytoScnPy/benchmark/examples']
    [OK] Completed in 0.27s (Memory: 100.0 MB)

[+] Running Pylint...
    Command: ['/opt/hostedtoolcache/Python/3.11.14/x64/bin/python', '-m', 'pylint', '/home/runner/work/CytoScnPy/CytoScnPy/benchmark/examples', '--output-format=json', '-j', '4']
    [OK] Completed in 4.15s (Memory: 371.8 MB)

[+] Running Ruff...
    Command: ['/opt/hostedtoolcache/Python/3.11.14/x64/bin/python', '-m', 'ruff', 'check', '/home/runner/work/CytoScnPy/CytoScnPy/benchmark/examples', '--output-format=json']
    [OK] Completed in 0.04s (Memory: 44.0 MB)

[+] Running uncalled...
    Command: ['/opt/hostedtoolcache/Python/3.11.14/x64/bin/python', '-m', 'uncalled', '/home/runner/work/CytoScnPy/CytoScnPy/benchmark/examples']
    [OK] Completed in 0.05s (Memory: 13.6 MB)

[+] Running dead...
    Command: ['/opt/hostedtoolcache/Python/3.11.14/x64/bin/python', '-m', 'dead', '--files', '.*\\.py$']
    [OK] Completed in 0.10s (Memory: 15.1 MB)

[+] Running deadcode...
    Command: ['/opt/hostedtoolcache/Python/3.11.14/x64/bin/deadcode', '/home/runner/work/CytoScnPy/CytoScnPy/benchmark/examples', '--no-color']
    [OK] Completed in 0.13s (Memory: 18.8 MB)

[=] Benchmark Results
Tool                 | Time (s)   | Mem (MB)   | Issues (Est)
------------------------------------------------------------
CytoScnPy (Rust)     | 0.028      | 7.59       | 169         
CytoScnPy (Python)   | 0.040      | 15.28      | 169         
Skylos               | 0.986      | 47.59      | 112         
Vulture (0%)         | 0.092      | 14.71      | 176         
Vulture (60%)        | 0.093      | 14.86      | 176         
Flake8               | 0.266      | 100.01     | 206         
Pylint               | 4.151      | 371.81     | 372         
Ruff                 | 0.042      | 44.00      | 258         
uncalled             | 0.052      | 13.61      | 87          
dead                 | 0.103      | 15.12      | 126         
deadcode             | 0.129      | 18.77      | 159         
------------------------------------------------------------

[=] Verification Results (Ground Truth Comparison)

--- Overall Detection ---
Tool                 | TP    | FP    | FN    | Precision  | Recall     | F1 Score  
--------------------------------------------------------------------------------
CytoScnPy (Rust)     | 110   | 46    | 38    | 0.7051     | 0.7432     | 0.7237    
CytoScnPy (Python)   | 110   | 46    | 38    | 0.7051     | 0.7432     | 0.7237    
Skylos               | 76    | 36    | 72    | 0.6786     | 0.5135     | 0.5846    
Vulture (0%)         | 102   | 67    | 46    | 0.6036     | 0.6892     | 0.6435    
Vulture (60%)        | 102   | 67    | 46    | 0.6036     | 0.6892     | 0.6435    
Flake8               | 17    | 19    | 131   | 0.4722     | 0.1149     | 0.1848    
Pylint               | 17    | 23    | 131   | 0.4250     | 0.1149     | 0.1809    
Ruff                 | 26    | 23    | 122   | 0.5306     | 0.1757     | 0.2640    
uncalled             | 64    | 23    | 84    | 0.7356     | 0.4324     | 0.5447    
dead                 | 44    | 67    | 104   | 0.3964     | 0.2973     | 0.3398    
deadcode             | 103   | 56    | 45    | 0.6478     | 0.6959     | 0.6710    
--------------------------------------------------------------------------------

--- Class Detection ---
Tool                 | TP    | FP    | FN    | Precision  | Recall     | F1 Score  
--------------------------------------------------------------------------------
CytoScnPy (Rust)     | 15    | 5     | 3     | 0.7500     | 0.8333     | 0.7895    
CytoScnPy (Python)   | 15    | 5     | 3     | 0.7500     | 0.8333     | 0.7895    
Skylos               | 15    | 7     | 3     | 0.6818     | 0.8333     | 0.7500    
Vulture (0%)         | 15    | 8     | 3     | 0.6522     | 0.8333     | 0.7317    
Vulture (60%)        | 15    | 8     | 3     | 0.6522     | 0.8333     | 0.7317    
Flake8               | 0     | 0     | 18    | 0.0000     | 0.0000     | 0.0000    
Pylint               | 0     | 0     | 18    | 0.0000     | 0.0000     | 0.0000    
Ruff                 | 0     | 0     | 18    | 0.0000     | 0.0000     | 0.0000    
uncalled             | 0     | 0     | 18    | 0.0000     | 0.0000     | 0.0000    
dead                 | 0     | 0     | 18    | 0.0000     | 0.0000     | 0.0000    
deadcode             | 15    | 8     | 3     | 0.6522     | 0.8333     | 0.7317    
--------------------------------------------------------------------------------

--- Function Detection ---
Tool                 | TP    | FP    | FN    | Precision  | Recall     | F1 Score  
--------------------------------------------------------------------------------
CytoScnPy (Rust)     | 42    | 20    | 14    | 0.6774     | 0.7500     | 0.7119    
CytoScnPy (Python)   | 42    | 20    | 14    | 0.6774     | 0.7500     | 0.7119    
Skylos               | 31    | 7     | 25    | 0.8158     | 0.5536     | 0.6596    
Vulture (0%)         | 51    | 25    | 5     | 0.6711     | 0.9107     | 0.7727    
Vulture (60%)        | 51    | 25    | 5     | 0.6711     | 0.9107     | 0.7727    
Flake8               | 0     | 0     | 56    | 0.0000     | 0.0000     | 0.0000    
Pylint               | 0     | 0     | 56    | 0.0000     | 0.0000     | 0.0000    
Ruff                 | 0     | 0     | 56    | 0.0000     | 0.0000     | 0.0000    
uncalled             | 44    | 23    | 12    | 0.6567     | 0.7857     | 0.7154    
dead                 | 32    | 67    | 24    | 0.3232     | 0.5714     | 0.4129    
deadcode             | 51    | 25    | 5     | 0.6711     | 0.9107     | 0.7727    
--------------------------------------------------------------------------------

--- Import Detection ---
Tool                 | TP    | FP    | FN    | Precision  | Recall     | F1 Score  
--------------------------------------------------------------------------------
CytoScnPy (Rust)     | 9     | 5     | 14    | 0.6429     | 0.3913     | 0.4865    
CytoScnPy (Python)   | 9     | 5     | 14    | 0.6429     | 0.3913     | 0.4865    
Skylos               | 7     | 5     | 16    | 0.5833     | 0.3043     | 0.4000    
Vulture (0%)         | 8     | 4     | 15    | 0.6667     | 0.3478     | 0.4571    
Vulture (60%)        | 8     | 4     | 15    | 0.6667     | 0.3478     | 0.4571    
Flake8               | 17    | 19    | 6     | 0.4722     | 0.7391     | 0.5763    
Pylint               | 10    | 18    | 13    | 0.3571     | 0.4348     | 0.3922    
Ruff                 | 18    | 18    | 5     | 0.5000     | 0.7826     | 0.6102    
uncalled             | 0     | 0     | 23    | 0.0000     | 0.0000     | 0.0000    
dead                 | 0     | 0     | 23    | 0.0000     | 0.0000     | 0.0000    
deadcode             | 9     | 3     | 14    | 0.7500     | 0.3913     | 0.5143    
--------------------------------------------------------------------------------

--- Method Detection ---
Tool                 | TP    | FP    | FN    | Precision  | Recall     | F1 Score  
--------------------------------------------------------------------------------
CytoScnPy (Rust)     | 24    | 9     | 4     | 0.7273     | 0.8571     | 0.7869    
CytoScnPy (Python)   | 24    | 9     | 4     | 0.7273     | 0.8571     | 0.7869    
Skylos               | 17    | 12    | 11    | 0.5862     | 0.6071     | 0.5965    
Vulture (0%)         | 20    | 9     | 8     | 0.6897     | 0.7143     | 0.7018    
Vulture (60%)        | 20    | 9     | 8     | 0.6897     | 0.7143     | 0.7018    
Flake8               | 0     | 0     | 28    | 0.0000     | 0.0000     | 0.0000    
Pylint               | 0     | 0     | 28    | 0.0000     | 0.0000     | 0.0000    
Ruff                 | 0     | 0     | 28    | 0.0000     | 0.0000     | 0.0000    
uncalled             | 20    | 0     | 8     | 1.0000     | 0.7143     | 0.8333    
dead                 | 12    | 0     | 16    | 1.0000     | 0.4286     | 0.6000    
deadcode             | 20    | 9     | 8     | 0.6897     | 0.7143     | 0.7018    
--------------------------------------------------------------------------------

--- Variable Detection ---
Tool                 | TP    | FP    | FN    | Precision  | Recall     | F1 Score  
--------------------------------------------------------------------------------
CytoScnPy (Rust)     | 20    | 7     | 3     | 0.7407     | 0.8696     | 0.8000    
CytoScnPy (Python)   | 20    | 7     | 3     | 0.7407     | 0.8696     | 0.8000    
Skylos               | 6     | 5     | 17    | 0.5455     | 0.2609     | 0.3529    
Vulture (0%)         | 8     | 21    | 15    | 0.2759     | 0.3478     | 0.3077    
Vulture (60%)        | 8     | 21    | 15    | 0.2759     | 0.3478     | 0.3077    
Flake8               | 0     | 0     | 23    | 0.0000     | 0.0000     | 0.0000    
Pylint               | 7     | 5     | 16    | 0.5833     | 0.3043     | 0.4000    
Ruff                 | 8     | 5     | 15    | 0.6154     | 0.3478     | 0.4444    
uncalled             | 0     | 0     | 23    | 0.0000     | 0.0000     | 0.0000    
dead                 | 0     | 0     | 23    | 0.0000     | 0.0000     | 0.0000    
deadcode             | 8     | 11    | 15    | 0.4211     | 0.3478     | 0.3810    
--------------------------------------------------------------------------------

[+] Comparing against baseline: benchmark/baseline_linux.json

[!] WARNING: Comparison tool regressions detected (informational only):
    - Flake8 F1 Score: 0.1916 -> 0.1848 (-0.0068)
    - Pylint F1 Score: 0.1988 -> 0.1809 (-0.0180)
    - Ruff Memory: 9.3MB -> 44.0MB (+373.4%)
    - Ruff F1 Score: 0.2778 -> 0.2640 (-0.0138)
    - uncalled F1 Score: 0.5741 -> 0.5447 (-0.0294)
    - dead F1 Score: 0.3621 -> 0.3398 (-0.0223)

[OK] No CytoScnPy regressions detected.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces several enhancements and bug fixes to the CytoScnPy project, focusing on security, code quality, and performance. Key changes include taint analysis improvements, new security rules, updates to the VS Code extension, and various code quality enhancements. The review focuses on identifying potential issues related to security vulnerabilities, code maintainability, and adherence to coding best practices, with a particular emphasis on areas where improvements can be made.

@djinn09 djinn09 merged commit 078a2c1 into main Jan 20, 2026
20 checks passed
@djinn09 djinn09 deleted the feature/new_danger_code branch January 20, 2026 17:46
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.

2 participants