Public report — rig, published 29 Sep 2026. Concrete security findings (which rule fired, in which file, on which line; CVE IDs, secret matches, dependency versions) are REDACTED in this version; ask the repo owner for the full report.
Public
Codebase survey Measured under the Code Assurance Index · rubric rubric-2026.09.17 (frozen) · verify this survey Filed cd_827042edfa4b4c67bb47e0f7c97db003 Filed 29 September 2026, 08:29 UTC Public

0XPlaygrounds/rig

Measured 29 September 2026, 07:55 UTC

68% Adequate
CriticalWeakAdequateStrongExemplary

Large · 227,467 LoC · 32 projects · rebuild ~4.1 person-years · weakest lens: Readiness (58%)

Findings by grade

30 critical 370 serious 20 minor 49 could not be resolved — could be critical — see Limitations

This survey was produced by

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
29 September 2026, 07:55 UTC

A measurement, not a certificate. The Code Assurance Index does not certify, approve or guarantee this codebase; it records a reproducible number and the evidence it was computed from. The standard is authored by Canine Development, who also build Watchdog — its only implementation today. That is said here so the number is checked rather than believed.

Grounded in facts. Every number here is computed, not narrated — reproducible, tool-backed, and traceable to a line of code. How to trust this ▸

43/47dimensions tool-verifieddeterministic · confidence 1.0 · 4 LLM-assisted, advisory
404findings with an exact file:lineof 420 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
47/127dimensions across the health lenses227467 LoC · 32 projects — wide & deep
Chapters

Executive summary

Band capped at Adequate: the weakest category (Security, 40%) reads Weak — the cover never out-promises the category table.

Preview (pre-1.0). This repo hasn't declared a stable release, so it's judged against a relaxed, pre-production bar.

The system holds an adequate overall standing of 68%, reflecting a robust foundation that carries real operational risk. While the code is clean and the architecture is sound, the asset is large, representing approximately 4.1 person-years of value. Rebuilding this would cost roughly €600,000, making it a significant business investment that requires careful stewardship to protect delivery speed and reliability.

The primary risk lies in production readiness, which scores only 58%. This gap means the system lacks the necessary safeguards for safe, continuous operation. Without proper timeouts and release gates, a single failure can cascade, causing outages or delaying releases. This weakness threatens the reliability of the service and increases the cost of maintaining stability, as teams must manually intervene to prevent bad builds from reaching users.

A secondary concern is security exposure, particularly regarding leaked secrets. Although the overall security score is 79%, the presence of two confirmed leaked secrets in test files poses an immediate threat. If these credentials are compromised, the business faces potential data breaches and compliance violations. Addressing this is critical to reducing security exposure and ensuring that sensitive information remains protected from unauthorized access.

Despite these risks, the system has genuine strengths. The code health is excellent at 88%, and domain modeling is perfect, indicating that the core logic is well-structured and maintainable. This high quality reduces the long-term cost of changes and makes it easier for new engineers to understand the system. These strengths provide a solid base for improvement, allowing the team to focus on operational gaps without rewriting core logic.

The highest-leverage action is to resolve the leaked secrets immediately. This small effort yields significant risk reduction and should be prioritized above all else. Once secured, the team should implement whole-request timeouts and release gates to bolster production readiness. This focused approach protects the substantial investment in the system while enhancing its operational resilience and security posture.

How the score is built — each lens's share of the headline Width is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
Readiness 58% · 45% weightMaturity 66% · 25% weightSecurity 79% · 14% weightCode Health 88% · 8% weightArchitecture 97% · 4% weightDomain Modelling 100% · 2% weightEvent Sourcing 100% · 1% weightPerformance 100% · 1% weight

Raise Readiness 58 → 70 (the Healthy floor) ⇒ headline 68 → ~73.

Code composition — where the lines go
Tests 100%
New since the last scan (100+)

182 finding(s) are new versus the previous scan (2026-09-12) — surfaced by this scheduled scan itself, no pull request required. Showing the first 100; the full set is in the report.

  • D1 · rig_cassette::ecs::delivery::collect_replayed (cyclomatic 37) crates/rig-cassette/src/ecs/delivery.rs
  • D1 · ReplayDelivery::new (cyclomatic 35) crates/rig-cassette/src/ecs/delivery.rs
  • D1 · MessagesDecoder::interpret_content (cyclomatic 29) crates/rig-core/src/providers/anthropic/streaming.rs
  • D1 · xtask::cassette::scan::scan (cyclomatic 27) xtask/src/cassette/scan.rs
  • D1 · File::compare (cyclomatic 25) xtask/src/cassette/audit.rs
  • D1 · rig_core::providers::openai::responses_api::input_items (cyclomatic 24) crates/rig-core/src/providers/openai/responses_api/mod.rs
  • D1 · rig_ecs::checkpoint::validate (cyclomatic 24) crates/rig-ecs/src/checkpoint.rs
  • D1 · rig_cassette::ecs::delivery::deliver_stream (cyclomatic 23) crates/rig-cassette/src/ecs/delivery.rs
  • D1 · rig_core::driver::read (cyclomatic 23) crates/rig-core/src/driver.rs
  • D1 · Message::from_message (cyclomatic 22) crates/rig-core/src/providers/anthropic/completion.rs
  • D1 · StreamState::process_event (cyclomatic 21) crates/rig-bedrock/src/streaming.rs
  • D1 · InteractionsDecoder::decode (cyclomatic 21) crates/rig-core/src/providers/gemini/interactions_api/streaming.rs
  • D1 · xtask::cassette::scan::key_shape (cyclomatic 21) xtask/src/cassette/scan.rs
  • D1 · rig_cassette::ecs::identity::required_row (cyclomatic 19) crates/rig-cassette/src/ecs/identity.rs
  • D1 · Caching::send (cyclomatic 19) crates/rig-core/src/client/gemini_caching.rs
  • D1 · GenerateContentDecoder::decode (cyclomatic 18) crates/rig-core/src/providers/gemini/streaming.rs
  • D1 · Buffered::poll (cyclomatic 17) crates/rig-cassette/src/ecs/delivery.rs
  • D1 · HttpExchange::streaming (cyclomatic 17) crates/rig-core/src/driver/http_transport.rs
  • D1 · File::header (cyclomatic 17) xtask/src/cassette/audit.rs
  • D1 · Session::record_one (cyclomatic 17) xtask/src/cassette/record.rs
  • D1 · GenerateContentDecoder::interpret_part (cyclomatic 16) crates/rig-core/src/providers/gemini/streaming.rs
  • D1 · rig_ecs::agent::checkpoint::validate (cyclomatic 16) crates/rig-ecs/src/agent/checkpoint.rs
  • D1 · xtask::cassette::goldens::inserted_per_batch (cyclomatic 16) xtask/src/cassette/goldens.rs
  • D2 · rig_cassette::ecs::delivery::collect_replayed (cognitive 65) crates/rig-cassette/src/ecs/delivery.rs
  • D2 · ReplayDelivery::new (cognitive 57) crates/rig-cassette/src/ecs/delivery.rs
  • D2 · MessagesDecoder::interpret_content (cognitive 47) crates/rig-core/src/providers/anthropic/streaming.rs
  • D2 · rig_cassette::ecs::delivery::deliver_stream (cognitive 44) crates/rig-cassette/src/ecs/delivery.rs
  • D2 · xtask::cassette::scan::scan (cognitive 43) xtask/src/cassette/scan.rs
  • D2 · rig_core::providers::openai::responses_api::input_items (cognitive 42) crates/rig-core/src/providers/openai/responses_api/mod.rs
  • D2 · rig_ecs::checkpoint::validate (cognitive 38) crates/rig-ecs/src/checkpoint.rs
  • D2 · File::compare (cognitive 37) xtask/src/cassette/audit.rs
  • D2 · EffectLogReplayer::serve (cognitive 36) crates/rig-cassette/src/effect_log/replay.rs
  • D2 · rig_core::driver::read (cognitive 34) crates/rig-core/src/driver.rs
  • D2 · InteractionsDecoder::decode (cognitive 33) crates/rig-core/src/providers/gemini/interactions_api/streaming.rs
  • D2 · xtask::cassette::owner::module_map (cognitive 32) xtask/src/cassette/owner.rs
  • D2 · rig_cassette::http::relay::advance_body (cognitive 31) crates/rig-cassette/src/http/relay.rs
  • D2 · rig_core::providers::openai::wire::chat::finalize_deepseek (cognitive 31) crates/rig-core/src/providers/openai/wire/chat.rs
  • D2 · Message::from_message (cognitive 30) crates/rig-core/src/providers/anthropic/completion.rs
  • D2 · rig_ecs::systems::gather_turn (cognitive 30) crates/rig-ecs/src/systems/mod.rs
  • D2 · HttpExchange::streaming (cognitive 29) crates/rig-core/src/driver/http_transport.rs
  • D2 · StreamState::process_event (cognitive 26) crates/rig-bedrock/src/streaming.rs
  • D2 · Buffered::poll (cognitive 26) crates/rig-cassette/src/ecs/delivery.rs
  • D2 · rig_cassette::ecs::identity::required_row (cognitive 25) crates/rig-cassette/src/ecs/identity.rs
  • D2 · Caching::send (cognitive 23) crates/rig-core/src/client/gemini_caching.rs
  • D2 · xtask::cassette::goldens::inserted_per_batch (cognitive 23) xtask/src/cassette/goldens.rs
  • D2 · GenerateContentDecoder::decode (cognitive 22) crates/rig-core/src/providers/gemini/streaming.rs
  • D2 · rig_ecs::checkpoint::restore::load_world (cognitive 22) crates/rig-ecs/src/checkpoint/restore.rs
  • D2 · ChatDecoder::interpret_chunk (cognitive 21) crates/rig-core/src/providers/openai/wire/chat.rs
  • D2 · rig_ecs::systems::advance (cognitive 21) crates/rig-ecs/src/systems/mod.rs
  • D2 · File::header (cognitive 21) xtask/src/cassette/audit.rs
  • D2 · xtask::bevy::check (cognitive 21) xtask/src/bevy.rs
  • D2 · rig_ecs::systems::read_turn (cognitive 20) crates/rig-ecs/src/systems/mod.rs
  • D2 · xtask::cassette::scan::key_shape (cognitive 20) xtask/src/cassette/scan.rs
  • D2 · EffectLogReplayer::check_header (cognitive 19) crates/rig-cassette/src/effect_log/replay.rs
  • D2 · GenerateContentDecoder::interpret_part (cognitive 19) crates/rig-core/src/providers/gemini/streaming.rs
  • D2 · rig_core::providers::openai::completion::assistant_content_to_messages (cognitive 19) crates/rig-core/src/providers/openai/completion/mod.rs
  • D2 · rig_ecs::systems::fold (cognitive 19) crates/rig-ecs/src/systems/mod.rs
  • D2 · rig_ecs::systems::judge_invalid_calls (cognitive 19) crates/rig-ecs/src/systems/mod.rs
  • D2 · rig_typesafeai::questions::validate_definition (cognitive 19) crates/rig-typesafeai/src/questions.rs
  • D2 · rig_vertexai::types::completion_response::assistant_content (cognitive 19) crates/rig-vertexai/src/types/completion_response.rs
  • D2 · Session::record_one (cognitive 19) xtask/src/cassette/record.rs
  • D2 · xtask::cassette::spend::spend (cognitive 19) xtask/src/cassette/spend.rs
  • D2 · xtask::cassette::record::run (cognitive 19) xtask/src/cassette/record.rs
  • D2 · CassetteScrubber::scrub_json_value (cognitive 18) crates/rig-cassette/src/http/mod.rs
  • D2 · rig_ecs::checkpoint::spawn_into (cognitive 18) crates/rig-ecs/src/checkpoint.rs
  • D2 · GrpcAdapter::interpret_part (cognitive 18) crates/rig-gemini-grpc/src/streaming.rs
  • D2 · xtask::cassette::audit::run (cognitive 18) xtask/src/cassette/audit.rs
  • D2 · ChatDecoder::interpret_stream (cognitive 17) crates/rig-core/src/providers/cohere/streaming.rs
  • D2 · BinaryAssets::resolve (cognitive 17) crates/rig-ecs/src/agent/content/binary.rs
  • D2 · rig_ecs::agent::checkpoint::validate (cognitive 17) crates/rig-ecs/src/agent/checkpoint.rs
  • D2 · rig_typesafeai::questions::validate (cognitive 17) crates/rig-typesafeai/src/questions.rs
  • D2 · File::stream (cognitive 17) xtask/src/cassette/audit.rs
  • D2 · xtask::cassette::audit::block_parts (cognitive 17) xtask/src/cassette/audit.rs
  • D2 · rig_cassette::http::ledger::clean_up (cognitive 16) crates/rig-cassette/src/http/ledger.rs
  • D2 · rig_cassette::ecs::identity::builder_spec_json (cognitive 16) crates/rig-cassette/src/ecs/identity.rs
  • D2 · OllamaDecoder::interpret_record (cognitive 16) crates/rig-core/src/providers/ollama.rs
  • D2 · rig_core::providers::openai::wire::chat::refuse_file_ids (cognitive 16) crates/rig-core/src/providers/openai/wire/chat.rs
  • D3 · FileTooLong: http/mod.rs crates/rig-cassette/src/http/mod.rs
  • D3 · FileTooLong: wire/chat.rs crates/rig-core/src/providers/openai/wire/chat.rs
  • D3 · FileTooLong: operation/completion.rs crates/rig-core/src/operation/completion.rs
  • D3 · FileTooLong: wire/modality.rs crates/rig-core/src/providers/openai/wire/modality.rs
  • D3 · FunctionTooLong: rig_cassette::ecs::delivery::collect_replayed crates/rig-cassette/src/ecs/delivery.rs
  • D3 · MethodTooLong: ReplayDelivery.new crates/rig-cassette/src/ecs/delivery.rs
  • D3 · TooManyMethods: OpenAIConfig crates/rig-core/src/providers/openai/wire.rs
  • D3 · MethodTooLong: MessagesDecoder.interpret_content crates/rig-core/src/providers/anthropic/streaming.rs
  • D3 · FunctionTooLong: rig_core::providers::openai::responses_api::input_items crates/rig-core/src/providers/openai/responses_api/mod.rs
  • D3 · MethodTooLong: Message.from_message crates/rig-core/src/providers/anthropic/completion.rs
  • D3 · FileTooLong: openai/wire.rs crates/rig-core/src/providers/openai/wire.rs
  • D3 · FunctionTooLong: rig_ecs::systems::gather_turn crates/rig-ecs/src/systems/mod.rs
  • D3 · TooManyFields: Quirks crates/rig-core/src/providers/openai/wire.rs
  • D3 · MethodTooLong: CacheBook.plan crates/rig-core/src/providers/gemini/caching.rs
  • D3 · MethodTooLong: Content.try_from crates/rig-vertexai/src/types/message.rs
  • D3 · FileTooLong: cassette/audit.rs xtask/src/cassette/audit.rs
  • D3 · FileTooLong: agent/mod.rs crates/rig-ecs/src/agent/mod.rs
  • D3 · TooManyMethods: Out crates/rig-core/src/wire.rs
  • D3 · FileTooLong: src/pose.rs crates/rig-candle/src/pose.rs
  • D3 · FileTooLong: gemini/caching.rs crates/rig-core/src/providers/gemini/caching.rs
  • D3 · FileTooLong: ecs/delivery.rs crates/rig-cassette/src/ecs/delivery.rs
  • D3 · FunctionTooLong: rig_cassette::ecs::identity::spec_json crates/rig-cassette/src/ecs/identity.rs
  • D3 · MethodTooLong: StreamState.process_event crates/rig-bedrock/src/streaming.rs

A full-fidelity diff against the previous run's complete recorded findings — line-move tolerant: a finding that only shifted line counts as unchanged, only genuinely new titles/files surface here.

Rebuild cost & value ~ Modeled — €200,000–€1,000,000
Cost to rebuild€200,000–€1,000,000 (2.0–6.2 person-years (3,302–10,474 h), ~2–8 engineers)
Domain complexityStandard — harder problems cost more per line
Quality factor1.0× (at 68% quality) — the last 20% of quality is most of the work
Size & shapeLarge · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)

This codebase represents roughly ~4.1 person-years of build effort (about ~€600,000 to rebuild). Its weakest lens is Readiness at 58% — the part of that asset most exposed by the findings below.

How we model this: boilerplate at a scaffolding rate + logic × domain Standard (×1.0) — standard service × a 1.0× quality factor, at €60–95/h; indicative, ±~30% · size measured directly from source · effort from total production LoC as straight-line logic (the tier split is a C#-only syntax walk), a conservative lower bound. Indicative only — most sensitive to the hourly rate and the domain tier (both tunable in config).

Top priorities

The highest-leverage moves; the full ranked list is in the Roadmap below.

1
Resolve the 2 Leaked secret finding(s) in Secret Scanning — start with REDACTED (2).
+9.1 pts · Low effort · Secret Scanning
2
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.
+9.1 pts · Medium effort · Deployment & Rollback
3
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.
+9.1 pts · Medium effort · Outbound HTTP resilience

Diagnosis — what's actually going on

Value concentrated against a weak lens · Medium · Value at risk
This is a Large asset (~4.1 person-years to rebuild), and its weakest lens is Readiness at 58%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
Evidence: valuation: Large, ~4.1 person-years rebuild (227,467 LoC) · weakest lens: Readiness 58%
→ Direct remediation budget at Readiness first — highest risk-reduction per euro on an asset this size.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Resolve the 2 Leaked secret finding(s) in Secret Scanning — start with REDACTED (2). The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Resolve the 2 Leaked secret finding(s) in Secret Scanning — start with REDACTED (2).

Architecture — module dependency graph

Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways — a layering smell or cycle. A clean layered graph has none.

arch rig rig rig-agent rig-agent rig->rig-agent rig-bedrock rig-bedrock rig->rig-bedrock rig-candle rig-candle rig->rig-candle rig-cassette rig-cassette rig->rig-cassette rig-core rig-core rig->rig-core rig-derive rig-derive rig->rig-derive rig-fastembed rig-fastembed rig->rig-fastembed rig-gemini-grpc rig-gemini-grpc rig->rig-gemini-grpc rig-helixdb rig-helixdb rig->rig-helixdb rig-lancedb rig-lancedb rig->rig-lancedb rig-memory rig-memory rig->rig-memory rig-milvus rig-milvus rig->rig-milvus rig-mongodb rig-mongodb rig->rig-mongodb rig-neo4j rig-neo4j rig->rig-neo4j rig-reqwest rig-reqwest rig->rig-reqwest rig-tungstenite rig-tungstenite rig->rig-tungstenite rig-typesafeai rig-typesafeai rig->rig-typesafeai rig-agent->rig-core rig-agent->rig-derive rig-bedrock->rig-core rig-candle->rig-core rig-cassette->rig-agent rig-cassette->rig-core rig-ecs rig-ecs rig-cassette->rig-ecs rig-cassette->rig-reqwest rig-core->rig-derive rig-http rig-http rig-core->rig-http rig-core->rig-reqwest rig-core->rig-tungstenite rig-ecs->rig-core rig-fastembed->rig-core rig-gemini-grpc->rig-core rig-helixdb->rig-core rig-lancedb->rig-core rig-memory->rig-core rig-milvus->rig-core rig-milvus->rig-reqwest rig-mongodb->rig-core rig-neo4j->rig-core rig-reqwest->rig-http rig-tungstenite->rig-http rig-typesafeai->rig-core rig-typesafeai->rig-reqwest __more__ +10 more projects

Architecture — module dependency matrix

Rows and columns are the same modules, ordered so that a module only depends on ones above it. A cell means the row depends on the column, and its number is how many type pairs create that dependency. Read one thing: is anything above the diagonal? A mark there is a dependency cycle. (A cycle is all this shows — an unusual but cycle-free dependency sits below the diagonal like any other.)

394 modules, 1382 dependencies. 4 dependency cycles across 131 modules, marked above the diagonal.

Showing the 40 most-connected modules; 354 more are not drawn.

Module dependency matrix. The row depends on the column; the number is how many type pairs create the dependency. A cell above the diagonal is part of a dependency cycle.
depends on →1 rig_bedrock.types.converse_output2 rig_candle.types3 rig_core.completion.message.identity4 rig_core.providers.gemini.completion.erased_wire5 rig_core.vector_store.request6 rig_http.http_client.framing7 rig_core.providers.gemini.completion.gemini_api_types8 rig_core.completion.request9 rig_typesafeai.types10 rig_http.http_client11 rig_core.observe.adapter12 rig_http.wasm_compat13 rig_core.tool.context14 rig_core.vector_store15 rig_ecs.agent16 rig_agent.bus.handle17 rig_core.completion.message18 rig_core.error19 rig_agent.run20 rig_core.effect21 rig_agent.bus.dispatcher22 rig_cassette.effect_log.log23 rig_core.effect.family24 rig_agent.agent.hook25 rig_core.operation.completion26 rig_core.serve.handler27 rig_core.tool.contextual28 rig_core.wire29 rig_ecs.bus.effect30 rig_agent.bus.driver31 rig_core.driver.dyn_model32 rig_core.providers.anthropic.wire33 rig_typesafeai.questions34 rig_agent.agent.completion35 rig_core.driver36 rig_core.providers.gemini37 rig_core.providers.openai.wire38 rig_agent.agent.engine39 rig_core.client.openai40 rig_test_support.goldens
1 rig_bedrock.types.converse_output
2 rig_candle.types
3 rig_core.completion.message.identity
4 rig_core.providers.gemini.completion.erased_wire
5 rig_core.vector_store.request
6 rig_http.http_client.framing
7 rig_core.providers.gemini.completion.gemini_api_types1226
8 rig_core.completion.request33135
9 rig_typesafeai.types1
10 rig_http.http_client22
11 rig_core.observe.adapter111
12 rig_http.wasm_compat1
13 rig_core.tool.context2
14 rig_core.vector_store14
15 rig_ecs.agent23181
16 rig_agent.bus.handle1321196
17 rig_core.completion.message1101
18 rig_core.error114112
19 rig_agent.run226481
20 rig_core.effect21111
21 rig_agent.bus.dispatcher354316
22 rig_cassette.effect_log.log16
23 rig_core.effect.family81615
24 rig_agent.agent.hook313125143122111211
25 rig_core.operation.completion132311314
26 rig_core.serve.handler2412112
27 rig_core.tool.contextual214411111
28 rig_core.wire211321446
29 rig_ecs.bus.effect2372111
30 rig_agent.bus.driver11215231
31 rig_core.driver.dyn_model22231
32 rig_core.providers.anthropic.wire31212
33 rig_typesafeai.questions928
34 rig_agent.agent.completion31221311211
35 rig_core.driver14213152
36 rig_core.providers.gemini21
37 rig_core.providers.openai.wire2141
38 rig_agent.agent.engine41131215185173
39 rig_core.client.openai11
40 rig_test_support.goldens215213761519010213
Dependency, pointing down the layeringAbove the diagonal — part of a cycleThe module itself
…types.converse_outputrig_candle.types…tion.message.identity…ompletion.erased_wire….vector_store.request…p.http_client.framing…tion.gemini_api_types…re.completion.requestrig_typesafeai.typesrig_http.http_client…_core.observe.adapterrig_http.wasm_compatrig_core.tool.contextrig_core.vector_storerig_ecs.agentrig_agent.bus.handle…re.completion.messagerig_core.errorrig_agent.runrig_core.effect…_agent.bus.dispatcher…ssette.effect_log.logrig_core.effect.familyrig_agent.agent.hook….operation.completionrig_core.serve.handler…_core.tool.contextualrig_core.wirerig_ecs.bus.effectrig_agent.bus.driver…core.driver.dyn_model…viders.anthropic.wire…_typesafeai.questions…gent.agent.completionrig_core.driver…core.providers.gemini…providers.openai.wirerig_agent.agent.enginerig_core.client.openai…_test_support.goldens…types.converse_output1rig_candle.types2…tion.message.identity3…ompletion.erased_wire4….vector_store.request5…p.http_client.framing6…tion.gemini_api_types7…re.completion.request8rig_typesafeai.types9rig_http.http_client10…_core.observe.adapter11rig_http.wasm_compat12rig_core.tool.context13rig_core.vector_store14rig_ecs.agent15rig_agent.bus.handle16…re.completion.message17rig_core.error18rig_agent.run19rig_core.effect20…_agent.bus.dispatcher21…ssette.effect_log.log22rig_core.effect.family23rig_agent.agent.hook24….operation.completion25rig_core.serve.handler26…_core.tool.contextual27rig_core.wire28rig_ecs.bus.effect29rig_agent.bus.driver30…core.driver.dyn_model31…viders.anthropic.wire32…_typesafeai.questions33…gent.agent.completion34rig_core.driver35…core.providers.gemini36…providers.openai.wire37rig_agent.agent.engine38rig_core.client.openai39…_test_support.goldens40122633135122111121423181132119611011141122264812111135431616816153131251431221112111323113142412112214411111211321446237211111215231222313121292831221311211142131522121414113121518517311215213761519010213+354 more modules (most-connected shown)

At a glance — Code Health · 88% · Exemplary ·

At a glance — Architecture · 97% · Exemplary ·

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

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

At a glance — Security · 79% · Adequate · gated by D29 ·

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

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

At a glance — Performance · 100% · 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
A03:2021 — Injection27High / Critical
A06:2021 — Vulnerable & Outdated Components12Medium
A02:2021 — Cryptographic Failures2High / Critical

Roadmap

Immediately resolve the two leaked secrets in REDACTED and implement a draft release gate to prevent bad builds from reaching users. Strengthen system resilience by adding request timeouts and retry logic to all outbound HTTP calls, and enable Dependabot monitoring for GitHub Actions to ensure consistent security updates. Finally, establish a structured repository for architecture decision records to document key design choices and their consequences.

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

Do thisHelpsEffortDimension
Resolve the 2 Leaked secret finding(s) in Secret Scanning — start with REDACTED (2).+9.1 ptsLowSecret Scanning
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.+9.1 ptsMediumDeployment & Rollback
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.+9.1 ptsMediumOutbound HTTP resilience
Resolve the 1 Banned license finding(s) in License Compliance.+4.2 ptsLowLicense Compliance
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.+8.2 ptsMediumSecurity & performance tooling
Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree, with each file named `NNNN-title` in whatever markup those docs already use, is the most discoverable form).+5.2 ptsMediumArchitecture documentation
Add a 'Testing' section to the root README — how to run the test suite.+4.8 ptsMediumDocumentation (README)
Resolve the 7 Documentation finding(s) in Documentation Quality — start with README.md (7).+2.0 ptsLowDocumentation Quality

File quality

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

FileScoreBandWorst signal
REDACTED4.4MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.8MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.8MixedStatic Analysis (SAST): High: REDACTED
crates/rig-bedrock/src/streaming.rs5.1MixedCyclomatic Complexity: StreamState::process_event (cyclomatic 21)
REDACTED5.8MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.8MixedDependency Vulnerabilities: Medium CVE: REDACTED
crates/rig-agent/src/agent/engine.rs7.0Near-cleanCyclomatic Complexity: StreamingTurnSource::run_model_turn (cyclomatic 42)
crates/rig-cassette/src/ecs/delivery.rs7.0Near-cleanCyclomatic Complexity: rig_cassette::ecs::delivery::collect_replayed (cyclomatic 37)
crates/rig-ecs/src/systems/mod.rs7.0Near-cleanCyclomatic Complexity: rig_ecs::systems::land_batch (cyclomatic 20)
crates/rig-postgres/src/lib.rs7.0Near-cleanCode Duplication: Duplicated block (8 lines × 2)
crates/rig-core/src/providers/anthropic/completion.rs7.0Near-cleanCyclomatic Complexity: rig_core::providers::anthropic::completion::transform_strict_tool_schema (cyclomatic 31)
crates/rig-core/src/providers/openai/completion/mod.rs7.0Near-cleanCyclomatic Complexity: UserContent::try_from (cyclomatic 29)
crates/rig-candle/src/protocol.rs7.0Near-cleanCyclomatic Complexity: rig_candle::protocol::render_qwen_message (cyclomatic 27)
xtask/src/cassette/audit.rs7.0Near-cleanCyclomatic Complexity: File::compare (cyclomatic 25)
crates/rig-core/src/providers/gemini/completion.rs7.0Near-cleanCyclomatic Complexity: Part::try_from (cyclomatic 24)
crates/rig-core/src/providers/openai/responses_api/mod.rs7.0Near-cleanCyclomatic Complexity: rig_core::providers::openai::responses_api::input_items (cyclomatic 24)
crates/rig-core/src/providers/gemini/interactions_api/mod.rs7.0Near-cleanCyclomatic Complexity: Step::split (cyclomatic 17)
test-support/rig-test-support/src/reasoning.rs7.0Near-cleanCode Duplication: Duplicated block (21 lines × 2)
crates/rig-agent/src/run/mod.rs7.1Near-cleanCyclomatic Complexity: AgentRun::next_step (cyclomatic 21)
test-support/rig-test-support/src/matrix_registry.rs7.1Near-cleanCode Duplication: Duplicated block (12 lines × 2)

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 — 30

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 — 370

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 — 20

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

Could not be resolved — 49

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. 43 of 47 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 4 documentation/naming judgement(s) are LLM-assisted and labelled advisory. 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 — 47 dimensions across the health lenses
D1D2D3D4D5D6D9D10D12D13D14D15D16D17D19D21D26D28D29D30D31D34D35D43D44AX10AX3AX4AX8AX9DM4DM5DM6ES1ES2M1M2M3M4P1P2P3P4P6P7P8PF3

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, 404 of 420 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 measurementLocal LLM◐ LLM · sampled · advisory

Every finding is locatable in findings.md. Run 01a0ec29-4d8c-7f42-8335-a888356116f7.

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, .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 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 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,253 test source file(s) (.rs) 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, .mjs) and this repository declares a Cargo test suite (repository root, 1092 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.
  • D22 Internal API Consistency — LLM provider failed — The model provider returned an unusable result, so this LLM-assisted dimension fell back to a measurement gap (confidence 0) rather than a penalty. Re-run with a reachable provider to score it.
  • AX1 Captive dependencies — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • AX2 Stateful singletons — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • AX6 Interface segregation — 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 is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing 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.
  • C1 Data Protection — 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. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
  • C2 Access Controls — 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. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
  • C3 Audit Trail — 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. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
  • C4 Data Retention — 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. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
  • C5 Data-Subject Rights — 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. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
  • DM3 Integration-event coupling — 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. Not scored — a domain type leaking across a crate boundary cannot be told apart from source alone from a legitimate shared-kernel crate. Reported as guidance rather than measured.
  • DM7 Repository granularity — 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. Not scored — detecting 'a repository per CHILD entity' needs the aggregate-root structure, which is not resolvable from source alone here. Reported as guidance rather than measured.
  • ED5 Idempotency — 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 finds retry-prone mutations by walking the repository's declared types, and NONE was loaded on this run, so it had nothing to look at. That is a limit of the analyzer's reach — it reads .NET projects — not a finding that this repository has no command handlers or message consumers.
  • 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • P10 Library API & versioning — 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 NuGet packaging and C# public API only, and no .NET project was loaded for 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.
  • PF1 Benchmark discipline — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • PF2 Allocation hygiene — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • S1 Web-Security Posture — 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. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
  • X1 Async 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X10 Duplicated predicate — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X12 Unreachable branch — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X13 Undrained process stream — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X14 Bypassable address classification — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X15 Unvalidated length from an untrusted reader — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X17 Uncapped recursion over a caller-supplied document — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X19 Unrestored process-global state — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X2 Cancellation propagation — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X20 Mistyped argument guard — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X21 Side-effecting pattern guard — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X22 Contradicted release guard — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X23 Unguarded diagnostic materialisation — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X24 Document value interpolated into markup unescaped — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X25 Inert configuration knob — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X26 Unsynchronised callback handoff — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X27 Collection changed while being enumerated — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X28 Index access outside its own emptiness guard — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X29 Per-element action decided by a fixed element — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X3 Exception handling — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X30 Support guard that admits what it rejects — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X32 Type resolved by simple name across every loaded assembly — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X4 Structured logging — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X6 Hand-rolled structured-format parsing — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X7 Silent fallback defaults — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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 Secret Scanning: Secret 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 is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
  • D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is 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.

The LLM boundary

LLM-set scores this run (4): D19, D21, D26, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.

Dimensions

D1 · Cyclomatic Complexity6.9 / 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.9 / 10 · rule-coverage 100% · ceiling Prevented

59 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was StreamingTurnSource::run_model_turn at 42. A further 4 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. 3 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), crates/rig-core/src/error.rs (ErrorKind::code at 18), crates/rig-candle/src/pose.rs (BodyPart::select at 17). 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_ecs::bus::collect::collect_streams (cyclomatic 30) · ×7crates/rig-ecs/src/bus/collect.rs:104
xtask::verify::selection::plan (cyclomatic 41) · ×6xtask/src/verify/selection.rs:197
rig_core::providers::anthropic::completion::transform_strict_tool_schema (cyclomatic 31) · ×6crates/rig-core/src/providers/anthropic/completion.rs:1389
rig_cassette::ecs::delivery::collect_replayed (cyclomatic 37) · ×3crates/rig-cassette/src/ecs/delivery.rs:378
rig_agent::agent::engine::drive_agent (cyclomatic 29) · ×3crates/rig-agent/src/agent/engine.rs:150

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

What to do

  1. Resolve the 7 rig_ecs finding(s) in Cyclomatic Complexity — start with checkpoint.rs (2), mod.rs (2), collect.rs. — One of this dimension's main actionable groups (7 warning-level).
  2. Resolve the 6 xtask finding(s) in Cyclomatic Complexity — start with scan.rs (2), selection.rs, preflight.rs. — One of this dimension's main actionable groups (6 warning-level).
  3. Resolve the 6 rig_core finding(s) in Cyclomatic Complexity — start with completion.rs (2), mod.rs (2), schema.rs. — One of this dimension's main actionable groups (6 warning-level).
  4. 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 Complexity6.0 / 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 6.0 / 10 · rule-coverage 100% · ceiling Prevented

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

rig_ecs::bus::collect::collect_streams (cognitive 87) · ×17crates/rig-ecs/src/bus/collect.rs:104
rig_core::providers::internal::schema::sanitize_schema (cognitive 56) · ×16crates/rig-core/src/providers/internal/schema.rs:24
xtask::verify::selection::plan (cognitive 75) · ×13xtask/src/verify/selection.rs:197
rig_cassette::ecs::delivery::collect_replayed (cognitive 65) · ×6crates/rig-cassette/src/ecs/delivery.rs:378
rig_candle::protocol::render_qwen_message (cognitive 65) · ×5crates/rig-candle/src/protocol.rs:554

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

What to do

  1. Resolve the 17 rig_ecs finding(s) in Cognitive Complexity — start with mod.rs (9), checkpoint.rs (3), collect.rs (2). — One of this dimension's main actionable groups (17 warning-level).
  2. Resolve the 16 rig_core finding(s) in Cognitive Complexity — start with mod.rs (5), completion.rs (4), chat.rs (2). — One of this dimension's main actionable groups (16 warning-level).
  3. Resolve the 13 xtask finding(s) in Cognitive Complexity — start with scan.rs (2), execute.rs (2), audit.rs (2). — One of this dimension's main actionable groups (13 warning-level).
  4. 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.0 / 10Strong✓ 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.0 / 10 · rule-coverage 100% · ceiling Prevented

70 god class(es) detected.

FileTooLong: http/mod.rs · ×29crates/rig-cassette/src/http/mod.rs
MethodTooLong: StreamingTurnSource.run_model_turn · ×17crates/rig-agent/src/agent/engine.rs:788
FunctionTooLong: xtask::verify::checks::all · ×16xtask/src/verify/checks.rs:42
TooManyMethods: AgentRun · ×6crates/rig-agent/src/run/mod.rs:367
ClassTooLong: AgentRuncrates/rig-agent/src/run/mod.rs:367

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

What to do

  1. Resolve the 29 FileTooLong finding(s) in God Classes — start with mod.rs (8), completion.rs (3), lib.rs (2). — One of this dimension's main actionable groups (29 warning-level).
  2. Resolve the 17 MethodTooLong finding(s) in God Classes — start with mod.rs (5), streaming.rs (3), completion.rs (2). — One of this dimension's main actionable groups (17 warning-level).
  3. Resolve the 16 FunctionTooLong finding(s) in God Classes — start with mod.rs (2), engine.rs (2), completion.rs (2). — One of this dimension's main actionable groups (16 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 64 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

64 duplicated block group(s) detected. 25 of the 64 are in trees this repository does not ship — vendored, example/demo, 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 (9 lines × 2) · ×8crates/rig-core/src/providers/cohere/wire.rs:292
Duplicated block (5 lines × 2) · ×8crates/rig-agent/src/bus/driver.rs:448
Duplicated block (7 lines × 2) · ×7crates/rig-candle/src/loader.rs:117
Duplicated block (11 lines × 2) · ×6crates/rig-cassette/src/ecs/delivery.rs:723
Duplicated block (8 lines × 2) · ×5crates/rig-core/src/providers/openai/wire/chat.rs:347

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

What to do

  1. Resolve the 8 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with streaming_conformance.rs (2), wire.rs, native.rs. — One of this dimension's main actionable groups (8 warning-level).
  2. Resolve the 8 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with matrix_registry.rs (2), driver.rs, patch.rs. — One of this dimension's main actionable groups (8 warning-level).
  3. Resolve the 7 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with loader.rs, model.rs, native.rs. — One of this dimension's main actionable groups (7 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 · Coupling9.7 / 10Stronggated by 1 serious finding✓ 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 9.7 / 10 · rule-coverage 100% · ceiling Prevented

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

Off the main sequence: rig-core

What to do

  1. Resolve the 1 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (1 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 2 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

2 of 335 classes have LCOM4 above 3.

Low cohesion: NewCachedContent (LCOM4 5) · ×2crates/rig-core/src/providers/gemini/cached_content.rs:92

What to do

  1. Resolve the 2 Low cohesion finding(s) in Cohesion (LCOM4) — start with cached_content.rs, client.rs. — One of this dimension's main actionable groups (2 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 Distribution10.0 / 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 10.0 / 10 · rule-coverage 100% · ceiling Documented

6660 test methods: 3062 unit, 3586 integration, 0 BDD, 12 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 6653 `#[test]` function(s) across 1092 file(s) declaring at least one; its unit/integration split is Cargo's own — 856 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 5 test function(s) across 1 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,253 test source file(s) (.rs) 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 Hygiene9.7 8.9 / 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.9 / 10 · rule-coverage 92% · ceiling Verified

7 outdated, 0 yanked direct Cargo dependencies. 12 of 13 direct crates were graded against crates.io (0 not published there, 1 not resolved by a committed REDACTED). 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-sdk-s3vectors · ×7

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 · Secret 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

2 secret(s) detected.

REDACTED

What to do

  1. Resolve the 2 Leaked secret finding(s) in Secret Scanning — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
  2. Enforce Secret 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 1157 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 38 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/completion/mod.rs (51×29=1479); crates/rig-core/src/providers/openai/responses_api/mod.rs (59×24=1416); crates/rig-core/src/providers/gemini/completion.rs (50×24=1200)

Hotspot: crates/rig-core/src/providers/openai/completion/mod.rs · ×38crates/rig-core/src/providers/openai/completion/mod.rs:653

What to do

  1. Resolve the 38 Hotspot finding(s) in Churn × Complexity Hotspots — start with streaming.rs (7), mod.rs (5), completion.rs (2). — One of this dimension's main actionable groups (38 warning-level).

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

D16 · Bus Factor8.6 / 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.6 / 10 · rule-coverage 100% · ceiling Documented

66 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is test-support/rig-test-support/src/support.rs. Counted over 476 of the 623 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 227467 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 QualityStrong◐ Sampled · advisory

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

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.

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

The repository's root README (with links to docs.rs, crates.io, Discord, and a warning) plus 38 example/README.md and 4 scripts/README.md documents the project as a whole with an overview, installation, usage, and contribution guide. The main architecture/design documentation is missing but all visible documents are complete for their respective directories: the root README gives an overview, install, and a one-line warning; each subdirectory's README describes its own directory (examples, scripts, tests) and shows how to run it with examples or commands. The READMEs for each of the 39 crates (rig-fastembed to rig-s3vectors) are all directory-level documentation that describe what their crate does and how to add it as a dependency; none is the repository root. The project's single architecture/design doc is absent from this set, so any architectural guidance would be outside these files. All 39 READMEs are present and well written with clear headings (Fastembed integration, Rig-Gemini-gRPC, etc.) and examples. A strong README for the crates/rig-scylladb directory that clearly states what it is (an embedding/vector store over ScyllaDB) and shows a runnable Rust example with an embedded struct, Tokio main, session creation, OpenAI model integration, vector-store construction, and query output. It links to examples and notes its capabilities and future direction.

Documentation: no project overview · ×7README.md

What to do

  1. Resolve the 7 Documentation finding(s) in Documentation Quality — start with README.md (7). — One of this dimension's main actionable groups (7 recommendation-level).

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

D21 · Naming ConsistencyExemplary◐ Sampled · advisory

What it measures: Whether names — types, methods, variables — are clear and consistent.

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.

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

0 naming inconsistencies across 0 sampled symbols.

✓ On the Gold path — maintain.

Detailed fixes: d21_recommendation.md.

D26 · Project Cohesion7.5 / 10Strong✓ 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 7.5 / 10 · rule-coverage 100% · ceiling Documented

4 of 32 build units (Cargo) flagged as possibly oversized/incoherent.

Split crates/rig-core

What to do

  1. Resolve the 1 Split crates/rig-core 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)10.0 / 10Exemplary○ Nothing flagged

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

Method: Secret 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 10.0 / 10 · rule-coverage 100% · ceiling Documented

gitleaks scanned the full history AND the current working tree and found no secrets.

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)3.5 / 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 3.5 / 10 · rule-coverage 100% · ceiling Documented

27 finding(s): 0 critical, 27 high, 0 medium, 0 low. 21 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 4 file(s) — `crates/rig-cassette/fixtures/cassettes/perplexity/raw_capture_matrix/normalized_fields_match_raw_renormalized.yaml`, `crates/rig-cassette/fixtures/cassettes/perplexity/raw_capture_matrix/raw_exposes_object_not_citations.yaml`, `crates/rig-cassette/fixtures/cassettes/perplexity/raw_capture_matrix/raw_round_trips_openai_type.yaml`, `test-support/rig-test-support/src/support.rs` (line 1255) — 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

What to do

  1. 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).
  2. 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).
  3. Resolve the 1 REDACTED finding(s) charged to Static Analysis (SAST) — the other 21 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 (22 issue-level, 1 of them charged here).

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

D30 · Dependency Vulnerabilities7.8 / 10Strong✓ 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 7.8 / 10 · rule-coverage 100% · ceiling Documented

12 finding(s): 0 critical, 0 high, 12 medium, 0 low.

REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 8 Medium advisory (unmaintained) finding(s) in Dependency Vulnerabilities — start with REDACTED (8). — One of this dimension's main actionable groups (8 warning-level).
  2. Resolve the 3 Medium vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED (3). — One of this dimension's main actionable groups (3 warning-level).
  3. Resolve the 1 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 warning-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 476 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is crates/rig-core/src/embeddings/embed.rs. Counted over 476 of the 623 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

✓ On the Gold path — maintain.

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

D35 · Change Coupling9.7 / 10Stronggated by 6 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.7 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: lib.rs↔lib.rs 64%; lib.rs↔lib.rs 64%; lib.rs↔lib.rs 64%

Change-coupling hub: lib.rs → lib.rs, lib.rs, lib.rs, lib.rs, lib.rs · ×3crates/rig-scylladb/src/lib.rs
Change coupling: streaming.rs ↔ streaming.rs · ×3crates/rig-bedrock/src/streaming.rs

What to do

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

What to do

  1. Resolve the 1 End-of-life runtime finding(s) in Platform End-of-Life. — 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.6 / 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.

DM4 · Rich vs anemic domain model10.0 / 10Exemplary✓ 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.

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)7.3 / 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 'Testing' section to the root README — 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 67 of 100 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 significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree, with each file named `NNNN-title` in whatever markup those docs already use, is the most discoverable form).
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◐ Sampled · advisory

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.

P2 · Observability9.8 / 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 12/13 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `xtask`.

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
P3 · Security & performance tooling7.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. 8 of the 8 files that make outbound calls are unbounded; the first 8 are listed. — 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. (×3) — crates/rig-cassette/src/http/ledger.rs:328, crates/rig-cassette/src/http/paths.rs:234, crates/rig-reqwest/src/lib.rs:64
  • `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:104
  • `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:127

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.

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) or inside a Java method returning a Reactor Mono/Flux — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.

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 Health88%ExemplarySolid.
Architecture97%ExemplarySolid.
Maturity66%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.
Security79%Adequate — gated by D29Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Domain Modelling100%ExemplaryStrongest area.
Event Sourcing100%ExemplarySolid.
Performance100%ExemplarySolid.
Not evidenced — 4 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.

  • C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) 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. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) 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. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) 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. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 76 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 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
  • AX2 Stateful singletons — 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
  • 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 — not assessed — interface segregation is computed over a type surface 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
  • 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) — DEPRECATED: The legacy builder is deprecated and will be removed in a future release. Install the buildx component to build images with BuildKit: https://docs.docker.com/go/bui…; 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 — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) 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. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) 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. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • 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.
  • D20 ADR Quality — N/A — ADRs are expected on deployable products with a user-facing host, not consumed libraries; no ADR log is required here.
  • D22 Internal API Consistency — LLM evaluation failed
  • 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. 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 — No inline comments to assess — comment value is not applicable here.
  • D25 ADR Conformance — no ADRs to check
  • D27 Navigability — symbol resolution incomplete — navigability not assessed
  • 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 scored — a domain type leaking across a crate boundary cannot be told apart from source alone from a legitimate shared-kernel crate. Reported as guidance rather than measured
  • DM7 Repository granularity — not scored — detecting 'a repository per CHILD entity' needs the aggregate-root structure, which is not resolvable from source alone here. Reported as guidance rather than measured
  • 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 — This check finds retry-prone mutations (command handlers and message/event consumers) by walking the repository's declared types, and none was loaded here, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C# syntax, and none was loaded for this repository. 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
  • P10 Library API & versioning — 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
  • PF1 Benchmark discipline — 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
  • PF2 Allocation hygiene — 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
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) 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. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • X1 Async 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
  • X10 Duplicated predicate — 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
  • X12 Unreachable branch — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X13 Undrained process stream — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X14 Bypassable address classification — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X15 Unvalidated length from an untrusted reader — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X16 Unfloored truncation loop — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X17 Uncapped recursion over a caller-supplied document — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X18 Disposal-pattern correctness — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X19 Unrestored process-global state — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X2 Cancellation propagation — 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
  • X20 Mistyped argument guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X21 Side-effecting pattern guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X22 Contradicted release guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X23 Unguarded diagnostic materialisation — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X24 Document value interpolated into markup unescaped — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X25 Inert configuration knob — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X26 Unsynchronised callback handoff — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X27 Collection changed while being enumerated — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X28 Index access outside its own emptiness guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X29 Per-element action decided by a fixed element — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X3 Exception handling — 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
  • X30 Support guard that admits what it rejects — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X32 Type resolved by simple name across every loaded assembly — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X4 Structured logging — 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
  • 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 — 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
  • X7 Silent fallback defaults — 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
  • 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 — 30 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D13 · Secret Scanning · Leaked secret · ×2
  • 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.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
Serious — 370 finding(s)
D15 · Churn × Complexity Hotspots · Hotspot · ×38
  • Hotspot: crates/rig-core/src/providers/openai/completion/mod.rs crates/rig-core/src/providers/openai/completion/mod.rs:653 — crates/rig-core/src/providers/openai/completion/mod.rs changed 51 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in UserContent::try_from at line 653. 7 of those changes were fix/bug commits, and the other 44 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 07:44:24 +00:00' --until='2026-09-29 07:44:24 +00:00' --full-history --no-merges -- crates/rig-core/src/providers/openai/completion/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/openai/responses_api/mod.rs crates/rig-core/src/providers/openai/responses_api/mod.rs:394 — crates/rig-core/src/providers/openai/responses_api/mod.rs changed 59 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in rig_core::providers::openai::responses_api::input_items at line 394. 15 of those changes were fix/bug commits, and the other 44 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 07:44:24 +00:00' --until='2026-09-29 07:44:24 +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/gemini/completion.rs crates/rig-core/src/providers/gemini/completion.rs:887 — crates/rig-core/src/providers/gemini/completion.rs changed 50 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in Part::try_from at line 887. 8 of those changes were fix/bug commits, and the other 42 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 07:44:24 +00:00' --until='2026-09-29 07:44:24 +00:00' --full-history --no-merges -- crates/rig-core/src/providers/gemini/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-core/src/providers/anthropic/streaming.rs crates/rig-core/src/providers/anthropic/streaming.rs:257 — crates/rig-core/src/providers/anthropic/streaming.rs changed 39 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in MessagesDecoder::interpret_content at line 257. 5 of those changes were fix/bug commits, and the other 34 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 07:44:24 +00:00' --until='2026-09-29 07:44:24 +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/anthropic/completion.rs crates/rig-core/src/providers/anthropic/completion.rs:859 — crates/rig-core/src/providers/anthropic/completion.rs changed 44 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in Message::from_message at line 859. 6 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 07:44:24 +00:00' --until='2026-09-29 07:44:24 +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/run/mod.rs crates/rig-agent/src/run/mod.rs:881 — crates/rig-agent/src/run/mod.rs changed 44 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in AgentRun::next_step at line 881. 3 of those changes were fix/bug commits, and the other 41 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 07:44:24 +00:00' --until='2026-09-29 07:44:24 +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-agent/src/agent/engine.rs crates/rig-agent/src/agent/engine.rs:788 — crates/rig-agent/src/agent/engine.rs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in StreamingTurnSource::run_model_turn at line 788. 2 of those changes were fix/bug commits, and the other 12 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 07:44:24 +00:00' --until='2026-09-29 07:44:24 +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-core/src/providers/gemini/interactions_api/mod.rs crates/rig-core/src/providers/gemini/interactions_api/mod.rs:1496 — crates/rig-core/src/providers/gemini/interactions_api/mod.rs changed 36 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in Content::try_from at line 1496. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 07:44:24 +00:00' --until='2026-09-29 07:44:24 +00:00' --full-history --no-merges -- crates/rig-core/src/providers/gemini/interactions_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/gemini/interactions_api/streaming.rs crates/rig-core/src/providers/gemini/interactions_api/streaming.rs:179 — crates/rig-core/src/providers/gemini/interactions_api/streaming.rs changed 27 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in InteractionsDecoder::decode at line 179. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 07:44:24 +00:00' --until='2026-09-29 07:44:24 +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:103 — crates/rig-bedrock/src/streaming.rs changed 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in StreamState::process_event at line 103. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 07:44:24 +00:00' --until='2026-09-29 07:44:24 +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-core/src/providers/gemini/streaming.rs crates/rig-core/src/providers/gemini/streaming.rs:141 — crates/rig-core/src/providers/gemini/streaming.rs changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in GenerateContentDecoder::decode at line 141. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 07:44:24 +00:00' --until='2026-09-29 07:44:24 +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-bedrock/src/types/assistant_content.rs crates/rig-bedrock/src/types/assistant_content.rs:112 — crates/rig-bedrock/src/types/assistant_content.rs changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in RigAssistantContent::into_content_block at line 112. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 07:44:24 +00:00' --until='2026-09-29 07:44:24 +00:00' --full-history --no-merges -- crates/rig-bedrock/src/types/assistant_content.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:62 — crates/rig-lancedb/src/utils/deserializer.rs changed 7 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 62. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 07:44:24 +00:00' --until='2026-09-29 07:44:24 +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-agent/src/test_utils/model_conformance.rs crates/rig-agent/src/test_utils/model_conformance.rs:1380 — crates/rig-agent/src/test_utils/model_conformance.rs changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in rig_agent::test_utils::model_conformance::invalid_tool_recovery at line 1380. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 07:44:24 +00:00' --until='2026-09-29 07:44:24 +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: crates/rig-core/src/providers/cohere/streaming.rs crates/rig-core/src/providers/cohere/streaming.rs:192 — crates/rig-core/src/providers/cohere/streaming.rs changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in ChatDecoder::interpret_stream at line 192. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 07:44:24 +00:00' --until='2026-09-29 07:44:24 +00:00' --full-history --no-merges -- crates/rig-core/src/providers/cohere/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-ecs/src/systems/mod.rs crates/rig-ecs/src/systems/mod.rs:1897 — crates/rig-ecs/src/systems/mod.rs changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in rig_ecs::systems::land_batch at line 1897. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 07:44:24 +00:00' --until='2026-09-29 07:44:24 +00:00' --full-history --no-merges -- crates/rig-ecs/src/systems/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-candle/src/protocol.rs crates/rig-candle/src/protocol.rs:554 — crates/rig-candle/src/protocol.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in rig_candle::protocol::render_qwen_message at line 554. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 07:44:24 +00:00' --until='2026-09-29 07:44:24 +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-gemini-grpc/src/streaming.rs crates/rig-gemini-grpc/src/streaming.rs:136 — crates/rig-gemini-grpc/src/streaming.rs changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in GrpcAdapter::interpret_part at line 136. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 07:44:24 +00:00' --until='2026-09-29 07:44:24 +00:00' --full-history --no-merges -- crates/rig-gemini-grpc/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-vertexai/src/types/completion_request.rs crates/rig-vertexai/src/types/completion_request.rs:152 — crates/rig-vertexai/src/types/completion_request.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in rig_vertexai::types::completion_request::vertex_generation_config at line 152. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 07:44:24 +00:00' --until='2026-09-29 07:44:24 +00:00' --full-history --no-merges -- crates/rig-vertexai/src/types/completion_request.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-vertexai/src/types/message.rs crates/rig-vertexai/src/types/message.rs:16 — crates/rig-vertexai/src/types/message.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in Content::try_from at line 16. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 07:44:24 +00:00' --until='2026-09-29 07:44:24 +00:00' --full-history --no-merges -- crates/rig-vertexai/src/types/message.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:868 — test-support/rig-test-support/src/reasoning.rs changed 17 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 868. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 07:44:24 +00:00' --until='2026-09-29 07:44:24 +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:273 — crates/rig-core/src/test_utils/streaming.rs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in MockDecoder::event at line 273. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 07:44:24 +00:00' --until='2026-09-29 07:44:24 +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-cassette/src/ecs/delivery.rs crates/rig-cassette/src/ecs/delivery.rs:378 — crates/rig-cassette/src/ecs/delivery.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 37 in rig_cassette::ecs::delivery::collect_replayed at line 378. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 07:44:24 +00:00' --until='2026-09-29 07:44:24 +00:00' --full-history --no-merges -- crates/rig-cassette/src/ecs/delivery.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:113 — crates/rig-agent/src/run/prepare.rs changed 9 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 113. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 07:44:24 +00:00' --until='2026-09-29 07:44:24 +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/driver.rs crates/rig-core/src/driver.rs:312 — crates/rig-core/src/driver.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in rig_core::driver::read at line 312. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 07:44:24 +00:00' --until='2026-09-29 07:44:24 +00:00' --full-history --no-merges -- crates/rig-core/src/driver.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.
  • + 13 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×29
  • FileTooLong: http/mod.rs crates/rig-cassette/src/http/mod.rs — FileTooLong — 2168 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 103 free functions. The bar is 500 significant lines; this is 1668 over it, 4.34× 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: systems/mod.rs crates/rig-ecs/src/systems/mod.rs — FileTooLong — 1945 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 51 free functions. The bar is 500 significant lines; this is 1445 over it, 3.89× 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: responses_api/mod.rs crates/rig-core/src/providers/openai/responses_api/mod.rs — FileTooLong — 1441 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 941 over it, 2.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: interactions_api/mod.rs crates/rig-core/src/providers/gemini/interactions_api/mod.rs — FileTooLong — 1411 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 911 over it, 2.82× 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: gemini/completion.rs crates/rig-core/src/providers/gemini/completion.rs — FileTooLong — 1407 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 907 over it, 2.81× 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 — 1350 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 47 free functions. The bar is 500 significant lines; this is 850 over it, 2.70× 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 — 1349 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 849 over it, 2.70× 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 — 1244 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 744 over it, 2.49× 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/mod.rs crates/rig-core/src/providers/openai/completion/mod.rs — FileTooLong — 1073 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 573 over it, 2.15× 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 — 987 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 77% of them inside a single declaration: AgentRun (4 blocks, 367-1743). The bar is 500 significant lines; this is 487 over it, 1.97× 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: wire/chat.rs crates/rig-core/src/providers/openai/wire/chat.rs — FileTooLong — 898 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 398 over it, 1.80× 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 — 833 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 333 over it, 1.67× 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 — 821 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 321 over it, 1.64× 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 — 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: wire/modality.rs crates/rig-core/src/providers/openai/wire/modality.rs — FileTooLong — 764 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 264 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.
  • FileTooLong: bus/dispatcher.rs crates/rig-agent/src/bus/dispatcher.rs — FileTooLong — 755 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 255 over it, 1.51× 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/validation.rs crates/rig-candle/src/validation.rs — FileTooLong — 665 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 165 over it, 1.33× 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/wire.rs crates/rig-core/src/providers/openai/wire.rs — FileTooLong — 631 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 131 over it, 1.26× 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/protocol.rs crates/rig-candle/src/protocol.rs — FileTooLong — 615 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 115 over it, 1.23× 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: responses_api/streaming.rs crates/rig-core/src/providers/openai/responses_api/streaming.rs — FileTooLong — 613 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 113 over it, 1.23× 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-memory/src/lib.rs — FileTooLong — 611 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 111 over it, 1.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: effect/mod.rs crates/rig-core/src/effect/mod.rs — FileTooLong — 609 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 109 over it, 1.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: cassette/audit.rs xtask/src/cassette/audit.rs — FileTooLong — 607 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 107 over it, 1.21× 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: types/converse_output.rs crates/rig-bedrock/src/types/converse_output.rs — FileTooLong — 595 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 95 over it, 1.19× 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/mod.rs crates/rig-ecs/src/agent/mod.rs — FileTooLong — 575 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 75 over it, 1.15× 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.
  • + 4 more in this group — see findings.md.
D2 · Cognitive Complexity · rig_ecs · ×17
  • rig_ecs::bus::collect::collect_streams (cognitive 87) crates/rig-ecs/src/bus/collect.rs:104 — rig_ecs::bus::collect::collect_streams has cognitive complexity 87 (threshold 15). Drivers by points: if/else 18 (61 pts), match/switch 5 (21 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 60). 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::bus::dispatch::dispatch (cognitive 52) crates/rig-ecs/src/bus/dispatch.rs:63 — rig_ecs::bus::dispatch::dispatch has cognitive complexity 52 (threshold 15). Drivers by points: if/else 18 (47 pts), boolean chains 2, match/switch 1 (2 pts), loops 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_ecs::systems::stream_invalid::discover_streamed_invalid_calls (cognitive 41) crates/rig-ecs/src/systems/stream_invalid.rs:63 — rig_ecs::systems::stream_invalid::discover_streamed_invalid_calls has cognitive complexity 41 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 4 (11 pts), match/switch 2 (6 pts), boolean chains 1 (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.
  • rig_ecs::systems::land_batch (cognitive 39) crates/rig-ecs/src/systems/mod.rs:1897 — rig_ecs::systems::land_batch has cognitive complexity 39 (threshold 15). Drivers by points: if/else 8 (20 pts), match/switch 4 (9 pts), loops 3 (6 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.
  • rig_ecs::checkpoint::validate (cognitive 38) crates/rig-ecs/src/checkpoint.rs:431 — rig_ecs::checkpoint::validate has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (28 pts), boolean chains 9, 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_ecs::systems::attach_retrieved (cognitive 31) crates/rig-ecs/src/systems/mod.rs:848 — rig_ecs::systems::attach_retrieved has cognitive complexity 31 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 6 (11 pts), match/switch 2 (5 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.
  • rig_ecs::systems::gather_turn (cognitive 30) crates/rig-ecs/src/systems/mod.rs:1490 — rig_ecs::systems::gather_turn has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 3 (6 pts), match/switch 3 (6 pts), boolean chains 1 (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.
  • rig_ecs::checkpoint::restore::load_world (cognitive 22) crates/rig-ecs/src/checkpoint/restore.rs:83 — rig_ecs::checkpoint::restore::load_world has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 4, 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.
  • rig_ecs::systems::advance (cognitive 21) crates/rig-ecs/src/systems/mod.rs:775 — rig_ecs::systems::advance has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (7 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::systems::read_turn (cognitive 20) crates/rig-ecs/src/systems/mod.rs:2358 — rig_ecs::systems::read_turn has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, loops 2 (4 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.
  • rig_ecs::systems::run_cancelled (cognitive 20) crates/rig-ecs/src/systems/mod.rs:2831 — rig_ecs::systems::run_cancelled has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (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::systems::fold (cognitive 19) crates/rig-ecs/src/systems/mod.rs:1712 — rig_ecs::systems::fold has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (15 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.
  • rig_ecs::systems::release_batch (cognitive 19) crates/rig-ecs/src/systems/mod.rs:1843 — rig_ecs::systems::release_batch has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (3 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_ecs::systems::judge_invalid_calls (cognitive 19) crates/rig-ecs/src/systems/mod.rs:2229 — rig_ecs::systems::judge_invalid_calls has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 2 (4 pts), loops 2 (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.
  • rig_ecs::checkpoint::spawn_into (cognitive 18) crates/rig-ecs/src/checkpoint.rs:336 — rig_ecs::checkpoint::spawn_into has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 4 (5 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.
  • rig_ecs::agent::checkpoint::validate (cognitive 17) crates/rig-ecs/src/agent/checkpoint.rs:165 — rig_ecs::agent::checkpoint::validate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 7, loops 1 (nesting depth added 2). 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.
  • rig_ecs::bus::collect::settle (cognitive 17) crates/rig-ecs/src/bus/collect.rs:316 — rig_ecs::bus::collect::settle has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (15 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.
D3 · God Classes · MethodTooLong · ×17
  • MethodTooLong: StreamingTurnSource.run_model_turn crates/rig-agent/src/agent/engine.rs:788 — MethodTooLong — run_model_turn runs 256 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 156 over it, 2.56× 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: Part.try_from crates/rig-core/src/providers/gemini/completion.rs:887 — MethodTooLong — try_from runs 165 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 65 over it, 1.65× 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: ReplayDelivery.new crates/rig-cassette/src/ecs/delivery.rs:66 — MethodTooLong — new runs 141 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 41 over it, 1.41× 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: MessagesDecoder.interpret_content crates/rig-core/src/providers/anthropic/streaming.rs:257 — MethodTooLong — interpret_content runs 139 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 39 over it, 1.39× 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: CompletionRequest.try_from crates/rig-core/src/providers/openai/completion/mod.rs:1566 — MethodTooLong — try_from 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.
  • MethodTooLong: Message.from_message crates/rig-core/src/providers/anthropic/completion.rs:859 — MethodTooLong — from_message runs 131 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 31 over it, 1.31× 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: CacheBook.plan crates/rig-core/src/providers/gemini/caching.rs:650 — MethodTooLong — plan runs 123 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 23 over it, 1.23× 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: Content.try_from crates/rig-vertexai/src/types/message.rs:16 — MethodTooLong — try_from runs 122 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 22 over it, 1.22× 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:881 — MethodTooLong — next_step 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.
  • MethodTooLong: UserContent.try_from crates/rig-core/src/providers/openai/completion/mod.rs:653 — MethodTooLong — try_from runs 112 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 12 over it, 1.12× 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: CompletionRequest.try_from crates/rig-core/src/providers/openai/responses_api/mod.rs:1156 — MethodTooLong — try_from 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.
  • MethodTooLong: StreamState.process_event crates/rig-bedrock/src/streaming.rs:103 — MethodTooLong — process_event 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.
  • MethodTooLong: InteractionsDecoder.decode crates/rig-core/src/providers/gemini/interactions_api/streaming.rs:179 — MethodTooLong — decode 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.
  • MethodTooLong: RigAssistantContent.into_content_block crates/rig-bedrock/src/types/assistant_content.rs:112 — MethodTooLong — into_content_block runs 105 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 5 over it, 1.05× 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: Content.try_from crates/rig-core/src/providers/gemini/interactions_api/mod.rs:1496 — MethodTooLong — try_from runs 105 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 5 over it, 1.05× 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: BusDriver.serve crates/rig-agent/src/bus/driver.rs:282 — MethodTooLong — serve runs 102 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 2 over it, 1.02× 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.
D2 · Cognitive Complexity · rig_core · ×16
  • 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::providers::anthropic::completion::transform_strict_tool_schema (cognitive 43) crates/rig-core/src/providers/anthropic/completion.rs:1389 — rig_core::providers::anthropic::completion::transform_strict_tool_schema has cognitive complexity 43 (threshold 15). Drivers by points: if/else 20 (28 pts), match/switch 5 (10 pts), boolean chains 3, loops 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_core::providers::openai::responses_api::input_items (cognitive 42) crates/rig-core/src/providers/openai/responses_api/mod.rs:394 — rig_core::providers::openai::responses_api::input_items has cognitive complexity 42 (threshold 15). Drivers by points: match/switch 7 (20 pts), if/else 4 (18 pts), loops 2 (4 pts) (nesting depth added 29). 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::gemini::interactions_api::interactions_api_types::pair_exchanges (cognitive 35) crates/rig-core/src/providers/gemini/interactions_api/mod.rs:539 — rig_core::providers::gemini::interactions_api::interactions_api_types::pair_exchanges has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (27 pts), match/switch 2 (7 pts), loops 1 (nesting depth added 22). 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_core::driver::read (cognitive 34) crates/rig-core/src/driver.rs:312 — rig_core::driver::read has cognitive complexity 34 (threshold 15). Drivers by points: if/else 6 (15 pts), match/switch 8 (14 pts), boolean chains 4, 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_core::providers::openai::wire::chat::finalize_deepseek (cognitive 31) crates/rig-core/src/providers/openai/wire/chat.rs:345 — rig_core::providers::openai::wire::chat::finalize_deepseek has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 2 (6 pts), boolean chains 3 (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_core::transcript::validate_canonical (cognitive 28) crates/rig-core/src/transcript.rs:50 — rig_core::transcript::validate_canonical has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (19 pts), match/switch 2 (5 pts), loops 2 (4 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_core::providers::gemini::completion::create_request_body (cognitive 27) crates/rig-core/src/providers/gemini/completion.rs:221 — rig_core::providers::gemini::completion::create_request_body has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16 (20 pts), loops 3, boolean chains 2, match/switch 1 (2 pts) (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.
  • rig_core::completion::message::keys_lost_in_round_trip::walk (cognitive 26) crates/rig-core/src/completion/message.rs:625 — rig_core::completion::message::keys_lost_in_round_trip::walk has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (15 pts), match/switch 3 (7 pts), loops 2 (4 pts) (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.
  • rig_core::providers::anthropic::completion::merge_root_all_of (cognitive 22) crates/rig-core/src/providers/anthropic/completion.rs:1286 — rig_core::providers::anthropic::completion::merge_root_all_of has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 2 (6 pts), loops 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.
  • rig_core::providers::openai::completion::sanitize_plain_text_history (cognitive 21) crates/rig-core/src/providers/openai/completion/mod.rs:1461 — rig_core::providers::openai::completion::sanitize_plain_text_history has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 3, loops 2, 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_core::providers::openai::completion::assistant_content_to_messages (cognitive 19) crates/rig-core/src/providers/openai/completion/mod.rs:857 — rig_core::providers::openai::completion::assistant_content_to_messages has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (11 pts), match/switch 2 (5 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.
  • rig_core::providers::gemini::interactions_api::create_request_body (cognitive 18) crates/rig-core/src/providers/gemini/interactions_api/mod.rs:200 — rig_core::providers::gemini::interactions_api::create_request_body has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, match/switch 1 (2 pts), boolean chains 1, loops 1 (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.
  • rig_core::providers::openai::wire::chat::refuse_file_ids (cognitive 16) crates/rig-core/src/providers/openai/wire/chat.rs:725 — rig_core::providers::openai::wire::chat::refuse_file_ids has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 2 (3 pts), match/switch 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.
  • rig_core::providers::anthropic::completion::inline_local_root_reference (cognitive 16) crates/rig-core/src/providers/anthropic/completion.rs:1181 — rig_core::providers::anthropic::completion::inline_local_root_reference has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 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.
  • rig_core::providers::internal::wire::scan_discriminators (cognitive 16) crates/rig-core/src/providers/internal/wire.rs:201 — rig_core::providers::internal::wire::scan_discriminators has cognitive complexity 16 (threshold 15). Drivers by points: if/else 2 (7 pts), match/switch 2 (5 pts), loops 4 (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 · FunctionTooLong · ×16
  • FunctionTooLong: xtask::verify::checks::all xtask/src/verify/checks.rs:42 — FunctionTooLong — xtask::verify::checks::all runs 333 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 233 over it, 3.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: xtask::verify::selection::plan xtask/src/verify/selection.rs:197 — FunctionTooLong — xtask::verify::selection::plan runs 220 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 120 over it, 2.20× 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 165 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 65 over it, 1.65× 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::bus::dispatch::dispatch crates/rig-ecs/src/bus/dispatch.rs:63 — FunctionTooLong — rig_ecs::bus::dispatch::dispatch runs 160 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 60 over it, 1.60× 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:62 — FunctionTooLong — rig_lancedb::utils::deserializer::type_matcher runs 150 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 50 over it, 1.50× 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:113 — FunctionTooLong — rig_agent::run::prepare::prepare_request 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_cassette::ecs::delivery::collect_replayed crates/rig-cassette/src/ecs/delivery.rs:378 — FunctionTooLong — rig_cassette::ecs::delivery::collect_replayed 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_core::providers::openai::responses_api::input_items crates/rig-core/src/providers/openai/responses_api/mod.rs:394 — FunctionTooLong — rig_core::providers::openai::responses_api::input_items 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.
  • FunctionTooLong: rig_ecs::bus::collect::collect_streams crates/rig-ecs/src/bus/collect.rs:104 — FunctionTooLong — rig_ecs::bus::collect::collect_streams runs 136 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 36 over it, 1.36× 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::systems::gather_turn crates/rig-ecs/src/systems/mod.rs:1490 — FunctionTooLong — rig_ecs::systems::gather_turn 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.
  • FunctionTooLong: rig_agent::agent::engine::drive_tool_calls crates/rig-agent/src/agent/engine.rs:498 — FunctionTooLong — rig_agent::agent::engine::drive_tool_calls runs 117 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 17 over it, 1.17× 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::agent::engine::dispatch_tool_call crates/rig-agent/src/agent/engine.rs:2032 — FunctionTooLong — rig_agent::agent::engine::dispatch_tool_call 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_candle::protocol::render_qwen_message crates/rig-candle/src/protocol.rs:554 — FunctionTooLong — rig_candle::protocol::render_qwen_message 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::providers::anthropic::completion::transform_strict_tool_schema crates/rig-core/src/providers/anthropic/completion.rs:1389 — FunctionTooLong — rig_core::providers::anthropic::completion::transform_strict_tool_schema 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_cassette::ecs::identity::spec_json crates/rig-cassette/src/ecs/identity.rs:107 — FunctionTooLong — rig_cassette::ecs::identity::spec_json 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: rig_core::providers::gemini::completion::create_request_body crates/rig-core/src/providers/gemini/completion.rs:221 — FunctionTooLong — rig_core::providers::gemini::completion::create_request_body runs 105 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 5 over it, 1.05× 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.
D2 · Cognitive Complexity · xtask · ×13
  • xtask::verify::selection::plan (cognitive 75) xtask/src/verify/selection.rs:197 — xtask::verify::selection::plan has cognitive complexity 75 (threshold 15). Drivers by points: if/else 26 (56 pts), boolean chains 11, loops 4 (8 pts) (nesting depth added 34). 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.
  • xtask::verify::preflight::run (cognitive 45) xtask/src/verify/preflight.rs:10 — xtask::verify::preflight::run has cognitive complexity 45 (threshold 15). Drivers by points: if/else 13 (33 pts), match/switch 3 (7 pts), loops 3 (4 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.
  • xtask::cassette::scan::scan (cognitive 43) xtask/src/cassette/scan.rs:113 — 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::cassette::owner::module_map (cognitive 32) xtask/src/cassette/owner.rs:87 — 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::cassette::goldens::inserted_per_batch (cognitive 23) xtask/src/cassette/goldens.rs:200 — xtask::cassette::goldens::inserted_per_batch has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 3, loops 3 (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::verify::execute::internal (cognitive 22) xtask/src/verify/execute.rs:41 — xtask::verify::execute::internal has cognitive complexity 22 (threshold 15). Drivers by points: if/else 3 (9 pts), boolean chains 7, loops 2 (5 pts), 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.
  • 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:39 — 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::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::cassette::record::run (cognitive 19) xtask/src/cassette/record.rs:201 — 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::audit::run (cognitive 18) xtask/src/cassette/audit.rs:851 — xtask::cassette::audit::run has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 3 (7 pts), if/else 4 (5 pts), loops 5, 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.
  • xtask::cassette::audit::block_parts (cognitive 17) xtask/src/cassette/audit.rs:207 — xtask::cassette::audit::block_parts has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 4 (9 pts), if/else 3 (6 pts), boolean chains 1, loops 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.
  • xtask::verify::execute::run (cognitive 16) xtask/src/verify/execute.rs:130 — 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.
D30 · Dependency Vulnerabilities · Medium advisory (unmaintained) · ×8
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×8
  • Duplicated block (9 lines × 2) crates/rig-core/src/providers/cohere/wire.rs:292 — crates/rig-core/src/providers/cohere/wire.rs:292-300 | crates/rig-core/src/providers/voyageai/wire.rs:376-384 — 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:150 — crates/rig-rmcp/src/native.rs:150-158 | crates/rig-sqlite/src/lib.rs:1211-1219 — 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:276 — crates/rig-core/src/completion/request.rs:276-284 | crates/rig-core/src/test_utils/streaming_conformance.rs:562-570 — 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/anthropic/streaming.rs:115 — crates/rig-core/src/providers/anthropic/streaming.rs:115-123 | crates/rig-core/src/providers/openai/responses_api/streaming.rs:939-947 — 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/test_utils/streaming_conformance.rs:242 — crates/rig-core/src/test_utils/streaming_conformance.rs:242-250 | crates/rig-core/src/test_utils/streaming_conformance.rs:280-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 (9 lines × 2) test-support/rig-test-support/src/matrix_registry.rs:134 — test-support/rig-test-support/src/matrix_registry.rs:134-142 | test-support/rig-test-support/src/matrix_registry.rs:183-191 — 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:1467 — crates/rig-agent/src/test_utils/model_conformance.rs:1467-1475 | crates/rig-agent/src/test_utils/model_conformance.rs:1481-1490 — 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-core/src/test_utils/streaming_conformance.rs:1003 — crates/rig-core/src/test_utils/streaming_conformance.rs:1003-1011 | crates/rig-core/src/test_utils/streaming_conformance.rs:1100-1108 — 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 × 2) · ×8
  • Duplicated block (5 lines × 2) crates/rig-agent/src/bus/driver.rs:448 — crates/rig-agent/src/bus/driver.rs:448-452 | crates/rig-agent/src/bus/driver.rs:476-480 — 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-agent/src/run/patch.rs:152 — crates/rig-agent/src/run/patch.rs:152-156 | crates/rig-ecs/src/agent/mod.rs:898-902 — 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/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/audio_generation.rs:108 — crates/rig-core/src/audio_generation.rs:108-112 | crates/rig-core/src/image_generation.rs:126-130 — 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-candle/src/model.rs:484 — crates/rig-candle/src/model.rs:484-488 | crates/rig-candle/src/pose.rs:690-694 — 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-cassette/src/ecs/delivery.rs:321 — crates/rig-cassette/src/ecs/delivery.rs:321-325 | crates/rig-ecs/src/bus/collect.rs:141-145 — 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) test-support/rig-test-support/src/matrix_registry.rs:76 — test-support/rig-test-support/src/matrix_registry.rs:76-80 | test-support/rig-test-support/src/matrix_registry.rs:127-131 — 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) test-support/rig-test-support/src/matrix_registry.rs:143 — test-support/rig-test-support/src/matrix_registry.rs:143-147 | test-support/rig-test-support/src/matrix_registry.rs:194-200 — 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.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×8
  • 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. 8 of the 8 files that make outbound calls are unbounded; the first 8 are listed.
  • Outbound HTTP without resilience crates/rig-cassette/src/http/ledger.rs:328 — `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:234 — `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:104 — `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:64 — `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 scripts/check-dependency-floors.py:127 — `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.
D1 · Cyclomatic Complexity · rig_ecs · ×7
  • rig_ecs::bus::collect::collect_streams (cyclomatic 30) crates/rig-ecs/src/bus/collect.rs:104 — rig_ecs::bus::collect::collect_streams has cyclomatic complexity 30 (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::checkpoint::validate (cyclomatic 24) crates/rig-ecs/src/checkpoint.rs:431 — rig_ecs::checkpoint::validate 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_ecs::bus::dispatch::dispatch (cyclomatic 22) crates/rig-ecs/src/bus/dispatch.rs:63 — rig_ecs::bus::dispatch::dispatch 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_ecs::systems::land_batch (cyclomatic 20) crates/rig-ecs/src/systems/mod.rs:1897 — rig_ecs::systems::land_batch 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_ecs::systems::stream_invalid::discover_streamed_invalid_calls (cyclomatic 17) crates/rig-ecs/src/systems/stream_invalid.rs:63 — rig_ecs::systems::stream_invalid::discover_streamed_invalid_calls 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.
  • rig_ecs::systems::attach_retrieved (cyclomatic 17) crates/rig-ecs/src/systems/mod.rs:848 — rig_ecs::systems::attach_retrieved 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_ecs::agent::checkpoint::validate (cyclomatic 16) crates/rig-ecs/src/agent/checkpoint.rs:165 — rig_ecs::agent::checkpoint::validate 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.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×7
  • Duplicated block (7 lines × 2) crates/rig-candle/src/loader.rs:117 — crates/rig-candle/src/loader.rs:117-123 | crates/rig-candle/src/loader.rs:158-164 — 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:439 — crates/rig-candle/src/model.rs:439-445 | crates/rig-candle/src/model.rs:476-482 — 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/copilot/auth/native.rs:255 — crates/rig-core/src/providers/copilot/auth/native.rs:255-261 | crates/rig-core/src/providers/copilot/auth/wasm.rs:51-57 — 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:158 — crates/rig-core/src/serve/layer.rs:158-164 | crates/rig-core/src/serve/layer.rs:175-181 — 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/run/response.rs:74 — crates/rig-agent/src/run/response.rs:74-80 | crates/rig-core/src/completion/request.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) 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:197-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 (7 lines × 2) test-support/rig-test-support/src/reasoning.rs:732 — test-support/rig-test-support/src/reasoning.rs:732-738 | test-support/rig-test-support/src/support.rs:917-923 — 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.
D1 · Cyclomatic Complexity · xtask · ×6
  • xtask::verify::selection::plan (cyclomatic 41) xtask/src/verify/selection.rs:197 — xtask::verify::selection::plan 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.
  • xtask::cassette::scan::scan (cyclomatic 27) xtask/src/cassette/scan.rs:113 — 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::verify::preflight::run (cyclomatic 22) xtask/src/verify/preflight.rs:10 — xtask::verify::preflight::run 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.
  • xtask::cassette::scan::key_shape (cyclomatic 21) xtask/src/cassette/scan.rs:39 — 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::verify::execute::internal (cyclomatic 19) xtask/src/verify/execute.rs:41 — xtask::verify::execute::internal has cyclomatic complexity 19 (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::goldens::inserted_per_batch (cyclomatic 16) xtask/src/cassette/goldens.rs:200 — xtask::cassette::goldens::inserted_per_batch 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_core · ×6
  • rig_core::providers::anthropic::completion::transform_strict_tool_schema (cyclomatic 31) crates/rig-core/src/providers/anthropic/completion.rs:1389 — rig_core::providers::anthropic::completion::transform_strict_tool_schema has cyclomatic complexity 31 (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::providers::openai::responses_api::input_items (cyclomatic 24) crates/rig-core/src/providers/openai/responses_api/mod.rs:394 — rig_core::providers::openai::responses_api::input_items has cyclomatic complexity 24 (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::driver::read (cyclomatic 23) crates/rig-core/src/driver.rs:312 — rig_core::driver::read has cyclomatic complexity 23 (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::gemini::completion::create_request_body (cyclomatic 19) crates/rig-core/src/providers/gemini/completion.rs:221 — rig_core::providers::gemini::completion::create_request_body has cyclomatic complexity 19 (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::providers::openai::completion::sanitize_plain_text_history (cyclomatic 16) crates/rig-core/src/providers/openai/completion/mod.rs:1461 — rig_core::providers::openai::completion::sanitize_plain_text_history 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_cassette · ×6
  • rig_cassette::ecs::delivery::collect_replayed (cognitive 65) crates/rig-cassette/src/ecs/delivery.rs:378 — rig_cassette::ecs::delivery::collect_replayed has cognitive complexity 65 (threshold 15). Drivers by points: if/else 23 (51 pts), match/switch 4 (9 pts), loops 4, boolean chains 1 (nesting depth added 33). 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::ecs::delivery::deliver_stream (cognitive 44) crates/rig-cassette/src/ecs/delivery.rs:666 — rig_cassette::ecs::delivery::deliver_stream has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15 (32 pts), match/switch 2 (7 pts), boolean chains 3, loops 1 (2 pts) (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.
  • rig_cassette::http::relay::advance_body (cognitive 31) crates/rig-cassette/src/http/relay.rs:410 — rig_cassette::http::relay::advance_body has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (25 pts), match/switch 2 (5 pts), loops 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.
  • rig_cassette::ecs::identity::required_row (cognitive 25) crates/rig-cassette/src/ecs/identity.rs:252 — rig_cassette::ecs::identity::required_row has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 7, loops 4 (7 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.
  • rig_cassette::http::ledger::clean_up (cognitive 16) crates/rig-cassette/src/http/ledger.rs:324 — 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.
  • rig_cassette::ecs::identity::builder_spec_json (cognitive 16) crates/rig-cassette/src/ecs/identity.rs:28 — rig_cassette::ecs::identity::builder_spec_json has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 2 (7 pts), match/switch 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.
D3 · God Classes · TooManyMethods · ×6
  • TooManyMethods: AgentRun crates/rig-agent/src/run/mod.rs:367 — TooManyMethods — 61 methods. The bar is 30 methods; this is 31 over it, 2.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.
  • TooManyMethods: OpenAIConfig crates/rig-core/src/providers/openai/wire.rs:740 — TooManyMethods — 42 methods, declared across 2 files: openai/wire.rs (40), 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: AgentBuilder crates/rig-agent/src/agent/builder.rs:134 — TooManyMethods — 41 methods. The bar is 30 methods; this is 11 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.
  • TooManyMethods: AgentRunner crates/rig-agent/src/agent/runner.rs:50 — TooManyMethods — 41 methods, declared across 2 files: agent/runner.rs (37), agent/streaming.rs (4). The bar is 30 methods; this is 11 over it, 1.37× 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: Out crates/rig-core/src/wire.rs:518 — TooManyMethods — 34 methods, declared across 2 files: operation/completion.rs (28), src/wire.rs (6). The bar is 30 methods; this is 4 over it, 1.13× 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: ToolExecutionError crates/rig-core/src/tool/result.rs:137 — 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.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×6
  • Duplicated block (11 lines × 2) crates/rig-cassette/src/ecs/delivery.rs:723 — crates/rig-cassette/src/ecs/delivery.rs:723-733 | crates/rig-ecs/src/bus/collect.rs:151-161 — 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-core/src/vector_store/in_memory_store.rs:422 — crates/rig-core/src/vector_store/in_memory_store.rs:422-432 | crates/rig-core/src/vector_store/in_memory_store.rs:450-460 — 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-cassette/src/http/mod.rs:2172 — crates/rig-cassette/src/http/mod.rs:2172-2182 | crates/rig-cassette/src/http/mod.rs:2190-2200 — 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:1906 — crates/rig-agent/src/test_utils/model_conformance.rs:1906-1916 | crates/rig-agent/src/test_utils/model_conformance.rs:2045-2055 — 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:340 — crates/rig-core/src/test_utils/streaming.rs:340-350 | crates/rig-core/src/test_utils/streaming.rs:352-362 — 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) test-support/rig-test-support/src/reasoning.rs:282 — test-support/rig-test-support/src/reasoning.rs:282-292 | test-support/rig-test-support/src/reasoning.rs:377-387 — 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 · rig_candle · ×5
  • rig_candle::protocol::render_qwen_message (cognitive 65) crates/rig-candle/src/protocol.rs:554 — rig_candle::protocol::render_qwen_message has cognitive complexity 65 (threshold 15). Drivers by points: if/else 12 (41 pts), match/switch 4 (12 pts), loops 3 (8 pts), boolean chains 4 (nesting depth added 42). 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 30) crates/rig-candle/src/protocol.rs:96 — rig_candle::protocol::validate_protocol_inputs has cognitive complexity 30 (threshold 15). Drivers by points: match/switch 4 (16 pts), loops 6 (14 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:446 — 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:711 — 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.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×5
  • Duplicated block (8 lines × 2) crates/rig-core/src/providers/openai/wire/chat.rs:347 — crates/rig-core/src/providers/openai/wire/chat.rs:347-354 | crates/rig-core/src/providers/openai/wire/chat.rs:438-449 — 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-core/src/providers/cohere/wire.rs:105 — crates/rig-core/src/providers/cohere/wire.rs:105-112 | crates/rig-core/src/providers/voyageai/wire.rs:100-107 — 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:230 — crates/rig-postgres/src/lib.rs:230-237 | crates/rig-surrealdb/src/lib.rs:268-275 — 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:325 — crates/rig-core/src/providers/openai/wire/modality.rs:325-332 | crates/rig-core/src/providers/openai/wire/modality.rs:1194-1202 — 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) test-support/rig-test-support/src/history_survival/adversarial.rs:119 — test-support/rig-test-support/src/history_survival/adversarial.rs:119-126 | test-support/rig-test-support/src/history_survival/adversarial.rs:204-211 — 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 (6 lines × 2) · ×4
  • 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/chatgpt/auth/mod.rs:54 — crates/rig-core/src/providers/chatgpt/auth/mod.rs:54-59 | crates/rig-core/src/providers/copilot/auth/mod.rs:51-56 — 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/cassette/audit.rs:821 — xtask/src/cassette/audit.rs:821-828 | xtask/src/packaging.rs:331-336 — 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) test-support/rig-test-support/src/reasoning.rs:296 — test-support/rig-test-support/src/reasoning.rs:296-301 | test-support/rig-test-support/src/reasoning.rs:390-395 — 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 · ×3
  • rig_cassette::ecs::delivery::collect_replayed (cyclomatic 37) crates/rig-cassette/src/ecs/delivery.rs:378 — rig_cassette::ecs::delivery::collect_replayed has cyclomatic complexity 37 (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::ecs::delivery::deliver_stream (cyclomatic 23) crates/rig-cassette/src/ecs/delivery.rs:666 — rig_cassette::ecs::delivery::deliver_stream 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_cassette::ecs::identity::required_row (cyclomatic 19) crates/rig-cassette/src/ecs/identity.rs:252 — rig_cassette::ecs::identity::required_row has cyclomatic complexity 19 (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_agent · ×3
  • rig_agent::agent::engine::drive_agent (cyclomatic 29) crates/rig-agent/src/agent/engine.rs:150 — rig_agent::agent::engine::drive_agent 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_agent::agent::engine::drive_tool_calls (cyclomatic 22) crates/rig-agent/src/agent/engine.rs:498 — rig_agent::agent::engine::drive_tool_calls 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_agent::run::prepare::prepare_request (cyclomatic 22) crates/rig-agent/src/run/prepare.rs:113 — 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.
D1 · Cyclomatic Complexity · rig_candle · ×3
  • rig_candle::protocol::render_qwen_message (cyclomatic 27) crates/rig-candle/src/protocol.rs:554 — rig_candle::protocol::render_qwen_message 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.
  • rig_candle::protocol::parse_qwen3_assistant (cyclomatic 19) crates/rig-candle/src/protocol.rs:711 — 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.
  • rig_candle::protocol::validate_protocol_inputs (cyclomatic 16) crates/rig-candle/src/protocol.rs:96 — rig_candle::protocol::validate_protocol_inputs has cyclomatic complexity 16 (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.
D2 · Cognitive Complexity · rig_agent · ×3
  • rig_agent::agent::engine::drive_agent (cognitive 56) crates/rig-agent/src/agent/engine.rs:150 — rig_agent::agent::engine::drive_agent has cognitive complexity 56 (threshold 15). Drivers by points: if/else 13 (30 pts), match/switch 9 (22 pts), loops 3, 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_agent::agent::engine::drive_tool_calls (cognitive 35) crates/rig-agent/src/agent/engine.rs:498 — rig_agent::agent::engine::drive_tool_calls has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (22 pts), match/switch 4 (8 pts), loops 4, 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.
  • rig_agent::run::prepare::prepare_request (cognitive 20) crates/rig-agent/src/run/prepare.rs:113 — rig_agent::run::prepare::prepare_request has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 4, 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 · File · ×3
  • File::compare (cognitive 37) xtask/src/cassette/audit.rs:415 — File::compare has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (23 pts), boolean chains 9, loops 2 (4 pts), 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.
  • File::header (cognitive 21) xtask/src/cassette/audit.rs:611 — File::header has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 3 (4 pts), boolean chains 2, match/switch 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.
  • File::stream (cognitive 17) xtask/src/cassette/audit.rs:542 — File::stream has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, match/switch 1 (2 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.
D30 · Dependency Vulnerabilities · Medium vulnerability · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D35 · Change Coupling · Change-coupling hub · ×3
  • Change-coupling hub: lib.rs → lib.rs, lib.rs, lib.rs, lib.rs, lib.rs crates/rig-scylladb/src/lib.rs — `crates/rig-scylladb/src/lib.rs` changes together with 5 other files — `crates/rig-lancedb/src/lib.rs`, `crates/rig-mongodb/src/lib.rs`, `crates/rig-postgres/src/lib.rs`, `crates/rig-sqlite/src/lib.rs`, `crates/rig-surrealdb/src/lib.rs` — none of which declares a dependency on it: one file is the hub of 5 separate couplings, not 5 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 5.
  • Change-coupling hub: lib.rs → lib.rs, lib.rs, lib.rs crates/rig-surrealdb/src/lib.rs — `crates/rig-surrealdb/src/lib.rs` changes together with 3 other files — `crates/rig-lancedb/src/lib.rs`, `crates/rig-mongodb/src/lib.rs`, `crates/rig-sqlite/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.
  • Change-coupling hub: lib.rs → lib.rs, lib.rs, lib.rs crates/rig-postgres/src/lib.rs — `crates/rig-postgres/src/lib.rs` changes together with 3 other files — `crates/rig-lancedb/src/lib.rs`, `crates/rig-mongodb/src/lib.rs`, `crates/rig-sqlite/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.
D35 · Change Coupling · Change coupling · ×3
  • Change coupling: streaming.rs ↔ streaming.rs crates/rig-bedrock/src/streaming.rs — `crates/rig-bedrock/src/streaming.rs` and `crates/rig-core/src/providers/cohere/streaming.rs` change together 60% of the time (6 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 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: streaming.rs ↔ streaming.rs crates/rig-bedrock/src/streaming.rs — `crates/rig-bedrock/src/streaming.rs` and `crates/rig-core/src/providers/anthropic/streaming.rs` change together 53% of the time (8 of the 15 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: mod.rs ↔ streaming.rs crates/rig-core/src/providers/copilot/mod.rs — `crates/rig-core/src/providers/copilot/mod.rs` and `crates/rig-core/src/providers/openai/responses_api/streaming.rs` change together 53% of the time (9 of the 17 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.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×3
  • Duplicated block (12 lines × 2) crates/rig-cassette/src/http/mod.rs:2942 — crates/rig-cassette/src/http/mod.rs:2942-2953 | crates/rig-cassette/src/http/mod.rs:2993-3004 — 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 (12 lines × 2) test-support/rig-test-support/src/matrix_registry.rs:148 — test-support/rig-test-support/src/matrix_registry.rs:148-159 | test-support/rig-test-support/src/matrix_registry.rs:201-212 — 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 (12 lines × 2) test-support/rig-test-support/src/raw_capture/chat.rs:64 — test-support/rig-test-support/src/raw_capture/chat.rs:64-75 | test-support/rig-test-support/src/raw_capture/chat.rs:161-172 — 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 · File · ×2
  • File::compare (cyclomatic 25) xtask/src/cassette/audit.rs:415 — File::compare 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.
  • File::header (cyclomatic 17) xtask/src/cassette/audit.rs:611 — File::header 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 · Content · ×2
  • Content::try_from (cyclomatic 24) crates/rig-vertexai/src/types/message.rs:16 — Content::try_from has cyclomatic complexity 24 (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.
  • Content::try_from (cyclomatic 16) crates/rig-core/src/providers/gemini/interactions_api/mod.rs:1496 — Content::try_from 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 · CompletionRequest · ×2
  • CompletionRequest::try_from (cyclomatic 23) crates/rig-core/src/providers/openai/completion/mod.rs:1566 — CompletionRequest::try_from 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.
  • CompletionRequest::try_from (cyclomatic 21) crates/rig-core/src/providers/openai/responses_api/mod.rs:1156 — CompletionRequest::try_from has cyclomatic complexity 21 (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 · GenerateContentDecoder · ×2
  • GenerateContentDecoder::decode (cyclomatic 18) crates/rig-core/src/providers/gemini/streaming.rs:141 — GenerateContentDecoder::decode 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.
  • GenerateContentDecoder::interpret_part (cyclomatic 16) crates/rig-core/src/providers/gemini/streaming.rs:387 — GenerateContentDecoder::interpret_part 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 · Content · ×2
  • Content::try_from (cognitive 53) crates/rig-vertexai/src/types/message.rs:16 — Content::try_from has cognitive complexity 53 (threshold 15). Drivers by points: if/else 6 (22 pts), match/switch 9 (20 pts), loops 3 (11 pts) (nesting depth added 35). 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.
  • Content::try_from (cognitive 16) crates/rig-core/src/providers/gemini/interactions_api/mod.rs:1496 — Content::try_from has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 4 (11 pts), if/else 3 (5 pts) (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.
D2 · Cognitive Complexity · CompletionRequest · ×2
  • CompletionRequest::try_from (cognitive 43) crates/rig-core/src/providers/openai/completion/mod.rs:1566 — CompletionRequest::try_from has cognitive complexity 43 (threshold 15). Drivers by points: if/else 19 (33 pts), boolean chains 5, 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.
  • CompletionRequest::try_from (cognitive 26) crates/rig-core/src/providers/openai/responses_api/mod.rs:1156 — CompletionRequest::try_from has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (15 pts), match/switch 4 (7 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 7). 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 · BusDriver · ×2
  • BusDriver::serve (cognitive 42) crates/rig-agent/src/bus/driver.rs:282 — BusDriver::serve has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (31 pts), match/switch 4 (6 pts), boolean chains 3, loops 1 (2 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.
  • BusDriver::poll (cognitive 23) crates/rig-agent/src/bus/driver.rs:526 — BusDriver::poll has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (6 pts), match/switch 1 (3 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.
D2 · Cognitive Complexity · EffectLogReplayer · ×2
  • EffectLogReplayer::serve (cognitive 36) crates/rig-cassette/src/effect_log/replay.rs:588 — EffectLogReplayer::serve has cognitive complexity 36 (threshold 15). Drivers by points: if/else 6 (22 pts), match/switch 4 (8 pts), loops 1 (4 pts), boolean chains 2 (nesting depth added 23). 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.
  • EffectLogReplayer::check_header (cognitive 19) crates/rig-cassette/src/effect_log/replay.rs:255 — EffectLogReplayer::check_header has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 5 (6 pts), boolean chains 4 (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 · GenerateContentDecoder · ×2
  • GenerateContentDecoder::decode (cognitive 22) crates/rig-core/src/providers/gemini/streaming.rs:141 — GenerateContentDecoder::decode has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 3, match/switch 2 (3 pts), loops 1 (2 pts) (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.
  • GenerateContentDecoder::interpret_part (cognitive 19) crates/rig-core/src/providers/gemini/streaming.rs:387 — GenerateContentDecoder::interpret_part has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 2, 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 · ChatDecoder · ×2
  • ChatDecoder::interpret_chunk (cognitive 21) crates/rig-core/src/providers/openai/wire/chat.rs:924 — ChatDecoder::interpret_chunk has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 3 (5 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.
  • ChatDecoder::interpret_stream (cognitive 17) crates/rig-core/src/providers/cohere/streaming.rs:192 — ChatDecoder::interpret_stream has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 2 (3 pts) (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.
D2 · Cognitive Complexity · rig_vertexai · ×2
  • rig_vertexai::types::completion_request::vertex_generation_config (cognitive 20) crates/rig-vertexai/src/types/completion_request.rs:152 — rig_vertexai::types::completion_request::vertex_generation_config has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, boolean chains 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.
  • rig_vertexai::types::completion_response::assistant_content (cognitive 19) crates/rig-vertexai/src/types/completion_response.rs:88 — rig_vertexai::types::completion_response::assistant_content has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 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.
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.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×2
  • Duplicated block (10 lines × 2) crates/rig-milvus/src/lib.rs:187 — crates/rig-milvus/src/lib.rs:187-196 | crates/rig-milvus/src/lib.rs:228-237 — 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:809 — test-support/rig-test-support/src/reasoning.rs:809-818 | test-support/rig-test-support/src/reasoning.rs:855-864 — 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 (9 lines × 3) · ×2
  • 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.
  • Duplicated block (9 lines × 3) crates/rig-agent/src/run/transcript.rs:105 — crates/rig-agent/src/run/transcript.rs:105-113 | test-support/rig-test-support/src/history_survival/adversarial.rs:62-70 | test-support/rig-test-support/src/support.rs:1030-1038 — 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×2
  • Low cohesion: NewCachedContent (LCOM4 5) crates/rig-core/src/providers/gemini/cached_content.rs:92 — 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:60 — 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.
D1 · Cyclomatic Complexity · StreamingTurnSource · ×1
  • StreamingTurnSource::run_model_turn (cyclomatic 42) crates/rig-agent/src/agent/engine.rs:788 — StreamingTurnSource::run_model_turn 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.
D1 · Cyclomatic Complexity · ReplayDelivery · ×1
  • ReplayDelivery::new (cyclomatic 35) crates/rig-cassette/src/ecs/delivery.rs:66 — ReplayDelivery::new 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.
D1 · Cyclomatic Complexity · MessagesDecoder · ×1
  • MessagesDecoder::interpret_content (cyclomatic 29) crates/rig-core/src/providers/anthropic/streaming.rs:257 — MessagesDecoder::interpret_content 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.
D1 · Cyclomatic Complexity · UserContent · ×1
  • UserContent::try_from (cyclomatic 29) crates/rig-core/src/providers/openai/completion/mod.rs:653 — UserContent::try_from 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.
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 · BusDriver · ×1
  • BusDriver::serve (cyclomatic 28) crates/rig-agent/src/bus/driver.rs:282 — BusDriver::serve 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.
D1 · Cyclomatic Complexity · Part · ×1
  • Part::try_from (cyclomatic 24) crates/rig-core/src/providers/gemini/completion.rs:887 — Part::try_from has cyclomatic complexity 24 (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 · Message · ×1
  • Message::from_message (cyclomatic 22) crates/rig-core/src/providers/anthropic/completion.rs:859 — Message::from_message 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.
D1 · Cyclomatic Complexity · rig_derive · ×1
  • rig_derive::tool::expand::expand_rig_tool (cyclomatic 22) crates/rig-derive/src/tool/expand.rs:108 — rig_derive::tool::expand::expand_rig_tool 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 · AgentRun · ×1
  • AgentRun::next_step (cyclomatic 21) crates/rig-agent/src/run/mod.rs:881 — AgentRun::next_step 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 · StreamState · ×1
  • StreamState::process_event (cyclomatic 21) crates/rig-bedrock/src/streaming.rs:103 — StreamState::process_event 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.
D1 · Cyclomatic Complexity · InteractionsDecoder · ×1
  • InteractionsDecoder::decode (cyclomatic 21) crates/rig-core/src/providers/gemini/interactions_api/streaming.rs:179 — InteractionsDecoder::decode 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_vertexai · ×1
  • rig_vertexai::types::completion_request::vertex_generation_config (cyclomatic 21) crates/rig-vertexai/src/types/completion_request.rs:152 — rig_vertexai::types::completion_request::vertex_generation_config has cyclomatic complexity 21 (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 · Reply · ×1
  • Reply::observed (cyclomatic 20) crates/rig-core/src/serve/handler.rs:333 — Reply::observed 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 · Caching · ×1
  • Caching::send (cyclomatic 19) crates/rig-core/src/client/gemini_caching.rs:330 — Caching::send has cyclomatic complexity 19 (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 · rig_tungstenite · ×1
  • rig_tungstenite::connection::run_actor (cyclomatic 19) crates/rig-tungstenite/src/connection.rs:97 — rig_tungstenite::connection::run_actor 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 · RigAssistantContent · ×1
  • RigAssistantContent::into_content_block (cyclomatic 18) crates/rig-bedrock/src/types/assistant_content.rs:112 — RigAssistantContent::into_content_block 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 · EffectStream · ×1
  • EffectStream::poll_next (cyclomatic 17) crates/rig-agent/src/bus/dispatcher.rs:1220 — EffectStream::poll_next 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 · Buffered · ×1
  • Buffered::poll (cyclomatic 17) crates/rig-cassette/src/ecs/delivery.rs:277 — Buffered::poll 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 · HttpExchange · ×1
  • HttpExchange::streaming (cyclomatic 17) crates/rig-core/src/driver/http_transport.rs:165 — HttpExchange::streaming 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 · Step · ×1
  • Step::split (cyclomatic 17) crates/rig-core/src/providers/gemini/interactions_api/mod.rs:1035 — Step::split 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 · Session · ×1
  • Session::record_one (cyclomatic 17) xtask/src/cassette/record.rs:298 — 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 · UnaryTurnSource · ×1
  • UnaryTurnSource::run_model_turn (cyclomatic 16) crates/rig-agent/src/agent/engine.rs:1701 — UnaryTurnSource::run_model_turn 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.
D2 · Cognitive Complexity · StreamingTurnSource · ×1
  • StreamingTurnSource::run_model_turn (cognitive 106) crates/rig-agent/src/agent/engine.rs:788 — StreamingTurnSource::run_model_turn has cognitive complexity 106 (threshold 15). Drivers by points: match/switch 15 (49 pts), if/else 14 (47 pts), loops 3 (7 pts), boolean chains 3 (nesting depth added 71). 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 · ReplayDelivery · ×1
  • ReplayDelivery::new (cognitive 57) crates/rig-cassette/src/ecs/delivery.rs:66 — ReplayDelivery::new has cognitive complexity 57 (threshold 15). Drivers by points: if/else 14 (33 pts), boolean chains 15, match/switch 2 (6 pts), loops 3 (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.
D2 · Cognitive Complexity · MessagesDecoder · ×1
  • MessagesDecoder::interpret_content (cognitive 47) crates/rig-core/src/providers/anthropic/streaming.rs:257 — MessagesDecoder::interpret_content has cognitive complexity 47 (threshold 15). Drivers by points: if/else 17 (42 pts), match/switch 3 (5 pts) (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 38) crates/rig-derive/src/tool/args.rs:99 — MacroArgs::parse has cognitive complexity 38 (threshold 15). Drivers by points: if/else 5 (21 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 · rig_tungstenite · ×1
  • rig_tungstenite::connection::run_actor (cognitive 37) crates/rig-tungstenite/src/connection.rs:97 — rig_tungstenite::connection::run_actor has cognitive complexity 37 (threshold 15). Drivers by points: match/switch 6 (18 pts), if/else 6 (16 pts), boolean chains 2, loops 1 (nesting depth added 22). 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 35) crates/rig-core/src/serve/handler.rs:333 — Reply::observed has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (31 pts), boolean chains 2, match/switch 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.
D2 · Cognitive Complexity · RigAssistantContent · ×1
  • RigAssistantContent::into_content_block (cognitive 34) crates/rig-bedrock/src/types/assistant_content.rs:112 — RigAssistantContent::into_content_block has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (25 pts), match/switch 3 (7 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · rig_derive · ×1
  • rig_derive::tool::expand::expand_rig_tool (cognitive 34) crates/rig-derive/src/tool/expand.rs:108 — rig_derive::tool::expand::expand_rig_tool has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (25 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 · AgentRun · ×1
  • AgentRun::next_step (cognitive 33) crates/rig-agent/src/run/mod.rs:881 — AgentRun::next_step has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (21 pts), match/switch 4 (8 pts), boolean chains 4 (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.
D2 · Cognitive Complexity · Part · ×1
  • Part::try_from (cognitive 33) crates/rig-core/src/providers/gemini/completion.rs:887 — Part::try_from has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (18 pts), match/switch 5 (13 pts), loops 1 (2 pts) (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.
D2 · Cognitive Complexity · InteractionsDecoder · ×1
  • InteractionsDecoder::decode (cognitive 33) crates/rig-core/src/providers/gemini/interactions_api/streaming.rs:179 — InteractionsDecoder::decode has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 3 (7 pts), match/switch 3 (4 pts), boolean chains 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 · Message · ×1
  • Message::from_message (cognitive 30) crates/rig-core/src/providers/anthropic/completion.rs:859 — Message::from_message has cognitive complexity 30 (threshold 15). Drivers by points: match/switch 7 (19 pts), if/else 3 (11 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.
D2 · Cognitive Complexity · HttpExchange · ×1
  • HttpExchange::streaming (cognitive 29) crates/rig-core/src/driver/http_transport.rs:165 — HttpExchange::streaming has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (19 pts), match/switch 4 (6 pts), loops 3 (4 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.
D2 · Cognitive Complexity · EffectStream · ×1
  • EffectStream::poll_next (cognitive 28) crates/rig-agent/src/bus/dispatcher.rs:1220 — EffectStream::poll_next has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (19 pts), match/switch 3 (8 pts), 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.
D2 · Cognitive Complexity · StreamState · ×1
  • StreamState::process_event (cognitive 26) crates/rig-bedrock/src/streaming.rs:103 — StreamState::process_event has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 4 (8 pts), loops 2 (6 pts) (nesting depth added 14). 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 · Buffered · ×1
  • Buffered::poll (cognitive 26) crates/rig-cassette/src/ecs/delivery.rs:277 — Buffered::poll has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 4 (9 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.
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:260 — 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 · Caching · ×1
  • Caching::send (cognitive 23) crates/rig-core/src/client/gemini_caching.rs:330 — Caching::send has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (13 pts), match/switch 4 (5 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.
D2 · Cognitive Complexity · OllamaCompletionRequest · ×1
  • OllamaCompletionRequest::try_from (cognitive 22) crates/rig-core/src/providers/ollama.rs:215 — OllamaCompletionRequest::try_from has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 2 (9 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 · UnaryTurnSource · ×1
  • UnaryTurnSource::run_model_turn (cognitive 20) crates/rig-agent/src/agent/engine.rs:1701 — UnaryTurnSource::run_model_turn has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 6 (14 pts), if/else 2 (4 pts), boolean chains 1, loops 1 (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 · 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 · Session · ×1
  • Session::record_one (cognitive 19) xtask/src/cassette/record.rs:298 — 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:171 — 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:202 — 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 · CassetteScrubber · ×1
  • CassetteScrubber::scrub_json_value (cognitive 18) crates/rig-cassette/src/http/mod.rs:2762 — CassetteScrubber::scrub_json_value has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (4 pts), 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.
D2 · Cognitive Complexity · GrpcAdapter · ×1
  • GrpcAdapter::interpret_part (cognitive 18) crates/rig-gemini-grpc/src/streaming.rs:136 — GrpcAdapter::interpret_part has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 2, 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.
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:122 — 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 · BinaryAssets · ×1
  • BinaryAssets::resolve (cognitive 17) crates/rig-ecs/src/agent/content/binary.rs:294 — BinaryAssets::resolve has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (10 pts), match/switch 3 (7 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.
D2 · Cognitive Complexity · OllamaDecoder · ×1
  • OllamaDecoder::interpret_record (cognitive 16) crates/rig-core/src/providers/ollama.rs:371 — OllamaDecoder::interpret_record has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 1 (2 pts), match/switch 1 (2 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 · ClassTooLong · ×1
  • ClassTooLong: AgentRun crates/rig-agent/src/run/mod.rs:367 — ClassTooLong — 756 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 61 methods, 4 blocks, lines 367-1743. The bar is 400 significant lines; this is 356 over it, 1.89× 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.
D3 · God Classes · TooManyFields · ×1
  • TooManyFields: Quirks crates/rig-core/src/providers/openai/wire.rs:515 — TooManyFields — 37 stored fields beside 3 methods. The bar is 30 stored fields; this is 7 over it, 1.23× 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.
D30 · Dependency Vulnerabilities · Medium CVE · ×1
  • REDACTED
D4 · Code Duplication · Duplicated block (15–17 lines × 2) · ×1
  • Duplicated block (15–17 lines × 2) crates/rig-core/src/providers/voyageai/wire.rs:215 — crates/rig-core/src/providers/voyageai/wire.rs:215-231 | crates/rig-core/src/providers/voyageai/wire.rs:379-393 — 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–14 lines × 2) · ×1
  • Duplicated block (13–14 lines × 2) crates/rig-core/src/serve/adapters.rs:292 — crates/rig-core/src/serve/adapters.rs:292-304 | crates/rig-core/src/serve/adapters.rs:388-401 — 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 (12–13 lines × 2) · ×1
  • Duplicated block (12–13 lines × 2) xtask/src/cassette/goldens.rs:33 — xtask/src/cassette/goldens.rs:33-44 | xtask/src/cassette/scan.rs:242-254 — 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 (11–12 lines × 2) · ×1
  • Duplicated block (11–12 lines × 2) crates/rig-candle/src/model.rs:494 — crates/rig-candle/src/model.rs:494-505 | 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–9 lines × 3) · ×1
  • Duplicated block (8–9 lines × 3) crates/rig-ecs/src/bus/dispatch.rs:113 — crates/rig-ecs/src/bus/dispatch.rs:113-120 | crates/rig-ecs/src/bus/dispatch.rs:132-140 | crates/rig-ecs/src/bus/dispatch.rs:156-163 — 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 (7 lines × 3) · ×1
  • Duplicated block (7 lines × 3) crates/rig-ecs/src/systems/mod.rs:2242 — crates/rig-ecs/src/systems/mod.rs:2242-2248 | crates/rig-ecs/src/systems/mod.rs:2381-2387 | crates/rig-ecs/src/systems/mod.rs:2696-2702 — 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 (11 lines × 4) · ×1
  • Duplicated block (11 lines × 4) crates/rig-core/src/audio_generation.rs:49 — crates/rig-core/src/audio_generation.rs:49-59 | crates/rig-core/src/embeddings/embedding.rs:75-85 | crates/rig-core/src/embeddings/embedding.rs:130-140 | crates/rig-core/src/image_generation.rs:53-63 — there are 4 copies across 3 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 4 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×1
  • Duplicated block (5 lines × 3) crates/rig-core/src/providers/cohere/wire.rs:249 — crates/rig-core/src/providers/cohere/wire.rs:249-253 | crates/rig-core/src/providers/ollama/wire.rs:202-206 | crates/rig-core/src/providers/voyageai/wire.rs:166-170 — 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 (13 lines × 2) · ×1
  • Duplicated block (13 lines × 2) crates/rig-cassette/src/ecs/identity.rs:337 — crates/rig-cassette/src/ecs/identity.rs:337-349 | crates/rig-cassette/src/ecs/identity.rs:376-388 — 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 (29 lines × 3) · ×1
  • Duplicated block (29 lines × 3) test-support/rig-test-support/src/scenario_registry.rs:149 — test-support/rig-test-support/src/scenario_registry.rs:149-177 | test-support/rig-test-support/src/scenario_registry.rs:181-209 | test-support/rig-test-support/src/scenario_registry.rs:213-241 — 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 (21 lines × 2) · ×1
  • Duplicated block (21 lines × 2) test-support/rig-test-support/src/reasoning.rs:367 — test-support/rig-test-support/src/reasoning.rs:367-387 | test-support/rig-test-support/src/reasoning.rs:460-480 — 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 (19 lines × 2) · ×1
  • Duplicated block (19 lines × 2) test-support/rig-test-support/src/reasoning.rs:274 — test-support/rig-test-support/src/reasoning.rs:274-292 | test-support/rig-test-support/src/reasoning.rs:418-436 — 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 (17 lines × 2) · ×1
  • Duplicated block (17 lines × 2) crates/rig-http/src/test_utils.rs:238 — crates/rig-http/src/test_utils.rs:238-254 | crates/rig-http/src/test_utils.rs:421-437 — 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 (11–16 lines × 2) · ×1
  • Duplicated block (11–16 lines × 2) test-support/rig-test-support/src/reasoning.rs:426 — test-support/rig-test-support/src/reasoning.rs:426-436 | test-support/rig-test-support/src/reasoning.rs:470-485 — 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 (14 lines × 2) · ×1
  • Duplicated block (14 lines × 2) test-support/rig-test-support/src/raw_capture/chat.rs:79 — test-support/rig-test-support/src/raw_capture/chat.rs:79-92 | test-support/rig-test-support/src/raw_capture/chat.rs:171-184 — 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:955 — crates/rig-core/src/test_utils/streaming_conformance.rs:955-962 | crates/rig-core/src/test_utils/streaming_conformance.rs:998-1008 | crates/rig-core/src/test_utils/streaming_conformance.rs:1056-1064 — 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 (10 lines × 3) · ×1
  • Duplicated block (10 lines × 3) test-support/rig-test-support/src/matrix_registry.rs:99 — test-support/rig-test-support/src/matrix_registry.rs:99-110 | test-support/rig-test-support/src/matrix_registry.rs:148-157 | test-support/rig-test-support/src/matrix_registry.rs:199-210 — 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 (8 lines × 3) · ×1
  • Duplicated block (8 lines × 3) test-support/rig-test-support/src/matrix_registry.rs:83 — test-support/rig-test-support/src/matrix_registry.rs:83-90 | test-support/rig-test-support/src/matrix_registry.rs:132-139 | test-support/rig-test-support/src/matrix_registry.rs:181-188 — 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:645 — test-support/rig-test-support/src/cache_conformance.rs:645-660 | test-support/rig-test-support/src/cache_conformance.rs:689-706 — 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.95 — rust-toolchain.toml declares Rust 1.95 as this project's toolchain file, and Rust 1.95, superseded by 1.96 on 2026-05-28 (the Rust project patches only the current stable). An unsupported runtime receives no security patches, so every vulnerability disclosed in it since 2026-05-28 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.
D5 · Coupling · Off the main sequence · ×1
  • Off the main sequence: rig-core — rig-core: abstractness 0.07, instability 0.14, distance 0.79 — zone of pain — concrete and depended on by 24 project(s), so it's rigid to change.
Minor — 13 finding(s)
D19 · Documentation Quality · Documentation · ×7
  • Documentation: no project overview README.md — The root README is a single banner linking to docs.rs, crates.io, Discord, and a warning but does not describe what Rig is or what it does. Write an overview paragraph explaining the project's purpose (LLM-powered applications with ergonomics/modularity) and its main features.
  • Documentation: no project overview crates/rig-fastembed/README.md — The first paragraph is a dependency line ('This crate allows you to use [fastembed-rs] with Rig') rather than an overview of what the project does or its scope. Replace the first sentence with a one-paragraph description stating what this crate provides and why it matters for Rig integration.
  • Documentation: no installation or build instructions crates/rig-fastembed/README.md — The installation section is present but only describes adding the dependency; there are no build or setup instructions. Add a short 'How to build and run' block under the README, covering any necessary Cargo features or commands.
  • Documentation: no usage examples crates/rig-fastembed/README.md — The Usage section is present but only shows dependency lines; there are no runnable examples. Add a short usage example (e.g. the vector_search_fastembed.rs path) that runs and outputs something concrete.
  • Documentation: no architecture or design documentation crates/rig-fastembed/README.md — The document set contains no architecture or design documentation, despite the presence of a single architecture/design doc in the summary. Add an architecture section describing how each integration (fastembed, gemini-grpc, helixdb) connects to Rig.
  • Documentation: no installation or build instructions crates/rig-scylladb/README.md — There are no installation, build, or setup instructions in the README. Add a short install section covering Cargo.toml dependencies and how to build/run the crate.
  • Documentation: no usage examples crates/rig-scylladb/README.md — The code example is long but there are no standalone usage examples or a 'how to run it' instruction. Add one or two short runnable snippets showing the minimal invocation of the crate.
D16 · Bus Factor · Off-boarding risk · ×1
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 66 significant file(s) lose their only recent owner: test-support/rig-test-support/src/support.rs, crates/rig-agent/src/run/mod.rs, crates/rig-agent/src/test_utils/model_conformance.rs, crates/rig-candle/src/model/tests.rs, test-support/rig-test-support/src/cache_conformance.rs, crates/rig-agent/src/agent/hook.rs, test-support/rig-test-support/src/reasoning.rs, crates/rig-candle/src/protocol.rs (+58 more). Pair on, review, or document these before any departure.
D26 · Project Cohesion · Split crates/rig-core · ×1
  • Split crates/rig-core — The core provider bundle is huge and sprawls across 43 namespaces under providers/*, a classic grab-bag. Suggested: split providers into cohesive GPT/Anthropic/Cohere integration libraries
D34 · Knowledge Freshness · Orphaned files with no living knowledge · ×1
  • Orphaned files with no living knowledge — 1 of 476 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 and example/demo trees and test files identified by path convention, largest first; 476 of the 623 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-core/src/embeddings/embed.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.
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 12/13 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `xtask`.
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.
Minor — 7 finding(s)
D12 · Dependency Hygiene · Outdated · ×7
  • Outdated: aws-sdk-s3vectors — `aws-sdk-s3vectors` is locked at 1.19.0 but 1.40.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: futures — `futures` is locked at 0.3.32 but 0.3.34 is the current stable release on crates.io, and it already satisfies the `"0.3"` requirement declared in tests/fixtures/agent_run_stepper/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p futures` and commit the updated REDACTED.
  • Outdated: reqwest — `reqwest` is locked at 0.13.4 but 0.13.5 is the current stable release on crates.io, and it already satisfies the `"0.13"` requirement declared in crates/rig-reqwest/tests/fixtures/middleware_features/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p reqwest` and commit the updated REDACTED.
  • Outdated: serde — `serde` is locked at 1.0.228 but 1.0.229 is the current stable release on crates.io, and it already satisfies the `"1.0.219"` requirement declared in tests/fixtures/tool_facade/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p serde` and commit the updated REDACTED.
  • Outdated: serde_json — `serde_json` is locked at 1.0.150 but 1.0.151 is the current stable release on crates.io, and it already satisfies the `"1.0.150"` requirement declared in tests/fixtures/agent_run_stepper/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p serde_json` and commit the updated REDACTED.
  • Outdated: thiserror — `thiserror` is locked at 2.0.18 but 2.0.21 is the current stable release on crates.io, and it already satisfies the `"2"` requirement declared in examples/discord_bot/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p thiserror` and commit the updated REDACTED.
  • Outdated: tokio — `tokio` is locked at 1.52.3 but 1.53.1 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in examples/discord_bot/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tokio` and commit the updated REDACTED.

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-afbc566bf5854d839506ea3fff3d30c0/history.json --exit-code 0 --source .0artifacts/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-afbc566bf5854d839506ea3fff3d30c0/tree.json --exit-code 0 --source .0artifacts/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 .27artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesosv-scanner—osv-scanner --format json --recursive .12artifacts/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 .0artifacts/raw/osv-scanner.json

Run 01a0ec29-4d8c-7f42-8335-a888356116f7 · 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