Public report of 0xPlaygrounds/rig, published 27 October 2026. It has the same score, grades and number of findings as the full report. The details of security findings (where they are in the code, which known vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive report Measured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.5). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey → Signed and filed in the standard's public register, 27 October 2026, 09:08 UTC · Survey ID cd_38117c948e7345ca98586eda8a803e94

0xPlaygrounds/rig

Measured 27 October 2026, 08:52 UTC, at code version e1cd47d

Regression: 1 dimension fell since the last survey

A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.

CAI score 66out of 100 Adequate
CriticalWeakAdequateStrongExemplary
Up 4 since the last survey

The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.

A very large codebase: 500,305 lines of product code in 56 projects, tests not counted · Estimated rebuild effort: about 5.4 person-years · Weakest lens: Production Readiness, 58

Findings by how serious they are

81 critical 837 serious 130 minor

13 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.

This survey was produced by

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
27 October 2026, 08:52 UTC

A measurement, not a certificate. The Code Assurance Index records a number together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee the code. The standard was written by Canine Development, which also builds Watchdog. It is open to any tool that implements it, and today Watchdog is the only one that does.

The score is deterministic, which means the same code always gets the same score. Watchdog works it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸

70of 70 dimensions measured by tools.
982of 1048 findings point to an exact file and line, so you can open each one in the code. The other 66 concern the repository as a whole, such as missing documentation.
70dimensions across 8 lenses, read from 500,305 lines of product code in 56 projects.
Chapters

Executive summary

0xPlaygrounds/rig falls short of our standard for a preview release because its Security dimensions are rated Weak, and 52 passwords or keys sit in the current code. It scores 66 out of 100, which alone would earn Strong, but it is rated Adequate: a rating can't sit more than one step above its weakest group.

Production Readiness, at 58, is the weakest lens and counts most in the score. The best first step for the work it takes is fixing the package under a licence on your banned list, worth about 4 points. Replacing the 52 exposed passwords or keys and switching the old ones off would lift Production Readiness itself, worth about 7 points. Raising Production Readiness to 62 would lift the score to about 68.

Fifty-two passwords or keys in the code and one in the code's history are open to anyone who can read the repository. Nineteen pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Replacing each exposed password or key and pinning each tool to an exact version would close both risks. Passing outside input through environment variables would fix the two pipeline steps that put outside input straight into a shell command, and limiting each secret to its own step would deal with the two secrets exposed to more of the pipeline than needed. Moving the business rules into the object that owns the data would take care of the business object that only holds data.

The product code is 500,305 lines, about €790,000 to rebuild.

A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.

How the score is built: what each lens counts for The lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Production Readiness 58 · counts for 45%Maturity 65 · counts for 25%Security and Compliance 71 · counts for 14%Code Health 76 · counts for 8%Domain Modelling 91 · counts for 4%Architecture 96 · counts for 2%Performance 97 · counts for 1%Event Sourcing 100 · counts for 1%

If Production Readiness rose from 58 to 62, the lowest score rated Strong, the score would rise from 66 to about 68.

Code composition: what the lines of code are
Product code 76%Tests 24%
New since the last survey: 623 findings

These 623 critical or serious findings weren't in the previous survey, on 13 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.

  • Cyclomatic Complexity · rig_tui::input::act (cyclomatic 48) plugins/rig-tui/src/input.rs
  • Cyclomatic Complexity · rig_claude_cloak::transport::body (cyclomatic 44) plugins/rig-claude-cloak/src/transport.rs
  • Cyclomatic Complexity · rig::launcher::run::launch (cyclomatic 42) src/launcher/run.rs
  • Cyclomatic Complexity · rig_claude_cloak::schema::upgrade (cyclomatic 39) plugins/rig-claude-cloak/src/schema.rs
  • Cyclomatic Complexity · rig_claude_cloak::transport::prompt_caching (cyclomatic 39) plugins/rig-claude-cloak/src/transport.rs
  • Cyclomatic Complexity · rig_cassette::scrub::capture_format (cyclomatic 36) crates/rig-cassette/src/scrub.rs
  • Cyclomatic Complexity · corpus_fh::editor_front::receive (cyclomatic 32) corpus/fh/src/editor_front.rs
  • Cyclomatic Complexity · Markdown::start (cyclomatic 30) corpus/sn/src/web_fetch/markdown.rs
  • Cyclomatic Complexity · corpus_sn::vim_input::editor::parse (cyclomatic 29) corpus/sn/src/vim_input/editor.rs
  • Cyclomatic Complexity · rig_tui::render::lay_out_transcript (cyclomatic 29) plugins/rig-tui/src/render.rs
  • Cyclomatic Complexity · corpus_ct::git_guardrails::shell::lex (cyclomatic 28) corpus/ct/src/git_guardrails/shell.rs
  • Cyclomatic Complexity · Screen::csi (cyclomatic 28) corpus/sn/src/terminal_sessions/screen.rs
  • Cyclomatic Complexity · rig_cassette::traffic::line::line (cyclomatic 28) crates/rig-cassette/src/traffic/line.rs
  • Cyclomatic Complexity · rig_claude_cloak::schema::normalize (cyclomatic 28) plugins/rig-claude-cloak/src/schema.rs
  • Cyclomatic Complexity · rig_tui::transcript::message_lines (cyclomatic 28) plugins/rig-tui/src/transcript.rs
  • Cyclomatic Complexity · rig_core::completion::history::assistant (cyclomatic 26) crates/rig-core/src/completion/history.rs
  • Cyclomatic Complexity · rig_core::providers::deepseek::strict_node (cyclomatic 26) crates/rig-core/src/providers/deepseek.rs
  • Cyclomatic Complexity · rig_claude_cloak::schema::postprocess (cyclomatic 26) plugins/rig-claude-cloak/src/schema.rs
  • Cyclomatic Complexity · corpus_oc::steer_and_queue::strip_keys (cyclomatic 25) corpus/oc/src/steer_and_queue.rs
  • Cyclomatic Complexity · rig_claude_cloak::schema::strict_schema (cyclomatic 25) plugins/rig-claude-cloak/src/schema.rs
  • Cyclomatic Complexity · Scrubber::scrub_json_in (cyclomatic 24) crates/rig-cassette/src/scrub.rs
  • Cyclomatic Complexity · rig_cassette::scrub::multipart_slices (cyclomatic 24) crates/rig-cassette/src/scrub.rs
  • Cyclomatic Complexity · corpus_library::transcript_import_library::import (cyclomatic 23) corpus/library/src/transcript_import_library.rs
  • Cyclomatic Complexity · rig_ecs::stage::start (cyclomatic 23) crates/rig-ecs/src/stage.rs
  • Cyclomatic Complexity · Markdown::end (cyclomatic 22) corpus/sn/src/web_fetch/markdown.rs
  • Cyclomatic Complexity · Validator::check (cyclomatic 22) crates/rig-core/src/tool/validate.rs
  • Cyclomatic Complexity · rig_basics::compaction::compact_near_the_window (cyclomatic 22) plugins/rig-basics/src/compaction.rs
  • Cyclomatic Complexity · rig_basics::print::drive (cyclomatic 22) plugins/rig-basics/src/print.rs
  • Cyclomatic Complexity · Writer::start (cyclomatic 22) plugins/rig-tui/src/markdown.rs
  • Cyclomatic Complexity · Repo::push (cyclomatic 21) corpus/ct/src/git_guardrails/rules.rs
  • Cyclomatic Complexity · corpus_oc::transcript_in_editor::rebuild (cyclomatic 21) corpus/oc/src/transcript_in_editor.rs
  • Cyclomatic Complexity · Message::absorb (cyclomatic 21) crates/rig-core/src/providers/anthropic/streaming/document.rs
  • Cyclomatic Complexity · rig_core::conversation::pairing::walk (cyclomatic 21) crates/rig-core/src/conversation/pairing.rs
  • Cyclomatic Complexity · Kept::line (cyclomatic 21) crates/rig-tools/src/shell.rs
  • Cyclomatic Complexity · Job::diagnostics (cyclomatic 20) corpus/fh/src/lsp_tools.rs
  • Cyclomatic Complexity · corpus_fh::import_sessions::parse::claude_code (cyclomatic 20) corpus/fh/src/import_sessions/parse.rs
  • Cyclomatic Complexity · Manifest::entries (cyclomatic 20) corpus/oc/src/dependency_guard.rs
  • Cyclomatic Complexity · corpus_oc::dataset_cli::dataset::chat_messages (cyclomatic 20) corpus/oc/src/dataset_cli/dataset.rs
  • Cyclomatic Complexity · Editor::run (cyclomatic 20) corpus/sn/src/vim_input/editor.rs
  • Cyclomatic Complexity · corpus_sn::crash_resume::recover (cyclomatic 20) corpus/sn/src/crash_resume.rs
  • Cyclomatic Complexity · Scrubber::learn_json_in (cyclomatic 20) crates/rig-cassette/src/scrub.rs
  • Cyclomatic Complexity · InteractionsDecoder::decode (cyclomatic 20) crates/rig-core/src/providers/gemini/interactions_api/streaming.rs
  • Cyclomatic Complexity · Responses::base (cyclomatic 20) crates/rig-core/src/providers/openai/responses_api/mod.rs
  • Cyclomatic Complexity · OAuthTransport::prepare (cyclomatic 20) plugins/rig-claude-cloak/src/transport.rs
  • Cyclomatic Complexity · rig_tui::pane::lay_out_panes (cyclomatic 20) plugins/rig-tui/src/pane.rs
  • Cyclomatic Complexity · corpus_fh::apply_patch_tool::patch::parse (cyclomatic 19) corpus/fh/src/apply_patch_tool/patch.rs
  • Cyclomatic Complexity · corpus_fh::prompt_cache_shaping::shape (cyclomatic 19) corpus/fh/src/prompt_cache_shaping.rs
  • Cyclomatic Complexity · Writer::end (cyclomatic 19) plugins/rig-tui/src/markdown.rs
  • Cyclomatic Complexity · rig_tui::input::read_input (cyclomatic 19) plugins/rig-tui/src/input.rs
  • Cyclomatic Complexity · Rewinder::rewind (cyclomatic 18) corpus/base/src/checkpoint_rewind.rs
  • Cyclomatic Complexity · corpus_base::debate::step (cyclomatic 18) corpus/base/src/debate.rs
  • Cyclomatic Complexity · corpus_fh::apply_patch_tool::patch::check (cyclomatic 18) corpus/fh/src/apply_patch_tool/patch.rs
  • Cyclomatic Complexity · corpus_ho::hunk_review::revert (cyclomatic 18) corpus/ho/src/hunk_review.rs
  • Cyclomatic Complexity · corpus_ho::hunk_review::review (cyclomatic 18) corpus/ho/src/hunk_review.rs
  • Cyclomatic Complexity · corpus_sn::model_params::check (cyclomatic 18) corpus/sn/src/model_params.rs
  • Cyclomatic Complexity · corpus_sn::vim_input::edit (cyclomatic 18) corpus/sn/src/vim_input.rs
  • Cyclomatic Complexity · JsonObjectContext::field (cyclomatic 18) crates/rig-cassette/src/scrub.rs
  • Cyclomatic Complexity · rig_cassette::http::replay_request (cyclomatic 18) crates/rig-cassette/src/http/mod.rs
  • Cyclomatic Complexity · rig_memory::rewrite::rewrite (cyclomatic 18) crates/rig-memory/src/rewrite.rs
  • Cyclomatic Complexity · corpus_base::export::render::walk (cyclomatic 17) corpus/base/src/export/render.rs
  • Cyclomatic Complexity · corpus_fh::apply_patch_tool::gate_together (cyclomatic 17) corpus/fh/src/apply_patch_tool.rs
  • Cyclomatic Complexity · corpus_ho::session_recall::docs (cyclomatic 17) corpus/ho/src/session_recall.rs
  • Cyclomatic Complexity · corpus_sn::crash_resume::resolve (cyclomatic 17) corpus/sn/src/crash_resume.rs
  • Cyclomatic Complexity · corpus_sn::vim_input::editor::target (cyclomatic 17) corpus/sn/src/vim_input/editor.rs
  • Cyclomatic Complexity · Scrubber::learn_body_parts (cyclomatic 17) crates/rig-cassette/src/scrub.rs
  • Cyclomatic Complexity · rig_ecs::turn::commit_turn_calls (cyclomatic 17) crates/rig-ecs/src/turn.rs
  • Cyclomatic Complexity · rig::launcher::plugin::add (cyclomatic 17) src/launcher/plugin.rs
  • Cyclomatic Complexity · corpus_oc::dataset_cli::dataset::session_lines (cyclomatic 16) corpus/oc/src/dataset_cli/dataset.rs
  • Cyclomatic Complexity · corpus_sn::sessions_prune_cli::plan (cyclomatic 16) corpus/sn/src/sessions_prune_cli.rs
  • Cyclomatic Complexity · corpus_sp::dead_ends_ledger::review_shell (cyclomatic 16) corpus/sp/src/dead_ends_ledger.rs
  • Cyclomatic Complexity · Writer::encode (cyclomatic 16) crates/rig-cassette/src/effect_log/jsonl.rs
  • Cyclomatic Complexity · StreamRecord::push (cyclomatic 16) crates/rig-core/src/streaming/event.rs
  • Cyclomatic Complexity · rig_core::providers::anthropic::completion::base (cyclomatic 16) crates/rig-core/src/providers/anthropic/completion.rs
  • Cyclomatic Complexity · rig_ecs::restore::restore_session (cyclomatic 16) crates/rig-ecs/src/restore.rs
  • Cyclomatic Complexity · rig_memory::rewrite::map_file (cyclomatic 16) crates/rig-memory/src/rewrite.rs
  • Cyclomatic Complexity · rig_tools::process::forward_both (cyclomatic 16) crates/rig-tools/src/process.rs
  • Cyclomatic Complexity · rig_basics::telemetry::usage::usage (cyclomatic 16) plugins/rig-basics/src/telemetry/usage.rs
  • Cyclomatic Complexity · Transcript::update (cyclomatic 16) plugins/rig-tui/src/transcript.rs
  • Cognitive Complexity · rig_claude_cloak::schema::upgrade (cognitive 102) plugins/rig-claude-cloak/src/schema.rs
  • Cognitive Complexity · rig::launcher::run::launch (cognitive 84) src/launcher/run.rs
  • Cognitive Complexity · corpus_fh::editor_front::receive (cognitive 72) corpus/fh/src/editor_front.rs
  • Cognitive Complexity · rig_claude_cloak::schema::postprocess (cognitive 58) plugins/rig-claude-cloak/src/schema.rs
  • Cognitive Complexity · rig_claude_cloak::transport::prompt_caching (cognitive 53) plugins/rig-claude-cloak/src/transport.rs
  • Cognitive Complexity · rig_claude_cloak::transport::body (cognitive 53) plugins/rig-claude-cloak/src/transport.rs
  • Cognitive Complexity · rig_tui::transcript::message_lines (cognitive 51) plugins/rig-tui/src/transcript.rs
  • Cognitive Complexity · rig_tui::render::lay_out_transcript (cognitive 50) plugins/rig-tui/src/render.rs
  • Cognitive Complexity · corpus_fh::prompt_cache_shaping::shape (cognitive 49) corpus/fh/src/prompt_cache_shaping.rs
  • Cognitive Complexity · corpus_ho::session_recall::docs (cognitive 49) corpus/ho/src/session_recall.rs
  • Cognitive Complexity · corpus_oc::transcript_in_editor::rebuild (cognitive 48) corpus/oc/src/transcript_in_editor.rs
  • Cognitive Complexity · rig_core::conversation::pairing::walk (cognitive 48) crates/rig-core/src/conversation/pairing.rs
  • Cognitive Complexity · rig_core::providers::deepseek::strict_node (cognitive 46) crates/rig-core/src/providers/deepseek.rs
  • Cognitive Complexity · rig_cassette::scrub::capture_format (cognitive 45) crates/rig-cassette/src/scrub.rs
  • Cognitive Complexity · rig_cassette::traffic::line::line (cognitive 44) crates/rig-cassette/src/traffic/line.rs
  • Cognitive Complexity · corpus_library::transcript_import_library::import (cognitive 42) corpus/library/src/transcript_import_library.rs
  • Cognitive Complexity · Scrubber::scrub_sse_body (cognitive 41) crates/rig-cassette/src/scrub.rs
  • Cognitive Complexity · rig_basics::compaction::compact_near_the_window (cognitive 41) plugins/rig-basics/src/compaction.rs
  • Cognitive Complexity · corpus_fh::apply_patch_tool::patch::parse (cognitive 40) corpus/fh/src/apply_patch_tool/patch.rs
  • Cognitive Complexity · corpus_ct::git_guardrails::shell::lex (cognitive 39) corpus/ct/src/git_guardrails/shell.rs
  • Cognitive Complexity · rig_tools::process::forward_both (cognitive 39) crates/rig-tools/src/process.rs
  • Cognitive Complexity · corpus_fh::checklist_runner::schedule (cognitive 38) corpus/fh/src/checklist_runner.rs

Watchdog compares every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.

Fixed since the last survey: 113 findings

These 113 critical or serious findings were in the previous survey, on 13 October 2026, and are gone from this one. The first 100 are listed here.

  • Cyclomatic Complexity · Model::load (cyclomatic 31) xtask/src/cassette/prune.rs
  • Cyclomatic Complexity · BusDriver::serve (cyclomatic 28) crates/rig-agent/src/bus/driver.rs
  • Cyclomatic Complexity · File::compare (cyclomatic 26) xtask/src/cassette/audit.rs
  • Cyclomatic Complexity · Model::outcome (cyclomatic 26) xtask/src/cassette/prune.rs
  • Cyclomatic Complexity · rig_core::transcript::pair (cyclomatic 21) crates/rig-core/src/transcript.rs
  • Cyclomatic Complexity · Names::add (cyclomatic 21) xtask/src/cassette/prune/names.rs
  • Cyclomatic Complexity · rig_tungstenite::connection::run_actor (cyclomatic 19) crates/rig-tungstenite/src/connection.rs
  • Cyclomatic Complexity · xtask::cassette::prune::run (cyclomatic 19) xtask/src/cassette/prune.rs
  • Cyclomatic Complexity · xtask::cassette::audit::run (cyclomatic 18) xtask/src/cassette/audit.rs
  • Cyclomatic Complexity · EffectStream::poll_next (cyclomatic 17) crates/rig-agent/src/bus/dispatcher.rs
  • Cyclomatic Complexity · HttpExchange::streaming (cyclomatic 17) crates/rig-core/src/driver/http_transport.rs
  • Cyclomatic Complexity · File::header (cyclomatic 17) xtask/src/cassette/audit.rs
  • Cyclomatic Complexity · Transcript::push (cyclomatic 16) crates/rig-core/src/streaming/event.rs
  • Cyclomatic Complexity · Options::parse (cyclomatic 16) xtask/src/coverage.rs
  • Cyclomatic Complexity · xtask::cassette::prune::read_per_test (cyclomatic 16) xtask/src/cassette/prune.rs
  • Cognitive Complexity · Model::load (cognitive 59) xtask/src/cassette/prune.rs
  • Cognitive Complexity · Model::outcome (cognitive 50) xtask/src/cassette/prune.rs
  • Cognitive Complexity · rig_core::transcript::pair (cognitive 48) crates/rig-core/src/transcript.rs
  • Cognitive Complexity · Names::add (cognitive 47) xtask/src/cassette/prune/names.rs
  • Cognitive Complexity · BusDriver::serve (cognitive 42) crates/rig-agent/src/bus/driver.rs
  • Cognitive Complexity · File::compare (cognitive 39) xtask/src/cassette/audit.rs
  • Cognitive Complexity · rig_tungstenite::connection::run_actor (cognitive 37) crates/rig-tungstenite/src/connection.rs
  • Cognitive Complexity · rig_cassette::http::relay::advance_body (cognitive 31) crates/rig-cassette/src/http/relay.rs
  • Cognitive Complexity · xtask::cassette::prune::read_per_test (cognitive 29) xtask/src/cassette/prune.rs
  • Cognitive Complexity · EffectStream::poll_next (cognitive 28) crates/rig-agent/src/bus/dispatcher.rs
  • Cognitive Complexity · xtask::coverage::run (cognitive 26) xtask/src/coverage.rs
  • Cognitive Complexity · xtask::cassette::prune::run (cognitive 25) xtask/src/cassette/prune.rs
  • Cognitive Complexity · BusDriver::poll (cognitive 23) crates/rig-agent/src/bus/driver.rs
  • Cognitive Complexity · xtask::coverage::lines::regressions (cognitive 23) xtask/src/coverage/lines.rs
  • Cognitive Complexity · xtask::cassette::audit::run (cognitive 22) xtask/src/cassette/audit.rs
  • Cognitive Complexity · File::header (cognitive 21) xtask/src/cassette/audit.rs
  • Cognitive Complexity · Finder::rows (cognitive 21) xtask/src/cassette/prune/names.rs
  • Cognitive Complexity · xtask::coverage::shapes::walk_facts (cognitive 20) xtask/src/coverage/shapes.rs
  • Cognitive Complexity · xtask::coverage::lines::parse_lcov (cognitive 19) xtask/src/coverage/lines.rs
  • Cognitive Complexity · CassetteScrubber::scrub_json_value (cognitive 18) crates/rig-cassette/src/http/mod.rs
  • Cognitive Complexity · Audit::parts (cognitive 18) xtask/src/cassette/audit.rs
  • Cognitive Complexity · xtask::cassette::prune::names::scan (cognitive 18) xtask/src/cassette/prune/names.rs
  • Cognitive Complexity · xtask::coverage::lines::measure (cognitive 18) xtask/src/coverage/lines.rs
  • Cognitive Complexity · Transcript::push (cognitive 17) crates/rig-core/src/streaming/event.rs
  • Cognitive Complexity · File::stream (cognitive 17) xtask/src/cassette/audit.rs
  • Cognitive Complexity · xtask::cassette::audit::block_parts (cognitive 17) xtask/src/cassette/audit.rs
  • God Classes · MethodTooLong: Model.load xtask/src/cassette/prune.rs
  • God Classes · FileTooLong: bus/dispatcher.rs crates/rig-agent/src/bus/dispatcher.rs
  • God Classes · FileTooLong: cassette/prune.rs xtask/src/cassette/prune.rs
  • God Classes · FileTooLong: cassette/audit.rs xtask/src/cassette/audit.rs
  • God Classes · ClassTooLong: Turn crates/rig-core/src/operation/completion.rs
  • God Classes · FileTooLong: src/lib.rs crates/rig-memory/src/lib.rs
  • God Classes · ClassTooLong: AgentBuilder crates/rig-agent/src/agent/builder.rs
  • God Classes · MethodTooLong: BusDriver.serve crates/rig-agent/src/bus/driver.rs
  • Code Duplication · Near-duplicate member pair (28 shared lines) xtask/src/cassette/prune.rs
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) crates/rig-core/src/providers/openai/options.rs
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) crates/rig-core/src/providers/anthropic/options.rs
  • Code Duplication · Duplicated block (15 lines × 2) xtask/src/cassette/prune.rs
  • Code Duplication · Duplicated block (13–14 lines × 4) crates/rig-core/src/providers/gemini/interactions_api/mod.rs
  • Code Duplication · Duplicated block (14 lines × 2) crates/rig-core/src/providers/openai/options.rs
  • Code Duplication · Duplicated block (13–14 lines × 2) crates/rig-core/src/serve/adapters.rs
  • Code Duplication · Duplicated block (12 lines × 2) crates/rig-core/src/providers/openai/options.rs
  • Code Duplication · Duplicated block (12 lines × 2) xtask/src/cassette/prune.rs
  • Code Duplication · Duplicated block (11 lines × 2) xtask/src/cassette/prune.rs
  • Code Duplication · Duplicated block (10 lines × 3) xtask/src/cassette/prune/names.rs
  • Code Duplication · Duplicated block (9 lines × 2) crates/rig-core/src/providers/anthropic/options.rs
  • Code Duplication · Duplicated block (9 lines × 2) xtask/src/cassette/prune/edit.rs
  • Code Duplication · Duplicated block (8 lines × 2) crates/rig-core/src/providers/cohere/chat.rs
  • Code Duplication · Duplicated block (4–8 lines × 3) crates/rig-core/src/providers/openai/options.rs
  • Code Duplication · Duplicated block (7 lines × 2) xtask/src/cassette/bank.rs
  • Code Duplication · Duplicated block (5 lines × 4) crates/rig-core/src/providers/openai/options.rs
  • Code Duplication · Duplicated block (5 lines × 4) crates/rig-core/src/providers/openai/options.rs
  • Code Duplication · Duplicated block (5 lines × 2) crates/rig-agent/src/bus/driver.rs
  • Code Duplication · Duplicated block (5 lines × 2) crates/rig-core/src/completion/message.rs
  • Code Duplication · Duplicated block (5 lines × 2) crates/rig-core/src/providers/gemini/interactions_api/streaming.rs
  • Code Duplication · Duplicated block (5 lines × 2) xtask/src/cassette/prune.rs
  • Code Duplication · Duplicated block (5 lines × 2) crates/rig-core/src/providers/anthropic/streaming/document.rs
  • Code Duplication · Duplicated block (9 lines × 4) crates/rig-core/src/transcript.rs
  • Code Duplication · Duplicated block (7 lines × 2) xtask/src/cassette/prune.rs
  • Code Duplication · Duplicated block (8 lines × 3) xtask/src/cassette/prune/edit.rs
  • Code Duplication · Duplicated block (14 lines × 2) crates/rig-core/src/providers/openai/options.rs
  • Code Duplication · Duplicated block (12 lines × 2) crates/rig-cassette/src/http/mod.rs
  • Code Duplication · Duplicated block (11 lines × 2) crates/rig-cassette/src/http/mod.rs
  • Code Duplication · Duplicated block (7 lines × 4) crates/rig-core/src/providers/openai/options.rs
  • Code Duplication · Duplicated block (6 lines × 5) crates/rig-core/src/providers/openai/options.rs
  • Code Duplication · Duplicated block (5 lines × 2) crates/rig-core/src/providers/openai/options.rs
  • Code Duplication · Duplicated block (5 lines × 2) crates/rig-core/src/providers/openai/options.rs
  • Code Duplication · Duplicated block (17 lines × 2) crates/rig-http/src/test_utils.rs
  • Code Duplication · Duplicated block (9 lines × 2) crates/rig-core/src/test_utils/streaming_conformance.rs
  • Code Duplication · Duplicated block (7 lines × 2) crates/rig-core/src/test_utils/history.rs
  • Code Duplication · Duplicated block (9 lines × 2) test-support/rig-test-support/src/history_survival/adversarial.rs
  • Code Duplication · Duplicated block (8 lines × 2) test-support/rig-test-support/src/history_survival/adversarial.rs
  • Churn × Complexity Hotspots · Hotspot: crates/rig-agent/src/bus/driver.rs crates/rig-agent/src/bus/driver.rs
  • Churn × Complexity Hotspots · Hotspot: xtask/src/cassette/audit.rs xtask/src/cassette/audit.rs
  • Churn × Complexity Hotspots · Hotspot: crates/rig-agent/src/bus/dispatcher.rs crates/rig-agent/src/bus/dispatcher.rs
  • Churn × Complexity Hotspots · Hotspot: crates/rig-derive/src/tool/args.rs crates/rig-derive/src/tool/args.rs
  • Static Analysis (SAST) · High: REDACTED .github/workflows/cache-warm.yaml
  • Static Analysis (SAST) · High: REDACTED .github/workflows/cache-warm.yaml
  • Static Analysis (SAST) · High: REDACTED REDACTED
  • Static Analysis (SAST) · High: REDACTED REDACTED
  • Static Analysis (SAST) · High: REDACTED REDACTED
  • Static Analysis (SAST) · High: REDACTED REDACTED
  • Static Analysis (SAST) · High: REDACTED REDACTED
  • Static Analysis (SAST) · High: REDACTED REDACTED
  • Static Analysis (SAST) · High: REDACTED REDACTED
Rebuild cost: about €790,000 · Estimate
Cost to rebuild€260,000 to €1,300,000, for 4,383 to 13,905 hours of work, about 5.4 person-years for 3 to 11 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.9 at a score of 66. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeVery large: 500,305 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

How the estimate is made: Watchdog prices the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.

Top priorities

The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.

1
Resolve the 1 Banned license finding(s) in License Compliance.
Raises the score by about 4 points · Low effort · License Compliance
2
Resolve the 1 No ADRs found finding(s) in ADR Quality.
Raises the score by about 4 points · Low effort · ADR Quality
3
Resolve the 52 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (51), REDACTED.
Raises the score by about 7 points · Medium effort · REDACTED Scanning

Diagnosis: what the measurements show together

Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.

Where the investment is most exposed · Value at risk
This code would cost about €790,000 to build again, about 5.4 person-years of work. Its weakest lens is Production Readiness, at 58 (Adequate). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 1 Banned license finding(s) in License Compliance. Of all the actions in this report, it raises the score most for the work it takes: about 4 points for low effort, because it clears the 1 License Compliance findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort

Architecture — module dependency graph

Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.

arch corpus-base corpus-base corpus-shared corpus-shared corpus-base->corpus-shared rig-basics rig-basics corpus-base->rig-basics rig-cassette rig-cassette corpus-base->rig-cassette rig-core rig-core corpus-base->rig-core rig-ecs rig-ecs corpus-base->rig-ecs rig-harness rig-harness corpus-base->rig-harness rig-http rig-http corpus-base->rig-http rig-memory rig-memory corpus-base->rig-memory rig-reqwest rig-reqwest corpus-base->rig-reqwest rig-tools rig-tools corpus-base->rig-tools rig-tui rig-tui corpus-base->rig-tui corpus-fh corpus-fh corpus-fh->corpus-shared corpus-fh->rig-basics corpus-fh->rig-core corpus-fh->rig-harness corpus-fh->rig-memory corpus-fh->rig-tools corpus-fh->rig-tui corpus-ho corpus-ho corpus-ho->corpus-shared corpus-ho->rig-basics corpus-ho->rig-core corpus-ho->rig-harness corpus-ho->rig-memory corpus-ho->rig-tools corpus-ho->rig-tui corpus-library corpus-library corpus-library->rig-core corpus-library->rig-memory corpus-library->rig-tools corpus-oc corpus-oc corpus-oc->corpus-shared corpus-oc->rig-basics corpus-oc->rig-cassette corpus-oc->rig-core corpus-oc->rig-harness corpus-oc->rig-reqwest corpus-oc->rig-tui corpus-rf-06 corpus-rf-06 rig-agent rig-agent corpus-rf-06->rig-agent corpus-rf-06->rig-core corpus-rf-06->rig-memory corpus-shared->rig-basics corpus-shared->rig-core corpus-shared->rig-harness corpus-shared->rig-tools corpus-shared->rig-tui corpus-sn corpus-sn corpus-sn->rig-basics corpus-sn->rig-cassette corpus-sn->rig-core corpus-sn->rig-harness corpus-sn->rig-memory corpus-sn->rig-tools corpus-sn->rig-tui rig rig rig->rig-agent rig->rig-cassette rig->rig-core rig->rig-memory rig->rig-reqwest rig-agent->rig-core rig-agent->rig-memory rig-basics->rig-cassette rig-basics->rig-core rig-basics->rig-ecs rig-basics->rig-harness rig-basics->rig-memory rig-basics->rig-reqwest rig-basics->rig-tools rig-basics->rig-tui rig-cassette->rig-agent rig-cassette->rig-core rig-cassette->rig-memory rig-cassette->rig-reqwest rig-core->rig-http rig-core->rig-reqwest rig-ecs->rig-core rig-ecs->rig-memory rig-harness->rig-core rig-harness->rig-ecs rig-harness->rig-http rig-harness->rig-memory rig-harness->rig-tools rig-memory->rig-core rig-reqwest->rig-http rig-tools->rig-core rig-tui->rig-core rig-tui->rig-ecs rig-tui->rig-harness rig-tui->rig-tools __more__ +36 more projects

Architecture: which parts of the code depend on which

The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.

849 modules, with 3549 dependencies between them. 5 loops run through 295 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 809 more are left out to keep it readable.

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 corpus_base.http_api.server2 corpus_ct.process_reaper.procfs3 rig_core.tool.context4 rig_harness_protocol5 rig_typesafeai.questions6 corpus_base.keybindings7 rig_core.completion.provider_options8 rig_core.effect.family9 rig_core.error10 rig_core.tool.facts11 rig_core.effect12 rig_agent.agent.hook13 rig_ecs.agent14 corpus_base.otel_tracing15 rig_agent.agent.completion16 rig_harness.ask17 corpus_rf_0618 rig_core.completion.message19 rig_core.conversation20 corpus_library.transcript_import_library21 corpus_base.think_tag_splitter22 rig_core.completion.request23 rig_core.serve.handler24 corpus_base.export25 rig_core.catalog.spec26 rig_http.http_client.erased27 corpus_base.local_models28 rig_cassette.traffic29 corpus_library.session_edit_library30 rig_core.wire31 rig_ecs.turn32 rig_core.driver33 rig_tools.process34 corpus_ct.status_command35 rig_harness.services36 corpus_base.custom_provider37 corpus_oc.opaque_reasoning38 rig_harness.host.session39 rig_core.providers.anthropic.wire40 rig_core.providers.openai.wire
1 corpus_base.http_api.server
2 corpus_ct.process_reaper.procfs
3 rig_core.tool.context
4 rig_harness_protocol
5 rig_typesafeai.questions
6 corpus_base.keybindings1
7 rig_core.completion.provider_options31
8 rig_core.effect.family5
9 rig_core.error24
10 rig_core.tool.facts4
11 rig_core.effect11111
12 rig_agent.agent.hook121102233
13 rig_ecs.agent122
14 corpus_base.otel_tracing11111
15 rig_agent.agent.completion42123
16 rig_harness.ask21
17 corpus_rf_0611211
18 rig_core.completion.message1111
19 rig_core.conversation115
20 corpus_library.transcript_import_library11
21 corpus_base.think_tag_splitter21212
22 rig_core.completion.request31423
23 rig_core.serve.handler22141
24 corpus_base.export1131
25 rig_core.catalog.spec131
26 rig_http.http_client.erased12
27 corpus_base.local_models1231
28 rig_cassette.traffic331
29 corpus_library.session_edit_library311
30 rig_core.wire21131423
31 rig_ecs.turn12118241311
32 rig_core.driver13132213
33 rig_tools.process22
34 corpus_ct.status_command11
35 rig_harness.services111
36 corpus_base.custom_provider3112
37 corpus_oc.opaque_reasoning111112
38 rig_harness.host.session5112
39 rig_core.providers.anthropic.wire1111211
40 rig_core.providers.openai.wire1114
Uses a module listed above itPart of a loopThe module itself
1 corpus_base.http_api.server2 corpus_ct.process_reaper.procfs3 rig_core.tool.context4 rig_harness_protocol5 rig_typesafeai.questions6 corpus_base.keybindings7 rig_core.completion.provider_options8 rig_core.effect.family9 rig_core.error10 rig_core.tool.facts11 rig_core.effect12 rig_agent.agent.hook13 rig_ecs.agent14 corpus_base.otel_tracing15 rig_agent.agent.completion16 rig_harness.ask17 corpus_rf_0618 rig_core.completion.message19 rig_core.conversation20 corpus_library.transcript_import_library21 corpus_base.think_tag_splitter22 rig_core.completion.request23 rig_core.serve.handler24 corpus_base.export25 rig_core.catalog.spec26 rig_http.http_client.erased27 corpus_base.local_models28 rig_cassette.traffic29 corpus_library.session_edit_library30 rig_core.wire31 rig_ecs.turn32 rig_core.driver33 rig_tools.process34 corpus_ct.status_command35 rig_harness.services36 corpus_base.custom_provider37 corpus_oc.opaque_reasoning38 rig_harness.host.session39 rig_core.providers.anthropic.wire40 rig_core.providers.openai.wirecorpus_base.http_api.server1corpus_ct.process_reaper.procfs2rig_core.tool.context3rig_harness_protocol4rig_typesafeai.questions5corpus_base.keybindings6rig_core.completion.provider_options7rig_core.effect.family8rig_core.error9rig_core.tool.facts10rig_core.effect11rig_agent.agent.hook12rig_ecs.agent13corpus_base.otel_tracing14rig_agent.agent.completion15rig_harness.ask16corpus_rf_0617rig_core.completion.message18rig_core.conversation19corpus_library.transcript_import_library20corpus_base.think_tag_splitter21rig_core.completion.request22rig_core.serve.handler23corpus_base.export24rig_core.catalog.spec25rig_http.http_client.erased26corpus_base.local_models27rig_cassette.traffic28corpus_library.session_edit_library29rig_core.wire30rig_ecs.turn31rig_core.driver32rig_tools.process33corpus_ct.status_command34rig_harness.services35corpus_base.custom_provider36corpus_oc.opaque_reasoning37rig_harness.host.session38rig_core.providers.anthropic.wire39rig_core.providers.openai.wire4013152441111112110223312211111421232111211111111511212123142322141113113112123133131121131423121182413111313221322111113112111112511211112111114+809 more modules (most-connected shown)

At a glance — Code Health · 76% · Strong ·

At a glance — Architecture · 96% · Exemplary ·

At a glance — Maturity · 65% · Adequate · gated by M2 ·

At a glance — Readiness · 58% · Adequate · gated by D13, P7 ·

At a glance — Security · 71% · Adequate · gated by D29, D30 ·

At a glance — Domain Modelling · 91% · Exemplary ·

At a glance — Event Sourcing · 100% · Exemplary ·

At a glance — Performance · 97% · Exemplary ·

Security & Compliance — OWASP Top-10 mapping

Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).

OWASP categoryFindingsSeverity
A07:2025 — Authentication Failures54High / Critical
A03:2025 — Software Supply Chain Failures46High / Critical
A05:2025 — Injection26High / Critical

Roadmap

Immediately resolve the 52 leaked secrets, prioritizing REDACTED and REDACTED, and address the single banned license violation to ensure compliance. Strengthen system stability by enforcing request timeouts on all HTTP clients and implementing retry logic with back-off for transient failures. Finally, establish architectural governance by documenting significant design decisions in a dedicated ADR folder to capture context and consequences for future reference.

Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.

Do thisHelpsEffortDimension
Resolve the 1 Banned license finding(s) in License Compliance.+3.8 ptsLowLicense Compliance
Resolve the 1 No ADRs found finding(s) in ADR Quality.+3.7 ptsLowADR Quality
Resolve the 52 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (51), REDACTED.+6.6 ptsMediumREDACTED Scanning
Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.+3.9 ptsMediumOutbound HTTP resilience
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.+3.2 ptsMediumArchitecture documentation
Resolve the 1 Off-boarding risk finding(s) in Bus Factor.+1.4 ptsLowBus Factor
Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.+2.7 ptsMediumDeployment & Rollback
Add a build/run (quick start) section to the root README — the first thing a newcomer needs.+1.8 ptsMediumDocumentation (README)

File quality

Per-file score 0–10 — a quality signature. Of 315 files carrying findings, judged against the Preview bar: 1% slop · 3% mixed · 96% near-clean.

FileScoreBandWorst signal
REDACTED2.3SlopREDACTED Scanning: Leaked secret: REDACTED
REDACTED2.3SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED2.9SlopREDACTED Scanning: Leaked secret: REDACTED
REDACTED4.4MixedREDACTED Scanning: Leaked secret: REDACTED
REDACTED4.4MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.6MixedREDACTED Scanning: Leaked secret: REDACTED
REDACTED4.6MixedREDACTED Scanning: Leaked secret: REDACTED
REDACTED4.6MixedREDACTED Scanning: Leaked secret: REDACTED
REDACTED4.8MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.8MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedREDACTED Scanning: Leaked secret: REDACTED
REDACTED5.7MixedStatic Analysis (SAST): High: REDACTED
crates/rig-core/src/completion/request.rs5.9MixedGod Classes: FileTooLong: completion/request.rs
crates/rig-bedrock/src/streaming.rs6.3MixedCyclomatic Complexity: StreamState::delta (cyclomatic 18)
plugins/rig-claude-cloak/src/transport.rs7.0Near-cleanCyclomatic Complexity: rig_claude_cloak::transport::body (cyclomatic 44)
plugins/rig-claude-cloak/src/schema.rs7.0Near-cleanCyclomatic Complexity: rig_claude_cloak::schema::upgrade (cyclomatic 39)
crates/rig-cassette/src/scrub.rs7.0Near-cleanCyclomatic Complexity: rig_cassette::scrub::capture_format (cyclomatic 36)
crates/rig-core/src/completion/history.rs7.0Near-cleanCyclomatic Complexity: rig_core::completion::history::user (cyclomatic 32)
crates/rig-core/src/providers/openai/options.rs7.0Near-cleanCyclomatic Complexity: rig_core::providers::openai::options::chat_options (cyclomatic 22)
crates/rig-ecs/src/turn.rs7.0Near-cleanCyclomatic Complexity: rig_ecs::turn::commit_turn_calls (cyclomatic 17)

How the grades work

Every finding carries one of four grades. Three say how serious it is. The fourth says this survey could not settle it — and it is a grade, not a gap.

Critical — 81

A definite problem that already costs you something and drags the score down: a missing authorisation check, a dependency with a known exploit, a build that does not reproduce. Failure here tends to cause failures elsewhere.

Serious — 837

Likely wrong, but not failing yet. It degrades the codebase over a longer horizon and can cause failures elsewhere — not urgent this week, not something to carry for two years either.

Minor — 130

Recorded, with no effect on how the codebase functions. Present so the survey is complete, not because it needs doing.

Could not be resolved — 13

Something this survey could not settle from the outside, and which could be critical or serious. Either a control was required and no positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean result. These are excluded from the score rather than awarded a pass, so the number on the cover neither rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each one is named under Limitations.

Methodology & how to trust this report

Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 70 of 70 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); none rely on LLM judgement. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.

Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.

What we checked — 70 dimensions across the health lenses
D1D2D3D4D5D6D9D10D12D13D14D15D16D17D19D20D26D28D29D30D31D34D35D43D44AX10AX3AX4AX8AX9C2DM4DM5DM6ES1ES2M1M2M3M4P1P10P2P3P4P6P7P8PF1PF3S1X1X12X13X14X15X17X19X21X22X23X24X25X26X27X28X29X3X30X4

Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.

How to trust any code-health report — three questions
  1. Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 982 of 1048 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
  2. Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

This report answers yes to all three. That's the bar to hold any assessment to.

Tools & methods

The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
Watchdog duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivy · checkovSecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3 · 3.2.533✓ deterministic
LLM (sampled · advisory)Documentation quality, ADR conformance, naming — sampled over a bounded sample; advisory, never a deterministic measurement—◐ LLM · sampled · advisory

Every finding is locatable in findings.md. Run 01a17c8f-f944-7b74-8a42-9661158d972a.

The exact command behind every deep-scan dimension — tool, version, invocation and retained raw output — is in Appendix B — Reproduction & audit trail.

Run transparency — what happened this run

What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.

  • D8 Code Coverage — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: test source is present (.rs, .py, .mjs) but the built-in coverage collector has no runner for this repository's ecosystem — so this suite was never executed by it. Not scored — this is a gap in the analyzer's language coverage, not a defect in the repo. To have real coverage read, produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`, or `coverage run -m pytest` then `coverage xml`, or lcov — `vitest --coverage`, `jest --coverage`, `bun test --coverage --coverage-reporter=lcov`, or `nyc`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures. You can widen what we reach: optional: produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`, or `coverage run -m pytest` then `coverage xml`, or lcov — `vitest --coverage`, `jest --coverage`, `bun test --coverage --coverage-reporter=lcov`, or `nyc`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures — then the real number is read on the next scan.
  • D10 Test Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 2 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 1,020 test source file(s) (.rs, .py) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
  • D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.rs, .py, .mjs) and this repository declares a Cargo test suite (repository root, 1247 test files), but it was not re-run: no test result was produced. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
  • D19 Documentation Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
  • D21 Naming Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
  • D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
  • D24 Comment Value — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
  • D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • AXR1 Runtime accessibility — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via Dockerfile (examples/otel/Dockerfile). docker build failed (exit 1) — 3 | 4 | # Copy your local config into the container -------------------- ERROR: failed to solve: otel/opentelemetry-collector-contrib:0.135.0: failed to resolve source metadata for docker.io/otel/opentelemetry-collector-contrib:0.135.0: failed to do request: Head "https://registry-1.docker.io/v2/otel/opentelemetry-collector-contrib/manifests/0.135.0": Forbidden; runtime evidence skipped.
  • GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and no C#, F#, JavaScript/TypeScript, Dart, Ruby or Scala was found, and this repository's Python, Rust is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and no C#, JavaScript/TypeScript, Java, Dart, Ruby or Scala was found, and this repository's Python, Rust is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • M4 Documentation accuracy — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9). Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • X16 Unfloored truncation loop — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X18 Disposal-pattern correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala or PHP was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X5 Nullable reference types — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax and MSBuild project configuration, TypeScript source and its tsconfig files, Java source and its package and module declarations, PHP source and its PHPStan and Psalm configuration, Dart source and its pubspec language version, Ruby source and its Sorbet and Steep configuration, Scala source and its build's explicit-nulls, WartRemover and Scalafix settings, and Kotlin source only, and no C# was loaded, no TypeScript was found, and this repository's Python, Rust is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.

Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.

Limitations & what we did not check

Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.

Per-dimension blind spots

For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
  • DM4 Rich vs anemic domain model: Behaviour is detected as state mutation inside a method body — a method that enforces an invariant by validating-and-throwing without mutating reads as a query, and mutation delegated through an interface the scan can't resolve isn't credited; entities with zero public properties still drop out of the population. It detects that state changes, not whether the rule is correct.
  • DM6 Domain ↔ infrastructure boundary: Infrastructure reached through a hand-rolled wrapper, a domain-named facade, reflection, or a string-keyed service locator resolves to a non-infra type and isn't seen; the body scan is symbol resolution over syntax, not full dataflow. A clean result means "no resolved infra reference in a domain body", not a proof of purity.
  • M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

Dimensions

D1 · Cyclomatic Complexity6.8 / 10Adequate✓ Tool-verified

What it measures: How tangled the control flow is — methods with many branches are hard to test and change.

Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.

Maturity: Documented → Verified → Prevented · effective 6.8 / 10 · rule-coverage 100% · ceiling Prevented

119 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was rig_tui::input::act at 48. A further 12 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being rig_lancedb::utils::deserializer::type_matcher at 58 — they are counted neither in the figure above nor in this dimension's score. 8 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold functions was excluded, so the exclusion is disclosed nowhere in the file itself: crates/rig-lancedb/src/utils/deserializer.rs (rig_lancedb::utils::deserializer::type_matcher at 58), corpus/sn/src/terminal_sessions/keys.rs (corpus_sn::terminal_sessions::keys::named at 32), crates/rig-core/src/catalog/row.rs (Row::without at 32), corpus/sp/src/theme_files.rs (ThemeRole::key at 22), plugins/rig-tui/src/pick.rs (rig_tui::pick::choice_key at 21), and 3 more not listed here. They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.

rig_core::providers::openai::responses_api::input (cyclomatic 41) · ×15crates/rig-core/src/providers/openai/responses_api/mod.rs:142
corpus_sn::vim_input::editor::parse (cyclomatic 29) · ×7corpus/sn/src/vim_input/editor.rs:409
rig_claude_cloak::transport::body (cyclomatic 44) · ×6plugins/rig-claude-cloak/src/transport.rs:625
xtask::verify::selection::plan (cyclomatic 43) · ×6xtask/src/verify/selection.rs:248
corpus_fh::editor_front::receive (cyclomatic 32) · ×6corpus/fh/src/editor_front.rs:545

+ 48 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Bring the 13 bodies over 30 down to 30 or less in Cyclomatic Complexity — start with rig_tui::input::act (cyclomatic 48), rig_claude_cloak::transport::body (cyclomatic 44), StreamingTurnSource::run_model_turn (cyclomatic 43). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 13 together lifts Cyclomatic Complexity from 6.8 to about 7.3/10, projected with the scoring formula itself and assuming each lands exactly at 30; a cleaner split scores higher.
  2. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.

D2 · Cognitive Complexity5.8 / 10Adequate✓ Tool-verified

What it measures: How hard the code is for a person to follow, beyond raw branching.

Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.

Maturity: Documented → Verified → Prevented · effective 5.8 / 10 · rule-coverage 100% · ceiling Prevented

302 method(s) exceeded the cognitive complexity threshold of 15; the worst was StreamingTurnSource::run_model_turn at 116.

rig_core::providers::openai::responses_api::input (cognitive 92) · ×27crates/rig-core/src/providers/openai/responses_api/mod.rs:142
corpus_sn::crash_resume::recover (cognitive 35) · ×18corpus/sn/src/crash_resume.rs:220
corpus_oc::transcript_in_editor::rebuild (cognitive 48) · ×17corpus/oc/src/transcript_in_editor.rs:499
corpus_fh::editor_front::receive (cognitive 72) · ×16corpus/fh/src/editor_front.rs:545
xtask::verify::selection::plan (cognitive 70) · ×16xtask/src/verify/selection.rs:248

+ 80 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Bring the 8 bodies over 60 down to 60 or less in Cognitive Complexity — start with StreamingTurnSource::run_model_turn (cognitive 116), rig_claude_cloak::schema::upgrade (cognitive 102), rig_core::providers::openai::responses_api::input (cognitive 92). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 8 together lifts Cognitive Complexity from 5.9 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
  2. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.

D3 · God Classes9.1 / 10Stronggated by 121 serious findings✓ Tool-verified

What it measures: Over-large classes that try to do too much ("god classes").

Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.

Maturity: Documented → Verified → Prevented · effective 9.1 / 10 · rule-coverage 100% · ceiling Prevented

121 god class(es) detected.

FileTooLong: http/mod.rs · ×72crates/rig-cassette/src/http/mod.rs
FunctionTooLong: xtask::verify::checks::all · ×26xtask/src/verify/checks.rs:76
TooManyMethods: AgentRun · ×9crates/rig-agent/src/run/mod.rs:304
ClassTooLong: Scrubber · ×7crates/rig-cassette/src/scrub.rs:181
MethodTooLong: StreamingTurnSource.run_model_turn · ×6crates/rig-agent/src/agent/engine.rs:703

+ 1 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 72 FileTooLong finding(s) in God Classes — start with mod.rs (5), lib.rs (3), completion.rs (3). — One of this dimension's main actionable groups (72 warning-level).
  2. Resolve the 26 FunctionTooLong finding(s) in God Classes — start with transport.rs (2), mod.rs (2), parse.rs (2). — One of this dimension's main actionable groups (26 warning-level).
  3. Resolve the 9 TooManyMethods finding(s) in God Classes — start with mod.rs (2), runner.rs, scrub.rs. — One of this dimension's main actionable groups (9 warning-level).
  4. Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.

D4 · Code Duplication9.9 / 10Stronggated by 151 serious findings✓ Tool-verified

What it measures: Copy-pasted code that should be shared instead.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.

Maturity: Documented → Verified → Prevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Verified

148 duplicated block group(s) detected. A further 3 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 14 of the 151 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.

Duplicated block (5 lines × 2) · ×28corpus/base/src/format_on_write.rs:287
Duplicated block (6 lines × 2) · ×24corpus/ho/src/spend_by_origin.rs:250
Duplicated block (7 lines × 2) · ×18corpus/base/src/share/render.rs:124
Duplicated block (8 lines × 2) · ×17corpus/base/src/auto_commit.rs:239
Duplicated block (9 lines × 2) · ×11corpus/base/src/output_truncate.rs:243

+ 27 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 28 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with skills.rs (3), scrub.rs (2), format_on_write.rs. — One of this dimension's main actionable groups (28 warning-level).
  2. Resolve the 24 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with server.rs (2), spend_by_origin.rs, dataset.rs. — One of this dimension's main actionable groups (24 warning-level).
  3. Resolve the 18 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with streaming.rs (2), options.rs (2), render.rs. — One of this dimension's main actionable groups (18 warning-level).
  4. Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.

D5 · Coupling8.9 / 10Strong✓ Tool-verified

What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.

Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.

Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.

Maturity: Documented → Verified → Prevented · effective 8.9 / 10 · rule-coverage 100% · ceiling Prevented

56 production modules (Cargo), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 8 module(s) off the main sequence, with abstractness counted on 55 of the 56 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).

Off the main sequence: rig-harness-protocol · ×8

What to do

  1. Resolve the 8 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (8 warning-level).
  2. Enforce Coupling in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.

D6 · Cohesion (LCOM4)9.9 / 10Stronggated by 8 serious findings✓ Tool-verified

What it measures: Whether a class's methods are focused on a single responsibility.

Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.

Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.

Maturity: Documented → Verified → Prevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Verified

8 of 774 classes have LCOM4 above 3.

Low cohesion: ModelSpec (LCOM4 8) · ×8crates/rig-core/src/catalog/spec.rs:44

What to do

  1. Resolve the 8 Low cohesion finding(s) in Cohesion (LCOM4) — start with wire.rs (3), spec.rs, request.rs. — One of this dimension's main actionable groups (8 warning-level).
  2. Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.

D9 · Test Distribution9.8 / 10Exemplary✓ Tool-verified

What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.

Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.

Maturity: Documented → Verified → Prevented · effective 9.8 / 10 · rule-coverage 100% · ceiling Documented

5840 test methods: 4191 unit, 1560 integration, 89 BDD, 0 e2e. The JavaScript/TypeScript suite contributes 2 `it`/`test` case(s) across 1 test file(s) declaring at least one; its tier split is read from package names and paths only. The Rust suite contributes 5744 `#[test]` function(s) across 1247 file(s) declaring at least one; its unit/integration split is Cargo's own — 600 of those file(s) are integration-test targets under a crate's tests/ directory, and the rest are #[test] functions compiled into the crate they test. The Python suite contributes 94 test function(s) across 5 file(s) declaring at least one — every `def test…` in a file pytest or unittest would collect, which is those frameworks' own definition of a case; a parametrize table counts once, so this is a floor. Its tier split is read from file names and paths only.

✓ On the Gold path — maintain.

Detailed fixes: d9_recommendation.md.

D10 · Test Quality10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the tests truly assert behaviour rather than just running the code.

Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

0 skipped, 0 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 2 tests. Measured on the JavaScript/TypeScript suite only — at least 1,020 test source file(s) (.rs, .py) went unread, so its test quality is unmeasured and is not in these counts.

✓ On the Gold path — maintain.

Detailed fixes: d10_recommendation.md.

D12 · Dependency Hygiene8.0 / 10Strong✓ Tool-verified

What it measures: Whether dependencies are current, secure, and not bloated.

Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (saturating for vulnerabilities, capped-linear for deprecation/outdated) per KLoC. Exhaustive, deterministic.

Maturity: Documented → Verified → Prevented · effective 8.0 / 10 · rule-coverage 100% · ceiling Verified

47 outdated, 0 yanked direct Cargo dependencies. Only DIRECT edges are graded: a transitive crate cannot be moved past what its parent's requirement admits, so reporting one would be advice its owner cannot take. A newer release is reported only where this repository's OWN requirement already admits it, so the remedy is `cargo update` and never a manifest edit — which means a release outside the declared range is deliberately NOT charged, because a written-down constraint is a decision rather than a defect. Note that a bare requirement is a CARET, and for a 0.x crate its ceiling is the minor. Whether any crate is UNMAINTAINED is not graded — crates.io publishes no maintenance status, and release age does not stand in for one. Known CVEs in this dependency graph are D30's question, read from REDACTED there.

Outdated: aws-config · ×47

What to do

  1. Enforce Dependency Hygiene in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.

D13 · REDACTED Scanning0.0 / 10Critical✓ Tool-verified

What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.

Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Prevented

20 secret(s) detected.

REDACTED

What to do

  1. Resolve the 52 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (51), REDACTED. — One of this dimension's main actionable groups (52 issue-level).
  2. Enforce REDACTED Scanning in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.md.

D14 · License Compliance8.0 / 10Adequategated by 1 critical finding✓ Tool-verified

What it measures: Whether the licenses of third-party packages are compatible with your policy.

Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.

Maturity: Documented → Verified → Prevented · effective 8.0 / 10 · rule-coverage 100% · ceiling Verified

1 of 1499 shipped crate(s) use a banned license. Licences were resolved from crates.io over the crates a consumer compiles — this repository's REDACTED closed over its manifests' `[dependencies]` and `[build-dependencies]`. Crates it asks for ONLY under `[dev-dependencies]` are excluded: they are not compiled by anything that depends on this repository. This repository publishes itself under MIT, which is its own choice and is not judged here.

Banned license: epub

What to do

  1. Resolve the 1 Banned license finding(s) in License Compliance. — One of this dimension's main actionable groups (1 issue-level).
  2. Enforce License Compliance in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

Detailed fixes: d14_recommendation.md · top locations in Appendix A, every location in findings.md.

D15 · Churn × Complexity Hotspots9.9 / 10Stronggated by 61 serious findings✓ Tool-verified

What it measures: Files that change often and are also complex — the riskiest hotspots.

Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.

Maturity: Documented → Verified → Prevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: crates/rig-core/src/providers/openai/responses_api/mod.rs (61×41=2501); crates/rig-core/src/providers/anthropic/completion.rs (56×32=1792); crates/rig-agent/src/agent/engine.rs (39×43=1677) Repeated repair below the complexity floor: crates/rig-tools/src/read.rs (7 of 10 changes were fixes); crates/rig-tools/src/remote.rs (6 of 8 changes were fixes); crates/rig-tools/src/workspace.rs (6 of 8 changes were fixes)

Hotspot: crates/rig-core/src/providers/openai/responses_api/mod.rs · ×53crates/rig-core/src/providers/openai/responses_api/mod.rs:142
Repeated repair: crates/rig-tools/src/read.rs · ×8crates/rig-tools/src/read.rs:360

What to do

  1. Resolve the 53 Hotspot finding(s) in Churn × Complexity Hotspots — start with streaming.rs (5), mod.rs (3), completion.rs (2). — One of this dimension's main actionable groups (53 warning-level).
  2. Resolve the 8 Repeated repair finding(s) in Churn × Complexity Hotspots — start with read.rs, remote.rs, workspace.rs. — One of this dimension's main actionable groups (8 warning-level).

Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.

D16 · Bus Factor8.3 / 10Strong✓ Tool-verified

What it measures: Whether knowledge is concentrated in too few people (the "bus factor").

Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.

Maturity: Documented → Verified → Prevented · effective 8.3 / 10 · rule-coverage 100% · ceiling Documented

227 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is crates/rig-agent/src/agent/engine/tests.rs. Counted over 1313 of the 1530 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Off-boarding risk: anonymized user #1

What to do

  1. Resolve the 1 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.

D17 · Explicit Debt10.0 / 10Exemplary○ Nothing flagged

What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.

Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

0 deducted task-comment markers across 500305 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.

✓ On the Gold path — maintain.

Detailed fixes: d17_recommendation.md.

D19 · Documentation Quality10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether the project's documentation is clear, complete, and useful.

Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

1 of 1 documentation facets pass in full. 42 document(s) read across 1 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D20 · ADR Quality0.0 / 10Critical✓ Tool-verified

What it measures: Whether architecture decisions are recorded well (context, decision, consequences).

Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

No architecture decision records were found.

No ADRs found

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.

D26 · Project Cohesion6.8 / 10Adequate✓ Tool-verified

What it measures: Whether each project is a focused, coherent unit rather than an oversized grab-bag.

Method: Project size overshoot penalties (LoC / public-type count / namespace count, 2-of-3 flag) weighted by log magnitude. Exhaustive across projects, deterministic, LLM-independent.

Maturity: Documented → Verified → Prevented · effective 6.8 / 10 · rule-coverage 100% · ceiling Documented

9 of 56 build units (Cargo) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion

What to do

  1. Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.

D28 · Secrets (history)9.0 / 10Adequategated by 1 critical finding✓ Tool-verified

What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.

Method: REDACTED scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.

Maturity: Documented → Verified → Prevented · effective 9.0 / 10 · rule-coverage 100% · ceiling Documented

1 finding(s): 0 critical, 1 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.

REDACTED
REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Secrets (history) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.

D29 · Static Analysis (SAST)2.8 / 10Weak✓ Tool-verified

What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.

Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.

Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).

Maturity: Documented → Verified → Prevented · effective 2.8 / 10 · rule-coverage 100% · ceiling Documented

26 finding(s): 0 critical, 25 high, 1 medium, 0 low. 18 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 15 file(s) — `corpus/base/src/effect_query/query.rs` (line 241, line 242), `corpus/base/src/session_replay.rs` (line 869), `corpus/ct/src/history_versions.rs` (line 360, line 361, line 362), `corpus/ct/src/shell_companion/snippet/bash.sh` (line 21), `corpus/ct/src/shell_companion/snippet/zsh.sh` (lines 12–42), … (+10 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 1 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

+ 1 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 1 REDACTED finding(s) charged to Static Analysis (SAST) — the other 18 are reported here at file:line but scored by D36 (supply-chain provenance), which charges them once. — One of this dimension's main actionable groups (19 issue-level, 1 of them charged here).
  2. Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
  3. Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).

Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.

D30 · Dependency Vulnerabilities1.1 / 10Critical✓ Tool-verified

What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.

Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05.

Maturity: Documented → Verified → Prevented · effective 1.1 / 10 · rule-coverage 100% · ceiling Documented

46 finding(s): 0 critical, 1 high, 44 medium, 1 low.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

+ 1 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 14 Medium advisory (unmaintained) finding(s) in Dependency Vulnerabilities — start with REDACTED (14). — One of this dimension's main actionable groups (14 warning-level).
  2. Resolve the 14 Medium vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED (14). — One of this dimension's main actionable groups (14 warning-level).
  3. Resolve the 1 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).

Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.

D31 · IaC & Container Security10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether Dockerfiles / Terraform / Kubernetes config follow security best practices.

Method: IaC/container misconfiguration scan via trivy config (Dockerfile/Terraform/K8s/Helm/CloudFormation); severity rules to 0-10 moderate normalizer. NotApplicable without manifests. Exhaustive, deterministic.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

trivy and checkov found no infrastructure-as-code or container misconfigurations.

✓ On the Gold path — maintain.

Detailed fixes: d31_recommendation.md.

D34 · Knowledge Freshness10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.

Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

1 of 1313 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is crates/rig-vectorize/src/client/types.rs. Counted over 1313 of the 1530 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned files with no living knowledge
Orphaned filecrates/rig-vectorize/src/client/types.rs:1

✓ On the Gold path — maintain.

Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.

D35 · Change Coupling9.9 / 10Stronggated by 8 serious findings✓ Tool-verified

What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.

Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.

Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.

Maturity: Documented → Verified → Prevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: lib.rs↔lib.rs 69%; lib.rs↔lib.rs 69%; lib.rs↔lib.rs 62%

Change coupling: lib.rs ↔ lib.rs · ×7crates/rig-postgres/src/lib.rs:1
Change-coupling hub: lib.rs → lib.rs, lib.rs, lib.rscrates/rig-mongodb/src/lib.rs

What to do

  1. Resolve the 7 Change coupling finding(s) in Change Coupling — start with lib.rs (3), mod.rs (2), streaming.rs (2). — One of this dimension's main actionable groups (7 warning-level).
  2. Resolve the 1 Change-coupling hub finding(s) in Change Coupling — start with lib.rs. — One of this dimension's main actionable groups (1 warning-level).

Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.

D43 · Malicious Dependencies10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Scored apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.

Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. SCORED, not informational.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No dependency in any ecosystem this repository declares is published as malicious.

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

D44 · Platform End-of-Life6.0 / 10Adequate✓ Tool-verified

What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.

Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.

Maturity: Documented → Verified → Prevented · effective 6.0 / 10 · rule-coverage 100% · ceiling Documented

1 end-of-life runtime(s) and 0 end-of-life framework(s), read from 2 platform declaration(s) and 0 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.

End-of-life runtime: Rust 1.97rust-toolchain.toml:1

What to do

  1. Resolve the 1 End-of-life runtime finding(s) in Platform End-of-Life — start with rust-toolchain.toml. — One of this dimension's main actionable groups (1 warning-level).

Detailed fixes: d44_recommendation.md · top locations in Appendix A, every location in findings.md.

Frontend & cross-cutting dimensions

R = React/JS · M = Maturity · P = Readiness.

AX10 · Code composition9.8 / 10Exemplary✓ Tool-verified

Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.

Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.

Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.

What to do

  • The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).

Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.

AX4 · Dependency direction10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.

Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.

AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.

Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.

AX9 · CQS / query purity10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.

Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.

Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.

C2 · Access Controls10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether access is authorized by default — a framework authorization attribute/decorator or policy, or imperative guard methods (throw-on-violation) called from handlers.

Method: Roslyn scan: [Authorize] usage and authorization policies, plus imperative throw-on-violation guard methods detected via syntax. Deterministic.

DM4 · Rich vs anemic domain model8.0 / 10Strong✓ Tool-verified

Other · Domain Modelling — Whether domain entities own their behaviour (invariant-enforcing commands) rather than being data-only structs driven by a foreign service.

Method: Roslyn (DDD-gated): entity method BODIES classified mutator-vs-query — only methods that mutate the entity's own declared state count as invariant-protecting behaviour, so a getter/passthrough doesn't rescue an anemic class. Deterministic, exhaustive over domain-layer entities.

Coverage: Population: entities by name/base convention; rich-vs-anemic judged by classifying each method body mutator-vs-query — logic-bearing domain types outside the convention are invisible.

  • `DeviceCodePrompt` is a data-only domain entity with `pub` mutable state and no invariant-enforcing behaviour of its own, while the repo holds the logic in a foreign service/manager/use-case — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants (or make it an immutable value object with private fields) rather than being driven from outside. — crates/rig-core/src/providers/internal/auth.rs:17

What to do

  • Move the domain logic onto the entity (invariant-enforcing `&mut self` commands) instead of a foreign service.
DM5 · Encapsulated state10.0 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether a domain type's identity-bearing field stays immutable — a `pub` mutable field under a hand-rolled Hash/PartialEq breaks the value-identity invariant.

Method: Roslyn (DDD-gated): entities scanned for publicly writable state — public setters, and (C#/VB) own mutable collections handed out through an auto-property, a public field or a bare-field expression getter, where a computed/copying getter is never charged. One finding per entity; score softened when Marten/EF rehydration frameworks present. Deterministic, framework-aware.

Coverage: Population: entities by convention; encapsulation (setter shape) checked exhaustively within the set.

DM6 · Domain ↔ infrastructure boundary10.0 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether the domain layer stays free of infrastructure dependencies — a domain aggregate fused to a persistence ORM (diesel/sea-orm/sqlx) on its own declaration (active-record) couples the domain to infrastructure. The clean-architecture dependency rule.

Method: Roslyn (DDD-gated): domain-layer types scanned for infrastructure usage in member SIGNATURES and inside method/accessor BODIES — resolved calls and object-creations into EF/Marten/HTTP/Mongo/Redis/message-bus types (not just a namespace allowlist). Deterministic, symbol-resolved, exhaustive over domain-layer bodies, DDD-native.

Coverage: Domain layer identified by NAMESPACE heuristic; infrastructure then resolved by symbol in member SIGNATURES and method/accessor BODIES — rename the layer and the check evaporates.

ES1 · Fold determinism10.0 / 10Exemplary✓ Tool-verified

Other · Event Sourcing — Whether the recovery-replay fold is deterministic — state derived purely from each event's own fields, no clock/random/IO on the replay path.

Method: Roslyn syntax scan (event-sourcing gated): Apply/When folds checked for forbidden tokens (DateTime.Now, Guid.NewGuid, Random, IO), stripped of comments/strings. Deterministic, hard fact per fold.

ES2 · Immutable events10.0 / 10Exemplary✓ Tool-verified

Other · Event Sourcing — Whether domain events stay immutable (private fields, set once) rather than carrying mutable state.

Method: Roslyn scan (event-sourcing gated): persisted events checked for public setters; immutability verified per property/field. Deterministic, hard fact.

M1 · Documentation (README)6.7 / 10Strong✓ Tool-verified

Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.

Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.

What to do

  • Add a build/run (quick start) section to the root README — the first thing a newcomer needs.
  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
  • Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
  • Add a README to the 82 of 125 project(s) that lack one — worth up to 1.3 pts.
M2 · Architecture documentation2.0 / 10Weak✓ Tool-verified

Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.

Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.

  • No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.

What to do

  • Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repo is organised deliberately — src/test separation and consistent project naming.

Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.

M4 · Documentation accuracy10.0 / 10Exemplary○ Nothing flagged

Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).

Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.

P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — Whether an automated pipeline builds and tests every change.

Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.

P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.

Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.

P2 · Observability9.2 / 10Exemplary✓ Tool-verified

Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.

Method: Filesystem/Roslyn scan: structured-logging frameworks (Serilog, NLog), OpenTelemetry, and health-check endpoint patterns. Exhaustive, deterministic.

  • Only 23/32 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `corpus/ct`, `corpus/library`, `corpus/rf-01`, `corpus/rf-06` and 4 more.

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
P3 · Security & performance tooling8.0 / 10Strong✓ Tool-verified

Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).

Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.

What to do

  • Dependabot is configured but does not watch `github-actions` — add that `package-ecosystem` entry to REDACTED so those dependencies get the same automatic update and advisory pressure as the ones it already covers.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback5.0 / 10Adequate✓ Tool-verified

Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.

Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.

  • The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.

What to do

  • Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
P6 · Release Hygiene10.0 / 10Exemplary✓ Tool-verified

Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.

Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.

P7 · Outbound HTTP resilience3.0 / 10Weak✓ Tool-verified

Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.

Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.

  • `AgentBuilder::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×3) — corpus/rf-01/src/main.rs:22, corpus/rf-06/src/lib.rs:284, crates/rig-agent/src/extractor.rs:118
  • `reqwest::Client::builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×6) — crates/rig-cassette/src/http/ledger.rs:520, crates/rig-cassette/src/http/paths.rs:235, crates/rig-cassette/src/http/proxy.rs:249, …
  • `Client::new()` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×2) — crates/rig-helixdb/src/lib.rs:30, crates/rig-vectorize/src/client/mod.rs:75
  • `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — crates/rig-milvus/src/lib.rs:105
  • `urllib.request.urlopen(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — scripts/check-dependency-floors.py:128

What to do

  • Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.
  • Pass `timeout=` on every `requests`/`httpx` call (requests has no default and will wait forever), mount an `HTTPAdapter(max_retries=Retry(...))` on shared sessions, and wrap calls to flaky dependencies in `tenacity` retries or a `pybreaker` circuit breaker.
P8 · Schema migrations10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — Whether database schema changes go through versioned migrations rather than being auto-created from the model at startup.

Method: Roslyn scan: EF Core DbContext for a versioned migrations directory versus bare EnsureCreated usage; off .NET, a file scan of dependency manifests, migration histories (Flyway, Liquibase, Alembic, Django, Rails, Prisma, TypeORM, Knex/Sequelize, golang-migrate, goose, Laravel, Doctrine, Diesel/sqlx) and schema auto-create in production source or config. Exhaustive, deterministic.

PF1 · Benchmark discipline9.5 / 10Exemplary✓ Tool-verified

Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.

Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.

PF3 · Async & latency hygiene10.0 / 10Exemplary✓ Tool-verified

Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.

Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from the language model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.

S1 · Web-Security Posture6.0 / 10Adequate✓ Tool-verified

Other · Security — Read from this repository's Rust source: cryptographic hygiene (weak hash or cipher, key material fixed in the source) and outbound TLS (certificate validation, protocol version) — facts about code that hold whether or not it serves anything itself. This repository serves HTTP itself (`axum::serve(` (crates/rig-cassette/src/http/mod.rs:1250)), so its Rust source was also read for the server controls: TLS served or HSTS set, security response headers, cookie flags and inbound validation — each credited where its Rust spelling appears in production source, not proven on every route. A Rocket 0.5 application is credited the headers Rocket's default `Shield` sends unless it attaches its own, and its cookie jar's SameSite=Strict default; a session middleware its default cookie flags.

Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.

  • This repository starts an HTTP server and nothing in its Rust source or committed `Rocket.toml` secures the transport: no TLS served (actix-web `bind_rustls`/`bind_openssl`, axum-server `bind_rustls` with a `RustlsConfig`, tonic `ServerTlsConfig`, a `TlsAcceptor`, Rocket's `[default.tls]`), no `Strict-Transport-Security` header, no `X-Forwarded-Proto` read from a TLS-terminating proxy — so its traffic may cross the network in clear text. (−2.0 on this card.) The server: `axum::serve(` (crates/rig-cassette/src/http/mod.rs:1250).
  • None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is set on a response this repository's Rust server sends — defense in depth, even when a proxy could set them. (−2.0 on this card.) The server: `axum::serve(` (crates/rig-cassette/src/http/mod.rs:1250).

What to do

  • Secure the server's transport: serve TLS itself (`HttpServer::bind_rustls_0_23(addr, config)` in actix-web, `axum_server::bind_rustls(addr, RustlsConfig::from_pem_file(…))`, tonic's `Server::builder().tls_config(ServerTlsConfig::new().identity(…))`, Rocket's `[default.tls]`), or run it behind a TLS-terminating proxy and check `X-Forwarded-Proto`; send `Strict-Transport-Security` once it is HTTPS-only.
  • Set security response headers on what the server sends — actix-web's `DefaultHeaders::new().add((header::X_CONTENT_TYPE_OPTIONS, "nosniff"))`, tower-http's `SetResponseHeaderLayer::overriding(…)` on an axum router, or keep Rocket's default `Shield` — with `Content-Security-Policy`, `X-Content-Type-Options` and a frame policy on every response.
X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.

Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.

X12 · Unreachable branch10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.

Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.

X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.

Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.

X14 · Bypassable address classification10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.

Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.

X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.

Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.

X17 · Uncapped recursion over a caller-supplied document10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.

Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.

X19 · Unrestored process-global state10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.

Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.

X21 · Side-effecting pattern guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.

Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.

X22 · Contradicted release guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.

Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.

X23 · Unguarded diagnostic materialisation10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.

Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.

X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.

Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.

X25 · Inert configuration knob10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.

Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.

X26 · Unsynchronised callback handoff10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.

Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.

X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a `for` loop leaves the `RefCell` it is walking alone — safe Rust rejects a body that changes the collection its loop borrows at compile time, except through interior mutability: a `RefCell` borrowed in the loop's header stays borrowed until the loop ends, so a `borrow_mut()` of it inside the body panics with `already borrowed: BorrowMutError` and the remaining elements are never seen. Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen.

Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.

X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.

Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.

X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.

Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.

X3 · Exception handling10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.

Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.

X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.

Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.

X4 · Structured logging4.3 / 10Weak✓ Tool-verified

Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.

Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.

  • `debug!` at line 266 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/rig-vertexai/src/completion.rs:266
  • `debug!` at line 174 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/rig-vectorize/src/lib.rs:174
  • `debug!` at line 26 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/rig-vectorize/src/client/mod.rs:26
  • `debug!` at line 113 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/rig-vectorize/src/client/mod.rs:113
  • `warn!` at line 691 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/rig-tools/src/checkpoint.rs:691
  • `warn!` at line 734 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/rig-tools/src/checkpoint.rs:734
  • `info!` at line 578 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/rig-sqlite/src/lib.rs:578
  • `debug!` at line 606 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/rig-sqlite/src/lib.rs:606
  • `debug!` at line 657 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/rig-sqlite/src/lib.rs:657
  • `debug!` at line 1932 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/rig-sqlite/src/lib.rs:1932
  • `debug!` at line 1967 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/rig-sqlite/src/lib.rs:1967
  • `debug!` at line 1979 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/rig-sqlite/src/lib.rs:1979
  • `debug!` at line 1985 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/rig-sqlite/src/lib.rs:1985
  • `debug!` at line 1993 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/rig-sqlite/src/lib.rs:1993
  • `debug!` at line 2010 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/rig-sqlite/src/lib.rs:2010
  • `error!` at line 257 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/rig-rmcp/src/handler.rs:257
  • `warn!` at line 123 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/rig-reqwest/src/lib.rs:123
  • `info!` at line 259 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/rig-neo4j/src/lib.rs:259
  • `warn!` at line 333 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/rig-neo4j/src/lib.rs:333
  • `info!` at line 390 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/rig-neo4j/src/lib.rs:390
  • `warn!` at line 428 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/rig-neo4j/src/lib.rs:428
  • `info!` at line 434 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/rig-neo4j/src/lib.rs:434
  • `debug!` at line 171 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/rig-neo4j/src/vector_index.rs:171
  • `info!` at line 218 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/rig-mongodb/src/lib.rs:218
  • `info!` at line 207 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/rig-core/src/vector_store/in_memory_store.rs:207
  • `warn!` at line 270 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/rig-core/src/providers/openai/wire/chat.rs:270
  • `trace!` at line 95 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/rig-core/src/providers/internal/mod.rs:95
  • `trace!` at line 100 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/rig-core/src/providers/gemini/embedding.rs:100
  • `trace!` at line 56 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/rig-core/src/providers/gemini/transcription.rs:56
  • `warn!` at line 525 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/rig-core/src/completion/options/merge.rs:525
  • `warn!` at line 690 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/rig-core/src/completion/options/merge.rs:690
  • `warn!` at line 604 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/rig-cassette/src/traffic.rs:604
  • `warn!` at line 631 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/rig-agent/src/tool/server.rs:631
  • `info!` at line 249 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/rig-agent/src/integrations/cli_chatbot.rs:249
  • `info!` at line 277 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/rig-agent/src/agent/engine.rs:277
  • `debug!` at line 166 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/rig-agent/src/agent/typed.rs:166
  • `warn!` at line 191 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/rig-agent/src/agent/typed.rs:191

What to do

  • Interpolated log message defeats structured logging

Reference — by lens

The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.

LensScoreRatingImpact
Code Health76%StrongSolid.
Architecture96%ExemplarySolid.
Maturity65%Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness58%Adequate — gated by D13, P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security71%Adequate — gated by D29, D30Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Domain Modelling91%ExemplarySolid.
Event Sourcing100%ExemplaryStrongest area.
Performance97%ExemplarySolid.
Unscored — 2 check(s) recorded observations but carry no score

These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.

  • X10 Duplicated predicate — 15 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 19 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 control(s) we could not find positive evidence for

These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.

  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 54 check(s) not relevant to this codebase

These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.

  • AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
  • AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
  • AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
  • AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
  • AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
  • AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
  • AC7 A11y enforcement — No web markup found — accessibility is not applicable to this repository.
  • AX1 Captive dependencies — Not applicable: this repository's JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; Rust with no dependency-injection crate has no container to hand one lifetime's instance to another — every value is owned by the code that builds it, and the borrow checker rejects a longer-lived value keeping a borrow of a shorter-lived one.
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. Rust's compiler refuses unsynchronised shared mutation — a value shared across threads must be Sync — so the race this check looks for cannot be written. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX6 Interface segregation — no exported interface declares behaviour
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — docker build failed (exit 1) — 3 | 4 | # Copy your local config into the container -------------------- ERROR: failed to solve: otel/opentelemetry-collector-contrib:0.135.0: failed to resolve source metadata for docker.io/otel/opentelemetry-collector-contrib:0.135.0: failed to do request: Head "https://registry-1.docker.io/v2/otel/opentelemetry-collector-contrib/manifests/0.135.0": Forbidden; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
  • C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no data at rest for these controls to protect.
  • C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a store configured outside this repository, for instance), the trail belongs to wherever that data is stored.
  • C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data whose lifetime a retention limit would bound.
  • C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data for a data subject to erase, export or consent over.
  • D11 Test Reliability — Test reliability not included — the .rs suite was found but not re-run
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D21 Naming Consistency — Naming consistency is measured on C# only; JavaScript, Python, Rust, TypeScript not measured.
  • D22 Internal API Consistency — API consistency is measured on C# only; the exposed Rust surface was not measured.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ projects each declaring an entity of their own. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — D24 reads C# and Visual Basic comments only — this repository's production source is .py, .rs, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D25 ADR Conformance — no ADRs to check
  • D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.rs), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D32 Data Compliance (PII/GDPR) — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
  • D36 Supply-chain Provenance & Signing — The CI pipeline builds and tests but publishes no released artifact — no package publish, container push, GitHub release or deployment step. Supply-chain provenance, signing and SBOM attest RELEASED artifacts, so there is nothing to attest here. Add them to the release pipeline when this repo starts shipping artifacts (a published package, a container image, a deployed service or a tagged release).
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage not included — suite not readable by the collector
  • DM1 Aggregate boundaries — this Rust crate declares no domain aggregate (a struct with private state and its own command methods), so DM1's aggregate-boundary read has no population to be taken over
  • DM2 Strongly-typed ids — the crate defines newtype typed-ids but declares no domain aggregate that could carry an id — so DM2's adoption ratio has no population to be taken over
  • DM3 Integration-event coupling — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
  • DM7 Repository granularity — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
  • PF2 Allocation hygiene — Not applicable: Rust spells out every heap allocation and makes borrowed slices (&[T], &str) its ordinary parameter types, so the allocation-aware style this card rewards elsewhere is the language's baseline rather than a rung to climb.
  • X16 Unfloored truncation loop — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X18 Disposal-pattern correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X2 Cancellation propagation — no C# was loaded; this repository's Python and Rust were read, and no request in it can be cancelled by a caller — a Python request takes no token: asyncio cancels the task and trio or anyio the scope that made it, from outside the call, and requests, httpx, aiohttp and gRPC take a timeout, not a cancellation; a Rust request takes no token: a future is cancelled by dropping it, from outside the call (select!, a timeout, an aborted task), and reqwest, hyper and tonic take none
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.

Critical — 81 finding(s)
D13 · REDACTED Scanning · Leaked secret · ×52
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 27 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D14 · License Compliance · Banned license · ×1
  • Banned license: epub — `epub` 2.1.5 is published on crates.io under `GPL-3.0`, which this policy bans, and it is in the SHIPPED closure of this repository's REDACTED — so it is compiled by everything that builds this repository, not just by its test harness. The expression was read as SPDX, not as text: an `OR` is a choice and is only charged when every branch is banned, while an `AND` binds you to both operands and is charged when either is. Replace the crate, or record an accepted exception.
D28 · Secrets (history) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · High CVE · ×1
  • REDACTED
DM4 · Rich vs anemic domain model · Anemic domain model · ×1
  • Anemic domain model: DeviceCodePrompt crates/rig-core/src/providers/internal/auth.rs:17 — `DeviceCodePrompt` is a data-only domain entity with `pub` mutable state and no invariant-enforcing behaviour of its own, while the repo holds the logic in a foreign service/manager/use-case — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants (or make it an immutable value object with private fields) rather than being driven from outside.
Serious — 837 finding(s)
D3 · God Classes · FileTooLong · ×72
  • FileTooLong: http/mod.rs crates/rig-cassette/src/http/mod.rs — FileTooLong — 2153 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 88 free functions. The bar is 500 significant lines; this is 1653 over it, 4.31× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/scrub.rs crates/rig-cassette/src/scrub.rs — FileTooLong — 2110 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 56 free functions. The bar is 500 significant lines; this is 1610 over it, 4.22× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/lib.rs crates/rig-sqlite/src/lib.rs — FileTooLong — 1248 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 748 over it, 2.50× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: wire/chat.rs crates/rig-core/src/providers/openai/wire/chat.rs — FileTooLong — 1223 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 723 over it, 2.45× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/transcript.rs plugins/rig-tui/src/transcript.rs — FileTooLong — 1156 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 656 over it, 2.31× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: openai/options.rs crates/rig-core/src/providers/openai/options.rs — FileTooLong — 1045 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 66 free functions. The bar is 500 significant lines; this is 545 over it, 2.09× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: completion/history.rs crates/rig-core/src/completion/history.rs — FileTooLong — 1030 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 33 free functions. The bar is 500 significant lines; this is 530 over it, 2.06× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: operation/completion.rs crates/rig-core/src/operation/completion.rs — FileTooLong — 1028 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 528 over it, 2.06× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: agent/engine.rs crates/rig-agent/src/agent/engine.rs — FileTooLong — 1020 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 520 over it, 2.04× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/render.rs plugins/rig-tui/src/render.rs — FileTooLong — 1000 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 500 over it, 2.00× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/compaction.rs plugins/rig-basics/src/compaction.rs — FileTooLong — 986 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 36 free functions. The bar is 500 significant lines; this is 486 over it, 1.97× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: run/mod.rs crates/rig-agent/src/run/mod.rs — FileTooLong — 982 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 79% of them inside a single declaration: AgentRun (4 blocks, 304-1761). The bar is 500 significant lines; this is 482 over it, 1.96× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: src/turn.rs crates/rig-ecs/src/turn.rs — FileTooLong — 939 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 35 free functions. The bar is 500 significant lines; this is 439 over it, 1.88× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: wire/modality.rs crates/rig-core/src/providers/openai/wire/modality.rs — FileTooLong — 913 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 413 over it, 1.83× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: completion/request.rs crates/rig-core/src/completion/request.rs — FileTooLong — 889 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 389 over it, 1.78× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/open_pr.rs corpus/fh/src/open_pr.rs — FileTooLong — 880 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 380 over it, 1.76× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/stage.rs crates/rig-ecs/src/stage.rs — FileTooLong — 856 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 33 free functions. The bar is 500 significant lines; this is 356 over it, 1.71× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: anthropic/completion.rs crates/rig-core/src/providers/anthropic/completion.rs — FileTooLong — 826 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 40 free functions. The bar is 500 significant lines; this is 326 over it, 1.65× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: completion/message.rs crates/rig-core/src/completion/message.rs — FileTooLong — 815 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 315 over it, 1.63× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/transport.rs plugins/rig-claude-cloak/src/transport.rs — FileTooLong — 814 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 314 over it, 1.63× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/print.rs plugins/rig-basics/src/print.rs — FileTooLong — 806 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 306 over it, 1.61× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/session_bundle.rs corpus/oc/src/session_bundle.rs — FileTooLong — 782 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 282 over it, 1.56× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: agent/hook.rs crates/rig-agent/src/agent/hook.rs — FileTooLong — 781 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 281 over it, 1.56× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/best_of_n.rs corpus/ho/src/best_of_n.rs — FileTooLong — 778 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 278 over it, 1.56× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/transcript_in_editor.rs corpus/oc/src/transcript_in_editor.rs — FileTooLong — 763 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 263 over it, 1.53× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • + 47 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×53
  • Hotspot: crates/rig-core/src/providers/openai/responses_api/mod.rs crates/rig-core/src/providers/openai/responses_api/mod.rs:142 — crates/rig-core/src/providers/openai/responses_api/mod.rs changed 61 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 41 in rig_core::providers::openai::responses_api::input at line 142. 10 of those changes were fix/bug commits, and the other 51 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 03:46:29 +00:00' --until='2026-10-27 03:46:29 +00:00' --full-history --no-merges -- crates/rig-core/src/providers/openai/responses_api/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/rig-core/src/providers/anthropic/completion.rs crates/rig-core/src/providers/anthropic/completion.rs:1208 — crates/rig-core/src/providers/anthropic/completion.rs changed 56 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in rig_core::providers::anthropic::completion::strict_schema at line 1208. 7 of those changes were fix/bug commits, and the other 49 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 03:46:29 +00:00' --until='2026-10-27 03:46:29 +00:00' --full-history --no-merges -- crates/rig-core/src/providers/anthropic/completion.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/rig-agent/src/agent/engine.rs crates/rig-agent/src/agent/engine.rs:703 — crates/rig-agent/src/agent/engine.rs changed 39 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in StreamingTurnSource::run_model_turn at line 703. 10 of those changes were fix/bug commits, and the other 29 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 03:46:29 +00:00' --until='2026-10-27 03:46:29 +00:00' --full-history --no-merges -- crates/rig-agent/src/agent/engine.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/rig-agent/src/run/mod.rs crates/rig-agent/src/run/mod.rs:852 — crates/rig-agent/src/run/mod.rs changed 50 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in AgentRun::next_step at line 852. 7 of those changes were fix/bug commits, and the other 43 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 03:46:29 +00:00' --until='2026-10-27 03:46:29 +00:00' --full-history --no-merges -- crates/rig-agent/src/run/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/rig-core/src/providers/gemini/streaming.rs crates/rig-core/src/providers/gemini/streaming.rs:95 — crates/rig-core/src/providers/gemini/streaming.rs changed 36 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in GenerateContentDecoder::decode at line 95. 5 of those changes were fix/bug commits, and the other 31 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 03:46:29 +00:00' --until='2026-10-27 03:46:29 +00:00' --full-history --no-merges -- crates/rig-core/src/providers/gemini/streaming.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/rig-core/src/providers/openai/wire/chat.rs crates/rig-core/src/providers/openai/wire/chat.rs:388 — crates/rig-core/src/providers/openai/wire/chat.rs changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in Chat::assistant at line 388. 6 of those changes were fix/bug commits, and the other 23 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 03:46:29 +00:00' --until='2026-10-27 03:46:29 +00:00' --full-history --no-merges -- crates/rig-core/src/providers/openai/wire/chat.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/rig-core/src/providers/anthropic/streaming.rs crates/rig-core/src/providers/anthropic/streaming.rs:396 — crates/rig-core/src/providers/anthropic/streaming.rs changed 45 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in MessagesDecoder::delta at line 396. 7 of those changes were fix/bug commits, and the other 38 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 03:46:29 +00:00' --until='2026-10-27 03:46:29 +00:00' --full-history --no-merges -- crates/rig-core/src/providers/anthropic/streaming.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/rig-core/src/providers/gemini/interactions_api/streaming.rs crates/rig-core/src/providers/gemini/interactions_api/streaming.rs:273 — crates/rig-core/src/providers/gemini/interactions_api/streaming.rs changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in InteractionsDecoder::delta at line 273. 1 of those changes was a fix/bug commit, and the other 31 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 03:46:29 +00:00' --until='2026-10-27 03:46:29 +00:00' --full-history --no-merges -- crates/rig-core/src/providers/gemini/interactions_api/streaming.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/rig-bedrock/src/streaming.rs crates/rig-bedrock/src/streaming.rs:139 — crates/rig-bedrock/src/streaming.rs changed 30 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in StreamState::delta at line 139. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 03:46:29 +00:00' --until='2026-10-27 03:46:29 +00:00' --full-history --no-merges -- crates/rig-bedrock/src/streaming.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/rig-candle/src/protocol.rs crates/rig-candle/src/protocol.rs:518 — crates/rig-candle/src/protocol.rs changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in rig_candle::protocol::render_qwen_message at line 518. 1 of those changes was a fix/bug commit, and the other 16 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 03:46:29 +00:00' --until='2026-10-27 03:46:29 +00:00' --full-history --no-merges -- crates/rig-candle/src/protocol.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/rig-lancedb/src/utils/deserializer.rs crates/rig-lancedb/src/utils/deserializer.rs:42 — crates/rig-lancedb/src/utils/deserializer.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 58 in rig_lancedb::utils::deserializer::type_matcher at line 42. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 03:46:29 +00:00' --until='2026-10-27 03:46:29 +00:00' --full-history --no-merges -- crates/rig-lancedb/src/utils/deserializer.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/rig-core/src/operation/completion.rs crates/rig-core/src/operation/completion.rs:1517 — crates/rig-core/src/operation/completion.rs changed 27 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in Out::fragment at line 1517. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 03:46:29 +00:00' --until='2026-10-27 03:46:29 +00:00' --full-history --no-merges -- crates/rig-core/src/operation/completion.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: xtask/src/verify/selection.rs xtask/src/verify/selection.rs:248 — xtask/src/verify/selection.rs changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in xtask::verify::selection::plan at line 248. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 03:46:29 +00:00' --until='2026-10-27 03:46:29 +00:00' --full-history --no-merges -- xtask/src/verify/selection.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/rig-agent/src/test_utils/model_conformance.rs crates/rig-agent/src/test_utils/model_conformance.rs:1386 — crates/rig-agent/src/test_utils/model_conformance.rs changed 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in rig_agent::test_utils::model_conformance::invalid_tool_recovery_with_choice at line 1386. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 03:46:29 +00:00' --until='2026-10-27 03:46:29 +00:00' --full-history --no-merges -- crates/rig-agent/src/test_utils/model_conformance.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: test-support/rig-test-support/src/reasoning.rs test-support/rig-test-support/src/reasoning.rs:738 — test-support/rig-test-support/src/reasoning.rs changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in rig_test_support::reasoning::assert_chat_history_preserves_reasoning_tool_roundtrip at line 738. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 03:46:29 +00:00' --until='2026-10-27 03:46:29 +00:00' --full-history --no-merges -- test-support/rig-test-support/src/reasoning.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/rig-core/src/test_utils/streaming.rs crates/rig-core/src/test_utils/streaming.rs:291 — crates/rig-core/src/test_utils/streaming.rs changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in MockDecoder::event at line 291. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 03:46:29 +00:00' --until='2026-10-27 03:46:29 +00:00' --full-history --no-merges -- crates/rig-core/src/test_utils/streaming.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/rig-agent/src/run/prepare.rs crates/rig-agent/src/run/prepare.rs:126 — crates/rig-agent/src/run/prepare.rs changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in rig_agent::run::prepare::prepare_request at line 126. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 03:46:29 +00:00' --until='2026-10-27 03:46:29 +00:00' --full-history --no-merges -- crates/rig-agent/src/run/prepare.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/rig-core/src/completion/history.rs crates/rig-core/src/completion/history.rs:1521 — crates/rig-core/src/completion/history.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in rig_core::completion::history::user at line 1521. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 03:46:29 +00:00' --until='2026-10-27 03:46:29 +00:00' --full-history --no-merges -- crates/rig-core/src/completion/history.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: plugins/rig-tui/src/transcript.rs plugins/rig-tui/src/transcript.rs:1553 — plugins/rig-tui/src/transcript.rs changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in rig_tui::transcript::message_lines at line 1553. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 03:46:29 +00:00' --until='2026-10-27 03:46:29 +00:00' --full-history --no-merges -- plugins/rig-tui/src/transcript.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/rig-core/src/serve/handler.rs crates/rig-core/src/serve/handler.rs:523 — crates/rig-core/src/serve/handler.rs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in Reply::observed at line 523. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 03:46:29 +00:00' --until='2026-10-27 03:46:29 +00:00' --full-history --no-merges -- crates/rig-core/src/serve/handler.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: plugins/rig-basics/src/compaction.rs plugins/rig-basics/src/compaction.rs:948 — plugins/rig-basics/src/compaction.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in rig_basics::compaction::compact_near_the_window at line 948. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 03:46:29 +00:00' --until='2026-10-27 03:46:29 +00:00' --full-history --no-merges -- plugins/rig-basics/src/compaction.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/rig-cassette/src/http/mod.rs crates/rig-cassette/src/http/mod.rs:1557 — crates/rig-cassette/src/http/mod.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in rig_cassette::http::replay_request at line 1557. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 03:46:29 +00:00' --until='2026-10-27 03:46:29 +00:00' --full-history --no-merges -- crates/rig-cassette/src/http/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/rig-tools/src/shell.rs crates/rig-tools/src/shell.rs:560 — crates/rig-tools/src/shell.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in Kept::line at line 560. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 03:46:29 +00:00' --until='2026-10-27 03:46:29 +00:00' --full-history --no-merges -- crates/rig-tools/src/shell.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: xtask/src/verify/execute.rs xtask/src/verify/execute.rs:40 — xtask/src/verify/execute.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in xtask::verify::execute::internal at line 40. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 03:46:29 +00:00' --until='2026-10-27 03:46:29 +00:00' --full-history --no-merges -- xtask/src/verify/execute.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/launcher/run.rs src/launcher/run.rs:196 — src/launcher/run.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in rig::launcher::run::launch at line 196. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 03:46:29 +00:00' --until='2026-10-27 03:46:29 +00:00' --full-history --no-merges -- src/launcher/run.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • + 28 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×28
  • Duplicated block (5 lines × 2) corpus/base/src/format_on_write.rs:287 — corpus/base/src/format_on_write.rs:287-291 | crates/rig-tools/src/edit.rs:766-770 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) corpus/base/src/handoff.rs:221 — corpus/base/src/handoff.rs:221-225 | corpus/oc/src/away_recap.rs:340-344 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) corpus/base/src/skills.rs:185 — corpus/base/src/skills.rs:185-189 | corpus/sn/src/glob_rules.rs:207-211 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) corpus/base/src/todo_tracker.rs:201 — corpus/base/src/todo_tracker.rs:201-205 | corpus/rf-03/src/todo.rs:219-223 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) corpus/ct/src/history_versions.rs:350 — corpus/ct/src/history_versions.rs:350-354 | plugins/rig-basics/src/skills.rs:329-333 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) corpus/fh/src/encrypted_sessions/reseal.rs:188 — corpus/fh/src/encrypted_sessions/reseal.rs:188-192 | corpus/oc/src/session_bundle.rs:300-304 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) corpus/library/src/session_compare_library.rs:294 — corpus/library/src/session_compare_library.rs:294-298 | crates/rig-memory/src/meta.rs:121-125 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) corpus/oc/src/dataset_cli/dataset.rs:167 — corpus/oc/src/dataset_cli/dataset.rs:167-171 | corpus/sn/src/usage_report_cli/report.rs:291-295 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) crates/rig-cassette/src/scrub.rs:1943 — crates/rig-cassette/src/scrub.rs:1943-1947 | crates/rig-cassette/src/scrub.rs:2398-2402 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) crates/rig-cassette/src/scrub.rs:2167 — crates/rig-cassette/src/scrub.rs:2167-2171 | crates/rig-cassette/src/scrub.rs:2200-2204 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) crates/rig-core/src/effect/mod.rs:111 — crates/rig-core/src/effect/mod.rs:111-115 | crates/rig-core/src/effect/mod.rs:130-134 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) crates/rig-core/src/providers/cohere/chat.rs:488 — crates/rig-core/src/providers/cohere/chat.rs:488-492 | crates/rig-core/src/providers/ollama/chat.rs:430-434 — `crates/rig-core/src/providers/cohere/chat.rs` and `crates/rig-core/src/providers/ollama/chat.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 30 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (5 lines × 2) crates/rig-tools/src/edit.rs:164 — crates/rig-tools/src/edit.rs:164-168 | crates/rig-tools/src/write.rs:104-108 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) corpus/base/src/code_search_index.rs:739 — corpus/base/src/code_search_index.rs:739-743 | corpus/fh/src/thinking_keywords.rs:241-245 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) corpus/base/src/tool_search.rs:246 — corpus/base/src/tool_search.rs:246-250 | corpus/ho/src/session_recall.rs:573-577 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) corpus/ct/src/test_runner_tool.rs:506 — corpus/ct/src/test_runner_tool.rs:506-510 | corpus/ho/src/cancellable_run.rs:367-371 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) corpus/ho/src/raw_stream_log.rs:295 — corpus/ho/src/raw_stream_log.rs:295-299 | corpus/sn/src/model_params.rs:699-703 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) corpus/sp/src/theme_files.rs:289 — corpus/sp/src/theme_files.rs:289-293 | crates/rig-tools/src/edit.rs:626-630 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) crates/rig-core/src/audio_generation.rs:96 — crates/rig-core/src/audio_generation.rs:96-100 | crates/rig-core/src/image_generation.rs:117-121 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) crates/rig-core/src/providers/gemini/extension.rs:110 — crates/rig-core/src/providers/gemini/extension.rs:110-114 | crates/rig-vertexai/src/extension.rs:114-118 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) corpus/base/src/review_agent.rs:655 — corpus/base/src/review_agent.rs:655-659 | plugins/rig-basics/src/reload/plugins.rs:223-227 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) crates/rig-core/src/tool/validate.rs:157 — crates/rig-core/src/tool/validate.rs:157-161 | crates/rig-core/src/tool/validate.rs:166-170 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) corpus/base/src/mcp_client.rs:404 — corpus/base/src/mcp_client.rs:404-408 | corpus/base/src/mcp_client.rs:426-430 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) corpus/base/src/skills.rs:262 — corpus/base/src/skills.rs:262-266 | corpus/ho/src/script_tools.rs:175-179 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) corpus/base/src/skills.rs:275 — corpus/base/src/skills.rs:275-279 | corpus/sn/src/glob_rules.rs:370-374 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • + 3 more in this group — see findings.md.
D2 · Cognitive Complexity · rig_core · ×27
  • rig_core::providers::openai::responses_api::input (cognitive 92) crates/rig-core/src/providers/openai/responses_api/mod.rs:142 — rig_core::providers::openai::responses_api::input has cognitive complexity 92 (threshold 15). Drivers by points: if/else 15 (56 pts), match/switch 6 (23 pts), loops 3 (7 pts), boolean chains 6 (nesting depth added 62). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_core::providers::internal::schema::sanitize_schema (cognitive 56) crates/rig-core/src/providers/internal/schema.rs:24 — rig_core::providers::internal::schema::sanitize_schema has cognitive complexity 56 (threshold 15). Drivers by points: if/else 13 (29 pts), loops 5 (16 pts), boolean chains 8, match/switch 1 (3 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_core::conversation::pairing::walk (cognitive 48) crates/rig-core/src/conversation/pairing.rs:288 — rig_core::conversation::pairing::walk has cognitive complexity 48 (threshold 15). Drivers by points: if/else 12 (34 pts), match/switch 2 (6 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_core::completion::history::user (cognitive 47) crates/rig-core/src/completion/history.rs:1521 — rig_core::completion::history::user has cognitive complexity 47 (threshold 15). Drivers by points: if/else 14 (33 pts), boolean chains 8, match/switch 2 (5 pts), loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_core::providers::deepseek::strict_node (cognitive 46) crates/rig-core/src/providers/deepseek.rs:212 — rig_core::providers::deepseek::strict_node has cognitive complexity 46 (threshold 15). Drivers by points: if/else 14 (28 pts), loops 5 (10 pts), boolean chains 4, match/switch 2 (4 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_core::providers::anthropic::completion::strict_schema (cognitive 40) crates/rig-core/src/providers/anthropic/completion.rs:1208 — rig_core::providers::anthropic::completion::strict_schema has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (24 pts), match/switch 7 (11 pts), boolean chains 3, loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_core::completion::history::assistant (cognitive 39) crates/rig-core/src/completion/history.rs:1209 — rig_core::completion::history::assistant has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 7, match/switch 4 (6 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_core::providers::anthropic::completion::apply_cache_control (cognitive 32) crates/rig-core/src/providers/anthropic/completion.rs:881 — rig_core::providers::anthropic::completion::apply_cache_control has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 7, loops 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_core::providers::gemini::interactions_api::steps (cognitive 28) crates/rig-core/src/providers/gemini/interactions_api/mod.rs:582 — rig_core::providers::gemini::interactions_api::steps has cognitive complexity 28 (threshold 15). Drivers by points: if/else 4 (15 pts), loops 3 (7 pts), match/switch 2 (6 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_core::providers::anthropic::completion::base (cognitive 24) crates/rig-core/src/providers/anthropic/completion.rs:228 — rig_core::providers::anthropic::completion::base has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (6 pts), match/switch 2 (5 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_core::completion::history::hosted_pairs (cognitive 23) crates/rig-core/src/completion/history.rs:1368 — rig_core::completion::history::hosted_pairs has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_core::providers::openai::options::chat_options (cognitive 22) crates/rig-core/src/providers/openai/options.rs:478 — rig_core::providers::openai::options::chat_options has cognitive complexity 22 (threshold 15). Drivers by points: if/else 21, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • rig_core::json_utils::parse_partial_object (cognitive 20) crates/rig-core/src/json_utils.rs:110 — rig_core::json_utils::parse_partial_object has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 3 (6 pts), boolean chains 2, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_core::redact::json_text (cognitive 20) REDACTED:194 — rig_core::redact::json_text has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 3 (7 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_core::completion::options::merge::apply (cognitive 19) crates/rig-core/src/completion/options/merge.rs:845 — rig_core::completion::options::merge::apply has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, loops 1 (2 pts), match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • rig_core::providers::openai::wire::chat::document::merge_call (cognitive 19) crates/rig-core/src/providers/openai/wire/chat/document.rs:231 — rig_core::providers::openai::wire::chat::document::merge_call has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 5, match/switch 3 (5 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_core::providers::anthropic::completion::merge_all_of (cognitive 18) crates/rig-core/src/providers/anthropic/completion.rs:1134 — rig_core::providers::anthropic::completion::merge_all_of has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_core::tool::schema::plain (cognitive 18) crates/rig-core/src/tool/schema.rs:49 — rig_core::tool::schema::plain has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_core::completion::history::adapt_for (cognitive 17) crates/rig-core/src/completion/history.rs:616 — rig_core::completion::history::adapt_for has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 5, match/switch 2 (4 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_core::completion::history::settled (cognitive 17) crates/rig-core/src/completion/history.rs:770 — rig_core::completion::history::settled has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (8 pts), match/switch 2 (5 pts), boolean chains 3, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_core::providers::chatgpt::auth::native::browser::serve (cognitive 17) REDACTED:189 — rig_core::providers::chatgpt::auth::native::browser::serve has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), match/switch 3 (7 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_core::providers::openai::wire::chat::rewrite_body (cognitive 17) crates/rig-core/src/providers/openai/wire/chat.rs:498 — rig_core::providers::openai::wire::chat::rewrite_body has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 2, loops 1 (2 pts), match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • rig_core::completion::history::paired (cognitive 16) crates/rig-core/src/completion/history.rs:1421 — rig_core::completion::history::paired has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 3 (6 pts), loops 2, match/switch 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_core::completion::options::merge::placed (cognitive 16) crates/rig-core/src/completion/options/merge.rs:656 — rig_core::completion::options::merge::placed has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 2 (4 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • rig_core::completion::options::merge::request_params (cognitive 16) crates/rig-core/src/completion/options/merge.rs:765 — rig_core::completion::options::merge::request_params has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), loops 5 (6 pts), match/switch 2 (4 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • + 2 more in this group — see findings.md.
D3 · God Classes · FunctionTooLong · ×26
  • FunctionTooLong: xtask::verify::checks::all xtask/src/verify/checks.rs:76 — FunctionTooLong — xtask::verify::checks::all runs 382 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 282 over it, 3.82× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: xtask::verify::selection::plan xtask/src/verify/selection.rs:248 — FunctionTooLong — xtask::verify::selection::plan runs 233 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 133 over it, 2.33× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: rig_claude_cloak::transport::body plugins/rig-claude-cloak/src/transport.rs:625 — FunctionTooLong — rig_claude_cloak::transport::body runs 208 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 108 over it, 2.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: rig_derive::tool::expand::expand_rig_tool crates/rig-derive/src/tool/expand.rs:108 — FunctionTooLong — rig_derive::tool::expand::expand_rig_tool runs 158 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 58 over it, 1.58× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: rig_lancedb::utils::deserializer::type_matcher crates/rig-lancedb/src/utils/deserializer.rs:42 — FunctionTooLong — rig_lancedb::utils::deserializer::type_matcher runs 157 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 57 over it, 1.57× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: rig_tui::transcript::message_lines plugins/rig-tui/src/transcript.rs:1553 — FunctionTooLong — rig_tui::transcript::message_lines runs 153 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 53 over it, 1.53× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: rig_core::providers::openai::responses_api::input crates/rig-core/src/providers/openai/responses_api/mod.rs:142 — FunctionTooLong — rig_core::providers::openai::responses_api::input runs 148 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 48 over it, 1.48× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: rig_agent::run::prepare::prepare_request crates/rig-agent/src/run/prepare.rs:126 — FunctionTooLong — rig_agent::run::prepare::prepare_request runs 145 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 45 over it, 1.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: rig::launcher::run::launch src/launcher/run.rs:196 — FunctionTooLong — rig::launcher::run::launch runs 142 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 42 over it, 1.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: rig_claude_cloak::transport::prompt_caching plugins/rig-claude-cloak/src/transport.rs:451 — FunctionTooLong — rig_claude_cloak::transport::prompt_caching runs 133 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 33 over it, 1.33× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: rig_tui::render::lay_out_transcript plugins/rig-tui/src/render.rs:647 — FunctionTooLong — rig_tui::render::lay_out_transcript runs 133 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 33 over it, 1.33× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: corpus_fh::editor_front::receive corpus/fh/src/editor_front.rs:545 — FunctionTooLong — corpus_fh::editor_front::receive runs 130 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 30 over it, 1.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: rig_cassette::http::replay_request crates/rig-cassette/src/http/mod.rs:1557 — FunctionTooLong — rig_cassette::http::replay_request runs 125 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 25 over it, 1.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: rig_candle::protocol::render_qwen_message crates/rig-candle/src/protocol.rs:518 — FunctionTooLong — rig_candle::protocol::render_qwen_message runs 116 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 16 over it, 1.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: rig_cassette::scrub::capture_format crates/rig-cassette/src/scrub.rs:525 — FunctionTooLong — rig_cassette::scrub::capture_format runs 116 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 16 over it, 1.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: corpus_fh::import_sessions::parse::codex corpus/fh/src/import_sessions/parse.rs:443 — FunctionTooLong — corpus_fh::import_sessions::parse::codex runs 115 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 15 over it, 1.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: corpus_fh::prompt_cache_shaping::shape corpus/fh/src/prompt_cache_shaping.rs:155 — FunctionTooLong — corpus_fh::prompt_cache_shaping::shape runs 115 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 15 over it, 1.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: rig_ecs::stage::start crates/rig-ecs/src/stage.rs:1090 — FunctionTooLong — rig_ecs::stage::start runs 115 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 15 over it, 1.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: xtask::verify::execute::internal xtask/src/verify/execute.rs:40 — FunctionTooLong — xtask::verify::execute::internal runs 113 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 13 over it, 1.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: rig_ecs::stage::build crates/rig-ecs/src/stage.rs:638 — FunctionTooLong — rig_ecs::stage::build runs 111 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 11 over it, 1.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: rig_basics::compaction::compact_near_the_window plugins/rig-basics/src/compaction.rs:948 — FunctionTooLong — rig_basics::compaction::compact_near_the_window runs 110 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 10 over it, 1.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: rig_claude_cloak::schema::upgrade plugins/rig-claude-cloak/src/schema.rs:646 — FunctionTooLong — rig_claude_cloak::schema::upgrade runs 109 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 9 over it, 1.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: corpus_sp::dead_ends_ledger::review_shell corpus/sp/src/dead_ends_ledger.rs:376 — FunctionTooLong — corpus_sp::dead_ends_ledger::review_shell runs 108 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 8 over it, 1.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: rig_core::completion::history::adapt_for crates/rig-core/src/completion/history.rs:616 — FunctionTooLong — rig_core::completion::history::adapt_for runs 107 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 7 over it, 1.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: corpus_fh::import_sessions::parse::claude_code corpus/fh/src/import_sessions/parse.rs:299 — FunctionTooLong — corpus_fh::import_sessions::parse::claude_code runs 106 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 6 over it, 1.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • + 1 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×24
  • Duplicated block (6 lines × 2) corpus/ho/src/spend_by_origin.rs:250 — corpus/ho/src/spend_by_origin.rs:250-255 | corpus/sn/src/usage_report_cli/report.rs:198-203 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) corpus/oc/src/dataset_cli/dataset.rs:160 — corpus/oc/src/dataset_cli/dataset.rs:160-165 | corpus/sn/src/usage_report_cli/report.rs:284-289 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) crates/rig-cassette/src/scrub.rs:1810 — crates/rig-cassette/src/scrub.rs:1810-1815 | crates/rig-cassette/src/scrub.rs:1840-1848 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/rig-core/src/loaders/epub/loader.rs:253 — crates/rig-core/src/loaders/epub/loader.rs:253-258 | crates/rig-core/src/loaders/pdf.rs:260-265 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) crates/rig-core/src/providers/openai/options.rs:1012 — crates/rig-core/src/providers/openai/options.rs:1012-1017 | crates/rig-core/src/providers/openai/options.rs:1491-1496 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) plugins/rig-claude-cloak/src/transport.rs:486 — plugins/rig-claude-cloak/src/transport.rs:486-491 | plugins/rig-claude-cloak/src/transport.rs:610-615 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) plugins/rig-tui/src/input.rs:499 — plugins/rig-tui/src/input.rs:499-504 | plugins/rig-tui/src/input.rs:528-533 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) corpus/base/src/background_jobs.rs:702 — corpus/base/src/background_jobs.rs:702-707 | corpus/sp/src/dead_ends_ledger.rs:252-257 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) corpus/base/src/cron_agent.rs:129 — corpus/base/src/cron_agent.rs:129-134 | corpus/sn/src/task_queue.rs:200-205 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) corpus/base/src/export/render.rs:510 — corpus/base/src/export/render.rs:510-515 | plugins/rig-basics/src/skills.rs:319-324 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) corpus/ct/src/shell_companion/socket.rs:37 — corpus/ct/src/shell_companion/socket.rs:37-42 | corpus/ho/src/socket_attach/server.rs:47-52 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) corpus/fh/src/import_sessions.rs:262 — corpus/fh/src/import_sessions.rs:262-267 | crates/rig-tools/src/attach.rs:132-137 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) corpus/fh/src/thinking_keywords.rs:158 — corpus/fh/src/thinking_keywords.rs:158-163 | corpus/shared/src/few_shot_examples.rs:210-215 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) crates/rig-bedrock/src/completion.rs:218 — crates/rig-bedrock/src/completion.rs:218-223 | crates/rig-vertexai/src/completion.rs:69-74 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) crates/rig-bedrock/src/extension.rs:260 — crates/rig-bedrock/src/extension.rs:260-265 | crates/rig-core/src/providers/cohere/extension.rs:240-245 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) crates/rig-core/src/providers/minimax/voice_clone.rs:326 — crates/rig-core/src/providers/minimax/voice_clone.rs:326-331 | crates/rig-core/src/providers/openai/wire/modality.rs:1149-1155 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) crates/rig-tools/src/list.rs:138 — crates/rig-tools/src/list.rs:138-143 | crates/rig-tools/src/search.rs:202-207 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) crates/rig-core/src/completion/message.rs:109 — crates/rig-core/src/completion/message.rs:109-114 | crates/rig-core/src/completion/request.rs:586-591 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) corpus/base/src/http_api/server.rs:118 — corpus/base/src/http_api/server.rs:118-123 | corpus/ct/src/metrics_endpoint/server.rs:61-67 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) corpus/base/src/http_api/server.rs:112 — corpus/base/src/http_api/server.rs:112-117 | corpus/ct/src/metrics_endpoint/server.rs:55-60 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) corpus/base/src/auto_commit.rs:532 — corpus/base/src/auto_commit.rs:532-537 | corpus/fh/src/dirty_tree_guard.rs:154-159 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) corpus/fh/src/correction_learner.rs:329 — corpus/fh/src/correction_learner.rs:329-334 | corpus/ho/src/auto_session_name.rs:116-121 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) xtask/src/stage_order.rs:33 — xtask/src/stage_order.rs:33-38 | xtask/src/test_layout.rs:37-42 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) test-support/rig-test-support/src/reasoning.rs:303 — test-support/rig-test-support/src/reasoning.rs:303-308 | test-support/rig-test-support/src/reasoning.rs:349-354 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D2 · Cognitive Complexity · corpus_sn · ×18
  • corpus_sn::crash_resume::recover (cognitive 35) corpus/sn/src/crash_resume.rs:220 — corpus_sn::crash_resume::recover has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 6 (8 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_sn::untrusted_quarantine::fence (cognitive 31) corpus/sn/src/untrusted_quarantine.rs:281 — corpus_sn::untrusted_quarantine::fence has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 5 (11 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_sn::crash_resume::resolve (cognitive 26) corpus/sn/src/crash_resume.rs:429 — corpus_sn::crash_resume::resolve has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 4, loops 3 (4 pts), match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_sn::race_models::claim (cognitive 26) corpus/sn/src/race_models.rs:419 — corpus_sn::race_models::claim has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_sn::sessions_prune_cli::plan (cognitive 26) corpus/sn/src/sessions_prune_cli.rs:347 — corpus_sn::sessions_prune_cli::plan has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_sn::vim_input::edit (cognitive 26) corpus/sn/src/vim_input.rs:148 — corpus_sn::vim_input::edit has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 3 (7 pts), boolean chains 4, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_sn::untrusted_quarantine::scan (cognitive 23) corpus/sn/src/untrusted_quarantine.rs:350 — corpus_sn::untrusted_quarantine::scan has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 6, loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_sn::glob_rules::deliver (cognitive 22) corpus/sn/src/glob_rules.rs:384 — corpus_sn::glob_rules::deliver has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (3 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_sn::tool_stats::work (cognitive 21) corpus/sn/src/tool_stats.rs:166 — corpus_sn::tool_stats::work has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 3 (9 pts), loops 3 (7 pts), if/else 2 (5 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_sn::vim_input::editor::parse (cognitive 21) corpus/sn/src/vim_input/editor.rs:409 — corpus_sn::vim_input::editor::parse has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 7 (14 pts), if/else 6 (7 pts) (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • corpus_sn::model_params::put (cognitive 20) corpus/sn/src/model_params.rs:484 — corpus_sn::model_params::put has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (12 pts), match/switch 2 (7 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_sn::race_models::drop_out (cognitive 20) corpus/sn/src/race_models.rs:564 — corpus_sn::race_models::drop_out has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 3, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_sn::file_annotations::annotate_reads (cognitive 19) corpus/sn/src/file_annotations.rs:208 — corpus_sn::file_annotations::annotate_reads has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_sn::web_fetch::answered (cognitive 19) corpus/sn/src/web_fetch.rs:180 — corpus_sn::web_fetch::answered has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_sn::plugin_profiler::frame_ended (cognitive 18) corpus/sn/src/plugin_profiler.rs:544 — corpus_sn::plugin_profiler::frame_ended has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_sn::leftover_detector::snapshot (cognitive 17) corpus/sn/src/leftover_detector.rs:315 — corpus_sn::leftover_detector::snapshot has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_sn::model_params::check (cognitive 17) corpus/sn/src/model_params.rs:350 — corpus_sn::model_params::check has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 5 (9 pts), if/else 3 (6 pts), boolean chains 2 (nesting depth added 7). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • corpus_sn::race_models::list_errors (cognitive 17) corpus/sn/src/race_models.rs:493 — corpus_sn::race_models::list_errors has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3, boolean chains 2, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×18
  • Duplicated block (7 lines × 2) corpus/base/src/share/render.rs:124 — corpus/base/src/share/render.rs:124-130 | REDACTED:316-322 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) corpus/ct/src/ask_session_cli.rs:272 — corpus/ct/src/ask_session_cli.rs:272-278 | corpus/sp/src/commit_msg_hook.rs:261-267 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) corpus/library/src/session_doctor_library.rs:368 — corpus/library/src/session_doctor_library.rs:368-374 | corpus/library/src/session_edit_library.rs:663-669 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) corpus/sn/src/task_queue.rs:356 — corpus/sn/src/task_queue.rs:356-362 | plugins/rig-basics/src/sessions/agents.rs:127-133 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) crates/rig-candle/src/generation.rs:586 — crates/rig-candle/src/generation.rs:586-592 | crates/rig-candle/src/generation.rs:643-649 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) crates/rig-candle/src/loader.rs:121 — crates/rig-candle/src/loader.rs:121-127 | crates/rig-candle/src/loader.rs:163-169 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) crates/rig-candle/src/model.rs:650 — crates/rig-candle/src/model.rs:650-656 | crates/rig-candle/src/model.rs:687-693 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) crates/rig-core/src/providers/anthropic/streaming.rs:563 — crates/rig-core/src/providers/anthropic/streaming.rs:563-569 | crates/rig-core/src/providers/cohere/streaming.rs:347-353 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) crates/rig-core/src/providers/anthropic/streaming.rs:741 — crates/rig-core/src/providers/anthropic/streaming.rs:741-747 | crates/rig-core/src/providers/openai/wire/chat.rs:1925-1931 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) crates/rig-core/src/providers/gemini/audio_generation.rs:352 — crates/rig-core/src/providers/gemini/audio_generation.rs:352-358 | crates/rig-core/src/providers/gemini/image_generation.rs:214-220 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) crates/rig-core/src/serve/layer.rs:174 — crates/rig-core/src/serve/layer.rs:174-180 | crates/rig-core/src/serve/layer.rs:191-197 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) crates/rig-core/src/tool/validate.rs:439 — crates/rig-core/src/tool/validate.rs:439-445 | test-support/rig-history-conformance/src/lib.rs:878-885 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) crates/rig-core/src/providers/gemini/completion.rs:168 — crates/rig-core/src/providers/gemini/completion.rs:168-174 | crates/rig-gemini-grpc/src/completion.rs:75-81 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) test-support/rig-test-support/src/comparison_guard.rs:53 — test-support/rig-test-support/src/comparison_guard.rs:53-59 | xtask/src/cassette/owner.rs:182-188 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) corpus/base/src/check_after_turn.rs:409 — corpus/base/src/check_after_turn.rs:409-415 | corpus/fh/src/batch_provider.rs:596-602 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) crates/rig-core/src/providers/anthropic/options.rs:203 — crates/rig-core/src/providers/anthropic/options.rs:203-209 | crates/rig-core/src/providers/anthropic/options.rs:282-288 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) crates/rig-core/src/providers/openai/options.rs:1185 — crates/rig-core/src/providers/openai/options.rs:1185-1191 | crates/rig-core/src/providers/openai/options.rs:1231-1237 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) crates/rig-agent/src/test_utils/model_conformance.rs:98 — crates/rig-agent/src/test_utils/model_conformance.rs:98-104 | crates/rig-agent/src/test_utils/model_conformance.rs:773-779 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D2 · Cognitive Complexity · corpus_oc · ×17
  • corpus_oc::transcript_in_editor::rebuild (cognitive 48) corpus/oc/src/transcript_in_editor.rs:499 — corpus_oc::transcript_in_editor::rebuild has cognitive complexity 48 (threshold 15). Drivers by points: if/else 8 (25 pts), match/switch 5 (12 pts), loops 4 (11 pts) (nesting depth added 31). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • corpus_oc::transcript_in_editor::render (cognitive 37) corpus/oc/src/transcript_in_editor.rs:236 — corpus_oc::transcript_in_editor::render has cognitive complexity 37 (threshold 15). Drivers by points: match/switch 4 (16 pts), loops 5 (13 pts), if/else 2 (8 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_oc::inline_images::sixel (cognitive 31) corpus/oc/src/inline_images.rs:670 — corpus_oc::inline_images::sixel has cognitive complexity 31 (threshold 15). Drivers by points: if/else 4 (15 pts), loops 6 (12 pts), match/switch 1 (4 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_oc::transcript_in_editor::parse_body (cognitive 27) corpus/oc/src/transcript_in_editor.rs:358 — corpus_oc::transcript_in_editor::parse_body has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 2 (4 pts), match/switch 1 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_oc::git_delta_context::annotate (cognitive 24) corpus/oc/src/git_delta_context.rs:214 — corpus_oc::git_delta_context::annotate has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (21 pts), boolean chains 2, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_oc::dependency_guard::gate (cognitive 23) corpus/oc/src/dependency_guard.rs:330 — corpus_oc::dependency_guard::gate has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (19 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_oc::steer_and_queue::strip_keys (cognitive 23) corpus/oc/src/steer_and_queue.rs:414 — corpus_oc::steer_and_queue::strip_keys has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 3 (6 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_oc::dataset_cli::dataset::chat_messages (cognitive 22) corpus/oc/src/dataset_cli/dataset.rs:395 — corpus_oc::dataset_cli::dataset::chat_messages has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 4 (11 pts), if/else 3 (6 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 12). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • corpus_oc::dataset_cli::dataset::session_lines (cognitive 20) corpus/oc/src/dataset_cli/dataset.rs:175 — corpus_oc::dataset_cli::dataset::session_lines has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 4, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_oc::architect_editor::report (cognitive 18) corpus/oc/src/architect_editor.rs:583 — corpus_oc::architect_editor::report has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 4 (7 pts), match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_oc::reviewable_compaction::uncompact (cognitive 18) corpus/oc/src/reviewable_compaction.rs:285 — corpus_oc::reviewable_compaction::uncompact has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (12 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • corpus_oc::auto_continue::join (cognitive 17) corpus/oc/src/auto_continue.rs:320 — corpus_oc::auto_continue::join has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (6 pts), match/switch 3 (6 pts), boolean chains 4, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_oc::dependency_guard::answered (cognitive 17) corpus/oc/src/dependency_guard.rs:444 — corpus_oc::dependency_guard::answered has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_oc::line_provenance::provenance (cognitive 17) corpus/oc/src/line_provenance.rs:469 — corpus_oc::line_provenance::provenance has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 2 (3 pts), loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_oc::transcript_in_editor::edit_history (cognitive 17) corpus/oc/src/transcript_in_editor.rs:843 — corpus_oc::transcript_in_editor::edit_history has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), match/switch 4 (7 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • corpus_oc::auto_continue::add_partial (cognitive 16) corpus/oc/src/auto_continue.rs:233 — corpus_oc::auto_continue::add_partial has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 2 (4 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_oc::git_delta_context::describe (cognitive 16) corpus/oc/src/git_delta_context.rs:278 — corpus_oc::git_delta_context::describe has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), match/switch 4 (7 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×17
  • Duplicated block (8 lines × 2) corpus/base/src/auto_commit.rs:239 — corpus/base/src/auto_commit.rs:239-246 | corpus/base/src/auto_commit.rs:339-346 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) corpus/base/src/handoff.rs:155 — corpus/base/src/handoff.rs:155-162 | corpus/ct/src/conversation_chapters.rs:759-766 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) corpus/base/src/http_api/server.rs:93 — corpus/base/src/http_api/server.rs:93-100 | corpus/ct/src/metrics_endpoint/server.rs:36-43 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) corpus/fh/src/lsp_tools.rs:715 — corpus/fh/src/lsp_tools.rs:715-722 | corpus/fh/src/lsp_tools.rs:762-769 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) corpus/sn/src/sessions_prune_cli.rs:127 — corpus/sn/src/sessions_prune_cli.rs:127-134 | corpus/sn/src/usage_report_cli/options.rs:146-153 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) crates/rig-bedrock/src/options.rs:79 — crates/rig-bedrock/src/options.rs:79-86 | crates/rig-core/src/providers/anthropic/options.rs:78-85 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) crates/rig-core/src/providers/anthropic/options.rs:317 — crates/rig-core/src/providers/anthropic/options.rs:317-324 | crates/rig-core/src/providers/openai/options.rs:1111-1118 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) crates/rig-core/src/providers/cohere/chat.rs:163 — crates/rig-core/src/providers/cohere/chat.rs:163-170 | crates/rig-core/src/providers/ollama/chat.rs:175-182 — `crates/rig-core/src/providers/cohere/chat.rs` and `crates/rig-core/src/providers/ollama/chat.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 30 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (8 lines × 2) crates/rig-core/src/providers/ollama/chat.rs:323 — crates/rig-core/src/providers/ollama/chat.rs:323-330 | crates/rig-core/src/providers/openai/wire/chat.rs:568-575 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) crates/rig-reqwest/src/lib.rs:408 — crates/rig-reqwest/src/lib.rs:408-415 | crates/rig-reqwest/src/middleware.rs:56-63 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) corpus/base/src/debate.rs:379 — corpus/base/src/debate.rs:379-386 | corpus/base/src/review_agent.rs:553-560 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) crates/rig-core/src/providers/cohere/embeddings.rs:67 — crates/rig-core/src/providers/cohere/embeddings.rs:67-74 | crates/rig-core/src/providers/voyageai/wire.rs:97-104 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) crates/rig-postgres/src/lib.rs:254 — crates/rig-postgres/src/lib.rs:254-261 | crates/rig-surrealdb/src/lib.rs:264-271 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) corpus/ho/src/api_key_pool.rs:398 — corpus/ho/src/api_key_pool.rs:398-405 | corpus/oc/src/rate_limit_status.rs:269-276 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) crates/rig-core/src/providers/openai/wire/modality.rs:641 — crates/rig-core/src/providers/openai/wire/modality.rs:641-648 | crates/rig-core/src/providers/openai/wire/modality.rs:1491-1499 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) crates/rig-cassette/src/http/snapshot.rs:486 — crates/rig-cassette/src/http/snapshot.rs:486-493 | xtask/src/cassette/acceptance.rs:324-331 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) corpus/ho/src/throughput_item.rs:292 — corpus/ho/src/throughput_item.rs:292-299 | corpus/ho/src/tool_arg_repair.rs:187-194 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D2 · Cognitive Complexity · corpus_fh · ×16
  • corpus_fh::editor_front::receive (cognitive 72) corpus/fh/src/editor_front.rs:545 — corpus_fh::editor_front::receive has cognitive complexity 72 (threshold 15). Drivers by points: if/else 17 (50 pts), loops 5 (15 pts), match/switch 3 (7 pts) (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_fh::prompt_cache_shaping::shape (cognitive 49) corpus/fh/src/prompt_cache_shaping.rs:155 — corpus_fh::prompt_cache_shaping::shape has cognitive complexity 49 (threshold 15). Drivers by points: if/else 9 (28 pts), match/switch 5 (15 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_fh::apply_patch_tool::patch::parse (cognitive 40) corpus/fh/src/apply_patch_tool/patch.rs:162 — corpus_fh::apply_patch_tool::patch::parse has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (24 pts), match/switch 2 (8 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_fh::checklist_runner::schedule (cognitive 38) corpus/fh/src/checklist_runner.rs:613 — corpus_fh::checklist_runner::schedule has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (28 pts), loops 3 (8 pts), boolean chains 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_fh::import_sessions::parse::claude_code (cognitive 38) corpus/fh/src/import_sessions/parse.rs:299 — corpus_fh::import_sessions::parse::claude_code has cognitive complexity 38 (threshold 15). Drivers by points: if/else 7 (20 pts), match/switch 3 (10 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_fh::apply_patch_tool::gate_together (cognitive 36) corpus/fh/src/apply_patch_tool.rs:321 — corpus_fh::apply_patch_tool::gate_together has cognitive complexity 36 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 6 (16 pts), boolean chains 4 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_fh::apply_patch_tool::patch::check (cognitive 36) corpus/fh/src/apply_patch_tool/patch.rs:50 — corpus_fh::apply_patch_tool::patch::check has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (23 pts), match/switch 5 (10 pts), loops 2 (3 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_fh::batch_provider::take_over (cognitive 20) corpus/fh/src/batch_provider.rs:297 — corpus_fh::batch_provider::take_over has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_fh::import_sessions::parse::codex (cognitive 20) corpus/fh/src/import_sessions/parse.rs:443 — corpus_fh::import_sessions::parse::codex has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 4 (13 pts), if/else 2 (6 pts), loops 1 (nesting depth added 13). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • corpus_fh::rich_tool_rendering::highlight::spans (cognitive 20) corpus/fh/src/rich_tool_rendering/highlight.rs:115 — corpus_fh::rich_tool_rendering::highlight::spans has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, match/switch 2 (5 pts), loops 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • corpus_fh::step_mode::answered (cognitive 20) corpus/fh/src/step_mode.rs:383 — corpus_fh::step_mode::answered has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 4 (10 pts), if/else 3 (9 pts), loops 1 (nesting depth added 12). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • corpus_fh::lsp_tools::client::read_message (cognitive 19) corpus/fh/src/lsp_tools/client.rs:371 — corpus_fh::lsp_tools::client::read_message has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_fh::apply_patch_tool::patch::apply (cognitive 17) corpus/fh/src/apply_patch_tool/patch.rs:256 — corpus_fh::apply_patch_tool::patch::apply has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (7 pts), match/switch 3 (7 pts), loops 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_fh::structured_compaction::structure (cognitive 17) corpus/fh/src/structured_compaction.rs:241 — corpus_fh::structured_compaction::structure has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (8 pts), match/switch 3 (8 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_fh::early_tool_start::adopt (cognitive 16) corpus/fh/src/early_tool_start.rs:222 — corpus_fh::early_tool_start::adopt has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_fh::prompt_cache_shaping::first_change (cognitive 16) corpus/fh/src/prompt_cache_shaping.rs:312 — corpus_fh::prompt_cache_shaping::first_change has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · xtask · ×16
  • xtask::verify::selection::plan (cognitive 70) xtask/src/verify/selection.rs:248 — xtask::verify::selection::plan has cognitive complexity 70 (threshold 15). Drivers by points: if/else 28 (54 pts), boolean chains 12, loops 3 (4 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • xtask::cassette::scan::scan (cognitive 43) xtask/src/cassette/scan.rs:112 — xtask::cassette::scan::scan has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 10 (13 pts), boolean chains 6 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • xtask::catalog::pin (cognitive 38) xtask/src/catalog.rs:440 — xtask::catalog::pin has cognitive complexity 38 (threshold 15). Drivers by points: loops 10 (18 pts), if/else 4 (12 pts), match/switch 3 (7 pts), boolean chains 1 (nesting depth added 20). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • xtask::verify::execute::internal (cognitive 37) xtask/src/verify/execute.rs:40 — xtask::verify::execute::internal has cognitive complexity 37 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 4 (10 pts), boolean chains 8, match/switch 1 (nesting depth added 18). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • xtask::verify::preflight::run (cognitive 37) xtask/src/verify/preflight.rs:10 — xtask::verify::preflight::run has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (25 pts), match/switch 3 (7 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • xtask::cassette::owner::module_map (cognitive 32) xtask/src/cassette/owner.rs:72 — xtask::cassette::owner::module_map has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (26 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • xtask::catalog::serve (cognitive 32) xtask/src/catalog.rs:647 — xtask::catalog::serve has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (22 pts), loops 3 (6 pts), match/switch 1 (4 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • xtask::catalog::translate_reasoning (cognitive 26) xtask/src/catalog.rs:695 — xtask::catalog::translate_reasoning has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 4 (10 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • xtask::bevy::check (cognitive 21) xtask/src/bevy.rs:20 — xtask::bevy::check has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • xtask::cassette::scan::key_shape (cognitive 20) xtask/src/cassette/scan.rs:38 — xtask::cassette::scan::key_shape has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 11, if/else 9. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
  • xtask::cassette::shapes::walk_facts (cognitive 20) xtask/src/cassette/shapes.rs:232 — xtask::cassette::shapes::walk_facts has cognitive complexity 20 (threshold 15). Drivers by points: loops 4 (10 pts), match/switch 3 (7 pts), if/else 1 (3 pts) (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • xtask::cassette::record::run (cognitive 19) xtask/src/cassette/record.rs:193 — xtask::cassette::record::run has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 4 (5 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • xtask::cassette::spend::spend (cognitive 19) xtask/src/cassette/spend.rs:175 — xtask::cassette::spend::spend has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (4 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • xtask::catalog::validate_review (cognitive 18) xtask/src/catalog.rs:549 — xtask::catalog::validate_review has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 2 (8 pts), boolean chains 1 (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • xtask::cassette::bank::walk (cognitive 16) xtask/src/cassette/bank.rs:436 — xtask::cassette::bank::walk has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 4, if/else 2 (4 pts), loops 2 (4 pts), match/switch 2 (4 pts) (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • xtask::verify::execute::run (cognitive 16) xtask/src/verify/execute.rs:194 — xtask::verify::execute::run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (7 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D1 · Cyclomatic Complexity · rig_core · ×15
  • rig_core::providers::openai::responses_api::input (cyclomatic 41) crates/rig-core/src/providers/openai/responses_api/mod.rs:142 — rig_core::providers::openai::responses_api::input has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rig_core::completion::history::user (cyclomatic 32) crates/rig-core/src/completion/history.rs:1521 — rig_core::completion::history::user has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rig_core::providers::anthropic::completion::strict_schema (cyclomatic 32) crates/rig-core/src/providers/anthropic/completion.rs:1208 — rig_core::providers::anthropic::completion::strict_schema has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rig_core::providers::internal::schema::sanitize_schema (cyclomatic 28) crates/rig-core/src/providers/internal/schema.rs:24 — rig_core::providers::internal::schema::sanitize_schema has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rig_core::completion::history::assistant (cyclomatic 26) crates/rig-core/src/completion/history.rs:1209 — rig_core::completion::history::assistant has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rig_core::providers::deepseek::strict_node (cyclomatic 26) crates/rig-core/src/providers/deepseek.rs:212 — rig_core::providers::deepseek::strict_node has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rig_core::providers::gemini::options::generate_content_options (cyclomatic 26) crates/rig-core/src/providers/gemini/options.rs:164 — rig_core::providers::gemini::options::generate_content_options has cyclomatic complexity 26 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • rig_core::providers::anthropic::completion::apply_cache_control (cyclomatic 24) crates/rig-core/src/providers/anthropic/completion.rs:881 — rig_core::providers::anthropic::completion::apply_cache_control has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rig_core::completion::options::merge::apply (cyclomatic 23) crates/rig-core/src/completion/options/merge.rs:845 — rig_core::completion::options::merge::apply has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • rig_core::providers::openai::options::chat_options (cyclomatic 22) crates/rig-core/src/providers/openai/options.rs:478 — rig_core::providers::openai::options::chat_options has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • rig_core::conversation::pairing::walk (cyclomatic 21) crates/rig-core/src/conversation/pairing.rs:288 — rig_core::conversation::pairing::walk has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rig_core::json_utils::parse_partial_object (cyclomatic 18) crates/rig-core/src/json_utils.rs:110 — rig_core::json_utils::parse_partial_object has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • rig_core::providers::openai::wire::chat::document::merge_call (cyclomatic 17) crates/rig-core/src/providers/openai/wire/chat/document.rs:231 — rig_core::providers::openai::wire::chat::document::merge_call has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • rig_core::completion::history::adapt_for (cyclomatic 16) crates/rig-core/src/completion/history.rs:616 — rig_core::completion::history::adapt_for has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • rig_core::providers::anthropic::completion::base (cyclomatic 16) crates/rig-core/src/providers/anthropic/completion.rs:228 — rig_core::providers::anthropic::completion::base has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D2 · Cognitive Complexity · rig_tui · ×14
  • rig_tui::transcript::message_lines (cognitive 51) plugins/rig-tui/src/transcript.rs:1553 — rig_tui::transcript::message_lines has cognitive complexity 51 (threshold 15). Drivers by points: if/else 10 (26 pts), match/switch 5 (13 pts), loops 5 (11 pts), boolean chains 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_tui::render::lay_out_transcript (cognitive 50) plugins/rig-tui/src/render.rs:647 — rig_tui::render::lay_out_transcript has cognitive complexity 50 (threshold 15). Drivers by points: if/else 11 (26 pts), loops 8 (16 pts), match/switch 4 (8 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_tui::pane::lay_out_panes (cognitive 32) plugins/rig-tui/src/pane.rs:207 — rig_tui::pane::lay_out_panes has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (26 pts), match/switch 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_tui::input::act (cognitive 29) plugins/rig-tui/src/input.rs:659 — rig_tui::input::act has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 6 (10 pts), boolean chains 2 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • rig_tui::wrap::wrap (cognitive 27) plugins/rig-tui/src/wrap.rs:21 — rig_tui::wrap::wrap has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 3 (6 pts), boolean chains 4 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_tui::markdown::table::grid (cognitive 26) plugins/rig-tui/src/markdown/table.rs:130 — rig_tui::markdown::table::grid has cognitive complexity 26 (threshold 15). Drivers by points: if/else 4 (15 pts), loops 4 (10 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_tui::input::read_input (cognitive 25) plugins/rig-tui/src/input.rs:448 — rig_tui::input::read_input has cognitive complexity 25 (threshold 15). Drivers by points: match/switch 5 (13 pts), if/else 3 (8 pts), boolean chains 3, loops 1 (nesting depth added 13). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • rig_tui::render::light_line (cognitive 21) plugins/rig-tui/src/render.rs:966 — rig_tui::render::light_line has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_tui::terminal::run_in_terminal (cognitive 19) plugins/rig-tui/src/terminal.rs:414 — rig_tui::terminal::run_in_terminal has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), match/switch 2 (4 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_tui::diff::changed_words (cognitive 18) plugins/rig-tui/src/diff.rs:188 — rig_tui::diff::changed_words has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (6 pts), match/switch 1 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_tui::editor::draw_editors (cognitive 18) plugins/rig-tui/src/editor.rs:511 — rig_tui::editor::draw_editors has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 2 (5 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_tui::input::run_keys (cognitive 18) plugins/rig-tui/src/input.rs:262 — rig_tui::input::run_keys has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_tui::pick::queue_choices (cognitive 18) plugins/rig-tui/src/pick.rs:344 — rig_tui::pick::queue_choices has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, loops 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_tui::markdown::table::records (cognitive 17) plugins/rig-tui/src/markdown/table.rs:186 — rig_tui::markdown::table::records has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (11 pts), if/else 3 (6 pts) (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D30 · Dependency Vulnerabilities · Medium advisory (unmaintained) · ×14
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Medium vulnerability · ×14
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×13
  • Outbound HTTP without resilience corpus/rf-01/src/main.rs:22 — `AgentBuilder::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience corpus/rf-06/src/lib.rs:284 — `AgentBuilder::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience crates/rig-agent/src/extractor.rs:118 — `AgentBuilder::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience crates/rig-cassette/src/http/ledger.rs:520 — `reqwest::Client::builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience crates/rig-cassette/src/http/paths.rs:235 — `reqwest::Client::builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience crates/rig-cassette/src/http/proxy.rs:249 — `reqwest::Client::builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience crates/rig-helixdb/src/lib.rs:30 — `Client::new()` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience crates/rig-milvus/src/lib.rs:105 — `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience crates/rig-reqwest/src/lib.rs:67 — `reqwest::Client::builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience crates/rig-reqwest/src/lib.rs:120 — `reqwest::Client::builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience crates/rig-vectorize/src/client/mod.rs:75 — `Client::new()` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience plugins/rig-claude-cloak/src/transport/live.rs:249 — `reqwest::Client::builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience scripts/check-dependency-floors.py:128 — `urllib.request.urlopen(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
D2 · Cognitive Complexity · rig_claude_cloak · ×12
  • rig_claude_cloak::schema::upgrade (cognitive 102) plugins/rig-claude-cloak/src/schema.rs:646 — rig_claude_cloak::schema::upgrade has cognitive complexity 102 (threshold 15). Drivers by points: if/else 29 (78 pts), loops 5 (17 pts), match/switch 3 (6 pts), boolean chains 1 (nesting depth added 64). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • rig_claude_cloak::schema::postprocess (cognitive 58) plugins/rig-claude-cloak/src/schema.rs:477 — rig_claude_cloak::schema::postprocess has cognitive complexity 58 (threshold 15). Drivers by points: if/else 13 (43 pts), boolean chains 8, loops 2 (6 pts), match/switch 1 (nesting depth added 34). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • rig_claude_cloak::transport::prompt_caching (cognitive 53) plugins/rig-claude-cloak/src/transport.rs:451 — rig_claude_cloak::transport::prompt_caching has cognitive complexity 53 (threshold 15). Drivers by points: if/else 21 (33 pts), boolean chains 15, loops 3 (4 pts), match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_claude_cloak::transport::body (cognitive 53) plugins/rig-claude-cloak/src/transport.rs:625 — rig_claude_cloak::transport::body has cognitive complexity 53 (threshold 15). Drivers by points: if/else 24 (36 pts), boolean chains 10, match/switch 4, loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_claude_cloak::schema::normalize (cognitive 34) plugins/rig-claude-cloak/src/schema.rs:116 — rig_claude_cloak::schema::normalize has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 8, loops 4 (6 pts), match/switch 3 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_claude_cloak::schema::strict_schema (cognitive 31) plugins/rig-claude-cloak/src/schema.rs:304 — rig_claude_cloak::schema::strict_schema has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 10, loops 4 (7 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_claude_cloak::transport::prefix_tools (cognitive 29) plugins/rig-claude-cloak/src/transport.rs:176 — rig_claude_cloak::transport::prefix_tools has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 3 (8 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_claude_cloak::schema::empty_schemas (cognitive 27) plugins/rig-claude-cloak/src/schema.rs:585 — rig_claude_cloak::schema::empty_schemas has cognitive complexity 27 (threshold 15). Drivers by points: loops 6 (16 pts), if/else 4 (10 pts), match/switch 1 (nesting depth added 16). Of this number, 26 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • rig_claude_cloak::auth::receive_code (cognitive 25) plugins/rig-claude-cloak/src/auth.rs:432 — rig_claude_cloak::auth::receive_code has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_claude_cloak::transport::normalize_messages (cognitive 23) plugins/rig-claude-cloak/src/transport.rs:247 — rig_claude_cloak::transport::normalize_messages has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (5 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_claude_cloak::transport::first_user_text (cognitive 21) plugins/rig-claude-cloak/src/transport.rs:208 — rig_claude_cloak::transport::first_user_text has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_claude_cloak::schema::normalize_tools (cognitive 17) plugins/rig-claude-cloak/src/schema.rs:35 — rig_claude_cloak::schema::normalize_tools has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · rig_ecs · ×12
  • rig_ecs::stage::start (cognitive 38) crates/rig-ecs/src/stage.rs:1090 — rig_ecs::stage::start has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (24 pts), match/switch 3 (7 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_ecs::inbox::push_messages (cognitive 26) crates/rig-ecs/src/inbox.rs:725 — rig_ecs::inbox::push_messages has cognitive complexity 26 (threshold 15). Drivers by points: match/switch 5 (15 pts), if/else 3 (8 pts), loops 2 (3 pts) (nesting depth added 16). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • rig_ecs::restore::restore_session (cognitive 24) crates/rig-ecs/src/restore.rs:263 — rig_ecs::restore::restore_session has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 6 (8 pts), match/switch 3 (6 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_ecs::turn::stream_partials (cognitive 21) crates/rig-ecs/src/turn.rs:998 — rig_ecs::turn::stream_partials has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (11 pts), match/switch 2 (7 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_ecs::turn::take_unanswered (cognitive 20) crates/rig-ecs/src/turn.rs:408 — rig_ecs::turn::take_unanswered has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 2 (4 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_ecs::turn::on_stop_turn (cognitive 20) crates/rig-ecs/src/turn.rs:501 — rig_ecs::turn::on_stop_turn has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (5 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_ecs::restore::carry_on_restored (cognitive 19) crates/rig-ecs/src/restore.rs:569 — rig_ecs::restore::carry_on_restored has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 3 (4 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_ecs::turn::commit_turn_calls (cognitive 18) crates/rig-ecs/src/turn.rs:1202 — rig_ecs::turn::commit_turn_calls has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 3 (7 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_ecs::turn::commit_replies (cognitive 18) crates/rig-ecs/src/turn.rs:1488 — rig_ecs::turn::commit_replies has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_ecs::turn::end_turns (cognitive 18) crates/rig-ecs/src/turn.rs:1532 — rig_ecs::turn::end_turns has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 2 (5 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_ecs::turn::wait_in_order (cognitive 17) crates/rig-ecs/src/turn.rs:1452 — rig_ecs::turn::wait_in_order has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (8 pts), match/switch 1 (4 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_ecs::turn::stop_calls (cognitive 16) crates/rig-ecs/src/turn.rs:1154 — rig_ecs::turn::stop_calls has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 2 (8 pts), if/else 2 (5 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · corpus_base · ×12
  • corpus_base::export::render::walk (cognitive 26) corpus/base/src/export/render.rs:155 — corpus_base::export::render::walk has cognitive complexity 26 (threshold 15). Drivers by points: loops 5 (13 pts), match/switch 3 (7 pts), if/else 3 (6 pts) (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • corpus_base::window_gui::blocks_of (cognitive 25) corpus/base/src/window_gui.rs:402 — corpus_base::window_gui::blocks_of has cognitive complexity 25 (threshold 15). Drivers by points: match/switch 5 (16 pts), loops 3 (7 pts), if/else 1 (2 pts) (nesting depth added 16). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • corpus_base::tool_rate_limit::limit (cognitive 24) corpus/base/src/tool_rate_limit.rs:155 — corpus_base::tool_rate_limit::limit has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_base::loop_breaker::judge (cognitive 22) corpus/base/src/loop_breaker.rs:117 — corpus_base::loop_breaker::judge has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 1 (4 pts), loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_base::session_replay::answer_from_record (cognitive 22) corpus/base/src/session_replay.rs:994 — corpus_base::session_replay::answer_from_record has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (16 pts), match/switch 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_base::debate::step (cognitive 21) corpus/base/src/debate.rs:411 — corpus_base::debate::step has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (17 pts), loops 1 (2 pts), match/switch 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • corpus_base::long_term_memory::recall (cognitive 19) corpus/base/src/long_term_memory.rs:385 — corpus_base::long_term_memory::recall has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_base::summarize_tool_output::summarize (cognitive 19) corpus/base/src/summarize_tool_output.rs:163 — corpus_base::summarize_tool_output::summarize has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_base::http_api::server::read_request (cognitive 17) corpus/base/src/http_api/server.rs:282 — corpus_base::http_api::server::read_request has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 2 (5 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_base::share::render::render (cognitive 17) corpus/base/src/share/render.rs:21 — corpus_base::share::render::render has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 3 (10 pts), loops 3 (7 pts) (nesting depth added 11). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • corpus_base::context_inspector::report (cognitive 16) corpus/base/src/context_inspector.rs:470 — corpus_base::context_inspector::report has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 4 (5 pts), match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_base::supervisor::count_calls (cognitive 16) corpus/base/src/supervisor.rs:297 — corpus_base::supervisor::count_calls has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D30 · Dependency Vulnerabilities · Medium advisory (unsound) · ×12
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D2 · Cognitive Complexity · rig_cassette · ×11
  • rig_cassette::scrub::capture_format (cognitive 45) crates/rig-cassette/src/scrub.rs:525 — rig_cassette::scrub::capture_format has cognitive complexity 45 (threshold 15). Drivers by points: if/else 25 (29 pts), boolean chains 16 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • rig_cassette::traffic::line::line (cognitive 44) crates/rig-cassette/src/traffic/line.rs:29 — rig_cassette::traffic::line::line has cognitive complexity 44 (threshold 15). Drivers by points: if/else 19 (33 pts), match/switch 5 (8 pts), boolean chains 2, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_cassette::scrub::multipart_slices (cognitive 37) crates/rig-cassette/src/scrub.rs:2811 — rig_cassette::scrub::multipart_slices has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (27 pts), boolean chains 9, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_cassette::http::replay_request (cognitive 26) crates/rig-cassette/src/http/mod.rs:1557 — rig_cassette::http::replay_request has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (17 pts), match/switch 3 (5 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_cassette::http::proxy::drained (cognitive 20) crates/rig-cassette/src/http/proxy.rs:171 — rig_cassette::http::proxy::drained has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 2 (5 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_cassette::scrub::mask_form_value (cognitive 20) crates/rig-cassette/src/scrub.rs:2299 — rig_cassette::scrub::mask_form_value has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 5 (6 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_cassette::scrub::scrub_query_params_in_text (cognitive 19) crates/rig-cassette/src/scrub.rs:1936 — rig_cassette::scrub::scrub_query_params_in_text has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_cassette::scrub::url_spans (cognitive 18) crates/rig-cassette/src/scrub.rs:2394 — rig_cassette::scrub::url_spans has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_cassette::scrub::parse_sse_chunks (cognitive 18) crates/rig-cassette/src/scrub.rs:2603 — rig_cassette::scrub::parse_sse_chunks has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 2, loops 2, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_cassette::http::snapshot::apply_change (cognitive 17) crates/rig-cassette/src/http/snapshot.rs:464 — rig_cassette::http::snapshot::apply_change has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 2 (3 pts) (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • rig_cassette::http::ledger::clean_up (cognitive 16) crates/rig-cassette/src/http/ledger.rs:516 — rig_cassette::http::ledger::clean_up has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 4 (11 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×11
  • Duplicated block (9 lines × 2) corpus/base/src/output_truncate.rs:243 — corpus/base/src/output_truncate.rs:243-251 | corpus/base/src/summarize_tool_output.rs:324-332 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (9 lines × 2) corpus/sn/src/terminal_sessions.rs:384 — corpus/sn/src/terminal_sessions.rs:384-392 | corpus/sn/src/terminal_sessions.rs:487-495 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) crates/rig-bedrock/src/options.rs:36 — crates/rig-bedrock/src/options.rs:36-44 | crates/rig-core/src/providers/anthropic/options.rs:33-41 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) crates/rig-core/src/operation/completion.rs:1281 — crates/rig-core/src/operation/completion.rs:1281-1289 | test-support/rig-test-support/src/citations.rs:86-94 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) crates/rig-core/src/providers/chatgpt/extension.rs:119 — crates/rig-core/src/providers/chatgpt/extension.rs:119-127 | crates/rig-core/src/providers/openai/extension/mod.rs:301-309 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) crates/rig-rmcp/src/native.rs:184 — crates/rig-rmcp/src/native.rs:184-192 | crates/rig-sqlite/src/lib.rs:1194-1202 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) crates/rig-core/src/completion/request.rs:519 — crates/rig-core/src/completion/request.rs:519-527 | crates/rig-core/src/test_utils/streaming_conformance.rs:551-559 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) test-support/rig-test-support/src/reasoning.rs:291 — test-support/rig-test-support/src/reasoning.rs:291-299 | test-support/rig-test-support/src/reasoning.rs:377-385 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) crates/rig-agent/src/test_utils/model_conformance.rs:1478 — crates/rig-agent/src/test_utils/model_conformance.rs:1478-1486 | crates/rig-agent/src/test_utils/model_conformance.rs:1492-1501 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) test-support/rig-test-support/src/history_survival/adversarial.rs:34 — test-support/rig-test-support/src/history_survival/adversarial.rs:34-42 | test-support/rig-test-support/src/history_survival/sessions.rs:39-48 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (9 lines × 2) crates/rig-core/src/test_utils/streaming_conformance.rs:992 — crates/rig-core/src/test_utils/streaming_conformance.rs:992-1000 | crates/rig-core/src/test_utils/streaming_conformance.rs:1089-1097 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D2 · Cognitive Complexity · corpus_ho · ×10
  • corpus_ho::session_recall::docs (cognitive 49) corpus/ho/src/session_recall.rs:479 — corpus_ho::session_recall::docs has cognitive complexity 49 (threshold 15). Drivers by points: match/switch 5 (25 pts), if/else 2 (12 pts), loops 4 (11 pts), boolean chains 1 (nesting depth added 37). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • corpus_ho::stale_read_elision::elide (cognitive 24) corpus/ho/src/stale_read_elision.rs:221 — corpus_ho::stale_read_elision::elide has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_ho::hunk_review::revert (cognitive 23) corpus/ho/src/hunk_review.rs:381 — corpus_ho::hunk_review::revert has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 4, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • corpus_ho::working_set_carryover::track (cognitive 23) corpus/ho/src/working_set_carryover.rs:115 — corpus_ho::working_set_carryover::track has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 2 (5 pts), loops 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_ho::hunk_review::review (cognitive 20) corpus/ho/src/hunk_review.rs:457 — corpus_ho::hunk_review::review has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 4 (8 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_ho::dry_run::dry_run (cognitive 18) corpus/ho/src/dry_run.rs:347 — corpus_ho::dry_run::dry_run has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 1, match/switch 1 (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • corpus_ho::stale_read_elision::stubs (cognitive 18) corpus/ho/src/stale_read_elision.rs:162 — corpus_ho::stale_read_elision::stubs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 2 (8 pts), loops 3 (7 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_ho::conversation_surgery::plan_drop (cognitive 17) corpus/ho/src/conversation_surgery.rs:327 — corpus_ho::conversation_surgery::plan_drop has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2, match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_ho::submit_result::judge (cognitive 17) corpus/ho/src/submit_result.rs:259 — corpus_ho::submit_result::judge has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_ho::dry_run::preview (cognitive 16) corpus/ho/src/dry_run.rs:179 — corpus_ho::dry_run::preview has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), match/switch 2 (4 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · corpus_ct · ×9
  • corpus_ct::git_guardrails::shell::lex (cognitive 39) corpus/ct/src/git_guardrails/shell.rs:146 — corpus_ct::git_guardrails::shell::lex has cognitive complexity 39 (threshold 15). Drivers by points: match/switch 4 (14 pts), loops 5 (13 pts), if/else 4 (11 pts), boolean chains 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_ct::status_command::clean (cognitive 33) corpus/ct/src/status_command.rs:469 — corpus_ct::status_command::clean has cognitive complexity 33 (threshold 15). Drivers by points: if/else 3 (16 pts), loops 3 (9 pts), match/switch 2 (5 pts), boolean chains 3 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_ct::git_history_tools::blamed (cognitive 26) corpus/ct/src/git_history_tools.rs:525 — corpus_ct::git_history_tools::blamed has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (20 pts), match/switch 1 (3 pts), loops 2, boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_ct::schema_adapter::schema::flatten (cognitive 24) corpus/ct/src/schema_adapter/schema.rs:160 — corpus_ct::schema_adapter::schema::flatten has cognitive complexity 24 (threshold 15). Drivers by points: match/switch 4 (9 pts), loops 3 (7 pts), if/else 4 (6 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_ct::paste_chips::send_contents (cognitive 22) corpus/ct/src/paste_chips.rs:641 — corpus_ct::paste_chips::send_contents has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (5 pts), match/switch 2 (5 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_ct::conversation_chapters::fold_in_requests (cognitive 20) corpus/ct/src/conversation_chapters.rs:889 — corpus_ct::conversation_chapters::fold_in_requests has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_ct::reply_review_comments::comment (cognitive 19) corpus/ct/src/reply_review_comments.rs:354 — corpus_ct::reply_review_comments::comment has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 4, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_ct::process_reaper::after_turn (cognitive 17) corpus/ct/src/process_reaper.rs:350 — corpus_ct::process_reaper::after_turn has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 2, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • corpus_ct::provider_side_tools::note_provider_runs (cognitive 16) corpus/ct/src/provider_side_tools.rs:410 — corpus_ct::provider_side_tools::note_provider_runs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D3 · God Classes · TooManyMethods · ×9
  • TooManyMethods: AgentRun crates/rig-agent/src/run/mod.rs:304 — TooManyMethods — 70 methods. The bar is 30 methods; this is 40 over it, 2.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Conversation crates/rig-core/src/conversation/mod.rs:85 — TooManyMethods — 59 methods, declared across 2 files: conversation/mod.rs (56), conversation/turn.rs (3). The bar is 30 methods; this is 29 over it, 1.97× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AgentRunner crates/rig-agent/src/agent/runner.rs:54 — TooManyMethods — 49 methods, declared across 2 files: agent/runner.rs (45), agent/streaming.rs (4). The bar is 30 methods; this is 19 over it, 1.63× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Scrubber crates/rig-cassette/src/scrub.rs:181 — TooManyMethods — 45 methods, declared across 2 files: src/scrub.rs (41), http/mod.rs (4). The bar is 30 methods; this is 15 over it, 1.50× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AgentBuilder crates/rig-agent/src/agent/builder.rs:115 — TooManyMethods — 43 methods. The bar is 30 methods; this is 13 over it, 1.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: OpenAIConfig crates/rig-core/src/providers/openai/wire.rs:580 — TooManyMethods — 42 methods, declared across 4 files: openai/wire.rs (24), wire/modality.rs (10), wire/auth.rs (6), client/openai.rs (2). The bar is 30 methods; this is 12 over it, 1.40× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: CompletionRequest crates/rig-core/src/completion/request.rs:1202 — TooManyMethods — 39 methods, declared across 2 files: completion/request.rs (38), completion/prompt.rs (1). The bar is 30 methods; this is 9 over it, 1.30× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Editor plugins/rig-tui/src/editor.rs:51 — TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ToolExecutionError crates/rig-core/src/tool/result.rs:136 — TooManyMethods — 32 methods, declared across 2 files: tool/result.rs (30), src/error.rs (2). The bar is 30 methods; this is 2 over it, 1.07× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D15 · Churn × Complexity Hotspots · Repeated repair · ×8
  • Repeated repair: crates/rig-tools/src/read.rs crates/rig-tools/src/read.rs:360 — crates/rig-tools/src/read.rs changed 10 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is rig_tools::read::show at line 360), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(tools)!: read returns images, long lines can be read on, a clearer timeout hint (#2913)”; “fix(rig-tools)!: triobench round 8: a read of part of a small remote file gets it whole so an edit after it is one call, an edit's reply shows the changed lines and a few around them (#2860)”; “fix(rig-tools): triobench round 6: shell output drops terminal escape codes, a cut keeps the first and last errors, a remote write cut off mid-way says whether it happened, an edit after a write is one call (#2858)”; “fix(rig-tools): triobench round 4: edits apply in order, an edit of a file seen whole is one transport call, a stopped command says how it was stopped (#2857)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 03:46:29 +00:00' --until='2026-10-27 03:46:29 +00:00' --full-history --no-merges -- crates/rig-tools/src/read.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: crates/rig-tools/src/remote.rs crates/rig-tools/src/remote.rs:609 — crates/rig-tools/src/remote.rs changed 8 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is Remote::canonical at line 609), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(tools)!: read returns images, long lines can be read on, a clearer timeout hint (#2913)”; “fix(rig-tools)!: triobench round 8: a read of part of a small remote file gets it whole so an edit after it is one call, an edit's reply shows the changed lines and a few around them (#2860)”; “fix(rig-tools): triobench round 6: shell output drops terminal escape codes, a cut keeps the first and last errors, a remote write cut off mid-way says whether it happened, an edit after a write is one call (#2858)”; “fix(rig-tools): triobench round 4: edits apply in order, an edit of a file seen whole is one transport call, a stopped command says how it was stopped (#2857)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 03:46:29 +00:00' --until='2026-10-27 03:46:29 +00:00' --full-history --no-merges -- crates/rig-tools/src/remote.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: crates/rig-tools/src/workspace.rs crates/rig-tools/src/workspace.rs:385 — crates/rig-tools/src/workspace.rs changed 8 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is rig_tools::workspace::text_error at line 385), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(tools)!: read returns images, long lines can be read on, a clearer timeout hint (#2913)”; “fix(rig-tools)!: triobench round 8: a read of part of a small remote file gets it whole so an edit after it is one call, an edit's reply shows the changed lines and a few around them (#2860)”; “fix(rig-tools): triobench round 4: edits apply in order, an edit of a file seen whole is one transport call, a stopped command says how it was stopped (#2857)”; “fix(rig-tools): triobench round 3: one transport call per remote write, remote reads sent only their lines, killed commands name the signal (#2855)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 03:46:29 +00:00' --until='2026-10-27 03:46:29 +00:00' --full-history --no-merges -- crates/rig-tools/src/workspace.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: crates/rig-tools/src/attach.rs crates/rig-tools/src/attach.rs:63 — crates/rig-tools/src/attach.rs changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is rig_tools::attach::attachments at line 63), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(tools)!: read returns images, long lines can be read on, a clearer timeout hint (#2913)”; “fix(tui)!: prompt history per project, the shown conversation's prompts first (#2916)”; “fix(agent)!: a failed message goes back into the input (#2895)”; “fix!: everything the pre-0.45 API review found (#2848)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 03:46:29 +00:00' --until='2026-10-27 03:46:29 +00:00' --full-history --no-merges -- crates/rig-tools/src/attach.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: crates/rig-ecs/src/agent.rs crates/rig-ecs/src/agent.rs:452 — crates/rig-ecs/src/agent.rs changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is TurnOutcome::stops at line 452), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(agent)!: Esc keeps the partial reply, /compact keeps history, accurate summaries, ctx ? after compaction (#2918)”; “fix(agent)!: a failed message goes back into the input (#2895)”; “fix(agent): a 64k output budget, unknown-tool feedback, honest failed summaries, ordered headless JSON (#2894)”; “fix!: everything the pre-0.45 API review found (#2848)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 03:46:29 +00:00' --until='2026-10-27 03:46:29 +00:00' --full-history --no-merges -- crates/rig-ecs/src/agent.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: crates/rig-tools/src/lib.rs crates/rig-tools/src/lib.rs:204 — crates/rig-tools/src/lib.rs changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is rig_tools::ago at line 204), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(tools)!: read returns images, long lines can be read on, a clearer timeout hint (#2913)”; “fix(rig-tools)!: triobench round 2: one transport call per remote file operation, a per-host cap and read retries, SIGTERM before SIGKILL, quiet calls, readable cuts, edit misses, long-line reads (#2852)”; “fix(rig)!: triobench round 1: subagent messages and reports, remote HOST:PATH paths, shell streams and cuts, search paths, OSC 133 turn marks (#2849)”; “fix!: everything the pre-0.45 API review found (#2848)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 03:46:29 +00:00' --until='2026-10-27 03:46:29 +00:00' --full-history --no-merges -- crates/rig-tools/src/lib.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: crates/rig-memory/src/store.rs crates/rig-memory/src/store.rs:294 — crates/rig-memory/src/store.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3 (its worst body is rig_memory::store::check_name at line 294), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(agent)!: no self-extension prompt, a resume hint on exit, a session migration chain (#2899)”; “fix!: everything the pre-0.45 API review found (#2848)”; “fix!: API review follow-up: defects, async storage, restored capabilities (#2845)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 03:46:29 +00:00' --until='2026-10-27 03:46:29 +00:00' --full-history --no-merges -- crates/rig-memory/src/store.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: corpus/ct/src/metrics_endpoint.rs corpus/ct/src/metrics_endpoint.rs:298 — corpus/ct/src/metrics_endpoint.rs changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is corpus_ct::metrics_endpoint::gauges at line 298), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(agent)!: Esc keeps the partial reply, /compact keeps history, accurate summaries, ctx ? after compaction (#2918)”; “fix(catalog, compaction): fit models' input limits with simpler overflow recovery (#2880)”; “fix!: everything the pre-0.45 API review found (#2848)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 03:46:29 +00:00' --until='2026-10-27 03:46:29 +00:00' --full-history --no-merges -- corpus/ct/src/metrics_endpoint.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
D2 · Cognitive Complexity · corpus_sp · ×8
  • corpus_sp::dead_ends_ledger::review_shell (cognitive 32) corpus/sp/src/dead_ends_ledger.rs:376 — corpus_sp::dead_ends_ledger::review_shell has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (24 pts), boolean chains 3, loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_sp::structured_config_edit::key::parse (cognitive 25) corpus/sp/src/structured_config_edit/key.rs:49 — corpus_sp::structured_config_edit::key::parse has cognitive complexity 25 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (7 pts), match/switch 2 (6 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_sp::inbox_folder::start_items (cognitive 22) corpus/sp/src/inbox_folder.rs:363 — corpus_sp::inbox_folder::start_items has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 2 (4 pts), boolean chains 2, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_sp::structured_config_edit::yaml::key_of (cognitive 20) corpus/sp/src/structured_config_edit/yaml.rs:276 — corpus_sp::structured_config_edit::yaml::key_of has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 5, loops 2 (4 pts), match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • corpus_sp::inbox_folder::take_changes (cognitive 19) corpus/sp/src/inbox_folder.rs:219 — corpus_sp::inbox_folder::take_changes has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_sp::output_styles::read_styles (cognitive 17) corpus/sp/src/output_styles.rs:202 — corpus_sp::output_styles::read_styles has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 2 (7 pts), if/else 2 (6 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_sp::shell_env_policy::referenced (cognitive 16) corpus/sp/src/shell_env_policy.rs:489 — corpus_sp::shell_env_policy::referenced has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 4 (7 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_sp::subagent_result_cache::watch_effect (cognitive 16) corpus/sp/src/subagent_result_cache.rs:322 — corpus_sp::subagent_result_cache::watch_effect has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), match/switch 2 (4 pts), loops 2, boolean chains 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D5 · Coupling · Off the main sequence · ×8
  • Off the main sequence: rig-harness-protocol — rig-harness-protocol: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
  • Off the main sequence: rig-tools — rig-tools: abstractness 0.02, instability 0.10, distance 0.88 — zone of pain — concrete and depended on by 9 project(s), so it's rigid to change.
  • Off the main sequence: rig-core — rig-core: abstractness 0.06, instability 0.09, distance 0.85 — zone of pain — concrete and depended on by 41 project(s), so it's rigid to change.
  • Off the main sequence: rig-memory — rig-memory: abstractness 0.10, instability 0.06, distance 0.84 — zone of pain — concrete and depended on by 16 project(s), so it's rigid to change.
  • Off the main sequence: rig-reqwest — rig-reqwest: abstractness 0.17, instability 0.09, distance 0.74 — zone of pain — concrete and depended on by 10 project(s), so it's rigid to change.
  • Off the main sequence: rig-ecs — rig-ecs: abstractness 0.02, instability 0.25, distance 0.73 — zone of pain — concrete and depended on by 6 project(s), so it's rigid to change.
  • Off the main sequence: rig-tui — rig-tui: abstractness 0.01, instability 0.27, distance 0.73 — zone of pain — concrete and depended on by 11 project(s), so it's rigid to change.
  • Off the main sequence: rig-http — rig-http: abstractness 0.30, instability 0.00, distance 0.70 — zone of pain — concrete and depended on by 6 project(s), so it's rigid to change.
D6 · Cohesion (LCOM4) · Low cohesion · ×8
  • Low cohesion: ModelSpec (LCOM4 8) crates/rig-core/src/catalog/spec.rs:44 — ModelSpec's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Messages (LCOM4 7) crates/rig-core/src/providers/anthropic/wire.rs:506 — Messages's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: CompletionRequest (LCOM4 6) crates/rig-core/src/completion/request.rs:1202 — CompletionRequest's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: NewCachedContent (LCOM4 5) crates/rig-core/src/providers/gemini/cached_content.rs:94 — NewCachedContent's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: BedrockRuntime (LCOM4 4) crates/rig-bedrock/src/client.rs:59 — BedrockRuntime's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Responses (LCOM4 4) crates/rig-core/src/providers/openai/responses_api/wire.rs:27 — Responses's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Descriptor (LCOM4 4) crates/rig-core/src/wire.rs:483 — Descriptor's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: ReqwestClient (LCOM4 4) crates/rig-reqwest/src/lib.rs:45 — ReqwestClient's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
D1 · Cyclomatic Complexity · corpus_sn · ×7
  • corpus_sn::vim_input::editor::parse (cyclomatic 29) corpus/sn/src/vim_input/editor.rs:409 — corpus_sn::vim_input::editor::parse has cyclomatic complexity 29 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • corpus_sn::crash_resume::recover (cyclomatic 20) corpus/sn/src/crash_resume.rs:220 — corpus_sn::crash_resume::recover has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • corpus_sn::model_params::check (cyclomatic 18) corpus/sn/src/model_params.rs:350 — corpus_sn::model_params::check has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • corpus_sn::vim_input::edit (cyclomatic 18) corpus/sn/src/vim_input.rs:148 — corpus_sn::vim_input::edit has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • corpus_sn::crash_resume::resolve (cyclomatic 17) corpus/sn/src/crash_resume.rs:429 — corpus_sn::crash_resume::resolve has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • corpus_sn::vim_input::editor::target (cyclomatic 17) corpus/sn/src/vim_input/editor.rs:561 — corpus_sn::vim_input::editor::target has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • corpus_sn::sessions_prune_cli::plan (cyclomatic 16) corpus/sn/src/sessions_prune_cli.rs:347 — corpus_sn::sessions_prune_cli::plan has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D2 · Cognitive Complexity · rig_basics · ×7
  • rig_basics::compaction::compact_near_the_window (cognitive 41) plugins/rig-basics/src/compaction.rs:948 — rig_basics::compaction::compact_near_the_window has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (24 pts), match/switch 3 (9 pts), boolean chains 7, loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_basics::print::drive (cognitive 31) plugins/rig-basics/src/print.rs:542 — rig_basics::print::drive has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (19 pts), match/switch 3 (6 pts), boolean chains 4, loops 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_basics::subagents::spawn::inherit_settings (cognitive 17) plugins/rig-basics/src/subagents/spawn.rs:265 — rig_basics::subagents::spawn::inherit_settings has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 4, loops 2 (3 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_basics::compaction::recover_from_overflow (cognitive 16) plugins/rig-basics/src/compaction.rs:1133 — rig_basics::compaction::recover_from_overflow has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 4, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_basics::compaction::retry_compaction_calls (cognitive 16) plugins/rig-basics/src/compaction.rs:1208 — rig_basics::compaction::retry_compaction_calls has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_basics::session_picker::preview (cognitive 16) plugins/rig-basics/src/session_picker.rs:587 — rig_basics::session_picker::preview has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 2 (4 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_basics::skills::discover (cognitive 16) plugins/rig-basics/src/skills.rs:146 — rig_basics::skills::discover has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 2 (7 pts), if/else 2 (6 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D3 · God Classes · ClassTooLong · ×7
  • ClassTooLong: Scrubber crates/rig-cassette/src/scrub.rs:181 — ClassTooLong — 873 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 45 methods, 2 blocks, lines 181-1892. The bar is 400 significant lines; this is 473 over it, 2.18× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AgentRun crates/rig-agent/src/run/mod.rs:304 — ClassTooLong — 779 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 70 methods, 4 blocks, lines 304-1761. The bar is 400 significant lines; this is 379 over it, 1.95× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Conversation crates/rig-core/src/conversation/mod.rs:85 — ClassTooLong — 552 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 59 methods, 4 blocks, lines 85-1376. The bar is 400 significant lines; this is 152 over it, 1.38× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ReplyFold crates/rig-core/src/operation/completion.rs:257 — ClassTooLong — 549 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 25 methods, 3 blocks, lines 257-1350. The bar is 400 significant lines; this is 149 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ChatDecoder crates/rig-core/src/providers/openai/wire/chat.rs:1164 — ClassTooLong — 438 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 19 methods, 4 blocks, lines 1164-1932. The bar is 400 significant lines; this is 38 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Chat crates/rig-core/src/providers/openai/wire/chat.rs:41 — ClassTooLong — 411 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 8 methods, 4 blocks, lines 41-1009. The bar is 400 significant lines; this is 11 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Job corpus/fh/src/lsp_tools.rs:397 — ClassTooLong — 401 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 18 methods, 2 blocks, lines 397-946. The bar is 400 significant lines; this is 1 over it, 1.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D35 · Change Coupling · Change coupling · ×7
  • Change coupling: lib.rs ↔ lib.rs crates/rig-postgres/src/lib.rs:1 — `crates/rig-postgres/src/lib.rs` and `crates/rig-scylladb/src/lib.rs` change together 69% of the time (9 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `bdd1d756` refactor(vector_store)!: tighten the VectorSearchRequest surface (#2683); `f42a7665` refactor(vector-stores)!: drop forwarding layers in vector-store crat…; `10ecfd80` fix: honour the WASM bounds in every vector store (#2545) — run `git show` on any of them.
  • Change coupling: lib.rs ↔ lib.rs crates/rig-scylladb/src/lib.rs:1 — `crates/rig-scylladb/src/lib.rs` and `crates/rig-surrealdb/src/lib.rs` change together 69% of the time (9 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `bdd1d756` refactor(vector_store)!: tighten the VectorSearchRequest surface (#2683); `f42a7665` refactor(vector-stores)!: drop forwarding layers in vector-store crat…; `10ecfd80` fix: honour the WASM bounds in every vector store (#2545) — run `git show` on any of them.
  • Change coupling: mod.rs ↔ streaming.rs crates/rig-core/src/providers/copilot/mod.rs:1 — `crates/rig-core/src/providers/copilot/mod.rs` and `crates/rig-core/src/providers/openai/responses_api/streaming.rs` change together 50% of the time (9 of the 18 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `f885c206` refactor(telemetry): centralize completion span lifecycle (#2115); `73a39fcb` feat(openai): expose complete Responses reasoning metadata (#2112); `02b81bd8` feat(openai): support GPT-5.6 models and reasoning controls (#2106) — run `git show` on any of them.
  • Change coupling: streaming.rs ↔ streaming.rs crates/rig-bedrock/src/streaming.rs:1 — `crates/rig-bedrock/src/streaming.rs` and `crates/rig-core/src/providers/anthropic/streaming.rs` change together 50% of the time (8 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `f885c206` refactor(telemetry): centralize completion span lifecycle (#2115); `1d411185` refactor(rig-core): replace nanoid with fastrand for internal IDs (#1…; `019b551f` refactor: typed reasoning content model (#1395) (at that commit the files were still `rig-integrations/rig-bedrock/src/streaming.rs` and `rig/rig-core/src/providers/anthropic/streaming.rs`) — run `git show` on any of them.
  • Change coupling: lib.rs ↔ lib.rs crates/rig-lancedb/src/lib.rs:1 — `crates/rig-lancedb/src/lib.rs` and `crates/rig-surrealdb/src/lib.rs` change together 50% of the time (7 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `10ecfd80` fix: honour the WASM bounds in every vector store (#2545); `235e3838` refactor: ownership sweep round 4 — avoidable clones, dead public ite…; `9b903e18` feat: improve vector store documentation and filter ergonomics (break… (at that commit the files were still `rig-integrations/rig-lancedb/src/lib.rs` and `rig-integrations/rig-surrealdb/src/lib.rs`) — run `git show` on any of them.
  • Change coupling: streaming.rs ↔ streaming.rs crates/rig-bedrock/src/streaming.rs:1 — `crates/rig-bedrock/src/streaming.rs` and `crates/rig-core/src/providers/cohere/streaming.rs` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `f885c206` refactor(telemetry): centralize completion span lifecycle (#2115); `1d411185` refactor(rig-core): replace nanoid with fastrand for internal IDs (#1…; `ac5ac622` feat(tools): adds internal tool call id (breaking) (#1311) (at that commit the files were still `rig-integrations/rig-bedrock/src/streaming.rs` and `rig/rig-core/src/providers/cohere/streaming.rs`) — run `git show` on any of them.
  • Change coupling: mod.rs ↔ ollama.rs crates/rig-core/src/providers/gemini/interactions_api/mod.rs:1 — `crates/rig-core/src/providers/gemini/interactions_api/mod.rs` and `crates/rig-core/src/providers/ollama.rs` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `7d30a176` refactor: share the tool-id spelling loop across request builders (#2…; `897e6275` refactor: consolidate provider schema/normalization and agent plumbin…; `2c22e181` cleanup: post-Vec-migration precision and the pre-Vec serde accommoda… — run `git show` on any of them.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×7
  • Duplicated block (10 lines × 2) corpus/base/src/check_after_turn.rs:273 — corpus/base/src/check_after_turn.rs:273-282 | corpus/ho/src/background_verify.rs:267-276 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) corpus/ct/src/process_reaper.rs:741 — corpus/ct/src/process_reaper.rs:741-750 | corpus/ct/src/process_reaper.rs:776-785 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) corpus/oc/src/dataset_cli.rs:219 — corpus/oc/src/dataset_cli.rs:219-228 | corpus/sn/src/usage_report_cli.rs:92-101 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) crates/rig-core/src/operation/completion.rs:851 — crates/rig-core/src/operation/completion.rs:851-860 | crates/rig-core/src/operation/completion.rs:907-916 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) crates/rig-core/src/providers/openai/options.rs:1357 — crates/rig-core/src/providers/openai/options.rs:1357-1366 | crates/rig-core/src/providers/openai/options.rs:1468-1477 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) crates/rig-milvus/src/lib.rs:188 — crates/rig-milvus/src/lib.rs:188-197 | crates/rig-milvus/src/lib.rs:229-238 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) test-support/rig-test-support/src/reasoning.rs:679 — test-support/rig-test-support/src/reasoning.rs:679-688 | test-support/rig-test-support/src/reasoning.rs:725-734 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×7
  • Duplicated block (5 lines × 3) corpus/ct/src/conversation_chapters.rs:814 — corpus/ct/src/conversation_chapters.rs:814-818 | corpus/ho/src/auto_session_name.rs:144-148 | corpus/oc/src/away_recap.rs:336-340 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (5 lines × 3) crates/rig-core/src/providers/cohere/chat.rs:239 — crates/rig-core/src/providers/cohere/chat.rs:239-244 | crates/rig-core/src/providers/ollama/chat.rs:334-338 | crates/rig-core/src/providers/openai/wire/chat.rs:601-605 — `crates/rig-core/src/providers/cohere/chat.rs` and `crates/rig-core/src/providers/ollama/chat.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 30 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (5 lines × 3) corpus/base/src/files_panel.rs:136 — corpus/base/src/files_panel.rs:136-140 | corpus/ho/src/hunk_review.rs:217-221 | corpus/ho/src/working_set_carryover.rs:319-323 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (5 lines × 3) crates/rig-core/src/providers/cohere/embeddings.rs:117 — crates/rig-core/src/providers/cohere/embeddings.rs:117-121 | crates/rig-core/src/providers/ollama/embedding.rs:91-95 | crates/rig-core/src/providers/voyageai/wire.rs:165-169 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (5 lines × 3) crates/rig-tools/src/delete.rs:79 — crates/rig-tools/src/delete.rs:79-83 | crates/rig-tools/src/edit.rs:153-157 | crates/rig-tools/src/write.rs:93-97 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (5 lines × 3) crates/rig-core/src/providers/anthropic/options.rs:320 — crates/rig-core/src/providers/anthropic/options.rs:320-324 | crates/rig-core/src/providers/openai/options.rs:1114-1118 | crates/rig-core/src/providers/openai/options.rs:1246-1250 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (5 lines × 3) crates/rig-core/src/providers/openai/options.rs:1120 — crates/rig-core/src/providers/openai/options.rs:1120-1124 | crates/rig-core/src/providers/openai/options.rs:1153-1157 | crates/rig-core/src/providers/openai/options.rs:1180-1184 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D1 · Cyclomatic Complexity · rig_claude_cloak · ×6
  • rig_claude_cloak::transport::body (cyclomatic 44) plugins/rig-claude-cloak/src/transport.rs:625 — rig_claude_cloak::transport::body has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rig_claude_cloak::schema::upgrade (cyclomatic 39) plugins/rig-claude-cloak/src/schema.rs:646 — rig_claude_cloak::schema::upgrade has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rig_claude_cloak::transport::prompt_caching (cyclomatic 39) plugins/rig-claude-cloak/src/transport.rs:451 — rig_claude_cloak::transport::prompt_caching has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rig_claude_cloak::schema::normalize (cyclomatic 28) plugins/rig-claude-cloak/src/schema.rs:116 — rig_claude_cloak::schema::normalize has cyclomatic complexity 28 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • rig_claude_cloak::schema::postprocess (cyclomatic 26) plugins/rig-claude-cloak/src/schema.rs:477 — rig_claude_cloak::schema::postprocess has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rig_claude_cloak::schema::strict_schema (cyclomatic 25) plugins/rig-claude-cloak/src/schema.rs:304 — rig_claude_cloak::schema::strict_schema has cyclomatic complexity 25 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · xtask · ×6
  • xtask::verify::selection::plan (cyclomatic 43) xtask/src/verify/selection.rs:248 — xtask::verify::selection::plan has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • xtask::verify::execute::internal (cyclomatic 28) xtask/src/verify/execute.rs:40 — xtask::verify::execute::internal has cyclomatic complexity 28 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • xtask::cassette::scan::scan (cyclomatic 27) xtask/src/cassette/scan.rs:112 — xtask::cassette::scan::scan has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • xtask::cassette::scan::key_shape (cyclomatic 21) xtask/src/cassette/scan.rs:38 — xtask::cassette::scan::key_shape has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
  • xtask::catalog::pin (cyclomatic 21) xtask/src/catalog.rs:440 — xtask::catalog::pin has cyclomatic complexity 21 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • xtask::verify::preflight::run (cyclomatic 19) xtask/src/verify/preflight.rs:10 — xtask::verify::preflight::run has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · corpus_fh · ×6
  • corpus_fh::editor_front::receive (cyclomatic 32) corpus/fh/src/editor_front.rs:545 — corpus_fh::editor_front::receive has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • corpus_fh::import_sessions::parse::claude_code (cyclomatic 20) corpus/fh/src/import_sessions/parse.rs:299 — corpus_fh::import_sessions::parse::claude_code has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • corpus_fh::apply_patch_tool::patch::parse (cyclomatic 19) corpus/fh/src/apply_patch_tool/patch.rs:162 — corpus_fh::apply_patch_tool::patch::parse has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • corpus_fh::prompt_cache_shaping::shape (cyclomatic 19) corpus/fh/src/prompt_cache_shaping.rs:155 — corpus_fh::prompt_cache_shaping::shape has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • corpus_fh::apply_patch_tool::patch::check (cyclomatic 18) corpus/fh/src/apply_patch_tool/patch.rs:50 — corpus_fh::apply_patch_tool::patch::check has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • corpus_fh::apply_patch_tool::gate_together (cyclomatic 17) corpus/fh/src/apply_patch_tool.rs:321 — corpus_fh::apply_patch_tool::gate_together has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D2 · Cognitive Complexity · Scrubber · ×6
  • Scrubber::scrub_sse_body (cognitive 41) crates/rig-cassette/src/scrub.rs:1495 — Scrubber::scrub_sse_body has cognitive complexity 41 (threshold 15). Drivers by points: if/else 8 (26 pts), loops 3 (8 pts), match/switch 2 (5 pts), boolean chains 2 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Scrubber::scrub_json_in (cognitive 38) crates/rig-cassette/src/scrub.rs:1659 — Scrubber::scrub_json_in has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 4 (10 pts), boolean chains 6, match/switch 1 (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • Scrubber::learn_json_in (cognitive 29) crates/rig-cassette/src/scrub.rs:1301 — Scrubber::learn_json_in has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 3 (7 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • Scrubber::learn_body_parts (cognitive 20) crates/rig-cassette/src/scrub.rs:863 — Scrubber::learn_body_parts has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (7 pts), match/switch 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Scrubber::learn_header (cognitive 19) crates/rig-cassette/src/scrub.rs:1175 — Scrubber::learn_header has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Scrubber::scrub_text (cognitive 17) crates/rig-cassette/src/scrub.rs:1748 — Scrubber::scrub_text has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3, boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · rig_tools · ×6
  • rig_tools::process::forward_both (cognitive 39) crates/rig-tools/src/process.rs:298 — rig_tools::process::forward_both has cognitive complexity 39 (threshold 15). Drivers by points: if/else 8 (27 pts), loops 4 (8 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_tools::edit::apply_to (cognitive 29) crates/rig-tools/src/edit.rs:404 — rig_tools::edit::apply_to has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (24 pts), loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_tools::search::find (cognitive 25) crates/rig-tools/src/search.rs:279 — rig_tools::search::find has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_tools::attach::attachments (cognitive 19) crates/rig-tools/src/attach.rs:63 — rig_tools::attach::attachments has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_tools::edit::around (cognitive 18) crates/rig-tools/src/edit.rs:240 — rig_tools::edit::around has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (4 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_tools::watch::send_batches (cognitive 18) crates/rig-tools/src/watch.rs:211 — rig_tools::watch::send_batches has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (5 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D3 · God Classes · MethodTooLong · ×6
  • MethodTooLong: StreamingTurnSource.run_model_turn crates/rig-agent/src/agent/engine.rs:703 — MethodTooLong — run_model_turn runs 244 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 144 over it, 2.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: OAuthTransport.prepare plugins/rig-claude-cloak/src/transport.rs:889 — MethodTooLong — prepare runs 138 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 38 over it, 1.38× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: QdrantFilter.interpret crates/rig-qdrant/src/filter.rs:137 — MethodTooLong — interpret runs 127 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 27 over it, 1.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AgentRun.next_step crates/rig-agent/src/run/mod.rs:852 — MethodTooLong — next_step runs 126 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 26 over it, 1.26× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Responses.base crates/rig-core/src/providers/openai/responses_api/mod.rs:469 — MethodTooLong — base runs 121 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 21 over it, 1.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: CacheBook.plan crates/rig-core/src/providers/gemini/caching.rs:737 — MethodTooLong — plan runs 108 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 8 over it, 1.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D1 · Cyclomatic Complexity · rig_tui · ×5
  • rig_tui::input::act (cyclomatic 48) plugins/rig-tui/src/input.rs:659 — rig_tui::input::act has cyclomatic complexity 48 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • rig_tui::render::lay_out_transcript (cyclomatic 29) plugins/rig-tui/src/render.rs:647 — rig_tui::render::lay_out_transcript has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rig_tui::transcript::message_lines (cyclomatic 28) plugins/rig-tui/src/transcript.rs:1553 — rig_tui::transcript::message_lines has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rig_tui::pane::lay_out_panes (cyclomatic 20) plugins/rig-tui/src/pane.rs:207 — rig_tui::pane::lay_out_panes has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rig_tui::input::read_input (cyclomatic 19) plugins/rig-tui/src/input.rs:448 — rig_tui::input::read_input has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D2 · Cognitive Complexity · rig · ×5
  • rig::launcher::run::launch (cognitive 84) src/launcher/run.rs:196 — rig::launcher::run::launch has cognitive complexity 84 (threshold 15). Drivers by points: if/else 27 (62 pts), boolean chains 13, loops 3 (6 pts), match/switch 1 (3 pts) (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig::launcher::locks::sweep (cognitive 26) src/launcher/locks.rs:46 — rig::launcher::locks::sweep has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig::launcher::plugin_list::parse (cognitive 17) src/launcher/plugin_list.rs:397 — rig::launcher::plugin_list::parse has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig::launcher::plugin_list::entries (cognitive 16) src/launcher/plugin_list.rs:315 — rig::launcher::plugin_list::entries has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig::launcher::plugin_list::parse_string (cognitive 16) src/launcher/plugin_list.rs:520 — rig::launcher::plugin_list::parse_string has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), match/switch 2 (5 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · rig_candle · ×5
  • rig_candle::protocol::render_qwen_message (cognitive 69) crates/rig-candle/src/protocol.rs:518 — rig_candle::protocol::render_qwen_message has cognitive complexity 69 (threshold 15). Drivers by points: if/else 10 (38 pts), match/switch 6 (20 pts), loops 3 (8 pts), boolean chains 3 (nesting depth added 47). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • rig_candle::protocol::validate_protocol_inputs (cognitive 29) crates/rig-candle/src/protocol.rs:97 — rig_candle::protocol::validate_protocol_inputs has cognitive complexity 29 (threshold 15). Drivers by points: match/switch 4 (16 pts), loops 5 (13 pts) (nesting depth added 20). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • rig_candle::protocol::render_qwen3 (cognitive 24) crates/rig-candle/src/protocol.rs:410 — rig_candle::protocol::render_qwen3 has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 5 (11 pts), match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_candle::protocol::parse_qwen3_assistant (cognitive 22) crates/rig-candle/src/protocol.rs:690 — rig_candle::protocol::parse_qwen3_assistant has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 5, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_candle::validation::validate_model_config (cognitive 17) crates/rig-candle/src/validation.rs:40 — rig_candle::validation::validate_model_config has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · corpus_library · ×5
  • corpus_library::transcript_import_library::import (cognitive 42) corpus/library/src/transcript_import_library.rs:230 — corpus_library::transcript_import_library::import has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (23 pts), match/switch 5 (12 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_library::session_edit_library::conversation_markdown (cognitive 30) corpus/library/src/session_edit_library.rs:735 — corpus_library::session_edit_library::conversation_markdown has cognitive complexity 30 (threshold 15). Drivers by points: match/switch 4 (15 pts), if/else 3 (8 pts), loops 3 (7 pts) (nesting depth added 20). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • corpus_library::session_compare_library::excerpt (cognitive 20) corpus/library/src/session_compare_library.rs:292 — corpus_library::session_compare_library::excerpt has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 4 (8 pts) (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • corpus_library::session_compare_library::render (cognitive 16) corpus/library/src/session_compare_library.rs:348 — corpus_library::session_compare_library::render has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (4 pts), match/switch 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • corpus_library::session_edit_library::save (cognitive 16) corpus/library/src/session_edit_library.rs:585 — corpus_library::session_edit_library::save has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 4 (6 pts) (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×5
  • Duplicated block (11 lines × 2) crates/rig-core/src/providers/gemini/image_generation.rs:279 — crates/rig-core/src/providers/gemini/image_generation.rs:279-289 | crates/rig-core/src/providers/gemini/transcription.rs:104-114 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (11 lines × 2) crates/rig-postgres/src/memory.rs:110 — crates/rig-postgres/src/memory.rs:110-120 | crates/rig-sqlite/src/memory.rs:88-98 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (11 lines × 2) crates/rig-tools/src/process.rs:274 — crates/rig-tools/src/process.rs:274-284 | crates/rig-tools/src/process.rs:354-364 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) crates/rig-agent/src/test_utils/model_conformance.rs:1925 — crates/rig-agent/src/test_utils/model_conformance.rs:1925-1935 | crates/rig-agent/src/test_utils/model_conformance.rs:2074-2084 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) crates/rig-core/src/test_utils/streaming.rs:356 — crates/rig-core/src/test_utils/streaming.rs:356-366 | crates/rig-core/src/test_utils/streaming.rs:368-378 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D1 · Cyclomatic Complexity · rig_cassette · ×4
  • rig_cassette::scrub::capture_format (cyclomatic 36) crates/rig-cassette/src/scrub.rs:525 — rig_cassette::scrub::capture_format has cyclomatic complexity 36 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • rig_cassette::traffic::line::line (cyclomatic 28) crates/rig-cassette/src/traffic/line.rs:29 — rig_cassette::traffic::line::line has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rig_cassette::scrub::multipart_slices (cyclomatic 24) crates/rig-cassette/src/scrub.rs:2811 — rig_cassette::scrub::multipart_slices has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rig_cassette::http::replay_request (cyclomatic 18) crates/rig-cassette/src/http/mod.rs:1557 — rig_cassette::http::replay_request has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · corpus_oc · ×4
  • corpus_oc::steer_and_queue::strip_keys (cyclomatic 25) corpus/oc/src/steer_and_queue.rs:414 — corpus_oc::steer_and_queue::strip_keys has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • corpus_oc::transcript_in_editor::rebuild (cyclomatic 21) corpus/oc/src/transcript_in_editor.rs:499 — corpus_oc::transcript_in_editor::rebuild has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • corpus_oc::dataset_cli::dataset::chat_messages (cyclomatic 20) corpus/oc/src/dataset_cli/dataset.rs:395 — corpus_oc::dataset_cli::dataset::chat_messages has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • corpus_oc::dataset_cli::dataset::session_lines (cyclomatic 16) corpus/oc/src/dataset_cli/dataset.rs:175 — corpus_oc::dataset_cli::dataset::session_lines has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D30 · Dependency Vulnerabilities · Medium CVE · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×4
  • Duplicated block (12 lines × 2) corpus/base/src/custom_provider.rs:190 — corpus/base/src/custom_provider.rs:190-201 | corpus/ho/src/command_provider.rs:215-226 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (12 lines × 2) corpus/ct/src/schema_adapter/schema.rs:379 — corpus/ct/src/schema_adapter/schema.rs:379-390 | corpus/sn/src/web_fetch/policy.rs:126-137 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (12 lines × 2) corpus/fh/src/next_step_suggestions.rs:327 — corpus/fh/src/next_step_suggestions.rs:327-338 | plugins/rig-tui/src/keys.rs:674-685 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (12 lines × 2) corpus/ho/src/conversation_surgery.rs:55 — corpus/ho/src/conversation_surgery.rs:55-66 | corpus/library/src/session_edit_library.rs:463-474 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D1 · Cyclomatic Complexity · rig_agent · ×3
  • rig_agent::agent::engine::drive_agent (cyclomatic 35) crates/rig-agent/src/agent/engine.rs:143 — rig_agent::agent::engine::drive_agent has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rig_agent::run::prepare::prepare_request (cyclomatic 22) crates/rig-agent/src/run/prepare.rs:126 — rig_agent::run::prepare::prepare_request has cyclomatic complexity 22 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • rig_agent::agent::engine::drive_tool_calls (cyclomatic 20) crates/rig-agent/src/agent/engine.rs:482 — rig_agent::agent::engine::drive_tool_calls has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Scrubber · ×3
  • Scrubber::scrub_json_in (cyclomatic 24) crates/rig-cassette/src/scrub.rs:1659 — Scrubber::scrub_json_in has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Scrubber::learn_json_in (cyclomatic 20) crates/rig-cassette/src/scrub.rs:1301 — Scrubber::learn_json_in has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Scrubber::learn_body_parts (cyclomatic 17) crates/rig-cassette/src/scrub.rs:863 — Scrubber::learn_body_parts has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · rig_ecs · ×3
  • rig_ecs::stage::start (cyclomatic 23) crates/rig-ecs/src/stage.rs:1090 — rig_ecs::stage::start has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rig_ecs::turn::commit_turn_calls (cyclomatic 17) crates/rig-ecs/src/turn.rs:1202 — rig_ecs::turn::commit_turn_calls has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • rig_ecs::restore::restore_session (cyclomatic 16) crates/rig-ecs/src/restore.rs:263 — rig_ecs::restore::restore_session has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · rig_basics · ×3
  • rig_basics::compaction::compact_near_the_window (cyclomatic 22) plugins/rig-basics/src/compaction.rs:948 — rig_basics::compaction::compact_near_the_window has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rig_basics::print::drive (cyclomatic 22) plugins/rig-basics/src/print.rs:542 — rig_basics::print::drive has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rig_basics::telemetry::usage::usage (cyclomatic 16) plugins/rig-basics/src/telemetry/usage.rs:218 — rig_basics::telemetry::usage::usage has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Writer · ×3
  • Writer::start (cyclomatic 22) plugins/rig-tui/src/markdown.rs:300 — Writer::start has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • Writer::end (cyclomatic 19) plugins/rig-tui/src/markdown.rs:382 — Writer::end has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Writer::encode (cyclomatic 16) crates/rig-cassette/src/effect_log/jsonl.rs:195 — Writer::encode has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · corpus_ho · ×3
  • corpus_ho::hunk_review::revert (cyclomatic 18) corpus/ho/src/hunk_review.rs:381 — corpus_ho::hunk_review::revert has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • corpus_ho::hunk_review::review (cyclomatic 18) corpus/ho/src/hunk_review.rs:457 — corpus_ho::hunk_review::review has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • corpus_ho::session_recall::docs (cyclomatic 17) corpus/ho/src/session_recall.rs:479 — corpus_ho::session_recall::docs has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D2 · Cognitive Complexity · rig_agent · ×3
  • rig_agent::agent::engine::drive_agent (cognitive 73) crates/rig-agent/src/agent/engine.rs:143 — rig_agent::agent::engine::drive_agent has cognitive complexity 73 (threshold 15). Drivers by points: if/else 15 (37 pts), match/switch 12 (30 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_agent::agent::engine::drive_tool_calls (cognitive 31) crates/rig-agent/src/agent/engine.rs:482 — rig_agent::agent::engine::drive_tool_calls has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (20 pts), match/switch 5 (7 pts), loops 3, boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_agent::run::prepare::prepare_request (cognitive 19) crates/rig-agent/src/run/prepare.rs:126 — rig_agent::run::prepare::prepare_request has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 6, match/switch 4 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · rig_memory · ×3
  • rig_memory::rewrite::map_file (cognitive 26) crates/rig-memory/src/rewrite.rs:351 — rig_memory::rewrite::map_file has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 4 (11 pts), boolean chains 2, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_memory::conformance::races (cognitive 25) crates/rig-memory/src/conformance.rs:276 — rig_memory::conformance::races has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 3 (4 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rig_memory::rewrite::rewrite (cognitive 25) crates/rig-memory/src/rewrite.rs:630 — rig_memory::rewrite::rewrite has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 8, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Editor · ×3
  • Editor::run (cognitive 22) corpus/sn/src/vim_input/editor.rs:181 — Editor::run has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 5 (11 pts), if/else 5 (9 pts), loops 1 (2 pts) (nesting depth added 11). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • Editor::layout (cognitive 18) plugins/rig-tui/src/editor.rs:404 — Editor::layout has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Editor::operate (cognitive 16) corpus/sn/src/vim_input/editor.rs:255 — Editor::operate has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 7 (13 pts), if/else 2 (3 pts) (nesting depth added 7). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · InteractionsDecoder · ×3
  • InteractionsDecoder::delta (cognitive 22) crates/rig-core/src/providers/gemini/interactions_api/streaming.rs:273 — InteractionsDecoder::delta has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 4 (7 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • InteractionsDecoder::decode (cognitive 20) crates/rig-core/src/providers/gemini/interactions_api/streaming.rs:550 — InteractionsDecoder::decode has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 6 (10 pts), if/else 4 (7 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • InteractionsDecoder::stop (cognitive 19) crates/rig-core/src/providers/gemini/interactions_api/streaming.rs:362 — InteractionsDecoder::stop has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (5 pts), boolean chains 1, match/switch 1 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · Writer · ×3
  • Writer::encode (cognitive 20) crates/rig-cassette/src/effect_log/jsonl.rs:195 — Writer::encode has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), match/switch 5 (7 pts), loops 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Writer::end (cognitive 18) plugins/rig-tui/src/markdown.rs:382 — Writer::end has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 1 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • Writer::start (cognitive 16) plugins/rig-tui/src/markdown.rs:300 — Writer::start has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 5 (9 pts), if/else 4 (7 pts) (nesting depth added 7). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×3
  • Members sharing a duplicated core (4 members, 50+ identical tokens) corpus/ct/src/schema_adapter/schema.rs:375 — corpus/ct/src/schema_adapter/schema.rs:375-392 | corpus/ho/src/degenerate_stream_cutter.rs:433-450 | corpus/oc/src/dependency_guard.rs:77-95 | corpus/sn/src/web_fetch/policy.rs:119-139 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/rig-core/src/providers/minimax/extension.rs:158 — crates/rig-core/src/providers/minimax/extension.rs:158-178 | crates/rig-core/src/providers/moonshot/extension.rs:146-166 | crates/rig-core/src/providers/xiaomimimo/extension.rs:67-86 | crates/rig-core/src/providers/zai/extension.rs:170-189 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/rig-core/src/providers/openai/options.rs:914 — crates/rig-core/src/providers/openai/options.rs:914-947 | crates/rig-core/src/providers/openai/options.rs:1075-1103 | crates/rig-core/src/providers/openai/options.rs:1105-1129 | crates/rig-core/src/providers/openai/options.rs:1131-1162 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D1 · Cyclomatic Complexity · rig · ×2
  • rig::launcher::run::launch (cyclomatic 42) src/launcher/run.rs:196 — rig::launcher::run::launch has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rig::launcher::plugin::add (cyclomatic 17) src/launcher/plugin.rs:148 — rig::launcher::plugin::add has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · Markdown · ×2
  • Markdown::start (cyclomatic 30) corpus/sn/src/web_fetch/markdown.rs:153 — Markdown::start has cyclomatic complexity 30 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • Markdown::end (cyclomatic 22) corpus/sn/src/web_fetch/markdown.rs:259 — Markdown::end has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · rig_candle · ×2
  • rig_candle::protocol::render_qwen_message (cyclomatic 29) crates/rig-candle/src/protocol.rs:518 — rig_candle::protocol::render_qwen_message has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rig_candle::protocol::parse_qwen3_assistant (cyclomatic 19) crates/rig-candle/src/protocol.rs:690 — rig_candle::protocol::parse_qwen3_assistant has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Chat · ×2
  • Chat::assistant (cyclomatic 25) crates/rig-core/src/providers/openai/wire/chat.rs:388 — Chat::assistant has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Chat::encodes (cyclomatic 17) crates/rig-core/src/providers/openai/wire/chat.rs:874 — Chat::encodes has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · GenerateContentDecoder · ×2
  • GenerateContentDecoder::decode (cyclomatic 21) crates/rig-core/src/providers/gemini/streaming.rs:95 — GenerateContentDecoder::decode has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • GenerateContentDecoder::part (cyclomatic 17) crates/rig-core/src/providers/gemini/streaming.rs:293 — GenerateContentDecoder::part has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InteractionsDecoder · ×2
  • InteractionsDecoder::delta (cyclomatic 20) crates/rig-core/src/providers/gemini/interactions_api/streaming.rs:273 — InteractionsDecoder::delta has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • InteractionsDecoder::decode (cyclomatic 20) crates/rig-core/src/providers/gemini/interactions_api/streaming.rs:550 — InteractionsDecoder::decode has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · corpus_base · ×2
  • corpus_base::debate::step (cyclomatic 18) corpus/base/src/debate.rs:411 — corpus_base::debate::step has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • corpus_base::export::render::walk (cyclomatic 17) corpus/base/src/export/render.rs:155 — corpus_base::export::render::walk has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · rig_bedrock · ×2
  • rig_bedrock::request::base (cyclomatic 18) crates/rig-bedrock/src/request.rs:62 — rig_bedrock::request::base has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • rig_bedrock::options::claude_reasoning (cyclomatic 17) crates/rig-bedrock/src/options.rs:27 — rig_bedrock::options::claude_reasoning has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · rig_memory · ×2
  • rig_memory::rewrite::rewrite (cyclomatic 18) crates/rig-memory/src/rewrite.rs:630 — rig_memory::rewrite::rewrite has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rig_memory::rewrite::map_file (cyclomatic 16) crates/rig-memory/src/rewrite.rs:351 — rig_memory::rewrite::map_file has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D2 · Cognitive Complexity · Catalog · ×2
  • Catalog::from_overrides (cognitive 39) crates/rig-core/src/catalog/read.rs:154 — Catalog::from_overrides has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (26 pts), match/switch 3 (7 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Catalog::from_models_dev (cognitive 18) crates/rig-core/src/catalog/read.rs:274 — Catalog::from_models_dev has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EffectLogReplayer · ×2
  • EffectLogReplayer::serve (cognitive 37) crates/rig-cassette/src/effect_log/replay.rs:641 — EffectLogReplayer::serve has cognitive complexity 37 (threshold 15). Drivers by points: if/else 8 (24 pts), match/switch 3 (7 pts), loops 1 (4 pts), boolean chains 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • EffectLogReplayer::check_header (cognitive 16) crates/rig-cassette/src/effect_log/replay.rs:263 — EffectLogReplayer::check_header has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 4, loops 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Chat · ×2
  • Chat::assistant (cognitive 37) crates/rig-core/src/providers/openai/wire/chat.rs:388 — Chat::assistant has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (19 pts), match/switch 4 (10 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Chat::base (cognitive 28) crates/rig-core/src/providers/openai/wire/chat.rs:237 — Chat::base has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 2 (5 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Message · ×2
  • Message::absorb (cognitive 28) crates/rig-core/src/providers/anthropic/streaming/document.rs:167 — Message::absorb has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 4, loops 1 (3 pts), match/switch 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • Message::message_delta (cognitive 16) crates/rig-core/src/providers/anthropic/streaming/document.rs:131 — Message::message_delta has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GenerateContentDecoder · ×2
  • GenerateContentDecoder::part (cognitive 25) crates/rig-core/src/providers/gemini/streaming.rs:293 — GenerateContentDecoder::part has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (16 pts), match/switch 2 (5 pts), boolean chains 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • GenerateContentDecoder::decode (cognitive 16) crates/rig-core/src/providers/gemini/streaming.rs:95 — GenerateContentDecoder::decode has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, match/switch 5, boolean chains 2, loops 1 (2 pts) (nesting depth added 1). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Repo · ×2
  • Repo::push (cognitive 21) corpus/ct/src/git_guardrails/rules.rs:384 — Repo::push has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 2, loops 2, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Repo::commit (cognitive 20) corpus/ct/src/git_guardrails/rules.rs:498 — Repo::commit has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (4 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Index · ×2
  • Index::update (cognitive 21) corpus/ho/src/session_recall.rs:272 — Index::update has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (5 pts), match/switch 2 (5 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Index::search (cognitive 16) corpus/ho/src/session_recall.rs:337 — Index::search has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Markdown · ×2
  • Markdown::start (cognitive 21) corpus/sn/src/web_fetch/markdown.rs:153 — Markdown::start has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 4, match/switch 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Markdown::end (cognitive 18) corpus/sn/src/web_fetch/markdown.rs:259 — Markdown::end has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · rig_typesafeai · ×2
  • rig_typesafeai::questions::validate_definition (cognitive 19) crates/rig-typesafeai/src/questions.rs:568 — rig_typesafeai::questions::validate_definition has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (7 pts), boolean chains 2, match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • rig_typesafeai::questions::validate (cognitive 17) crates/rig-typesafeai/src/questions.rs:654 — rig_typesafeai::questions::validate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, match/switch 1 (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ResponsesDecoder · ×2
  • ResponsesDecoder::done (cognitive 16) crates/rig-core/src/providers/openai/responses_api/streaming.rs:605 — ResponsesDecoder::done has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ResponsesDecoder::finish (cognitive 16) crates/rig-core/src/providers/openai/responses_api/streaming.rs:784 — ResponsesDecoder::finish has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 2 (3 pts), loops 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×2
  • Duplicated block (14 lines × 2) corpus/sn/src/model_params.rs:468 — corpus/sn/src/model_params.rs:468-481 | xtask/src/catalog.rs:892-905 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (14 lines × 2) test-support/rig-test-support/src/raw_capture/chat.rs:68 — test-support/rig-test-support/src/raw_capture/chat.rs:68-81 | test-support/rig-test-support/src/raw_capture/chat.rs:154-167 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×2
  • Duplicated block (13 lines × 2) corpus/oc/src/dataset_cli.rs:205 — corpus/oc/src/dataset_cli.rs:205-217 | corpus/sn/src/usage_report_cli.rs:74-86 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (13 lines × 2) crates/rig-core/src/providers/openai/options.rs:1402 — crates/rig-core/src/providers/openai/options.rs:1402-1414 | crates/rig-core/src/providers/openai/options.rs:1602-1614 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×2
  • Duplicated block (10–11 lines × 2) crates/rig-core/src/providers/cohere/chat.rs:236 — crates/rig-core/src/providers/cohere/chat.rs:236-246 | crates/rig-core/src/providers/ollama/chat.rs:331-340 — `crates/rig-core/src/providers/cohere/chat.rs` and `crates/rig-core/src/providers/ollama/chat.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 30 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (10–11 lines × 2) xtask/src/verify/extras.rs:51 — xtask/src/verify/extras.rs:51-61 | xtask/src/verify/guards.rs:96-105 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×2
  • Duplicated block (9 lines × 3) corpus/ho/src/conversation_surgery.rs:57 — corpus/ho/src/conversation_surgery.rs:57-65 | corpus/library/src/session_edit_library.rs:465-473 | test-support/rig-history-conformance/src/lib.rs:748-756 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (9 lines × 3) crates/rig-qdrant/src/filter.rs:282 — crates/rig-qdrant/src/filter.rs:282-290 | crates/rig-qdrant/src/filter.rs:293-301 | crates/rig-qdrant/src/filter.rs:304-312 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×2
  • Duplicated block (5 lines × 4) crates/rig-core/src/providers/openai/options.rs:943 — crates/rig-core/src/providers/openai/options.rs:943-947 | crates/rig-core/src/providers/openai/options.rs:1099-1103 | crates/rig-core/src/providers/openai/options.rs:1125-1129 | crates/rig-core/src/providers/openai/options.rs:1158-1162 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (5 lines × 4) corpus/ct/src/conversation_chapters.rs:814 — corpus/ct/src/conversation_chapters.rs:814-818 | corpus/ho/src/auto_session_name.rs:144-148 | corpus/oc/src/away_recap.rs:336-340 | corpus/sp/src/changelog_fragments.rs:351-355 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
D1 · Cyclomatic Complexity · StreamingTurnSource · ×1
  • StreamingTurnSource::run_model_turn (cyclomatic 43) crates/rig-agent/src/agent/engine.rs:703 — StreamingTurnSource::run_model_turn has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · QdrantFilter · ×1
  • QdrantFilter::interpret (cyclomatic 29) crates/rig-qdrant/src/filter.rs:137 — QdrantFilter::interpret has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 3 of the 29 points are its own statements and the rest belongs to 3 function items inside it that branch (to_condition, to_filter, to_match). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · corpus_ct · ×1
  • corpus_ct::git_guardrails::shell::lex (cyclomatic 28) corpus/ct/src/git_guardrails/shell.rs:146 — corpus_ct::git_guardrails::shell::lex has cyclomatic complexity 28 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · Screen · ×1
  • Screen::csi (cyclomatic 28) corpus/sn/src/terminal_sessions/screen.rs:215 — Screen::csi has cyclomatic complexity 28 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · AgentRun · ×1
  • AgentRun::next_step (cyclomatic 25) crates/rig-agent/src/run/mod.rs:852 — AgentRun::next_step has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · corpus_library · ×1
  • corpus_library::transcript_import_library::import (cyclomatic 23) corpus/library/src/transcript_import_library.rs:230 — corpus_library::transcript_import_library::import has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ChatResponse · ×1
  • ChatResponse::absorb (cyclomatic 23) crates/rig-core/src/providers/cohere/streaming/document.rs:62 — ChatResponse::absorb has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Reply · ×1
  • Reply::observed (cyclomatic 22) crates/rig-core/src/serve/handler.rs:523 — Reply::observed has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Validator · ×1
  • Validator::check (cyclomatic 22) crates/rig-core/src/tool/validate.rs:92 — Validator::check has cyclomatic complexity 22 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · Repo · ×1
  • Repo::push (cyclomatic 21) corpus/ct/src/git_guardrails/rules.rs:384 — Repo::push has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Message · ×1
  • Message::absorb (cyclomatic 21) crates/rig-core/src/providers/anthropic/streaming/document.rs:167 — Message::absorb has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · rig_derive · ×1
  • rig_derive::tool::expand::expand_rig_tool (cyclomatic 21) crates/rig-derive/src/tool/expand.rs:108 — rig_derive::tool::expand::expand_rig_tool has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Kept · ×1
  • Kept::line (cyclomatic 21) crates/rig-tools/src/shell.rs:560 — Kept::line has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Job · ×1
  • Job::diagnostics (cyclomatic 20) corpus/fh/src/lsp_tools.rs:597 — Job::diagnostics has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Manifest · ×1
  • Manifest::entries (cyclomatic 20) corpus/oc/src/dependency_guard.rs:695 — Manifest::entries has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · Editor · ×1
  • Editor::run (cyclomatic 20) corpus/sn/src/vim_input/editor.rs:181 — Editor::run has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · Responses · ×1
  • Responses::base (cyclomatic 20) crates/rig-core/src/providers/openai/responses_api/mod.rs:469 — Responses::base has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OAuthTransport · ×1
  • OAuthTransport::prepare (cyclomatic 20) plugins/rig-claude-cloak/src/transport.rs:889 — OAuthTransport::prepare has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Rewinder · ×1
  • Rewinder::rewind (cyclomatic 18) corpus/base/src/checkpoint_rewind.rs:508 — Rewinder::rewind has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StreamState · ×1
  • StreamState::delta (cyclomatic 18) crates/rig-bedrock/src/streaming.rs:139 — StreamState::delta has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · JsonObjectContext · ×1
  • JsonObjectContext::field (cyclomatic 18) crates/rig-cassette/src/scrub.rs:119 — JsonObjectContext::field has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · Caching · ×1
  • Caching::send (cyclomatic 18) crates/rig-core/src/client/gemini_caching.rs:331 — Caching::send has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Catalog · ×1
  • Catalog::from_overrides (cyclomatic 17) crates/rig-core/src/catalog/read.rs:154 — Catalog::from_overrides has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Session · ×1
  • Session::record_one (cyclomatic 17) xtask/src/cassette/record.rs:290 — Session::record_one has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · corpus_sp · ×1
  • corpus_sp::dead_ends_ledger::review_shell (cyclomatic 16) corpus/sp/src/dead_ends_ledger.rs:376 — corpus_sp::dead_ends_ledger::review_shell has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NativeChat · ×1
  • NativeChat::assistant (cyclomatic 16) crates/rig-core/src/providers/cohere/chat.rs:198 — NativeChat::assistant has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · StreamRecord · ×1
  • StreamRecord::push (cyclomatic 16) crates/rig-core/src/streaming/event.rs:228 — StreamRecord::push has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · Out · ×1
  • Out::fragment (cyclomatic 16) crates/rig-core/src/operation/completion.rs:1517 — Out::fragment has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · rig_tools · ×1
  • rig_tools::process::forward_both (cyclomatic 16) crates/rig-tools/src/process.rs:298 — rig_tools::process::forward_both has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Transcript · ×1
  • Transcript::update (cyclomatic 16) plugins/rig-tui/src/transcript.rs:1056 — Transcript::update has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D2 · Cognitive Complexity · StreamingTurnSource · ×1
  • StreamingTurnSource::run_model_turn (cognitive 116) crates/rig-agent/src/agent/engine.rs:703 — StreamingTurnSource::run_model_turn has cognitive complexity 116 (threshold 15). Drivers by points: if/else 17 (63 pts), match/switch 13 (42 pts), loops 3 (7 pts), boolean chains 4 (nesting depth added 79). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentRun · ×1
  • AgentRun::next_step (cognitive 48) crates/rig-agent/src/run/mod.rs:852 — AgentRun::next_step has cognitive complexity 48 (threshold 15). Drivers by points: if/else 14 (39 pts), match/switch 3 (5 pts), boolean chains 4 (nesting depth added 27). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · MacroArgs · ×1
  • MacroArgs::parse (cognitive 37) crates/rig-derive/src/tool/args.rs:99 — MacroArgs::parse has cognitive complexity 37 (threshold 15). Drivers by points: if/else 4 (20 pts), loops 3 (9 pts), match/switch 3 (8 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Job · ×1
  • Job::diagnostics (cognitive 36) corpus/fh/src/lsp_tools.rs:597 — Job::diagnostics has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 4 (8 pts), match/switch 4 (6 pts), boolean chains 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Manifest · ×1
  • Manifest::entries (cognitive 34) corpus/oc/src/dependency_guard.rs:695 — Manifest::entries has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 7 (15 pts), boolean chains 2, match/switch 1 (nesting depth added 17). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · Reply · ×1
  • Reply::observed (cognitive 32) crates/rig-core/src/serve/handler.rs:523 — Reply::observed has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (24 pts), match/switch 3 (5 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · rig_derive · ×1
  • rig_derive::tool::expand::expand_rig_tool (cognitive 32) crates/rig-derive/src/tool/expand.rs:108 — rig_derive::tool::expand::expand_rig_tool has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (23 pts), loops 4 (5 pts), boolean chains 2, match/switch 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SummaryState · ×1
  • SummaryState::track (cognitive 30) crates/rig-memory/src/compaction.rs:124 — SummaryState::track has cognitive complexity 30 (threshold 15). Drivers by points: if/else 4 (15 pts), loops 4 (9 pts), match/switch 2 (6 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Summarizer · ×1
  • Summarizer::serialize (cognitive 28) crates/rig-memory/src/compaction.rs:1054 — Summarizer::serialize has cognitive complexity 28 (threshold 15). Drivers by points: match/switch 4 (15 pts), loops 3 (7 pts), if/else 2 (6 pts) (nesting depth added 19). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · Kept · ×1
  • Kept::line (cognitive 28) crates/rig-tools/src/shell.rs:560 — Kept::line has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 5, loops 3 (5 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · rig_bedrock · ×1
  • rig_bedrock::request::base (cognitive 27) crates/rig-bedrock/src/request.rs:62 — rig_bedrock::request::base has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 4 (8 pts), match/switch 4 (5 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · check-dependency-floors.guard_source_paths (cognitive 26) · ×1
  • check-dependency-floors.guard_source_paths (cognitive 26) scripts/check-dependency-floors.py:261 — check-dependency-floors.guard_source_paths has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 5 (7 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WireIds · ×1
  • WireIds::for_target (cognitive 25) crates/rig-core/src/providers/internal/wire_ids.rs:28 — WireIds::for_target has cognitive complexity 25 (threshold 15). Drivers by points: match/switch 4 (11 pts), loops 4 (8 pts), if/else 2 (6 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Rewinder · ×1
  • Rewinder::rewind (cognitive 24) corpus/base/src/checkpoint_rewind.rs:508 — Rewinder::rewind has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (18 pts), match/switch 2 (3 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · corpus_rf_07 · ×1
  • corpus_rf_07::checkpoints (cognitive 24) corpus/rf-07/src/lib.rs:382 — corpus_rf_07::checkpoints has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (18 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChatResponse · ×1
  • ChatResponse::absorb (cognitive 24) crates/rig-core/src/providers/cohere/streaming/document.rs:62 — ChatResponse::absorb has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (21 pts), match/switch 2, boolean chains 1 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · OAuthTransport · ×1
  • OAuthTransport::prepare (cognitive 24) plugins/rig-claude-cloak/src/transport.rs:889 — OAuthTransport::prepare has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 6, loops 4 (5 pts), match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Screen · ×1
  • Screen::csi (cognitive 23) corpus/sn/src/terminal_sessions/screen.rs:215 — Screen::csi has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 4 (10 pts), match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HttpExchange · ×1
  • HttpExchange::streaming (cognitive 23) crates/rig-core/src/driver/http_transport.rs:168 — HttpExchange::streaming has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 4 (6 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Responses · ×1
  • Responses::base (cognitive 23) crates/rig-core/src/providers/openai/responses_api/mod.rs:469 — Responses::base has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 3, match/switch 3, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Out · ×1
  • Out::fragment (cognitive 23) crates/rig-core/src/operation/completion.rs:1517 — Out::fragment has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 4 (7 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · corpus_shared · ×1
  • corpus_shared::protected_paths::filter_searches (cognitive 22) corpus/shared/src/protected_paths.rs:350 — corpus_shared::protected_paths::filter_searches has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (6 pts), match/switch 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NativeChat · ×1
  • NativeChat::assistant (cognitive 22) crates/rig-core/src/providers/cohere/chat.rs:198 — NativeChat::assistant has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 4 (9 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GenerateContentResponse · ×1
  • GenerateContentResponse::candidate (cognitive 22) crates/rig-core/src/providers/gemini/streaming/document.rs:84 — GenerateContentResponse::candidate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (9 pts), match/switch 3 (8 pts), loops 2 (5 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Cron · ×1
  • Cron::after (cognitive 21) corpus/base/src/cron_agent/schedule.rs:106 — Cron::after has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 3 (6 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Caching · ×1
  • Caching::send (cognitive 21) crates/rig-core/src/client/gemini_caching.rs:331 — Caching::send has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4, match/switch 3, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · QdrantFilter · ×1
  • QdrantFilter::interpret::to_condition (cognitive 20) crates/rig-qdrant/src/filter.rs:165 — QdrantFilter::interpret::to_condition has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Registry · ×1
  • Registry::render (cognitive 19) corpus/ct/src/metrics_endpoint/registry.rs:231 — Registry::render has cognitive complexity 19 (threshold 15). Drivers by points: loops 5 (11 pts), if/else 3 (8 pts) (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · Pty · ×1
  • Pty::wait (cognitive 19) corpus/sn/src/terminal_sessions/pty.rs:206 — Pty::wait has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser · ×1
  • Parser::value (cognitive 19) corpus/sp/src/structured_config_edit/json.rs:102 — Parser::value has cognitive complexity 19 (threshold 15). Drivers by points: loops 3 (8 pts), match/switch 3 (6 pts), if/else 2 (4 pts), boolean chains 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · Validator · ×1
  • Validator::check (cognitive 19) crates/rig-core/src/tool/validate.rs:92 — Validator::check has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 4, match/switch 3 (4 pts), loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · rig_vertexai · ×1
  • rig_vertexai::types::completion_response::rest_chunk (cognitive 19) crates/rig-vertexai/src/types/completion_response.rs:15 — rig_vertexai::types::completion_response::rest_chunk has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 4 (8 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Transcript · ×1
  • Transcript::update (cognitive 19) plugins/rig-tui/src/transcript.rs:1056 — Transcript::update has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 5, loops 2 (3 pts), match/switch 2 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Session · ×1
  • Session::record_one (cognitive 19) xtask/src/cassette/record.rs:290 — Session::record_one has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (13 pts), match/switch 3 (4 pts), boolean chains 1, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · check-dependency-floors.workspace_direct_deps (cognitive 19) · ×1
  • check-dependency-floors.workspace_direct_deps (cognitive 19) scripts/check-dependency-floors.py:172 — check-dependency-floors.workspace_direct_deps has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · check-dependency-floors.check_floors (cognitive 19) · ×1
  • check-dependency-floors.check_floors (cognitive 19) scripts/check-dependency-floors.py:203 — check-dependency-floors.check_floors has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 2 (4 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Report · ×1
  • Report::collect (cognitive 18) corpus/sn/src/usage_report_cli/report.rs:79 — Report::collect has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), match/switch 3 (4 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MessagesDecoder · ×1
  • MessagesDecoder::delta (cognitive 18) crates/rig-core/src/providers/anthropic/streaming.rs:396 — MessagesDecoder::delta has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 3 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Guard · ×1
  • Guard::visit_expr_call (cognitive 18) xtask/src/verify/guards.rs:530 — Guard::visit_expr_call has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Plan · ×1
  • Plan::of (cognitive 17) crates/rig-cassette/src/effect_log/jsonl.rs:829 — Plan::of has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), match/switch 3 (8 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StripXmlProcessor · ×1
  • StripXmlProcessor::process (cognitive 17) crates/rig-core/src/loaders/epub/text_processors.rs:42 — StripXmlProcessor::process has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (12 pts), match/switch 2 (4 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Layer · ×1
  • Layer::serve (cognitive 17) crates/rig-core/src/serve/layer.rs:138 — Layer::serve has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), match/switch 3 (5 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · StreamRecord · ×1
  • StreamRecord::push (cognitive 17) crates/rig-core/src/streaming/event.rs:228 — StreamRecord::push has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), match/switch 3 (8 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Template · ×1
  • Template::expand (cognitive 16) corpus/base/src/prompt_templates.rs:143 — Template::expand has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Runner · ×1
  • Runner::steps (cognitive 16) corpus/fh/src/open_pr.rs:1195 — Runner::steps has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), match/switch 2 (3 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · Rotating · ×1
  • Rotating::send_keyed (cognitive 16) corpus/ho/src/api_key_pool.rs:419 — Rotating::send_keyed has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 2 (4 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UnaryTurnSource · ×1
  • UnaryTurnSource::run_model_turn (cognitive 16) crates/rig-agent/src/agent/engine.rs:1441 — UnaryTurnSource::run_model_turn has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 6 (13 pts), boolean chains 1, if/else 1, loops 1 (nesting depth added 7). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · Known · ×1
  • Known::restore (cognitive 16) crates/rig-cassette/src/effect_log/jsonl.rs:718 — Known::restore has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), loops 2 (4 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ChatDecoder · ×1
  • ChatDecoder::close_calls (cognitive 16) crates/rig-core/src/providers/openai/wire/chat.rs:1575 — ChatDecoder::close_calls has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FileChange · ×1
  • FileChange::after_text (cognitive 16) crates/rig-core/src/tool/facts.rs:357 — FileChange::after_text has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (5 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClearToolOutputs · ×1
  • ClearToolOutputs::targets (cognitive 16) crates/rig-memory/src/compaction.rs:1237 — ClearToolOutputs::targets has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D3 · God Classes · TooManyFields · ×1
  • TooManyFields: Quirks crates/rig-core/src/providers/openai/wire.rs:295 — TooManyFields — 45 stored fields beside 4 methods. The bar is 30 stored fields; this is 15 over it, 1.50× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
D35 · Change Coupling · Change-coupling hub · ×1
  • Change-coupling hub: lib.rs → lib.rs, lib.rs, lib.rs crates/rig-mongodb/src/lib.rs — `crates/rig-mongodb/src/lib.rs` changes together with 3 other files — `crates/rig-postgres/src/lib.rs`, `crates/rig-scylladb/src/lib.rs`, `crates/rig-surrealdb/src/lib.rs` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×1
  • Duplicated block (15 lines × 2) corpus/fh/src/editor_front.rs:783 — corpus/fh/src/editor_front.rs:783-797 | corpus/ho/src/hunk_review.rs:175-189 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×1
  • Duplicated block (13–14 lines × 2) crates/rig-core/src/providers/anthropic/streaming.rs:356 — crates/rig-core/src/providers/anthropic/streaming.rs:356-368 | crates/rig-core/src/providers/cohere/streaming.rs:221-234 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×1
  • Duplicated block (11–12 lines × 2) crates/rig-candle/src/model.rs:705 — crates/rig-candle/src/model.rs:705-716 | crates/rig-candle/src/pose.rs:705-715 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×1
  • Duplicated block (8 lines × 4) corpus/ct/src/schema_adapter/schema.rs:378 — corpus/ct/src/schema_adapter/schema.rs:378-385 | corpus/ho/src/degenerate_stream_cutter.rs:436-443 | corpus/oc/src/dependency_guard.rs:81-88 | corpus/sn/src/web_fetch/policy.rs:125-132 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×1
  • Duplicated block (7 lines × 3) corpus/base/src/custom_provider.rs:180 — corpus/base/src/custom_provider.rs:180-186 | corpus/ho/src/command_provider.rs:205-211 | corpus/sn/src/race_models.rs:66-72 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
D4 · Code Duplication · Duplicated block (6–7 lines × 2) · ×1
  • Duplicated block (6–7 lines × 2) corpus/base/src/summarize_tool_output.rs:252 — corpus/base/src/summarize_tool_output.rs:252-257 | corpus/fh/src/mentions_and_images.rs:600-606 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (5 lines × 5) · ×1
  • Duplicated block (5 lines × 5) crates/rig-core/src/providers/openai/options.rs:701 — crates/rig-core/src/providers/openai/options.rs:701-705 | crates/rig-core/src/providers/openai/options.rs:770-774 | crates/rig-core/src/providers/openai/options.rs:823-827 | crates/rig-core/src/providers/openai/options.rs:972-976 | crates/rig-core/src/providers/openai/options.rs:1094-1098 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (2–5 lines × 3) · ×1
  • Duplicated block (2–5 lines × 3) crates/rig-core/src/providers/openai/options.rs:706 — crates/rig-core/src/providers/openai/options.rs:706-710 | crates/rig-core/src/providers/openai/options.rs:828-832 | crates/rig-core/src/providers/openai/options.rs:977-978 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×1
  • Duplicated block (9 lines × 4) crates/rig-agent/src/run/transcript.rs:41 — crates/rig-agent/src/run/transcript.rs:41-49 | test-support/rig-test-support/src/history_survival/adversarial.rs:57-65 | test-support/rig-test-support/src/model_session.rs:1058-1066 | test-support/rig-test-support/src/support.rs:915-923 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×1
  • Duplicated block (11 lines × 3) crates/rig-core/src/audio_generation.rs:50 — crates/rig-core/src/audio_generation.rs:50-60 | crates/rig-core/src/embeddings/embedding.rs:76-86 | crates/rig-core/src/image_generation.rs:54-64 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×1
  • Duplicated block (8 lines × 3) crates/rig-tools/src/edit.rs:59 — crates/rig-tools/src/edit.rs:59-66 | crates/rig-tools/src/read.rs:44-51 | crates/rig-tools/src/write.rs:39-46 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (13 lines × 4) · ×1
  • Duplicated block (13 lines × 4) crates/rig-core/src/providers/minimax/extension.rs:160 — crates/rig-core/src/providers/minimax/extension.rs:160-172 | crates/rig-core/src/providers/moonshot/extension.rs:148-160 | crates/rig-core/src/providers/xiaomimimo/extension.rs:69-81 | crates/rig-core/src/providers/zai/extension.rs:172-184 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
D4 · Code Duplication · Duplicated block (6 lines × 5) · ×1
  • Duplicated block (6 lines × 5) crates/rig-core/src/providers/openai/options.rs:768 — crates/rig-core/src/providers/openai/options.rs:768-773 | crates/rig-core/src/providers/openai/options.rs:821-826 | crates/rig-core/src/providers/openai/options.rs:898-903 | crates/rig-core/src/providers/openai/options.rs:970-975 | crates/rig-core/src/providers/openai/options.rs:1092-1097 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (16–18 lines × 2) · ×1
  • Duplicated block (16–18 lines × 2) test-support/rig-test-support/src/reasoning.rs:331 — test-support/rig-test-support/src/reasoning.rs:331-346 | test-support/rig-test-support/src/reasoning.rs:404-421 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (8–12 lines × 2) · ×1
  • Duplicated block (8–12 lines × 2) test-support/rig-test-support/src/raw_capture/chat.rs:57 — test-support/rig-test-support/src/raw_capture/chat.rs:57-64 | test-support/rig-test-support/src/raw_capture/chat.rs:144-155 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (8–11 lines × 3) · ×1
  • Duplicated block (8–11 lines × 3) crates/rig-core/src/test_utils/streaming_conformance.rs:944 — crates/rig-core/src/test_utils/streaming_conformance.rs:944-951 | crates/rig-core/src/test_utils/streaming_conformance.rs:987-997 | crates/rig-core/src/test_utils/streaming_conformance.rs:1045-1053 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×1
  • Duplicated block (16 lines × 2) test-support/rig-test-support/src/cache_conformance.rs:620 — test-support/rig-test-support/src/cache_conformance.rs:620-635 | test-support/rig-test-support/src/cache_conformance.rs:664-681 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D44 · Platform End-of-Life · End-of-life runtime · ×1
  • End-of-life runtime: Rust 1.97 rust-toolchain.toml:1 — rust-toolchain.toml declares Rust 1.97 as this project's toolchain file, and Rust 1.97, superseded by 1.98 on 2026-08-20 (the Rust project patches only the current stable). An unsupported runtime receives no security patches, so every vulnerability disclosed in it since 2026-08-20 is present and unfixable without moving off it. This is a migration rather than an upgrade: there is no newer release of a runtime that has ended.
Minor — 83 finding(s)
X4 · Structured logging · Interpolated log message defeats structured logging · ×37
  • Interpolated log message defeats structured logging crates/rig-vertexai/src/completion.rs:266 — `debug!` at line 266 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/rig-vectorize/src/lib.rs:174 — `debug!` at line 174 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/rig-vectorize/src/client/mod.rs:26 — `debug!` at line 26 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/rig-vectorize/src/client/mod.rs:113 — `debug!` at line 113 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/rig-tools/src/checkpoint.rs:691 — `warn!` at line 691 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/rig-tools/src/checkpoint.rs:734 — `warn!` at line 734 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/rig-sqlite/src/lib.rs:578 — `info!` at line 578 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/rig-sqlite/src/lib.rs:606 — `debug!` at line 606 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/rig-sqlite/src/lib.rs:657 — `debug!` at line 657 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/rig-sqlite/src/lib.rs:1932 — `debug!` at line 1932 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/rig-sqlite/src/lib.rs:1967 — `debug!` at line 1967 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/rig-sqlite/src/lib.rs:1979 — `debug!` at line 1979 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/rig-sqlite/src/lib.rs:1985 — `debug!` at line 1985 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/rig-sqlite/src/lib.rs:1993 — `debug!` at line 1993 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/rig-sqlite/src/lib.rs:2010 — `debug!` at line 2010 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/rig-rmcp/src/handler.rs:257 — `error!` at line 257 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/rig-reqwest/src/lib.rs:123 — `warn!` at line 123 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/rig-neo4j/src/lib.rs:259 — `info!` at line 259 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/rig-neo4j/src/lib.rs:333 — `warn!` at line 333 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/rig-neo4j/src/lib.rs:390 — `info!` at line 390 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/rig-neo4j/src/lib.rs:428 — `warn!` at line 428 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/rig-neo4j/src/lib.rs:434 — `info!` at line 434 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/rig-neo4j/src/vector_index.rs:171 — `debug!` at line 171 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/rig-mongodb/src/lib.rs:218 — `info!` at line 218 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/rig-core/src/vector_store/in_memory_store.rs:207 — `info!` at line 207 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • + 12 more in this group — see findings.md.
X7 · Silent fallback defaults · Silent fallback default on Err · ×18
  • Silent fallback default on Err corpus/base/src/nested_context.rs:124 — `nested_files` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err corpus/ct/src/process_reaper/procfs.rs:92 — `scan` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err corpus/ct/src/reply_review_comments.rs:244 — `removed_replies` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err corpus/fh/src/encrypted_sessions.rs:73 — `read` turns every `Err` into `Ok(Self::default())` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err corpus/fh/src/encrypted_sessions/reseal.rs:152 — `sessions` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err corpus/fh/src/import_sessions.rs:326 — `session_files` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err corpus/sn/src/terminal_sessions/screen.rs:222 — `csi` turns every `Err` into `0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err corpus/sn/src/sessions_prune_cli.rs:619 — `bytes_under` turns every `Err` into `0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err corpus/sn/src/terminal_sessions/pty.rs:329 — `in_session` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/rig-cassette/src/http/ledger.rs:480 — `outstanding` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/rig-core/src/tool/output.rs:145 — `render` turns every `Err` into `"<structured tool output>".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/rig-tools/src/fs.rs:391 — `read` turns every `Err` into `Some(Self::default())` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err plugins/rig-basics/src/login/keys.rs:96 — `vendors` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err plugins/rig-basics/src/subagents/lifecycle.rs:127 — `awaited` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err plugins/rig-steel/src/program.rs:420 — `text` turns every `Err` into `String::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err plugins/rig-tui/src/theme.rs:241 — `of_terminal` turns every `Err` into `Self::default()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err src/launcher/project.rs:125 — `dependencies` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err xtask/src/verify/preflight.rs:56 — `run` turns every `Err` into `0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
X10 · Duplicated predicate · Duplicated predicate · ×15
  • Duplicated predicate corpus/sn/src/notebook_cells/notebook.rs:149 — `!text.is_empty() && !text.ends_with('\n')` appears character-identically in 4 files — corpus/sn/src/notebook_cells/notebook.rs, corpus/sn/src/stray_file_cleanup.rs, crates/rig-harness/src/progress.rs, src/launcher/plugin_list.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate corpus/base/src/todo_tracker/tests.rs:49 — `!world.resource::<Ended>().0.is_empty() && world.get::<ActiveTurn>(agent).is_none()` appears character-identically in 2 files — corpus/base/src/todo_tracker/tests.rs, corpus/rf-03/src/todo/tests.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate crates/rig-harness/src/per_call/tests.rs:80 — `app.world().get::<Outcome>(call).is_none() && started.elapsed() < Duration::from_secs(5)` appears character-identically in 2 files — crates/rig-harness/src/per_call/tests.rs, plugins/rig-basics/src/preview/tests.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate corpus/fh/src/mentions_and_images.rs:402 — `before.is_empty() || before.ends_with(char::is_whitespace)` appears character-identically in 2 files — corpus/fh/src/mentions_and_images.rs, plugins/rig-tui/src/clipboard.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate corpus/base/src/output_truncate.rs:245 — `i > 0 && (digits.len() - i).is_multiple_of(3)` appears character-identically in 2 files — corpus/base/src/output_truncate.rs, corpus/base/src/summarize_tool_output.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate corpus/base/src/custom_provider/tests.rs:43 — `line.split_once(':') && name.eq_ignore_ascii_case("content-length")` appears character-identically in 4 files — corpus/base/src/custom_provider/tests.rs, corpus/base/src/local_models/tests.rs, corpus/oc/src/opaque_reasoning/tests.rs, corpus/oc/src/rate_limit_status/tests.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate corpus/base/src/check_after_turn.rs:384 — `message.author.kind != AuthorKind::User || message.command().is_some()` appears character-identically in 3 files — corpus/base/src/check_after_turn.rs, corpus/base/src/review_agent.rs, corpus/sn/src/stray_file_cleanup.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate corpus/ct/src/resume_subagent.rs:361 — `message.author.kind == AuthorKind::User && message.command().is_none()` appears character-identically in 3 files — corpus/ct/src/resume_subagent.rs, corpus/oc/src/away_recap.rs, corpus/oc/src/steer_and_queue.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate corpus/base/src/mcp_client/tests.rs:211 — `model.request_count() == 4 && !world.entity(agent).contains::<ActiveTurn>()` appears character-identically in 3 files — corpus/base/src/mcp_client/tests.rs, corpus/fh/src/lsp_tools/tests.rs, corpus/shared/src/plan_mode/tests.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate corpus/base/src/prompt_templates.rs:270 — `name.is_empty() || name.contains(char::is_whitespace)` appears character-identically in 3 files — corpus/base/src/prompt_templates.rs, corpus/base/src/skills.rs, plugins/rig-basics/src/skills.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate crates/rig-bedrock/src/request.rs:248 — `reasoning.redacted || reasoning.text.trim().is_empty()` appears character-identically in 5 files — crates/rig-bedrock/src/request.rs, crates/rig-core/src/completion/history.rs, crates/rig-core/src/providers/anthropic/completion.rs, crates/rig-core/src/providers/gemini/completion.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate xtask/src/verify/guards.rs:128 — `relative.ends_with("REDACTED") || relative.contains("/tests/")` appears character-identically in 2 files — xtask/src/verify/guards.rs, xtask/src/wires.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate corpus/base/src/handoff.rs:136 — `rest.is_empty() || rest.starts_with(char::is_whitespace)` appears character-identically in 2 files — corpus/base/src/handoff.rs, corpus/fh/src/side_question.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate crates/rig-core/src/providers/anthropic/streaming.rs:669 — `self.message_started && event.fields.get("message").is_some_and(Value::is_object)` appears character-identically in 2 files — crates/rig-core/src/providers/anthropic/streaming.rs, crates/rig-core/src/providers/anthropic/streaming/document.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate corpus/fh/src/mentions_and_images.rs:440 — `typed.author.kind != AuthorKind::User || typed.command().is_some()` appears character-identically in 3 files — corpus/fh/src/mentions_and_images.rs, corpus/oc/src/issue_references.rs, plugins/rig-basics/src/coding_tools.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
D16 · Bus Factor · Off-boarding risk · ×1
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 227 significant file(s) lose their only recent owner: crates/rig-agent/src/agent/engine/tests.rs, crates/rig-agent/src/agent/streaming/tests.rs, crates/rig-cassette/src/http/mod.rs, crates/rig-core/src/providers/anthropic/completion/tests.rs, crates/rig-sqlite/src/tests.rs, crates/rig-agent/src/run/tests.rs, crates/rig-core/src/providers/openai/wire/chat.rs, test-support/rig-test-support/src/goldens.rs (+219 more). Pair on, review, or document these before any departure.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 9 of 56 project(s) overshoot their size bounds, lowering Project Cohesion to 6.8/10. The most over is `crates/rig-core` (125221 LoC, 1013 module-visible types across 65 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Low vulnerability · ×1
  • REDACTED
D34 · Knowledge Freshness · Orphaned files with no living knowledge · ×1
  • Orphaned files with no living knowledge — 1 of 1313 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 1313 of the 1530 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: crates/rig-vectorize/src/client/types.rs. Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
D34 · Knowledge Freshness · Orphaned file · ×1
  • Orphaned file crates/rig-vectorize/src/client/types.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 23/32 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `corpus/ct`, `corpus/library`, `corpus/rf-01`, `corpus/rf-06` and 4 more.
P4 · Deployment & Rollback · No release approval gate · ×1
  • No release approval gate — The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.
S1 · Web-Security Posture · No app-layer HTTPS enforcement detected · ×1
  • No app-layer HTTPS enforcement detected — This repository starts an HTTP server and nothing in its Rust source or committed `Rocket.toml` secures the transport: no TLS served (actix-web `bind_rustls`/`bind_openssl`, axum-server `bind_rustls` with a `RustlsConfig`, tonic `ServerTlsConfig`, a `TlsAcceptor`, Rocket's `[default.tls]`), no `Strict-Transport-Security` header, no `X-Forwarded-Proto` read from a TLS-terminating proxy — so its traffic may cross the network in clear text. (−2.0 on this card.) The server: `axum::serve(` (crates/rig-cassette/src/http/mod.rs:1250).
S1 · Web-Security Posture · No security response headers detected · ×1
  • No security response headers detected — None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is set on a response this repository's Rust server sends — defense in depth, even when a proxy could set them. (−2.0 on this card.) The server: `axum::serve(` (crates/rig-cassette/src/http/mod.rs:1250).
X7 · Silent fallback defaults · Silent fallback default on parse failure · ×1
  • Silent fallback default on parse failure plugins/rig-claude-cloak/tests/acceptance/audit.py:342 — `read_matches` returns `False` when `(ValueError, OSError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Minor — 47 finding(s)
D12 · Dependency Hygiene · Outdated · ×47
  • Outdated: aws-config — `aws-config` is locked at 1.12.0 but 1.13.0 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/rig-bedrock/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p aws-config` and commit the updated REDACTED.
  • Outdated: aws-sdk-bedrockruntime — `aws-sdk-bedrockruntime` is locked at 1.148.0 but 1.151.0 is the current stable release on crates.io, and it already satisfies the `"1.124"` requirement declared in crates/rig-bedrock/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p aws-sdk-bedrockruntime` and commit the updated REDACTED.
  • Outdated: aws-sdk-s3vectors — `aws-sdk-s3vectors` is locked at 1.42.0 but 1.45.0 is the current stable release on crates.io, and it already satisfies the `"1.1.0"` requirement declared in crates/rig-s3vectors/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p aws-sdk-s3vectors` and commit the updated REDACTED.
  • Outdated: aws-smithy-eventstream — `aws-smithy-eventstream` is locked at 0.61.4 but 0.61.6 is the current stable release on crates.io, and it already satisfies the `"0.61"` requirement declared in crates/rig-bedrock/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p aws-smithy-eventstream` and commit the updated REDACTED.
  • Outdated: aws-smithy-runtime-api — `aws-smithy-runtime-api` is locked at 1.19.0 but 1.19.1 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/rig-bedrock/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p aws-smithy-runtime-api` and commit the updated REDACTED.
  • Outdated: aws-smithy-types — `aws-smithy-types` is locked at 1.8.1 but 1.9.0 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/rig-bedrock/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p aws-smithy-types` and commit the updated REDACTED.
  • Outdated: bytes — `bytes` is locked at 1.11.1 but 1.12.1 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/rig-bedrock/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p bytes` and commit the updated REDACTED.
  • Outdated: crossbeam-channel — `crossbeam-channel` is locked at 0.5.15 but 0.5.17 is the current stable release on crates.io, and it already satisfies the `"0.5.15"` requirement declared in crates/rig-ecs/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p crossbeam-channel` and commit the updated REDACTED.
  • Outdated: fastrand — `fastrand` is locked at 2.4.1 but 2.5.0 is the current stable release on crates.io, and it already satisfies the `"2"` requirement declared in corpus/sn/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p fastrand` and commit the updated REDACTED.
  • Outdated: flate2 — `flate2` is locked at 1.1.9 but 1.1.10 is the current stable release on crates.io, and it already satisfies the `"1.1.9"` requirement declared in corpus/oc/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p flate2` and commit the updated REDACTED.
  • Outdated: glob — `glob` is locked at 0.3.3 but 0.3.4 is the current stable release on crates.io, and it already satisfies the `"0.3"` requirement declared in corpus/base/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p glob` and commit the updated REDACTED.
  • Outdated: google-cloud-aiplatform-v1 — `google-cloud-aiplatform-v1` is locked at 1.11.0 but 1.18.0 is the current stable release on crates.io, and it already satisfies the `"1.8"` requirement declared in crates/rig-vertexai/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p google-cloud-aiplatform-v1` and commit the updated REDACTED.
  • Outdated: google-cloud-auth — `google-cloud-auth` is locked at 1.13.0 but 1.18.0 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/rig-vertexai/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p google-cloud-auth` and commit the updated REDACTED.
  • Outdated: google-cloud-gax — `google-cloud-gax` is locked at 1.11.0 but 1.15.0 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/rig-vertexai/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p google-cloud-gax` and commit the updated REDACTED.
  • Outdated: http — `http` is locked at 1.4.2 but 1.5.0 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in corpus/base/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p http` and commit the updated REDACTED.
  • Outdated: http-body — `http-body` is locked at 1.0.1 but 1.1.0 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/rig-bedrock/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p http-body` and commit the updated REDACTED.
  • Outdated: ignore — `ignore` is locked at 0.4.25 but 0.4.33 is the current stable release on crates.io, and it already satisfies the `"0.4.25"` requirement declared in corpus/fh/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p ignore` and commit the updated REDACTED.
  • Outdated: indexmap — `indexmap` is locked at 2.14.0 but 2.14.2 is the current stable release on crates.io, and it already satisfies the `"2"` requirement declared in crates/rig-agent/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p indexmap` and commit the updated REDACTED.
  • Outdated: libc — `libc` is locked at 0.2.186 but 0.2.191 is the current stable release on crates.io, and it already satisfies the `"0.2.186"` requirement declared in corpus/base/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p libc` and commit the updated REDACTED.
  • Outdated: memchr — `memchr` is locked at 2.8.0 but 2.8.3 is the current stable release on crates.io, and it already satisfies the `"2"` requirement declared in crates/rig-memory/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p memchr` and commit the updated REDACTED.
  • Outdated: mongodb — `mongodb` is locked at 3.7.0 but 3.9.1 is the current stable release on crates.io, and it already satisfies the `"3.4.1"` requirement declared in crates/rig-mongodb/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p mongodb` and commit the updated REDACTED.
  • Outdated: notify — `notify` is locked at 8.2.0 but 8.2.1 is the current stable release on crates.io, and it already satisfies the `"8"` requirement declared in crates/rig-tools/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p notify` and commit the updated REDACTED.
  • Outdated: ordered-float — `ordered-float` is locked at 5.3.0 but 5.5.1 is the current stable release on crates.io, and it already satisfies the `"5"` requirement declared in crates/rig-core/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p ordered-float` and commit the updated REDACTED.
  • Outdated: proc-macro2 — `proc-macro2` is locked at 1.0.106 but 1.0.107 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in xtask/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p proc-macro2` and commit the updated REDACTED.
  • Outdated: prost-types — `prost-types` is locked at 0.14.3 but 0.14.4 is the current stable release on crates.io, and it already satisfies the `"0.14"` requirement declared in crates/rig-gemini-grpc/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p prost-types` and commit the updated REDACTED.
  • + 22 more in this group — see findings.md.

Appendix B — Reproduction & audit trail

Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-0a0aa38cd374466a8c12408cdf1960af/history.json --exit-code 0 --source .1artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-0a0aa38cd374466a8c12408cdf1960af/tree.json --exit-code 0 --source .1artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/watchdog-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt .26artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .46artifacts/raw/osv-scanner.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .0artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.0—
D36 · Supply-chain Provenance & Signingprovenance—provenance: not applicable — The CI pipeline builds and tests but publishes no released artifact — no package publish, container push, GitHub release or deployment step. Supply-chain provenance, signing and SBOM attest RELEASED artifacts, so there is nothing to attest here. Add them to the release pipeline when this repo starts shipping artifacts (a published package, a container image, a deployed service or a tagged release).0—
D37 · Vulnerability-disclosure Policydisclosure—disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .0artifacts/raw/osv-scanner.json

Run 01a17c8f-f944-7b74-8a42-9661158d972a · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.

⬇ Findings, MITRE CWE-tagged .sarif⬇ Health changelog .md