B&W print-friendly diagrams + tinkerpop-0001 + wave-3 proof sections. Squash of 94 local commits onto remote master.
1.2 KiB
1.2 KiB
| id | repo | severity | status | created |
|---|---|---|---|---|
| debian-0001 | debian-perl-config | LOW | NOT-WORTH-FIXING | 2026-03-23 |
Defect
File: DebianLinux.pm:140
Pattern: 6-item list membership in config parsing
Complexity: O(n)
Language: Perl
Description
Debian's Perl configuration module checks membership in a hardcoded list of 6 architecture or platform names using a linear list search. Because the list is bounded at 6 elements, the effective complexity is O(1) in practice — the constant factor is negligible and the list never grows. This is a stylistic defect only; it follows the same CWE-407 pattern but poses no measurable performance risk given the fixed input size.
Fix
Replace: grep { $_ eq $value } @six_item_list
With: exists $six_item_hash{$value}
Data structure change: @list: 6-element array → %hash: 6-element hash
Work required
- Patch in
defects/debian/patch/ - Unit test — asserts exact operation counts before/after (in
defects/debian/unit/) - Integration test (in
defects/debian/integration/) - Benchmark — before/after on V=100,200,400,800 (in
defects/debian/bench/) - White paper section