Repository navigation
Description
Remove logic_bomb and algorithmic_dos metrics
Description
The logic_bomb and algorithmic_dos metrics in the GitGalaxy SAST engine (gitgalaxy/metrics/signal_processor.py) generate systematic false positives by criminalizing standard programming patterns. We need to completely remove these metrics from the schema and calculation pipeline.
Why they are broken
1. logic_bomb
This metric calculates a "sabotage mass" by multiplying branching logic (e.g., if statements) by defensive payloads (panics_and_aborts and cleanup). This means that completely safe, defensive functions that validate input and raise an Exception on failure are mathematically scored as a Logic Bomb.
Furthermore, detecting a true logic bomb requires an Abstract Syntax Tree (AST) to directly link a conditional trigger to a specific malicious payload. Because the AST-less engine only tracks keyword counts per file, it blindly flags legitimate scripts (like Log Rotators or Garbage Collectors) simply because they happen to contain both time-based logic and file-deletion logic somewhere in the same file.
2. algorithmic_dos
This metric relies heavily on the big_o_depth structural heuristic, which derives algorithmic time complexity purely from whitespace indentation. Because it combines this flawed metric with standard io and api signals, any deeply indented server configuration or web server loop (like runserver.py) is misclassified as an intentional Algorithmic Denial of Service attack.
Action Items
- Remove
_calc_logic_bomband_calc_algorithmic_doslogic fromgitgalaxy/metrics/signal_processor.py. - Remove
logic_bombandalgorithmic_dosfrom theRISK_SCHEMAarray inanalysis_lens.pyand other schema mappings. - Clean up any downstream references in the reporting tools or AI threat auditors.
Activity
Remove logic_bomb and algorithmic_dos metrics from the risk engine (s…
Remove big_o_depth and is_recursive complexity metrics from the risk …