generate_probe |
interop/tsgo/probe_gen.rs:97 |
754 lines — 4 distinct phases: import collection, type decl emission, const probes, call probes |
check_all |
checker.rs:696 |
Sequential registration passes (imports, types, JSX hints, items) each self-contained |
Checker::new |
checker.rs:319 |
15+ field inits + global registry setup could be extracted |
check_call |
checker/expr.rs:848 |
stdlib arg checking, unify loop, and trait dispatch are separate concerns |
check_construct |
checker/expr.rs:1513 |
Field collection, validation, required-field check, spread handling — 4 concerns |
check_pipe_right |
checker/expr.rs:1959 |
stdlib / for-block / trait / fallback dispatch branches |
resolve_member_type |
checker/expr.rs:2721 |
Narrowing, tuple, record, foreign — separate lookup paths |
check_import |
checker/imports.rs:9 |
Default import, specifier loop, trait import are independent |
check_function |
checker/items.rs:481 |
Param validation, return type wrapping, scope setup |
check_trait_impl |
checker/traits.rs:122 |
self/param count/signature/return — 4 orthogonal checks |
register_type_decl |
checker/type_registration.rs:7 |
Naming, field population, spread flattening |
resolve_from_source |
resolve.rs:463 |
Transitive imports, type map, for-block exports, flattening — 4 passes |
emit_mock_for_type |
codegen/typescript/parse_mock.rs:167 |
Repeated mock gen patterns extractable |
emit_mock_for_typedef |
codegen/typescript/parse_mock.rs:278 |
Union variant + record entry handling |
emit_pipe |
codegen/typescript/pipes.rs:160 |
stdlib / trait / for-block / normal dispatch |
emit_import |
codegen/typescript/statement.rs:36 |
Default + specifier loop extractable |
handle_completion |
floe-lsp/completions.rs:32 |
Independent context-detection branches |
handle_hover |
floe-lsp/hover.rs:13 |
Pipe / symbol / member / type-map branches |
collect_items |
floe-lsp/index.rs:134 |
Import / const / fn / type / for-block collection |
lower_template_literal |
lower.rs:108 |
Escape handling, brace tracking, string parsing |
enhance_object_destructure_probes |
interop/tsgo.rs:427 |
Import mapping, collection, enhancement — 3 passes |
cmd_test |
floe-cli/main.rs:364 |
File discovery, detection, typecheck, codegen, execution phases |
These functions got
#[allow(clippy::too_many_lines)]or#[allow(clippy::cognitive_complexity)]in #1405 but are genuinely refactorable — they have orthogonal sub-problems or distinct phases, not just a single large enum match.Functions to refactor
generate_probeinterop/tsgo/probe_gen.rs:97check_allchecker.rs:696Checker::newchecker.rs:319check_callchecker/expr.rs:848check_constructchecker/expr.rs:1513check_pipe_rightchecker/expr.rs:1959resolve_member_typechecker/expr.rs:2721check_importchecker/imports.rs:9check_functionchecker/items.rs:481check_trait_implchecker/traits.rs:122register_type_declchecker/type_registration.rs:7resolve_from_sourceresolve.rs:463emit_mock_for_typecodegen/typescript/parse_mock.rs:167emit_mock_for_typedefcodegen/typescript/parse_mock.rs:278emit_pipecodegen/typescript/pipes.rs:160emit_importcodegen/typescript/statement.rs:36handle_completionfloe-lsp/completions.rs:32handle_hoverfloe-lsp/hover.rs:13collect_itemsfloe-lsp/index.rs:134lower_template_literallower.rs:108enhance_object_destructure_probesinterop/tsgo.rs:427cmd_testfloe-cli/main.rs:364Goal
After each refactor, remove the
#[allow]attribute. The lint stays — only the suppression goes away.Tests
cargo clippy --workspacemust pass with zero errors after removing the allowscargo test --workspacemust pass