Master tracking issue for the workspace-wide refactor effort to remove all #[allow(clippy::cognitive_complexity)] and #[allow(clippy::too_many_lines)] suppressions.
Goal
The workspace Cargo.toml sets cognitive_complexity and too_many_lines to warn globally. Over time, functions that exceeded the thresholds gained #[allow(...)] suppressions. This tracking issue coordinates refactoring each one so the suppressions can be removed without raising global thresholds.
How to pick one up
Each child ticket contains:
- What the function does in plain English
- Specific extraction proposals with proposed function signatures
- Suggested unit tests for new helpers
- Acceptance criteria checklist
Pattern to follow (see merged PRs): #187, #188, #189, #190, #191
- Checkout branch from
main: refactor/<file>-cognitive-complexity-<issue#>
- Extract helpers per the ticket
- Add unit tests for new code (pure/extracted logic)
- Remove the
#[allow(...)] suppression
- Run
make lint and make test — both must be green
- Open a PR with
Closes #<issue> so this master issue's task list ticks automatically
Progress
Resolved (5)
Already merged — kept here for pattern reference:
Open — coast-daemon/src/handlers/ (5)
- [ ] #205
- [ ] #206
- [ ] #207
- [ ] #208
- [ ] #209
Open — coast-daemon/src/api/ (9 tickets, 13 suppressions)
- [ ] #210
- [ ] #211
- [ ] #212
- [ ] #213
- [ ] #214
- [ ] #215
- [ ] #216
- [ ] #217
- [ ] #218
Open — coast-daemon/src/ root (4 tickets, 8 suppressions)
- [ ] #219
- [ ] #220
- [ ] #221
- [ ] #222
Open — coast-docker/src/ (2)
Suppression count
| Location |
Files |
Suppressions |
Status |
coast-daemon/src/handlers/ |
5 |
5 |
Open |
coast-daemon/src/api/ |
9 |
13 |
Open |
coast-daemon/src/ (root) |
4 |
8 |
Open |
coast-docker/src/ |
2 |
2 |
Open |
| Total open |
20 |
27 |
|
| Resolved |
5 |
5 |
Done |
| Grand total |
25 |
32 |
|
Notes for contributors
- DRY strictly. Several functions share patterns (e.g., stats collectors across
ws_stats.rs, ws_service_stats.rs, ws_host_service_stats.rs; inner daemon health checks across checkout.rs, stop.rs, unassign.rs). Extract shared helpers into common modules where it makes sense.
- Don't lower clippy thresholds — fix the code, not the lint config.
- Don't expand the public API — all extracted helpers should stay private unless the issue explicitly says otherwise.
- Contracts stay stable — the original function signature must not change.
- Write tests for new code. Existing end-to-end tests usually cover the extracted-verbatim parts; add focused unit tests for pure/new logic.
Master tracking issue for the workspace-wide refactor effort to remove all
#[allow(clippy::cognitive_complexity)]and#[allow(clippy::too_many_lines)]suppressions.Goal
The workspace
Cargo.tomlsetscognitive_complexityandtoo_many_linestowarnglobally. Over time, functions that exceeded the thresholds gained#[allow(...)]suppressions. This tracking issue coordinates refactoring each one so the suppressions can be removed without raising global thresholds.How to pick one up
Each child ticket contains:
Pattern to follow (see merged PRs): #187, #188, #189, #190, #191
main:refactor/<file>-cognitive-complexity-<issue#>#[allow(...)]suppressionmake lintandmake test— both must be greenCloses #<issue>so this master issue's task list ticks automaticallyProgress
Resolved (5)
Already merged — kept here for pattern reference:
coast-daemon/src/handlers/ports.rs— PR refactor: extract match arms and validation from ports::handle to reduce cognitive complexity #187coast-daemon/src/handlers/ps.rs— PR refactor: extract validation and enrichment from ps::handle to reduce cognitive complexity #188coast-daemon/src/handlers/logs.rs— PR refactor: extract select_output and resolve_service_log_command from logs::handle to reduce cognitive complexity #189coast-daemon/src/handlers/shared.rs— PR refactor: extract volume discovery and container cleanup from shared::handle_rm to reduce cognitive complexity #190coast-daemon/src/handlers/rm.rs— PR refactor: extract teardown phases from rm::handle to reduce cognitive complexity #191Open —
coast-daemon/src/handlers/(5)Open —
coast-daemon/src/api/(9 tickets, 13 suppressions)Open —
coast-daemon/src/root (4 tickets, 8 suppressions)Open —
coast-docker/src/(2)Suppression count
coast-daemon/src/handlers/coast-daemon/src/api/coast-daemon/src/(root)coast-docker/src/Notes for contributors
ws_stats.rs,ws_service_stats.rs,ws_host_service_stats.rs; inner daemon health checks acrosscheckout.rs,stop.rs,unassign.rs). Extract shared helpers into common modules where it makes sense.