Code optimization audit: remaining issues to address #84

Closed
opened 2026-06-10 02:23:41 +00:00 by Mark · 0 comments
Owner

Summary

After the code optimization audit (~100 issues identified, ~85% resolved), the following remain:

Test Failures

  1. Missing settings.evidence_max_tasks attribute (app/services/investigations/pipeline/consolidator.py:332)

    • 3 unit test failures in test_auto_gather_consolidation.py
    • Fix: Add attribute to Settings model or use existing equivalent
  2. Exception handler leaks internals (app/main.py)

  • 1 integration test failure: test_error_doesak_internals
  • Fix: Add global exception handler that returns sanitized 500 response

Pre-existing Lint Issues (17 remaining in app/)

  • 9x ERA001: Commented-out code
  • 4x UP038: Use X | Y in isinstance calls
  • 2x B006: Mutable default arguments
  • 2x SIM110: Use any() instead of for loops

Verification

  • Unit tests: 692 passed / 23 failed (pre-existing)
  • Integration: 154 passed / 1 failed (pre-existing)
  • Frontend build: Success
  • Commits pushed: 69a79ce → 7ad6705
## Summary After the code optimization audit (~100 issues identified, ~85% resolved), the following remain: ### Test Failures 1. **Missing `settings.evidence_max_tasks` attribute** (`app/services/investigations/pipeline/consolidator.py:332`) - 3 unit test failures in `test_auto_gather_consolidation.py` - Fix: Add attribute to Settings model or use existing equivalent 2. **Exception handler leaks internals** (`app/main.py`) - 1 integration test failure: `test_error_doesak_internals` - Fix: Add global exception handler that returns sanitized 500 response ### Pre-existing Lint Issues (17 remaining in `app/`) - 9x ERA001: Commented-out code - 4x UP038: Use `X | Y` in isinstance calls - 2x B006: Mutable default arguments - 2x SIM110: Use `any()` instead of for loops ### Verification - Unit tests: 692 passed / 23 failed (pre-existing) - Integration: 154 passed / 1 failed (pre-existing) - Frontend build: Success - Commits pushed: `69a79ce` → `7ad6705`
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/osint-hub#84
No description provided.