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

langchain-ai/deepagents

Measured 20 October 2026, 17:10 UTC, at code version d1962cf

CAI score 59out of 100 Weak
CriticalWeakAdequateStrongExemplary
Down 10 since the last survey

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

A large codebase: 255,996 lines of product code in 12 projects, tests not counted · Estimated rebuild effort: about 4.0 person-years · Weakest lens: Production Readiness, 46

Findings by how serious they are

67 critical 1101 serious 73 minor

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

This survey was produced by

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
20 October 2026, 17:10 UTC

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

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

62of 66 dimensions measured by tools. The other 4 are advisory notes from an AI model, which explain the code but don't count towards the score.
1223of 1241 findings point to an exact file and line, so you can open each one in the code. The other 18 concern the repository as a whole, such as missing documentation.
66dimensions across 6 lenses, read from 255,996 lines of product code in 12 projects.
Chapters

Executive summary

langchain-ai/deepagents scores 59 out of 100, which would normally be rated Adequate, but it is rated Weak because its weakest group of dimensions, Dependencies, is rated Critical. The standard never rates a score more than one step above its weakest group, so a high average can't hide a weak area. The project hasn't declared a stable release yet, so its lenses are rated against a lower bar than a released product's, while the score itself is worked out as for any repository.

The weakest lens counts most in the score, and here that is Production Readiness, which scores 46 and is rated Adequate. Its Dependency Hygiene dimension scores 0.3 out of 10, and until that reaches 4, Production Readiness can't be rated higher than Adequate. The first actions are to resolve the 2 Leaked secret finding(s) in Secret Scanning and to resolve the 1 No ADRs found finding(s) in ADR Quality, and if Production Readiness rose to 70, the score would rise from 59 to about 67.

67 findings are critical: 32 in IaC & Container Security, 31 in Static Analysis (SAST), two in Dependency Vulnerabilities and two in Secret Scanning.

Watchdog couldn't measure 15 dimensions in this code, among them Code Coverage, Test Reliability and Navigability, so they are left out of the score. The product code is 255,996 lines, which would take an estimated 4.0 person-years, around €590,000, to rebuild.

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

How the score is built: what each lens counts for The lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Production Readiness 46 · counts for 46%Maturity 56 · counts for 25%Security and Compliance 81 · counts for 14%Code Health 82 · counts for 8%Performance 87 · counts for 4%Architecture 92 · counts for 2%

If Production Readiness rose from 46 to 70, the lowest score rated Strong, the score would rise from 59 to about 67.

Code composition: what the lines of code are
Product code 46%Tests 54%
New since the last survey: 69 findings

These 69 critical or serious findings weren't in the previous survey, on 4 October 2026.

  • Cyclomatic Complexity · DeepAgentsApp._restart_server_for_owned_agent_swap (cyclomatic 52) libs/code/deepagents_code/app.py
  • Cyclomatic Complexity · DeepAgentsApp._resume_owned_thread (cyclomatic 24) libs/code/deepagents_code/app.py
  • Cyclomatic Complexity · DeepAgentsApp._confirm_and_switch_model (cyclomatic 20) libs/code/deepagents_code/app.py
  • Cyclomatic Complexity · model_api.model_metadata (cyclomatic 20) libs/code/deepagents_code/model_api.py
  • Cyclomatic Complexity · DeepAgentsApp._generate_thread_name (cyclomatic 18) libs/code/deepagents_code/app.py
  • Cyclomatic Complexity · DeepAgentsApp._confirm_then_resume_owned_cross_agent_thread (cyclomatic 18) libs/code/deepagents_code/app.py
  • Cyclomatic Complexity · model_catalog.load_model_catalog (cyclomatic 17) libs/code/deepagents_code/model_catalog.py
  • Cyclomatic Complexity · thread_selector._format_column_value (cyclomatic 17) libs/code/deepagents_code/tui/widgets/thread_selector.py
  • Cyclomatic Complexity · DeepAgentsApp._replace_server_after_cwd_switch (cyclomatic 16) libs/code/deepagents_code/app.py
  • Cyclomatic Complexity · model_config.load_thread_config (cyclomatic 16) REDACTED
  • Cyclomatic Complexity · ToolCallMessage._restore_deferred_state (cyclomatic 16) libs/code/deepagents_code/tui/widgets/messages.py
  • Cyclomatic Complexity · ModelSelectorScreen._set_default (cyclomatic 16) libs/code/deepagents_code/tui/widgets/model_selector.py
  • Cyclomatic Complexity · _skill_tools._find_skill_reads (cyclomatic 16) libs/deepagents/deepagents/middleware/_skill_tools.py
  • Cognitive Complexity · DeepAgentsApp._restart_server_for_owned_agent_swap (cognitive 67) libs/code/deepagents_code/app.py
  • Cognitive Complexity · DeepAgentsApp._resume_owned_thread (cognitive 37) libs/code/deepagents_code/app.py
  • Cognitive Complexity · ModelSelectorScreen._set_default (cognitive 28) libs/code/deepagents_code/tui/widgets/model_selector.py
  • Cognitive Complexity · model_catalog.load_model_catalog (cognitive 23) libs/code/deepagents_code/model_catalog.py
  • Cognitive Complexity · DeepAgentsApp._generate_thread_name (cognitive 22) libs/code/deepagents_code/app.py
  • Cognitive Complexity · model_api.model_metadata (cognitive 22) libs/code/deepagents_code/model_api.py
  • Cognitive Complexity · DeepAgentsApp._refresh_cache_expiry_banner (cognitive 20) libs/code/deepagents_code/app.py
  • Cognitive Complexity · _skill_tools._find_skill_reads (cognitive 19) libs/deepagents/deepagents/middleware/_skill_tools.py
  • Cognitive Complexity · DeepAgentsApp._sync_cache_state_from_state (cognitive 17) libs/code/deepagents_code/app.py
  • Cognitive Complexity · DeepAgentsApp._confirm_then_resume_owned_cross_agent_thread (cognitive 17) libs/code/deepagents_code/app.py
  • Cognitive Complexity · _DaytonaProvider.get_or_create (cognitive 17) libs/code/deepagents_code/integrations/sandbox_factory.py
  • Cognitive Complexity · TalonHost._effort_command (cognitive 16) libs/talon/deepagents_talon/host.py
  • God Classes · FileTooLong: deepagents_code/configurable_model.py libs/code/deepagents_code/configurable_model.py
  • Code Duplication · Edited copy of a member (32 corresponding lines) libs/code/deepagents_code/client/launch/server_manager.py
  • Code Duplication · Members sharing a duplicated core (11 members, 50+ identical tokens) REDACTED
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) libs/code/deepagents_code/app.py
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) libs/code/deepagents_code/ui.py
  • Code Duplication · Duplicated block (26–34 lines × 2) libs/code/deepagents_code/ui.py
  • Code Duplication · Duplicated block (28–32 lines × 2) libs/code/deepagents_code/ui.py
  • Code Duplication · Duplicated block (17–30 lines × 2) libs/code/deepagents_code/ui.py
  • Code Duplication · Duplicated block (27 lines × 2) libs/deepagents/deepagents/middleware/async_subagents.py
  • Code Duplication · Duplicated block (22–26 lines × 3) libs/code/deepagents_code/ui.py
  • Code Duplication · Duplicated block (20–22 lines × 2) libs/code/deepagents_code/model_retry.py
  • Code Duplication · Duplicated block (21 lines × 2) libs/code/deepagents_code/model_api.py
  • Code Duplication · Duplicated block (20 lines × 4) libs/deepagents/deepagents/middleware/filesystem.py
  • Code Duplication · Duplicated block (19 lines × 2) libs/code/deepagents_code/hooks/server_middleware.py
  • Code Duplication · Duplicated block (19 lines × 2) libs/code/deepagents_code/model_retry.py
  • Code Duplication · Duplicated block (16 lines × 2) libs/deepagents/deepagents/middleware/filesystem.py
  • Code Duplication · Duplicated block (14–15 lines × 6) libs/deepagents/deepagents/middleware/filesystem.py
  • Code Duplication · Duplicated block (12–15 lines × 2) libs/code/deepagents_code/plugins/adapters/skills_middleware.py
  • Code Duplication · Duplicated block (15 lines × 2) libs/deepagents/deepagents/middleware/filesystem.py
  • Code Duplication · Duplicated block (11 lines × 3) libs/deepagents/deepagents/backends/state.py
  • Code Duplication · Duplicated block (9–10 lines × 2) libs/code/deepagents_code/model_retry.py
  • Code Duplication · Duplicated block (7–8 lines × 2) libs/code/deepagents_code/model_api.py
  • Code Duplication · Duplicated block (7 lines × 2) libs/deepagents/deepagents/middleware/async_subagents.py
  • Code Duplication · Duplicated block (7 lines × 2) libs/deepagents/deepagents/middleware/filesystem.py
  • Code Duplication · Duplicated block (6 lines × 2) libs/code/deepagents_code/plugins/adapters/skills_middleware.py
  • Cohesion (LCOM4) · Low cohesion: BaseSandbox (LCOM4 13) libs/deepagents/deepagents/backends/sandbox.py
  • Secret Scanning · REDACTED
  • Secret Scanning · REDACTED
  • Churn × Complexity Hotspots · Hotspot: libs/code/deepagents_code/tui/widgets/thread_selector.py libs/code/deepagents_code/tui/widgets/thread_selector.py
  • Churn × Complexity Hotspots · Hotspot: libs/deepagents/deepagents/backends/sandbox.py libs/deepagents/deepagents/backends/sandbox.py
  • Churn × Complexity Hotspots · Hotspot: libs/code/deepagents_code/btw.py libs/code/deepagents_code/btw.py
  • Churn × Complexity Hotspots · Repeated repair: libs/code/deepagents_code/tui/widgets/debug_console.py libs/code/deepagents_code/tui/widgets/debug_console.py
  • Churn × Complexity Hotspots · Repeated repair: libs/deepagents/deepagents/middleware/rubric.py libs/deepagents/deepagents/middleware/rubric.py
  • Churn × Complexity Hotspots · Repeated repair: libs/code/deepagents_code/tui/widgets/approval.py libs/code/deepagents_code/tui/widgets/approval.py
  • Churn × Complexity Hotspots · Repeated repair: libs/code/deepagents_code/tui/widgets/subagent_panel.py libs/code/deepagents_code/tui/widgets/subagent_panel.py
  • Churn × Complexity Hotspots · Repeated repair: libs/evals/deepagents_harbor/langgraph_project/langgraph_agent.py libs/evals/deepagents_harbor/langgraph_project/langgraph_agent.py
  • Churn × Complexity Hotspots · Repeated repair: libs/code/deepagents_code/model_retry.py libs/code/deepagents_code/model_retry.py
  • Churn × Complexity Hotspots · Repeated repair: libs/code/deepagents_code/tui/widgets/autocomplete.py libs/code/deepagents_code/tui/widgets/autocomplete.py
  • Static Analysis (SAST) · REDACTED
  • Static Analysis (SAST) · REDACTED
  • Dependency Vulnerabilities · REDACTED
  • Exception handling · Swallowed exception (caught, then discarded) libs/talon/deepagents_talon/channels/whatsapp_bridge/bridge.js
  • Exception handling · Swallowed exception (empty catch) libs/talon/deepagents_talon/channels/whatsapp_bridge/bridge.js
  • Exception handling · Swallowed exception (empty catch) libs/talon/deepagents_talon/channels/whatsapp_bridge/bridge.js

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

Fixed since the last survey: 55 findings

These 55 critical or serious findings were in the previous survey, on 4 October 2026, and are gone from this one.

  • Cyclomatic Complexity · DeepAgentsApp._restart_server_for_agent_swap (cyclomatic 47) libs/code/deepagents_code/app.py
  • Cyclomatic Complexity · sessions._populate_checkpoint_fields (cyclomatic 25) libs/code/deepagents_code/sessions.py
  • Cyclomatic Complexity · DeepAgentsApp._resume_thread (cyclomatic 22) libs/code/deepagents_code/app.py
  • Cyclomatic Complexity · DeepAgentsApp._set_auto_classifier_model (cyclomatic 20) libs/code/deepagents_code/app.py
  • Cyclomatic Complexity · ModelSelectorScreen._load_model_data (cyclomatic 20) libs/code/deepagents_code/tui/widgets/model_selector.py
  • Cyclomatic Complexity · DeepAgentsApp._confirm_then_resume_cross_agent_thread (cyclomatic 17) libs/code/deepagents_code/app.py
  • Cognitive Complexity · DeepAgentsApp._restart_server_for_agent_swap (cognitive 61) libs/code/deepagents_code/app.py
  • Cognitive Complexity · sessions._populate_checkpoint_fields (cognitive 42) libs/code/deepagents_code/sessions.py
  • Cognitive Complexity · DeepAgentsApp._resume_thread (cognitive 34) libs/code/deepagents_code/app.py
  • Cognitive Complexity · ModelSelectorScreen._load_model_data (cognitive 31) libs/code/deepagents_code/tui/widgets/model_selector.py
  • Cognitive Complexity · DeepAgentsApp._invoke_skill (cognitive 20) libs/code/deepagents_code/app.py
  • Cognitive Complexity · ModelSelectorScreen.action_set_default (cognitive 19) libs/code/deepagents_code/tui/widgets/model_selector.py
  • Cognitive Complexity · ThreadSelectorScreen._load_threads (cognitive 17) libs/code/deepagents_code/tui/widgets/thread_selector.py
  • Cognitive Complexity · ThreadSelectorScreen._load_checkpoint_details (cognitive 17) libs/code/deepagents_code/tui/widgets/thread_selector.py
  • Cognitive Complexity · DeepAgentsApp._confirm_then_resume_cross_agent_thread (cognitive 16) libs/code/deepagents_code/app.py
  • Code Duplication · Edited copy of a member (32 corresponding lines) libs/code/deepagents_code/client/launch/server_manager.py
  • Code Duplication · Members sharing a duplicated core (11 members, 50+ identical tokens) REDACTED
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) libs/code/deepagents_code/app.py
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) libs/code/deepagents_code/ui.py
  • Code Duplication · Duplicated block (26–35 lines × 2) libs/code/deepagents_code/ui.py
  • Code Duplication · Duplicated block (17–32 lines × 2) libs/code/deepagents_code/ui.py
  • Code Duplication · Duplicated block (26 lines × 2) libs/deepagents/deepagents/middleware/async_subagents.py
  • Code Duplication · Duplicated block (20–23 lines × 2) libs/code/deepagents_code/plugins/adapters/skills_middleware.py
  • Code Duplication · Duplicated block (20 lines × 4) libs/deepagents/deepagents/middleware/filesystem.py
  • Code Duplication · Duplicated block (18–20 lines × 2) libs/code/deepagents_code/model_retry.py
  • Code Duplication · Duplicated block (17–19 lines × 2) libs/code/deepagents_code/client/non_interactive.py
  • Code Duplication · Duplicated block (19 lines × 2) libs/code/deepagents_code/hooks/server_middleware.py
  • Code Duplication · Duplicated block (19 lines × 2) libs/deepagents/deepagents/middleware/async_subagents.py
  • Code Duplication · Duplicated block (16–18 lines × 2) libs/code/deepagents_code/app.py
  • Code Duplication · Duplicated block (16 lines × 2) libs/deepagents/deepagents/middleware/filesystem.py
  • Code Duplication · Duplicated block (14–15 lines × 6) libs/deepagents/deepagents/middleware/filesystem.py
  • Code Duplication · Duplicated block (15 lines × 2) libs/deepagents/deepagents/middleware/filesystem.py
  • Code Duplication · Duplicated block (12 lines × 2) libs/code/deepagents_code/model_retry.py
  • Code Duplication · Duplicated block (9–11 lines × 2) libs/code/deepagents_code/ui.py
  • Code Duplication · Duplicated block (10 lines × 2) libs/code/deepagents_code/ui.py
  • Code Duplication · Duplicated block (8–10 lines × 2) libs/deepagents/deepagents/middleware/filesystem.py
  • Code Duplication · Duplicated block (7–8 lines × 2) libs/deepagents/deepagents/middleware/async_subagents.py
  • Code Duplication · Duplicated block (6 lines × 2) libs/deepagents/deepagents/middleware/async_subagents.py
  • Churn × Complexity Hotspots · Hotspot: REDACTED REDACTED
  • Churn × Complexity Hotspots · Hotspot: libs/code/deepagents_code/client/launch/server.py libs/code/deepagents_code/client/launch/server.py
  • Churn × Complexity Hotspots · Hotspot: libs/deepagents/deepagents/backends/protocol.py libs/deepagents/deepagents/backends/protocol.py
  • Churn × Complexity Hotspots · Hotspot: libs/code/deepagents_code/_tool_stream.py libs/code/deepagents_code/_tool_stream.py
  • Churn × Complexity Hotspots · Hotspot: libs/deepagents/deepagents/backends/composite.py libs/deepagents/deepagents/backends/composite.py
  • Churn × Complexity Hotspots · Hotspot: REDACTED REDACTED
  • Churn × Complexity Hotspots · Repeated repair: libs/deepagents/deepagents/backends/sandbox.py libs/deepagents/deepagents/backends/sandbox.py
  • Churn × Complexity Hotspots · Repeated repair: libs/code/deepagents_code/extras_info.py libs/code/deepagents_code/extras_info.py
  • Churn × Complexity Hotspots · Repeated repair: libs/code/deepagents_code/tui/modals/plugin_manager/state.py libs/code/deepagents_code/tui/modals/plugin_manager/state.py
  • Churn × Complexity Hotspots · Repeated repair: libs/code/deepagents_code/tui/widgets/_paste_textarea.py libs/code/deepagents_code/tui/widgets/_paste_textarea.py
  • Churn × Complexity Hotspots · Repeated repair: libs/code/deepagents_code/tui/modals/plugin_manager/models.py libs/code/deepagents_code/tui/modals/plugin_manager/models.py
  • Churn × Complexity Hotspots · Repeated repair: libs/code/deepagents_code/media_utils.py libs/code/deepagents_code/media_utils.py
  • Static Analysis (SAST) · Medium: REDACTED REDACTED
  • Static Analysis (SAST) · Medium: REDACTED REDACTED
  • Dependency Vulnerabilities · Medium CVE: [GHSA redacted] REDACTED
  • Dependency Vulnerabilities · Medium CVE: PYSEC-2026-2132 REDACTED
  • Dependency Vulnerabilities · Medium CVE: PYSEC-2026-2132 libs/partners/modal/uv.lock
Rebuild cost: about €590,000 · Estimate
Cost to rebuild€190,000 to €980,000, for 3,248 to 10,304 hours of work, about 4.0 person-years for 2 to 8 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.8 at a score of 59. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeLarge: 255,996 lines of product code

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

Top priorities

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

1
Resolve the 2 Leaked secret finding(s) in Secret Scanning — start with REDACTED (2).
Raises the score by about 8 points · Low effort · Secret Scanning
2
Resolve the 1 No ADRs found finding(s) in ADR Quality.
Raises the score by about 7 points · Low effort · ADR Quality
3
Reconcile the README with reality: libs/acp/README.md changes into `deepagents/libs/acp`, but no such folder exists; libs/talon/README.md names `cron/jobs.json`, but no file or folder `cron/jobs.json` exists; libs/evals/datasets/context-retrieval-evals/README.md names `tests/judge.py`, but no file or folder `tests/judge.py` exists; libs/evals/datasets/context-retrieval-evals/README.md names `environment/files/`, but no file or folder `environment/files` exists.
Raises the score by about 5 points · Medium effort · Documentation accuracy

Diagnosis: what the measurements show together

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

Where the investment is most exposed · Value at risk
This code would cost about €590,000 to build again, about 4.0 person-years of work. Its weakest lens is Production Readiness, at 46 (Weak). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 2 Leaked secret finding(s) in Secret Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 8 points for low effort, because it clears the 2 Secret Scanning findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.5 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 4% to 9% on every change. The history of the code shows how much it changes: about 725,420 lines over the last 90 days, which is about 2,941,981 lines a year. At that pace, the extra work comes to an estimated 281 to 1685.8 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

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 deepagents deepagents deepagents-acp deepagents-acp deepagents-acp->deepagents deepagents-code deepagents-code deepagents-code->deepagents deepagents-code->deepagents-acp langchain-quickjs langchain-quickjs deepagents-code->langchain-quickjs deepagents-evals deepagents-evals deepagents-evals->deepagents deepagents-evals->deepagents-code deepagents-evals->langchain-quickjs deepagents-talon deepagents-talon deepagents-talon->deepagents deepagents-talon->deepagents-code deepagents-talon-whatsapp-bridge deepagents-talon-whatsapp-bridge langchain-daytona langchain-daytona langchain-daytona->deepagents langchain-modal langchain-modal langchain-modal->deepagents langchain-quickjs->deepagents langchain-runloop langchain-runloop langchain-runloop->deepagents langchain-vercel-sandbox langchain-vercel-sandbox langchain-vercel-sandbox->deepagents

Architecture: which parts of the code depend on which

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

412 modules, with 262 dependencies between them. Every module uses only modules listed above it, so there are no loops.

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

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 .github.scripts.release2 libs.code.deepagents_code._cli_context3 libs.code.deepagents_code._session_stats4 libs.code.deepagents_code.approval_mode5 libs.code.deepagents_code.configuration.types6 libs.code.deepagents_code.extensions.registry7 libs.code.deepagents_code.mcp_auth8 libs.code.deepagents_code.mcp_oauth_ui9 libs.code.deepagents_code.model_config10 libs.code.deepagents_code.notifications11 libs.code.deepagents_code.sessions12 libs.code.deepagents_code.theme13 libs.code.deepagents_code.tool_catalog14 libs.code.deepagents_code.tui.widgets._inline_prompt15 libs.code.deepagents_code.client.commands16 libs.code.deepagents_code.config17 libs.code.deepagents_code.configuration.provider18 libs.code.deepagents_code.hooks.models.domain19 libs.code.deepagents_code.mcp_providers.base20 libs.code.deepagents_code.model_catalog21 libs.code.deepagents_code.tui.widgets.messages22 libs.code.deepagents_code.configuration.resolver23 libs.code.deepagents_code.hooks.client_lifecycle24 libs.code.deepagents_code.hooks.models.transport25 libs.code.deepagents_code.hooks.presenter26 libs.code.deepagents_code.hooks.snapshot27 libs.code.deepagents_code.tui28 libs.code.deepagents_code.tui.widgets29 libs.code.deepagents_code.configuration30 libs.code.deepagents_code.extensions31 libs.code.deepagents_code.hooks.engine32 libs.code.deepagents_code.hooks.manager33 libs.code.deepagents_code.hooks.server_middleware34 libs.code.deepagents_code.hooks.runtime35 libs.code.deepagents_code.offload_middleware36 libs.code.deepagents_code.client.remote_client37 libs.code.deepagents_code.hooks38 libs.code.deepagents_code.app39 libs.code.deepagents_code.client40 libs.code.deepagents_code
1 .github.scripts.release
2 libs.code.deepagents_code._cli_context
3 libs.code.deepagents_code._session_stats
4 libs.code.deepagents_code.approval_mode
5 libs.code.deepagents_code.configuration.types
6 libs.code.deepagents_code.extensions.registry
7 libs.code.deepagents_code.mcp_auth
8 libs.code.deepagents_code.mcp_oauth_ui
9 libs.code.deepagents_code.model_config
10 libs.code.deepagents_code.notifications
11 libs.code.deepagents_code.sessions
12 libs.code.deepagents_code.theme
13 libs.code.deepagents_code.tool_catalog
14 libs.code.deepagents_code.tui.widgets._inline_prompt
15 libs.code.deepagents_code.client.commands11
16 libs.code.deepagents_code.config1
17 libs.code.deepagents_code.configuration.provider2
18 libs.code.deepagents_code.hooks.models.domain1
19 libs.code.deepagents_code.mcp_providers.base11
20 libs.code.deepagents_code.model_catalog3
21 libs.code.deepagents_code.tui.widgets.messages1
22 libs.code.deepagents_code.configuration.resolver11
23 libs.code.deepagents_code.hooks.client_lifecycle113
24 libs.code.deepagents_code.hooks.models.transport1
25 libs.code.deepagents_code.hooks.presenter2
26 libs.code.deepagents_code.hooks.snapshot2
27 libs.code.deepagents_code.tui111
28 libs.code.deepagents_code.tui.widgets12211
29 libs.code.deepagents_code.configuration612
30 libs.code.deepagents_code.extensions51
31 libs.code.deepagents_code.hooks.engine11
32 libs.code.deepagents_code.hooks.manager11511
33 libs.code.deepagents_code.hooks.server_middleware21
34 libs.code.deepagents_code.hooks.runtime2111
35 libs.code.deepagents_code.offload_middleware1
36 libs.code.deepagents_code.client.remote_client11
37 libs.code.deepagents_code.hooks113033321
38 libs.code.deepagents_code.app1114111431
39 libs.code.deepagents_code.client111111
40 libs.code.deepagents_code12431182212123262
Uses a module listed above itPart of a loopThe module itself
1 .github.scripts.release2 libs.code.deepagents_code._cli_context3 libs.code.deepagents_code._session_stats4 libs.code.deepagents_code.approval_mode5 libs.code.deepagents_code.configuration.types6 libs.code.deepagents_code.extensions.registry7 libs.code.deepagents_code.mcp_auth8 libs.code.deepagents_code.mcp_oauth_ui9 libs.code.deepagents_code.model_config10 libs.code.deepagents_code.notifications11 libs.code.deepagents_code.sessions12 libs.code.deepagents_code.theme13 libs.code.deepagents_code.tool_catalog14 libs.code.deepagents_code.tui.widgets._inline_prompt15 libs.code.deepagents_code.client.commands16 libs.code.deepagents_code.config17 libs.code.deepagents_code.configuration.provider18 libs.code.deepagents_code.hooks.models.domain19 libs.code.deepagents_code.mcp_providers.base20 libs.code.deepagents_code.model_catalog21 libs.code.deepagents_code.tui.widgets.messages22 libs.code.deepagents_code.configuration.resolver23 libs.code.deepagents_code.hooks.client_lifecycle24 libs.code.deepagents_code.hooks.models.transport25 libs.code.deepagents_code.hooks.presenter26 libs.code.deepagents_code.hooks.snapshot27 libs.code.deepagents_code.tui28 libs.code.deepagents_code.tui.widgets29 libs.code.deepagents_code.configuration30 libs.code.deepagents_code.extensions31 libs.code.deepagents_code.hooks.engine32 libs.code.deepagents_code.hooks.manager33 libs.code.deepagents_code.hooks.server_middleware34 libs.code.deepagents_code.hooks.runtime35 libs.code.deepagents_code.offload_middleware36 libs.code.deepagents_code.client.remote_client37 libs.code.deepagents_code.hooks38 libs.code.deepagents_code.app39 libs.code.deepagents_code.client40 libs.code.deepagents_code.github.scripts.release1libs.code.deepagents_code._cli_context2libs.code.deepagents_code._session_stats3libs.code.deepagents_code.approval_mode4libs.code.deepagents_code.configuration.types5libs.code.deepagents_code.extensions.registry6libs.code.deepagents_code.mcp_auth7libs.code.deepagents_code.mcp_oauth_ui8libs.code.deepagents_code.model_config9libs.code.deepagents_code.notifications10libs.code.deepagents_code.sessions11libs.code.deepagents_code.theme12libs.code.deepagents_code.tool_catalog13libs.code.deepagents_code.tui.widgets._inline_prompt14libs.code.deepagents_code.client.commands15libs.code.deepagents_code.config16libs.code.deepagents_code.configuration.provider17libs.code.deepagents_code.hooks.models.domain18libs.code.deepagents_code.mcp_providers.base19libs.code.deepagents_code.model_catalog20libs.code.deepagents_code.tui.widgets.messages21libs.code.deepagents_code.configuration.resolver22libs.code.deepagents_code.hooks.client_lifecycle23libs.code.deepagents_code.hooks.models.transport24libs.code.deepagents_code.hooks.presenter25libs.code.deepagents_code.hooks.snapshot26libs.code.deepagents_code.tui27libs.code.deepagents_code.tui.widgets28libs.code.deepagents_code.configuration29libs.code.deepagents_code.extensions30libs.code.deepagents_code.hooks.engine31libs.code.deepagents_code.hooks.manager32libs.code.deepagents_code.hooks.server_middleware33libs.code.deepagents_code.hooks.runtime34libs.code.deepagents_code.offload_middleware35libs.code.deepagents_code.client.remote_client36libs.code.deepagents_code.hooks37libs.code.deepagents_code.app38libs.code.deepagents_code.client39libs.code.deepagents_code401112111311111312211112211612511111511212111111113033321111411143111111112431182212123262+372 more modules (most-connected shown)

At a glance — Code Health · 82% · Adequate · gated by D2 ·

At a glance — Architecture · 92% · Exemplary ·

At a glance — Maturity · 56% · Adequate · gated by M4 ·

At a glance — Readiness · 46% · Adequate · gated by D12, P3 ·

At a glance — Security · 81% · Adequate · gated by D29, D31 ·

At a glance — Performance · 87% · 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
A02:2025 — Security Misconfiguration64High / Critical
A05:2025 — Injection62High / Critical
A03:2025 — Software Supply Chain Failures5High / Critical
A07:2025 — Authentication Failures2High / Critical

Roadmap

Immediately resolve the two leaked secrets in REDACTED and establish a Security & Performance tooling pipeline by adding a SAST step to CI to prevent security regressions. Reconcile the documentation accuracy by correcting the README files to reflect the actual repository structure, ensuring paths and files match reality. Finally, improve ADR quality and architecture documentation by creating a dedicated docs/adr folder to record significant design decisions with their dates, contexts, and 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).+8.4 ptsLowSecret Scanning
Resolve the 1 No ADRs found finding(s) in ADR Quality.+7.1 ptsLowADR Quality
Reconcile the README with reality: libs/acp/README.md changes into `deepagents/libs/acp`, but no such folder exists; libs/talon/README.md names `cron/jobs.json`, but no file or folder `cron/jobs.json` exists; libs/evals/datasets/context-retrieval-evals/README.md names `tests/judge.py`, but no file or folder `tests/judge.py` exists; libs/evals/datasets/context-retrieval-evals/README.md names `environment/files/`, but no file or folder `environment/files` exists.+5.1 ptsMediumDocumentation accuracy
Resolve the 4 Off-boarding risk finding(s) in Bus Factor.+2.3 ptsLowBus Factor
Add a SAST step to CI running what this repository's stack ships: bandit, `semgrep --config=p/python`, or CodeQL's python pack — so a security regression fails the build instead of landing.+4.2 ptsMediumSecurity & performance tooling
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.+2.6 ptsMediumArchitecture documentation
Stamp a version in your build/package manifest (e.g. csproj <Version>, package.json, REDACTED, Cargo.toml, or a VERSION file) or tag releases with semver so builds and releases are traceable.+2.3 ptsMediumRelease Hygiene
Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor.+0.6 ptsLowBus Factor

File quality

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

FileScoreBandWorst signal
REDACTED3.3MixedSecret Scanning: Leaked secret: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.4MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.1MixedIaC & Container Security: High IaC: REDACTED
REDACTED5.1MixedIaC & Container Security: High IaC: REDACTED
REDACTED5.1MixedIaC & Container Security: High IaC: REDACTED
REDACTED5.1MixedIaC & Container Security: High IaC: REDACTED
REDACTED5.1MixedIaC & Container Security: High IaC: REDACTED
REDACTED5.1MixedIaC & Container Security: High IaC: REDACTED
REDACTED5.1MixedIaC & Container Security: High IaC: REDACTED
REDACTED5.1MixedIaC & Container Security: High IaC: REDACTED
REDACTED5.1MixedIaC & Container Security: High IaC: REDACTED
REDACTED5.1MixedIaC & Container Security: High IaC: REDACTED
REDACTED5.1MixedIaC & Container Security: High IaC: REDACTED
REDACTED5.1MixedIaC & Container Security: High IaC: REDACTED
REDACTED5.1MixedIaC & Container Security: High IaC: REDACTED

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

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

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

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

Could not be resolved — 16

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. 62 of 66 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 — 66 dimensions across the health lenses
D1D2D3D4D5D6D9D10D12D13D14D15D16D17D19D20D21D22D26D28D29D30D31D34D35D36D43D44AX10AX3AX4C2M1M2M3M4P1P10P2P3P4P6P7PF1PF3X1X12X13X14X15X16X17X18X19X21X22X23X24X25X26X27X28X29X3X30X4

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, 1223 of 1241 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 01a15a4b-4f53-701c-a405-26e652553da5.

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: this repository's production source spans .py, and our analyzer cannot run the .py test suite(s) — so no coverage was collected for the repository as a whole. The JavaScript/TypeScript half did build and run, and its own line coverage came back at 88.9% — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — coverage is excluded from the score rather than counted as a near-zero. In the meantime, produce a coverage report in a standard format (`coverage run -m pytest` then `coverage xml`) 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 and real coverage will be read. You can widen what we reach: optional: produce a coverage report in a standard format (`coverage run -m pytest` then `coverage xml`) 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 both halves are 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 26 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 585 test source file(s) (.py) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
  • D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability NOT SCORED: this repository's production source includes .py, and the python executor ran against the .py half and did not finish re-running within its tier budget — so reliability was not measured for the repository as a whole. The JavaScript/TypeScript (node:test via `npm ci --ignore-scripts` in libs/talon/deepagents_talon/channels/whatsapp_bridge/ (31 tests)): measured (0 flaky) suite(s) did re-run, and came back with 0 flaky across 1 measured tier(s) — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — test reliability is excluded from the score rather than counted. The half was driven by a runner we ship, so this is not a missing-runner gap.
  • D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • D32 Data Compliance (PII/GDPR) — 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. `libs/code/deepagents_code/_async.py`, `libs/code/deepagents_code/_tool_free.py`, `libs/code/deepagents_code/btw_api.py`, `libs/code/deepagents_code/client/remote_client.py`, `libs/code/deepagents_code/config_manifest.py`, … (+32 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover 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 reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository defines its own container in REDACTED, whose lifetimes are not modelled yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • 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.
  • AXR1 Runtime accessibility — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DockerCompose (examples/talon/docker-compose.yml). compose up failed (exit 14 — a file the compose project references is missing) — env file examples/talon/.env not found: stat examples/talon/.env: no such file or directory; runtime evidence skipped.
  • 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.
  • 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. 'sqlite3' is imported (libs/code/deepagents_code/workspace.py:10), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • 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. 'sqlite3' is imported (libs/code/deepagents_code/workspace.py:10), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • 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. 'sqlite3' is imported (libs/code/deepagents_code/workspace.py:10), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's Python is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Python is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • P8 Schema migrations — 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. The schema may be created by a runner, a deploy script or a config file outside what this check reads, so an absence here is our blind spot rather than a missing migration strategy. The card abstains instead of scoring. You can widen what we reach: if the schema is created and evolved by a tool this check does not name, naming it lets us teach the detector to read it.
  • 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.
  • X5 Nullable reference types — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax and MSBuild project configuration, TypeScript source and its tsconfig files, Java source and its package and module declarations, PHP source and its PHPStan and Psalm configuration, Dart source and its pubspec language version, Ruby source and its Sorbet and Steep configuration, Scala source and its build's explicit-nulls, WartRemover and Scalafix settings, and Kotlin source only, and no C# was loaded, no TypeScript was found, and this repository's Python is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.

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

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 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.
  • D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
  • 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.
  • D22 Internal API Consistency: API-surface coherence is an LLM judgement over a sample of the public surface — consistency of intent across the whole API is approximated, not exhaustively verified.
  • 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 REDACTED (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.
  • 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, D22, 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 Complexity4.6 / 10Weak✓ 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 4.6 / 10 · rule-coverage 100% · ceiling Prevented

204 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was textual_adapter.execute_task_textual at 380.

textual_adapter.execute_task_textual (cyclomatic 380)REDACTED:1797
main.cli_main (cyclomatic 194)libs/code/deepagents_code/main.py:5335
DeepAgentsApp._handle_command (cyclomatic 124)libs/code/deepagents_code/app.py:17494
agent.create_cli_agent (cyclomatic 113)libs/code/deepagents_code/agent.py:2524
DeepAgentsApp._run_agent_task (cyclomatic 61)libs/code/deepagents_code/app.py:19801

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

What to do

  1. Bring the 1 body over 240 down to 240 or less in Cyclomatic Complexity — start with textual_adapter.execute_task_textual (cyclomatic 380). — Refactoring it lifts Cyclomatic Complexity from 4.6 to about 5.1/10.
  2. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D2 · Cognitive Complexity2.0 / 10Critical✓ 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 2.0 / 10 · rule-coverage 100% · ceiling Prevented

394 method(s) exceeded the cognitive complexity threshold of 15; the worst was textual_adapter.execute_task_textual at 1506.

textual_adapter.execute_task_textual (cognitive 1506)REDACTED:1797
main.cli_main (cognitive 304)libs/code/deepagents_code/main.py:5335
agent.create_cli_agent (cognitive 156)libs/code/deepagents_code/agent.py:2524
DeepAgentsApp._handle_command (cognitive 152)libs/code/deepagents_code/app.py:17494
graph.create_deep_agent (cognitive 106)libs/deepagents/deepagents/graph.py:278

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

What to do

  1. Bring the 4 bodies over 120 down to 120 or less in Cognitive Complexity — start with textual_adapter.execute_task_textual (cognitive 1506), main.cli_main (cognitive 304), agent.create_cli_agent (cognitive 156). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 4 together lifts Cognitive Complexity from 2.0 to about 4.1/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
  2. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D3 · God Classes8.4 / 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 8.4 / 10 · rule-coverage 100% · ceiling Prevented

98 god class(es) detected.

FileTooLong: deepagents_code/app.py · ×81libs/code/deepagents_code/app.py
TooManyMethods: DeepAgentsApp · ×17libs/code/deepagents_code/app.py:3222

What to do

  1. Resolve the 81 FileTooLong finding(s) in God Classes — start with REDACTED (2), filesystem.py (2), REDACTED (2). — One of this dimension's main actionable groups (81 warning-level).
  2. Resolve the 17 TooManyMethods finding(s) in God Classes — start with chat_input.py (2), app.py, thread_selector.py. — One of this dimension's main actionable groups (17 warning-level).
  3. 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.6 / 10Stronggated by 233 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.6 / 10 · rule-coverage 100% · ceiling Verified

223 duplicated block group(s) detected. A further 10 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 5 of the 233 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 (12 lines × 2) · ×13.github/scripts/evals/aggregate_shards.py:773
Duplicated block (11 lines × 2) · ×9libs/code/deepagents_code/_repository_bounds.py:298
Duplicated block (13 lines × 2) · ×8libs/code/deepagents_code/skills/commands.py:578
Duplicated block (10 lines × 2) · ×8.github/scripts/checks/raise_langchain_minimums.py:169
Duplicated block (9 lines × 2) · ×8libs/code/deepagents_code/extras_info.py:126

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

What to do

  1. Resolve the 13 Duplicated block (12 lines × 2) finding(s) in Code Duplication — start with main.py (4), composite.py (2), aggregate_shards.py. — One of this dimension's main actionable groups (13 warning-level).
  2. Resolve the 9 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with _repository_bounds.py, init_skill.py, extras.py. — One of this dimension's main actionable groups (9 warning-level).
  3. Resolve the 8 Duplicated block (13 lines × 2) finding(s) in Code Duplication — start with filesystem.py (3), ui.py (2), commands.py. — One of this dimension's main actionable groups (8 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.3 / 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.3 / 10 · rule-coverage 100% · ceiling Prevented

11 production modules (npm+Python), 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 10 of the 11 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).

Off the main sequence: deepagents

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.7 / 10Stronggated by 5 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.7 / 10 · rule-coverage 100% · ceiling Verified

5 of 207 classes have LCOM4 above 3.

Low cohesion: BaseSandbox (LCOM4 13) · ×5libs/deepagents/deepagents/backends/sandbox.py:1587

What to do

  1. Resolve the 5 Low cohesion finding(s) in Cohesion (LCOM4) — start with sandbox.py, chat_input.py, app.py. — One of this dimension's main actionable groups (5 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

12412 test methods: 12375 unit, 37 integration, 0 BDD, 0 e2e. The JavaScript/TypeScript suite contributes 26 `it`/`test` case(s) across 2 test file(s) declaring at least one; its tier split is read from package names and paths only. The Python suite contributes 12386 test function(s) across 479 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 26 tests. Measured on the JavaScript/TypeScript suite only — at least 585 test source file(s) (.py) went unread, so its test quality is unmeasured and is not in these counts.

✓ On the Gold path — maintain.

Detailed fixes: d10_recommendation.md.

D12 · Dependency Hygiene10.0 0.3 / 10Critical✓ 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 0.3 / 10 · rule-coverage 3% · ceiling Verified

0 outdated, 0 yanked pinned Python distributions. 1 of 34 shipped distributions were graded against pypi.org (0 not published there, 33 declared without an exact pin, which installs the newest release the declaration admits and so cannot be behind one). Only EXACT pins are graded for currency: a floor or a range already installs the newest release it admits, so reporting one would report this repository for being current. Whether a deliberate upper cap has itself gone stale is a different and weaker question, and is not asked. Whether any distribution is UNMAINTAINED is not graded — PyPI publishes no maintenance status, and release age does not stand in for one. Lockfiles are not read (poetry.lock, REDACTED, Pipfile.lock, pdm.lock), so a lock-resolved install is outside this verdict. Known CVEs in this dependency graph are D30's question.

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.

D13 · Secret Scanning5.0 / 10Adequate✓ 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 5.0 / 10 · rule-coverage 100% · ceiling Prevented

1 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 Compliance10.0 / 10Exemplary○ Nothing flagged

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 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 of 185 shipped Python distribution(s) use a banned license. Licences were resolved from PyPI over the distributions a consumer installs — this repository's 34 declared runtime requirement(s) closed transitively over each distribution's published `requires_dist` (151 reached that way). Requirements it states ONLY under an extra, a PEP 735 dependency group, a Poetry dev group or a dev-named requirements file are excluded: pip does not install any of them for a consumer. ★ This repository commits no dependency lockfile that this pass reads, so each licence is the one PyPI publishes for the distribution's CURRENT release rather than for a pinned version. 10 of them publish no licence on PyPI this pass can read; that is missing data, not a violation, and none of them is charged. This repository publishes itself under MIT, which is its own choice and is not judged here.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots8.8 / 10Strong✓ 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 8.8 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: libs/code/deepagents_code/app.py (212×124=26288); REDACTED (35×380=13300); libs/code/deepagents_code/main.py (63×194=12222) Repeated repair below the complexity floor: libs/deepagents/deepagents/backends/utils.py (11 of 12 changes were fixes); libs/code/deepagents_code/tui/widgets/debug_console.py (7 of 13 changes were fixes); libs/talon/deepagents_talon/mcp_auth.py (7 of 12 changes were fixes)

Hotspot: libs/code/deepagents_code/app.py · ×63libs/code/deepagents_code/app.py:17494
Repeated repair: libs/deepagents/deepagents/backends/utils.py · ×33libs/deepagents/deepagents/backends/utils.py:1091

What to do

  1. Resolve the 63 Hotspot finding(s) in Churn × Complexity Hotspots — start with filesystem.py (2), app.py, REDACTED. — One of this dimension's main actionable groups (63 warning-level).
  2. Resolve the 33 Repeated repair finding(s) in Churn × Complexity Hotspots — start with utils.py, debug_console.py, REDACTED. — One of this dimension's main actionable groups (33 warning-level).

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

D16 · Bus Factor6.7 / 10Adequate✓ 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 6.7 / 10 · rule-coverage 100% · ceiling Documented

126 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is libs/code/deepagents_code/update_check.py. Counted over 370 of the 465 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 · ×4
Further sole-owners (lower concentration)

What to do

  1. Resolve the 4 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (4 recommendation-level).
  2. Resolve the 1 Further sole-owners (lower concentration) 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 / 10Stronggated by 5 serious findings✓ Tool-verified

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

5 deducted task-comment markers across 255996 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.

TodoComment · ×5libs/code/deepagents_code/built_in_skills/skill-creator/scripts/init_skill.py:60

What to do

  1. Resolve the 5 TodoComment finding(s) in Explicit Debt — start with init_skill.py (4), test_local_shell_backend.py. — One of this dimension's main actionable groups (5 warning-level).
  2. Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D19 · Documentation QualityExemplary◐ 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 Exemplary / 10 · rule-coverage 100% · ceiling Documented

The repository's root README and the examples/README directories are clear and complete for their purposes: the root one is a thorough overview of Deep Agents as an opinionated agent harness with principles, features, and links to PyPI stats, licenses, and the LangChain community; each example directory (examples/, libs/, async-subagent-server/, better-harness/, content-builder-agent/) documents its own subdirectory, covering Quickstart, prerequisites, usage options, architecture, output, customizing, security, and resources. The READMEs are well-structured with a consistent heading outline and the visible text is representative of what each document covers. The repository's READMEs are well written for their deploy-tier directories: each one is a self-contained example or agent that explains what it does and how to run it. The architecture/design docs (e.g., the full LLM Wiki outline) provide comprehensive documentation of the project structure and features, while the root README covers installation, usage, contribution, and licensing. (7 of 25 sampled documents could not be assessed: 1 of 3 evaluation groups failed.)

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

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

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

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

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

No architecture decision records were found.

No ADRs found

What to do

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

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

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.

D22 · Internal API ConsistencyStronggated by 3 serious findings◐ Sampled · advisory

What it measures: Whether the internal API surface is consistent and coherent.

Method: Judged by language model at low temperature over a sample of the public API surface (IsPackable or .Contracts types). Sampled, advisory; confidence discounted by model uncertainty.

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

3 API inconsistencies across a 400-member sample of 1466 exposed types.

Inconsistent session lifecycle naming and parameter structure. `new_session` creates a session and returns a response, while `load_session` retrieves an existing one. However, `load_session` requires the `session_id` as an explicit argument, whereas `new_session` does not return the ID in its signature (implied in response). More critically, the naming convention `new_` vs `load_` is inconsistent with standard CRUD patterns (e.g., `create`/`get` or `init`/`restore`). Additionally, `new_session` accepts `mcp_servers` as a parameter to configure the new session, but `load_session` also accepts `mcp_servers`, implying that loading a session might override or merge MCP configurations, which is a subtle behavioral inconsistency not reflected in the naming.
Duplicate intent with inconsistent return types and naming. `read_git_branch_from_filesystem` and `read_git_branch_via_subprocess` perform the same logical operation (reading the current git branch) but use different mechanisms. The naming `from_filesystem` vs `via_subprocess` exposes implementation details rather than intent. Furthermore, their return types differ: the filesystem version returns `str | None` (allowing for 'no branch' state), while the subprocess version returns `str` (likely raising an exception or returning a default on failure). This inconsistency forces callers to handle different error states for the same logical outcome.
Same inconsistency as branch reading. Duplicate intent with implementation-specific naming (`from_filesystem` vs `via_subprocess`) and inconsistent return types (`str | None` vs `str`). This pattern repeats for `read_git_remote_url` as well.

What to do

  1. Resolve the 1 Inconsistent session lifecycle naming and parameter structure.… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 Duplicate intent with inconsistent return types and naming.… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 Same inconsistency as branch reading. Duplicate intent with… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).

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

D26 · Project Cohesion5.0 / 10Adequate✓ Tool-verified

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

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

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

3 of 12 build units (Python, checkout, npm) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion

What to do

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

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

D28 · Secrets (history)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)0.0 / 10Critical✓ 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 0.0 / 10 · rule-coverage 100% · ceiling Documented

62 finding(s): 0 critical, 31 high, 19 medium, 12 low. semgrep hit a parse error in 38 file(s) — `libs/code/deepagents_code/_async.py` (lines 1–24), `libs/code/deepagents_code/_tool_free.py` (lines 1–79), `libs/code/deepagents_code/btw_api.py` (line 66, line 67, line 68, …), `libs/code/deepagents_code/client/remote_client.py` (line 62, lines 65–68, line 98, …), `libs/code/deepagents_code/config_manifest.py` (line 466, line 467, line 468, …), … (+33 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 9 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 16 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (11), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (16 issue-level).
  2. Resolve the 5 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (5). — One of this dimension's main actionable groups (5 issue-level).
  3. Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (3 issue-level).

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

D30 · Dependency Vulnerabilities8.8 / 10Adequategated by 2 critical findings✓ 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 8.8 / 10 · rule-coverage 100% · ceiling Documented

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

REDACTED
REDACTED

What to do

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

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

D31 · IaC & Container Security0.0 / 10Critical✓ Tool-verified

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

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

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

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

REDACTED
REDACTED

What to do

  1. Resolve the 32 High IaC finding(s) in IaC & Container Security — start with REDACTED (30), REDACTED, REDACTED. — One of this dimension's main actionable groups (32 issue-level).
  2. Resolve the 32 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (30), REDACTED, REDACTED. — One of this dimension's main actionable groups (32 warning-level).

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

D34 · Knowledge Freshness9.9 / 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 9.9 / 10 · rule-coverage 100% · ceiling Documented

2 of 370 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is libs/partners/vercel/langchain_vercel_sandbox/sandbox.py. Counted over 370 of the 465 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned file · ×2libs/partners/vercel/langchain_vercel_sandbox/sandbox.py:1
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 Coupling10.0 / 10Stronggated by 1 serious finding✓ 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 10.0 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: _server_config.py↔ui.py 59%

Change coupling: _server_config.py ↔ ui.pylibs/code/deepagents_code/_server_config.py:1

What to do

  1. Resolve the 1 Change coupling finding(s) in Change Coupling — start with _server_config.py. — One of this dimension's main actionable groups (1 warning-level).

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

D36 · Supply-chain Provenance & Signing7.5 / 10Strong✓ Tool-verified

What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.

Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.

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

3/4 supply-chain integrity signals present (provenance, signing, SBOM, pinned actions).

REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
  3. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d36_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-Life10.0 / 10Exemplary✓ 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 10.0 / 10 · rule-coverage 100% · ceiling Documented

0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 0 platform declaration(s) and 34 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.

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

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

AX10 · Code composition9.4 / 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.

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

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

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

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

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

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

What to do

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

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

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

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

What to do

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

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

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

M4 · Documentation accuracy2.0 / 10Weak◐ 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.

  • libs/acp/README.md changes into `deepagents/libs/acp`, but no such folder exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — libs/acp/README.md:25
  • libs/talon/README.md names `cron/jobs.json`, but no file or folder `cron/jobs.json` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — libs/talon/README.md:844
  • libs/evals/datasets/context-retrieval-evals/README.md names `tests/judge.py`, but no file or folder `tests/judge.py` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — libs/evals/datasets/context-retrieval-evals/README.md:15
  • libs/evals/datasets/context-retrieval-evals/README.md names `environment/files/`, but no file or folder `environment/files` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — libs/evals/datasets/context-retrieval-evals/README.md:21

What to do

  • Reconcile the README with reality: libs/acp/README.md changes into `deepagents/libs/acp`, but no such folder exists; libs/talon/README.md names `cron/jobs.json`, but no file or folder `cron/jobs.json` exists; libs/evals/datasets/context-retrieval-evals/README.md names `tests/judge.py`, but no file or folder `tests/judge.py` exists; libs/evals/datasets/context-retrieval-evals/README.md names `environment/files/`, but no file or folder `environment/files` exists.
P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

P2 · Observability7.3 / 10Strong✓ 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 7/9 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `libs/acp`, `libs/talon/deepagents_talon/channels/whatsapp_bridge`.

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
  • Add OpenTelemetry tracing/metrics (opentelemetry-sdk) so requests are traceable across the system, not just health-probable.
P3 · Security & performance tooling3.0 / 10Weak✓ 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.

  • No static application security testing detected. For this repository's stack, add bandit, `semgrep --config=p/python`, or CodeQL's python pack as a CI step. What was searched, so you can tell an absence from a miss: the 935415 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.

What to do

  • Add a SAST step to CI running what this repository's stack ships: bandit, `semgrep --config=p/python`, or CodeQL's python pack — so a security regression fails the build instead of landing.
  • Dependabot is configured but does not watch `pip` — 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 & Rollback7.0 / 10Strong✓ 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.

P6 · Release Hygiene5.0 / 10Adequate✓ 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.

What to do

  • Stamp a version in your build/package manifest (e.g. csproj <Version>, package.json, REDACTED, Cargo.toml, or a VERSION file) or tag releases with semver so builds and releases are traceable.
P7 · Outbound HTTP resilience10.0 / 10Exemplary○ Nothing flagged

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.

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

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

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

PF3 · Async & latency hygiene8.5 / 10Exemplary✓ Tool-verified

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

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

  • `fs.writeFileSync` in `downloadMessageMedia` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — libs/talon/deepagents_talon/channels/whatsapp_bridge/bridge.js:400

What to do

  • TypeScript/JavaScript: use the promise APIs (fs/promises, a promisified child_process.execFile, the async zlib/crypto functions) and await them instead of the *Sync variants.
X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

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

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

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

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

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

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

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

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

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

X16 · Unfloored truncation loop10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.

Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.

X17 · Uncapped recursion over a caller-supplied document1.9 / 10Critical✓ Tool-verified

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

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

  • `iter_string_values` is public and takes `data: dict[str, Any]` from its caller, and it calls itself at line 537 (`iter_string_values`) with a piece of `data` — and nowhere in `iter_string_values` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `iter_string_values` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — libs/code/deepagents_code/unicode_security.py:537
  • `resolve_auto_classifier_timeout_with_source` is public and takes `toml_data: dict[str, Any] | None` from its caller, and it calls itself at line 1598 (`resolve_auto_classifier_timeout_with_source`) with a piece of `toml_data` — and nowhere in `resolve_auto_classifier_timeout_with_source` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `resolve_auto_classifier_timeout_with_source` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — libs/code/deepagents_code/config_manifest.py:1598
  • `merge_toml_tables` is public, takes a document from its caller (line 1032) and hands it to `_leaf_provenance`, which calls itself at line 1238 (`_leaf_provenance`) with a piece of `value` — and nowhere in `_leaf_provenance` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_leaf_provenance` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — libs/code/deepagents_code/configuration/resolver.py:1238
  • `redact_transcript_value` is public and takes `value: object` from its caller, and it calls itself at line 614 (`redact_transcript_value`) with a piece of `value` (and at line 620) — and nowhere in `redact_transcript_value` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `redact_transcript_value` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — libs/code/deepagents_code/hooks/transcript.py:614
  • `substitute_json` is public and takes `value: JsonValue` from its caller, and it calls itself at line 89 (`substitute_json`) with a piece of `value` (and at line 99) — and nowhere in `substitute_json` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `substitute_json` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — libs/code/deepagents_code/plugins/substitution.py:89
  • `json_value` is public and takes `value: object` from its caller, and it calls itself at line 22 (`json_value`) with a piece of `value` (and at line 31) — and nowhere in `json_value` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `json_value` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — libs/code/deepagents_code/plugins/_json.py:22
  • `coerce_tool_output_for_ptc` is public and takes `value: Any` from its caller, and it calls itself at line 112 (`coerce_tool_output_for_ptc`) with a piece of `value` (and at line 116) — and nowhere in `coerce_tool_output_for_ptc` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `coerce_tool_output_for_ptc` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — libs/partners/quickjs/langchain_quickjs/_format.py:112
  • `coerce_tool_output_for_ptc` is public, takes a document from its caller (line 93) and hands it to `_coerce_for_marshal`, which calls itself at line 127 (`_coerce_for_marshal`) with a piece of `value` (and at line 129, line 134) — and nowhere in `_coerce_for_marshal` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_coerce_for_marshal` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — libs/partners/quickjs/langchain_quickjs/_format.py:127
  • `redact_for_logging` is public and takes `value: object` from its caller, and it calls itself at line 455 (`redact_for_logging`) with a piece of `value` (and at line 459) — and nowhere in `redact_for_logging` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `redact_for_logging` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — libs/talon/deepagents_talon/observability.py:455

What to do

  • Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
X18 · Disposal-pattern correctness10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.

Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.

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

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

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

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

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

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

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

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

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

X23 · Unguarded diagnostic materialisation7.8 / 10Strong✓ Tool-verified

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

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

  • `debug` at line 2347 is called with an argument built by `sorted(str(key) for key in payload_dict)` (line 2350), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on. — REDACTED:2347
  • `debug` at line 88 is called with an argument built by `sorted(set(arguments) - set(cleaned))` (line 90), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on. — libs/code/deepagents_code/mcp_middleware.py:88
  • `debug` at line 1403 is called with an argument built by `sum(len(provider.models) for provider in providers)` (line 1408), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on. — libs/code/deepagents_code/cost_tracking.py:1403
  • `debug` at line 1123 is called with an argument built by `"…".join(namespace)` (line 1125), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on. — libs/code/deepagents_code/client/remote_client.py:1123
  • `debug` at line 158 is called with an argument built by `sorted(repr(entry) for entry in profile.excluded_middleware)` (line 161), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on. — libs/deepagents/deepagents/_excluded_middleware.py:158

What to do

  • In Python, put the construction behind the logger's own check (`if logger.isEnabledFor(logging.DEBUG):`), or pass the collection itself with a `%s` placeholder (`logger.debug("Items %s", items)`) so the logging module renders it only when the record is emitted. The placeholder alone is not the fix when the argument is still built first: it defers the formatting, not a `json.dumps`, a `join` or a comprehension in the argument, and an f-string defers nothing at all.
X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

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

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

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

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

Other · Code Health — Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen.

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

X28 · Index access outside its own emptiness guard6.8 / 10Strong✓ Tool-verified

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

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

  • This condition tests `results` for emptiness and then indexes it on a branch that test does not reach. `results[0]` is evaluated whenever the guarded half is false — which includes the case the guard exists to anticipate, `results` being empty — so an empty `results` indexes position 0 of nothing and throws. This same condition already shows the intended bracketing at line 30767: `results[1]` sits INSIDE the guard. Either the guard is load-bearing, in which case this access escapes it and crashes, or `results` cannot be empty here, in which case the guard beside it is dead code — the condition is wrong under both readings. Move the parenthesis so the emptiness test brackets every access to `results`. — libs/code/deepagents_code/app.py:30765

What to do

  • Each finding names the index access that escapes the guard and the line of the correctly bracketed access beside it. Compare the two: they differ only in where one parenthesis sits. Move it so the emptiness test brackets every access to that symbol — and if the value provably cannot be empty at this point, delete the test rather than leave a condition that guards one access and not its neighbour.
X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged

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

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

X3 · Exception handling8.0 / 10Strong✓ Tool-verified

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

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

  • `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — libs/evals/scripts/analyze.py:317
  • `catch (_error)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — libs/talon/deepagents_talon/channels/whatsapp_bridge/bridge.js:297
  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×2) — libs/talon/deepagents_talon/channels/whatsapp_bridge/bridge.js:309, libs/talon/deepagents_talon/channels/whatsapp_bridge/bridge.js:729

What to do

  • Swallowed exception (caught, then discarded)
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged

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

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

X4 · Structured logging10.0 / 10Exemplary○ Nothing flagged

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

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

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 Health82%Adequate — gated by D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture92%ExemplaryStrongest area.
Maturity56%Adequate — gated by M4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness46%Adequate — gated by D12, P3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security81%Adequate — gated by D29, D31Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance87%ExemplarySolid.
Unscored — 2 check(s) recorded observations but carry no score

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

  • X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 12 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
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: this repository stores data through 'sqlite3' (libs/code/deepagents_code/workspace.py:10) but declares no persisted model this check reads (Django, SQLAlchemy, SQLModel, Peewee, Tortoise and MongoEngine model fields, Alembic and Django migration columns, CREATE TABLE and ALTER TABLE … ADD columns in SQL files). Personal data may be written through raw SQL or a hosted backend, so whether its changes need an audit trail could not be established, and the trail's absence is not scored.
  • C4 Data Retention — Not assessed: this repository stores data through 'sqlite3' (libs/code/deepagents_code/workspace.py:10) but declares no persisted model this check reads (Django, SQLAlchemy, SQLModel, Peewee, Tortoise and mongoengine model fields, Alembic and Django migration columns, SQL schemas). Personal data may be written through raw SQL or a hosted backend, so whether a retention limit applies here could not be established, and its absence is not scored.
  • C5 Data-Subject Rights — Not assessed: this repository stores data through 'sqlite3' (libs/code/deepagents_code/workspace.py:10) but declares no persisted model this check reads (Django, SQLAlchemy, SQLModel, Peewee, Tortoise and mongoengine model fields, Alembic and Django migration columns, CREATE TABLE and ALTER TABLE … ADD columns in SQL files). Personal data may be written through raw SQL or a hosted backend, so whether data-subject rights apply here could not be established, and their absence is not scored.
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 49 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 — No container singleton was found, so there is no shared instance for concurrent requests to race on. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX6 Interface segregation — 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
  • AX8 Test isolation — no test/production split to check
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — compose up failed (exit 14 — a file the compose project references is missing) — env file examples/talon/.env not found: stat examples/talon/.env: no such file or directory; 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.
  • D11 Test Reliability — Test reliability not scored — polyglot repository, one half's runner produced no measurement
  • 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.
  • 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 — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.py), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D32 Data Compliance (PII/GDPR) — 37 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • 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 measured — polyglot repository, one half has no runner
  • DM1 Domain Modelling — applicable but not scored (3 signals for this style, 3 needed — the count is met but a required primary signal is absent): 397 value object(s); 3 domain event(s); its domain events are published by services or handlers — no domain entity raises one; a Domain/Aggregates/ValueObjects layer; a domain structure with no aggregate, domain event or strongly-typed id in it: a CRUD / clean-architecture model, measured but not claimed as DDD; a top-level examples/ tree: a library or framework whose examples are its consumers — these types are building blocks, not a domain
  • ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P8 Schema migrations — SQLAlchemy is declared, but the schema-migration mechanism could not be identified. Our limit, not a verdict on this repository.
  • P9 Domain vs controller coverage — coverage data present for 4 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
  • PF2 Allocation hygiene — Not applicable: Python runs on a garbage-collected runtime that gives a program no allocation-control idiom to choose on a hot path — no pools, stack allocation or value types — so allocation awareness is not something this code can be rated on.
  • 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.
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X2 Cancellation propagation — no C# was loaded; this repository's Python was read, and no request in it can be cancelled by a caller — a Python request takes no token: asyncio cancels the task and trio or anyio the scope that made it, from outside the call, and requests, httpx, aiohttp and gRPC take a timeout, not a cancellation
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

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

Critical — 67 finding(s)
D31 · IaC & Container Security · High IaC · ×32
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 7 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · 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
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · High CVE · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · High vulnerability · ×1
  • REDACTED
Serious — 1101 finding(s)
D3 · God Classes · FileTooLong · ×81
  • FileTooLong: deepagents_code/app.py libs/code/deepagents_code/app.py — FileTooLong — 18826 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 18326 over it, 37.65× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: deepagents_code/main.py libs/code/deepagents_code/main.py — FileTooLong — 3921 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3421 over it, 7.84× 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: REDACTED REDACTED — FileTooLong — 3524 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3024 over it, 7.05× 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: REDACTED REDACTED — FileTooLong — 3262 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2762 over it, 6.52× 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: deepagents_code/auto_mode.py libs/code/deepagents_code/auto_mode.py — FileTooLong — 2994 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2494 over it, 5.99× 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: REDACTED REDACTED — FileTooLong — 2786 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2286 over it, 5.57× 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: widgets/messages.py libs/code/deepagents_code/tui/widgets/messages.py — FileTooLong — 2673 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2173 over it, 5.35× 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: middleware/filesystem.py libs/deepagents/deepagents/middleware/filesystem.py — FileTooLong — 2388 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1888 over it, 4.78× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: widgets/chat_input.py libs/code/deepagents_code/tui/widgets/chat_input.py — FileTooLong — 2194 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1694 over it, 4.39× 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: deepagents_code/update_check.py libs/code/deepagents_code/update_check.py — FileTooLong — 2131 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1631 over it, 4.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: deepagents_code/agent.py libs/code/deepagents_code/agent.py — FileTooLong — 2106 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1606 over it, 4.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: deepagents_code/config_manifest.py libs/code/deepagents_code/config_manifest.py — FileTooLong — 1981 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1481 over it, 3.96× 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: deepagents_talon/host.py libs/talon/deepagents_talon/host.py — FileTooLong — 1947 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1447 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: widgets/thread_selector.py libs/code/deepagents_code/tui/widgets/thread_selector.py — FileTooLong — 1852 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1352 over it, 3.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: client/non_interactive.py libs/code/deepagents_code/client/non_interactive.py — FileTooLong — 1821 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1321 over it, 3.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: deepagents_code/cost_tracking.py libs/code/deepagents_code/cost_tracking.py — FileTooLong — 1760 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1260 over it, 3.52× 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: deepagents_talon/runtime.py libs/talon/deepagents_talon/runtime.py — FileTooLong — 1512 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1012 over it, 3.02× 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: harness/_nvidia_nemotron_3_ultra.py libs/deepagents/deepagents/profiles/harness/_nvidia_nemotron_3_ultra.py — FileTooLong — 1455 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 955 over it, 2.91× 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: deepagents_code/mcp_tools.py libs/code/deepagents_code/mcp_tools.py — FileTooLong — 1443 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 943 over it, 2.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: widgets/model_selector.py libs/code/deepagents_code/tui/widgets/model_selector.py — FileTooLong — 1421 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 921 over it, 2.84× 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: REDACTED REDACTED — FileTooLong — 1277 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 777 over it, 2.55× 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: release/build_release_notes.py .github/scripts/release/build_release_notes.py — FileTooLong — 1203 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 703 over it, 2.41× 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: backends/sandbox.py libs/deepagents/deepagents/backends/sandbox.py — FileTooLong — 1196 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 696 over it, 2.39× 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: widgets/auth.py libs/code/deepagents_code/tui/widgets/auth.py — FileTooLong — 1104 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 604 over it, 2.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: deepagents_code/goal_rubric.py libs/code/deepagents_code/goal_rubric.py — FileTooLong — 1072 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 572 over it, 2.14× 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.
  • + 56 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×63
  • Hotspot: libs/code/deepagents_code/app.py libs/code/deepagents_code/app.py:17494 — libs/code/deepagents_code/app.py changed 212 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 124 in DeepAgentsApp._handle_command at line 17494. 114 of those changes were fix/bug commits, so the churn is repair rather than feature work. 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-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/code/deepagents_code/app.py`: 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: REDACTED REDACTED:1797 — REDACTED changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 380 in textual_adapter.execute_task_textual at line 1797. 14 of those changes were fix/bug commits, and the other 21 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-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- REDACTED`: 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: libs/code/deepagents_code/main.py libs/code/deepagents_code/main.py:5335 — libs/code/deepagents_code/main.py changed 63 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 194 in main.cli_main at line 5335. 23 of those changes were fix/bug commits, and the other 40 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-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/code/deepagents_code/main.py`: 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: libs/code/deepagents_code/agent.py libs/code/deepagents_code/agent.py:2524 — libs/code/deepagents_code/agent.py changed 54 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 113 in agent.create_cli_agent at line 2524. 23 of those changes were fix/bug commits, and the other 31 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/code/deepagents_code/agent.py`: 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: REDACTED REDACTED:6767 — REDACTED changed 65 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 55 in config.create_model at line 6767. 24 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-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- REDACTED`: 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: libs/code/deepagents_code/client/non_interactive.py libs/code/deepagents_code/client/non_interactive.py:2121 — libs/code/deepagents_code/client/non_interactive.py changed 33 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 53 in non_interactive._run_agent_loop at line 2121. 13 of those changes were fix/bug commits, and the other 20 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-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/code/deepagents_code/client/non_interactive.py`: 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: libs/code/deepagents_code/auto_mode.py libs/code/deepagents_code/auto_mode.py:3215 — libs/code/deepagents_code/auto_mode.py changed 34 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in AutoModeHITLMiddleware.awrap_model_call at line 3215. 20 of those changes were fix/bug commits, so the churn is repair rather than feature work. 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-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/code/deepagents_code/auto_mode.py`: 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: libs/code/deepagents_code/config_manifest.py libs/code/deepagents_code/config_manifest.py:716 — libs/code/deepagents_code/config_manifest.py changed 57 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in ConfigOption.__post_init__ at line 716. 16 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-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/code/deepagents_code/config_manifest.py`: 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: libs/talon/deepagents_talon/runtime.py libs/talon/deepagents_talon/runtime.py:433 — libs/talon/deepagents_talon/runtime.py changed 44 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in DeepAgentRuntime._create_graph at line 433. 14 of those changes were fix/bug commits, and the other 30 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-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/talon/deepagents_talon/runtime.py`: 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: libs/code/deepagents_code/tui/widgets/model_selector.py libs/code/deepagents_code/tui/widgets/model_selector.py:1310 — libs/code/deepagents_code/tui/widgets/model_selector.py changed 28 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 41 in ModelSelectorScreen._update_display at line 1310. 5 of those changes were fix/bug commits, and the other 23 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/code/deepagents_code/tui/widgets/model_selector.py`: 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: REDACTED REDACTED:1562 — REDACTED changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in model_config._discover_available_models at line 1562. 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-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- REDACTED`: 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: libs/deepagents/deepagents/graph.py libs/deepagents/deepagents/graph.py:278 — libs/deepagents/deepagents/graph.py changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 59 in graph.create_deep_agent at line 278. 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-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/deepagents/deepagents/graph.py`: 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: libs/code/deepagents_code/tui/widgets/chat_input.py libs/code/deepagents_code/tui/widgets/chat_input.py:1239 — libs/code/deepagents_code/tui/widgets/chat_input.py changed 22 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in ChatTextArea._on_key at line 1239. 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-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/code/deepagents_code/tui/widgets/chat_input.py`: 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: libs/code/deepagents_code/sessions.py libs/code/deepagents_code/sessions.py:2180 — libs/code/deepagents_code/sessions.py changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in sessions.list_threads_command at line 2180. 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-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/code/deepagents_code/sessions.py`: 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: libs/code/deepagents_code/cost_tracking.py libs/code/deepagents_code/cost_tracking.py:3054 — libs/code/deepagents_code/cost_tracking.py changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in CostTrackingMiddleware._charge at line 3054. 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-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/code/deepagents_code/cost_tracking.py`: 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: libs/code/deepagents_code/configuration/providers.py libs/code/deepagents_code/configuration/providers.py:268 — libs/code/deepagents_code/configuration/providers.py changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in providers.coerce_toml_value at line 268. 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-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/code/deepagents_code/configuration/providers.py`: 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: libs/deepagents/deepagents/middleware/filesystem.py libs/deepagents/deepagents/middleware/filesystem.py:1891 — libs/deepagents/deepagents/middleware/filesystem.py changed 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in FilesystemMiddleware.__init__ at line 1891. 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-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/deepagents/deepagents/middleware/filesystem.py`: 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: libs/code/deepagents_code/tui/widgets/messages.py libs/code/deepagents_code/tui/widgets/messages.py:2172 — libs/code/deepagents_code/tui/widgets/messages.py changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in ToolCallMessage._restore_deferred_state at line 2172. 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-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/code/deepagents_code/tui/widgets/messages.py`: 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: libs/code/deepagents_code/mcp_tools.py libs/code/deepagents_code/mcp_tools.py:2565 — libs/code/deepagents_code/mcp_tools.py changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 46 in mcp_tools.resolve_and_load_mcp_tools at line 2565. 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-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/code/deepagents_code/mcp_tools.py`: 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: libs/code/deepagents_code/server_graph.py libs/code/deepagents_code/server_graph.py:416 — libs/code/deepagents_code/server_graph.py changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in server_graph._make_graphs_in_environment at line 416. 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-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/code/deepagents_code/server_graph.py`: 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: libs/code/deepagents_code/update_check.py libs/code/deepagents_code/update_check.py:2495 — libs/code/deepagents_code/update_check.py changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in update_check.perform_upgrade at line 2495. 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-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/code/deepagents_code/update_check.py`: 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: libs/code/deepagents_code/offload_api.py libs/code/deepagents_code/offload_api.py:242 — libs/code/deepagents_code/offload_api.py changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in offload_api.workspace at line 242. 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-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/code/deepagents_code/offload_api.py`: 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: libs/code/deepagents_code/configurable_model.py libs/code/deepagents_code/configurable_model.py:379 — libs/code/deepagents_code/configurable_model.py changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in configurable_model._build_overrides at line 379. 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-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/code/deepagents_code/configurable_model.py`: 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: REDACTED REDACTED:828 — REDACTED changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in mcp._remote_connection at line 828. 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-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- REDACTED`: 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: libs/code/deepagents_code/tui/widgets/message_store.py libs/code/deepagents_code/tui/widgets/message_store.py:360 — libs/code/deepagents_code/tui/widgets/message_store.py changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in MessageData.to_widget at line 360. 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-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/code/deepagents_code/tui/widgets/message_store.py`: 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.
  • + 38 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Repeated repair · ×33
  • Repeated repair: libs/deepagents/deepagents/backends/utils.py libs/deepagents/deepagents/backends/utils.py:1091 — libs/deepagents/deepagents/backends/utils.py changed 12 times in last 90 days and 11 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is utils.grep_matches_from_files at line 1091), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(sdk): skip binary files in in-memory `grep` (#7032)”; “fix(sdk): bound tool offload paths and abbreviate long IDs (#6519)”; “fix(sdk): preserve legacy large-result templates behind deprecation (#5568)”; “fix(sdk): explain truncation markers only when preview omits lines (#5563)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/deepagents/deepagents/backends/utils.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: libs/code/deepagents_code/tui/widgets/debug_console.py libs/code/deepagents_code/tui/widgets/debug_console.py:459 — libs/code/deepagents_code/tui/widgets/debug_console.py changed 13 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is _DebugLogView.render_line at line 459), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(code): move debug MCP server details into a modal (#6720)”; “fix(code): refresh token and cost breakdown while open (#6520)”; “fix(code): wrap debug logs before the scrollbar (#6219)”; “fix(code): order debug console log filters (#6217)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/code/deepagents_code/tui/widgets/debug_console.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: libs/talon/deepagents_talon/mcp_auth.py libs/talon/deepagents_talon/mcp_auth.py:1126 — libs/talon/deepagents_talon/mcp_auth.py changed 12 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is mcp_auth.extract_loopback_oauth_callback_url at line 1126), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(talon): identify MCP OAuth requests with a user agent (#6981)”; “fix(talon): close a url swap past the MCP auto-approve guard (#6173)”; “fix(talon): stop losing MCP refresh tokens on a refresh response (#6172)”; “fix(talon): harden the MCP OAuth device flow and credential paths (#6170)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/talon/deepagents_talon/mcp_auth.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: libs/deepagents/deepagents/backends/state.py libs/deepagents/deepagents/backends/state.py:292 — libs/deepagents/deepagents/backends/state.py changed 6 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is StateBackend.glob at line 292), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(sdk): reject text edits of binary files (#7069)”; “fix(sdk): reset stale encoding on text overwrite (#6737)”; “fix(sdk): tag binary `StateBackend.upload_files` content as base64 (#6551)”; “fix(sdk): report UTF-8 byte sizes (#6258)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/deepagents/deepagents/backends/state.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: libs/talon/deepagents_talon/history_vectors.py libs/talon/deepagents_talon/history_vectors.py:105 — libs/talon/deepagents_talon/history_vectors.py changed 6 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is HistoryVectorIndex.close at line 105), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(talon): index only visible conversation text (#6358)”; “fix(talon): persist history vector deduplication (#6357)”; “fix(talon): bound the vector rebuild, break the import cycle, pin postgres (#6165)”; “fix(talon): surface indexing failures and bound the indexing worker (#6163)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/talon/deepagents_talon/history_vectors.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: libs/code/deepagents_code/tui/widgets/auto_mode_notice.py libs/code/deepagents_code/tui/widgets/auto_mode_notice.py:60 — libs/code/deepagents_code/tui/widgets/auto_mode_notice.py changed 8 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is auto_mode_notice.build_auto_mode_notice_body at line 60), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(code): complete ASCII UI fallbacks (#5930)”; “fix(code): show Auto first-enable notice as pre-confirmation (#5686)”; “fix(code): simplify classifier notice copy (#5691)”; “fix(code): remove review failure approval copy (#5687)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/code/deepagents_code/tui/widgets/auto_mode_notice.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: libs/code/deepagents_code/_textual_patches.py libs/code/deepagents_code/_textual_patches.py:302 — libs/code/deepagents_code/_textual_patches.py changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is _textual_patches._word_bounds at line 302), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(code): extend triple-click selection across blocks (#6819)”; “fix(code): complete ASCII UI fallbacks (#5930)”; “fix(code): extend text selection with `Shift` + `click` (#5732)”; “fix(code): hide chat input cursor while unfocused (#5258)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/code/deepagents_code/_textual_patches.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: libs/deepagents/deepagents/backends/store.py libs/deepagents/deepagents/backends/store.py:170 — libs/deepagents/deepagents/backends/store.py changed 5 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is StoreBackend._convert_store_item_to_file_data at line 170), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(sdk): reject text edits of binary files (#7069)”; “fix(sdk): reset stale encoding on text overwrite (#6737)”; “fix(sdk): report UTF-8 byte sizes (#6258)”; “fix(sdk): surface sandbox glob failures instead of reporting no matches (#5566)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/deepagents/deepagents/backends/store.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: libs/deepagents/deepagents/middleware/_message_eviction.py libs/deepagents/deepagents/middleware/_message_eviction.py:260 — libs/deepagents/deepagents/middleware/_message_eviction.py changed 5 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is _message_eviction._offload_tool_message_content at line 260), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(sdk): preserve resolved tool-result paths (#6968)”; “fix(sdk): bound tool offload paths and abbreviate long IDs (#6519)”; “fix(sdk): disclose per-line clipping in large-result previews (#5564)”; “fix(sdk): explain truncation markers only when preview omits lines (#5563)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/deepagents/deepagents/middleware/_message_eviction.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: libs/talon/deepagents_talon/history_adapters.py libs/talon/deepagents_talon/history_adapters.py:169 — libs/talon/deepagents_talon/history_adapters.py changed 5 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is BoundedEmbeddings._bridge at line 169), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(talon): fix local voice transcription and embedding retries (#6255)”; “fix(talon): persist local model downloads (#6137)”; “fix(talon): share one optional-driver loader and close provider clients (#6164)”; “fix(talon): make remote embedding settings explicit and search non-blocking (#6133)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/talon/deepagents_talon/history_adapters.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: libs/code/deepagents_code/integrations/sandbox_factory.py libs/code/deepagents_code/integrations/sandbox_factory.py:490 — libs/code/deepagents_code/integrations/sandbox_factory.py changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is _DaytonaProvider.get_or_create at line 490), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(code): clean up new sandboxes when setup fails (#6475)”; “fix(code): resolve project policy per workspace (#6064)”; “fix(code): isolate LangSmith auth and workspace tracing (#6061)”; “fix(code): scope project dotenv to workspaces (#5980)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/code/deepagents_code/integrations/sandbox_factory.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: libs/deepagents/deepagents/middleware/rubric.py libs/deepagents/deepagents/middleware/rubric.py:559 — libs/deepagents/deepagents/middleware/rubric.py changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is RubricMiddleware.__init__ at line 559), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(sdk): preserve parent rubric during parallel subagent calls (#6849)”; “fix(sdk): enforce full criterion coverage in `RubricMiddleware` (#5234)”; “fix(sdk): diagnose rubric grader structured output errors (#4938)”; “fix(sdk): include HTTP status in rubric grader errors (#4967)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/deepagents/deepagents/middleware/rubric.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: libs/code/deepagents_code/tui/widgets/approval.py libs/code/deepagents_code/tui/widgets/approval.py:237 — libs/code/deepagents_code/tui/widgets/approval.py changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is ApprovalMenu._get_command_display at line 237), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(code): show bound workspace in shell approvals (#5966)”; “fix(code): simplify Auto fallback copy (#5670)”; “fix(code): make reject-with-feedback discoverable in approval menu (#5260)”; “fix(code): make Auto mode generally available (#4957)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/code/deepagents_code/tui/widgets/approval.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: libs/code/deepagents_code/tui/widgets/subagent_panel.py libs/code/deepagents_code/tui/widgets/subagent_panel.py:419 — libs/code/deepagents_code/tui/widgets/subagent_panel.py changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is SubagentPanel._handle_finish at line 419), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(code): collapse idle subagents and reopen new work (#6782)”; “fix(code): preserve dispatch timers across interrupt replays (#6722)”; “fix(code): complete ASCII UI fallbacks (#5930)”; “fix(code): clear dynamic subagents on next turn (#5437)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/code/deepagents_code/tui/widgets/subagent_panel.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: libs/talon/deepagents_talon/archive_saver.py libs/talon/deepagents_talon/archive_saver.py:210 — libs/talon/deepagents_talon/archive_saver.py changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is ConversationSaver._messages at line 210), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(talon): share Slack channel conversation archives across threads (#6665)”; “fix(talon): let scheduled jobs read their origin chat's history (#6583)”; “fix(talon): index only visible conversation text (#6358)”; “fix(talon): persist history vector deduplication (#6357)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/talon/deepagents_talon/archive_saver.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: libs/evals/deepagents_harbor/langgraph_project/langgraph_agent.py libs/evals/deepagents_harbor/langgraph_project/langgraph_agent.py:126 — libs/evals/deepagents_harbor/langgraph_project/langgraph_agent.py changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is langgraph_agent._apply_glm_5_2_reasoning_default at line 126), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(evals): migrate Harbor to `langchain.mcp` (#6391)”; “fix(evals): use dcode runtime state in Harbor (#5872)”; “fix(evals): inherit Harbor task working directory (#5281)”; “fix(evals): pin virtual_mode=False in the Harbor bare adapter (#5008)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/evals/deepagents_harbor/langgraph_project/langgraph_agent.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: libs/code/deepagents_code/model_retry.py libs/code/deepagents_code/model_retry.py:259 — libs/code/deepagents_code/model_retry.py changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is model_retry._extract_status_code at line 259), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(code): surface actionable Groq tool-limit errors (#6996)”; “fix(code): reconcile cache expiry during model requests (#6763)”; “fix(code): retry bare `openai.APIError` raised mid-stream (#6499)”; “fix(code): retry interrupted model streams (#5905)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/code/deepagents_code/model_retry.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: libs/code/deepagents_code/tools.py libs/code/deepagents_code/tools.py:98 — libs/code/deepagents_code/tools.py changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is tools._validate_url at line 98), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(code): isolate LangSmith auth and workspace tracing (#6061)”; “fix(code): scope project dotenv to workspaces (#5980)”; “fix(code): trim `web_search` and `fetch_url` tool descriptions (#5016)”; “fix(code): put field descriptions on first-party tool schemas (#5019)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/code/deepagents_code/tools.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: libs/deepagents/deepagents/backends/context_hub.py libs/deepagents/deepagents/backends/context_hub.py:596 — libs/deepagents/deepagents/backends/context_hub.py changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is ContextHubBackend.grep at line 596), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(sdk): make `ContextHubBackend.glob` honor `path` (#6998)”; “fix(sdk): surface sandbox glob failures instead of reporting no matches (#5566)”; “fix(sdk): make `BackendProtocol.glob` recursive for bare patterns (#5026)”; “fix(sdk): batch concurrent `ContextHubBackend` mutations (#5471)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/deepagents/deepagents/backends/context_hub.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: libs/code/deepagents_code/tui/widgets/prompt_search.py libs/code/deepagents_code/tui/widgets/prompt_search.py:451 — libs/code/deepagents_code/tui/widgets/prompt_search.py changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is PromptSearchPanel._rebuild_options at line 451), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(code): hide unavailable prompt search hints (#6543)”; “fix(code): replace composer with prompt search and prevent query feedback (#6346)”; “fix(code): align prompt clipboard word deletion (#6345)”; “fix(code): make prompt clipboard Tab insert (#5820)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/code/deepagents_code/tui/widgets/prompt_search.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: libs/code/deepagents_code/workspace.py libs/code/deepagents_code/workspace.py:143 — libs/code/deepagents_code/workspace.py changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is workspace._canonical_directory at line 143), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(code): separate access-policy compatibility from runtime identity (#6386)”; “fix(code): diagnose workspace binding and runtime refusals (#6384)”; “fix(code): resolve project policy per workspace (#6064)”; “fix(code): refuse a second sandbox workspace (#5979)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/code/deepagents_code/workspace.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: libs/talon/deepagents_talon/store_archive_index.py libs/talon/deepagents_talon/store_archive_index.py:62 — libs/talon/deepagents_talon/store_archive_index.py changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is StoreVectorArchive.rows at line 62), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(talon): index only visible conversation text (#6358)”; “fix(talon): persist history vector deduplication (#6357)”; “fix(talon): bound the vector rebuild, break the import cycle, pin postgres (#6165)”; “fix(talon): bound archive scans, query embeddings, and deletion markers (#6162)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/talon/deepagents_talon/store_archive_index.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: libs/code/deepagents_code/tui/widgets/cwd_switch.py libs/code/deepagents_code/tui/widgets/cwd_switch.py:137 — libs/code/deepagents_code/tui/widgets/cwd_switch.py changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is CwdSwitchPromptScreen._body_text at line 137), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(code): confirm server restart for workspace switch (#6178)”; “fix(code): complete ASCII UI fallbacks (#5930)”; “fix(code): clarify project hooks trust prompt and stop prompting for user hooks (#5426)”; “fix(code): refresh hooks after cwd switches (#5249)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/code/deepagents_code/tui/widgets/cwd_switch.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: libs/code/deepagents_code/tui/widgets/autocomplete.py libs/code/deepagents_code/tui/widgets/autocomplete.py:213 — libs/code/deepagents_code/tui/widgets/autocomplete.py changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is SlashCommandController._score_command at line 213), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(code): support non-ASCII file names in `@` mentions (#7023)”; “fix(code): add `/resume` alias and rank alias matches (#6988)”; “fix(code): keep prompt recall out of file picker (#6494)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/code/deepagents_code/tui/widgets/autocomplete.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: libs/talon/deepagents_talon/archive.py libs/talon/deepagents_talon/archive.py:69 — libs/talon/deepagents_talon/archive.py changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is archive.build_search_page at line 69), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(talon): resume history search past the scan budget (#6740)”; “fix(talon): validate archive pagination arguments (#6442)”; “fix(talon): bound the vector rebuild, break the import cycle, pin postgres (#6165)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 12:40:25 -04:00' --until='2026-10-20 12:40:25 -04:00' --full-history --no-merges -- libs/talon/deepagents_talon/archive.py`: 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.
  • + 8 more in this group — see findings.md.
D31 · IaC & Container Security · Medium IaC · ×32
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 7 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED · ×18
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D3 · God Classes · TooManyMethods · ×17
  • TooManyMethods: DeepAgentsApp libs/code/deepagents_code/app.py:3222 — TooManyMethods — 659 methods. The bar is 30 methods; this is 629 over it, 21.97× 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: ThreadSelectorScreen libs/code/deepagents_code/tui/widgets/thread_selector.py:746 — TooManyMethods — 106 methods. The bar is 30 methods; this is 76 over it, 3.53× 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: ChatInput libs/code/deepagents_code/tui/widgets/chat_input.py:2136 — TooManyMethods — 91 methods. The bar is 30 methods; this is 61 over it, 3.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: ToolCallMessage libs/code/deepagents_code/tui/widgets/messages.py:1853 — TooManyMethods — 76 methods. The bar is 30 methods; this is 46 over it, 2.53× 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: TalonHost libs/talon/deepagents_talon/host.py:276 — TooManyMethods — 67 methods. The bar is 30 methods; this is 37 over it, 2.23× 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: ModelSelectorScreen libs/code/deepagents_code/tui/widgets/model_selector.py:374 — TooManyMethods — 56 methods. The bar is 30 methods; this is 26 over it, 1.87× 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: PluginManagerScreen libs/code/deepagents_code/tui/modals/plugin_manager/__init__.py:89 — TooManyMethods — 49 methods. The bar is 30 methods; this is 19 over it, 1.63× 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: ChatTextArea libs/code/deepagents_code/tui/widgets/chat_input.py:572 — TooManyMethods — 48 methods. The bar is 30 methods; this is 18 over it, 1.60× 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: StatusBar libs/code/deepagents_code/tui/widgets/status.py:559 — TooManyMethods — 47 methods. The bar is 30 methods; this is 17 over it, 1.57× 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: DeepAgentRuntime libs/talon/deepagents_talon/runtime.py:291 — TooManyMethods — 43 methods. The bar is 30 methods; this is 13 over it, 1.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SubagentPanel libs/code/deepagents_code/tui/widgets/subagent_panel.py:215 — TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× 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: DebugConsoleScreen libs/code/deepagents_code/tui/widgets/debug_console.py:722 — TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× 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: FilesystemMiddleware libs/deepagents/deepagents/middleware/filesystem.py:1819 — TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× 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: MessageStore libs/code/deepagents_code/tui/widgets/message_store.py:655 — TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: _DeepAgentsSummarizationMiddleware libs/deepagents/deepagents/middleware/summarization.py:524 — TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ContextHubBackend libs/deepagents/deepagents/backends/context_hub.py:101 — TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× 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: MCPViewerScreen libs/code/deepagents_code/tui/widgets/mcp_viewer.py:767 — TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×13
  • Duplicated block (12 lines × 2) .github/scripts/evals/aggregate_shards.py:773 — .github/scripts/evals/aggregate_shards.py:773-784 | .github/scripts/evals/aggregate_shards.py:828-839 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `.github/scripts/evals/aggregate_shards.py:773` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) libs/code/deepagents_code/built_in_skills/skill-creator/scripts/init_skill.py:327 — libs/code/deepagents_code/built_in_skills/skill-creator/scripts/init_skill.py:327-338 | libs/code/examples/skills/skill-creator/scripts/init_skill.py:279-290 — before extracting anything, compare `libs/code/deepagents_code/built_in_skills/skill-creator/scripts/init_skill.py` and `libs/code/examples/skills/skill-creator/scripts/init_skill.py` as WHOLE FILES: 96% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) libs/code/deepagents_code/main.py:1798 — libs/code/deepagents_code/main.py:1798-1809 | libs/code/deepagents_code/main.py:1811-1823 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) libs/code/deepagents_code/main.py:2246 — libs/code/deepagents_code/main.py:2246-2257 | libs/code/deepagents_code/skills/commands.py:1022-1033 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (12 lines × 2) libs/code/deepagents_code/main.py:6551 — libs/code/deepagents_code/main.py:6551-6562 | libs/code/deepagents_code/main.py:6565-6576 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/main.py:6551` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (12 lines × 2) libs/code/deepagents_code/tui/widgets/messages.py:3434 — libs/code/deepagents_code/tui/widgets/messages.py:3434-3445 | libs/code/deepagents_code/tui/widgets/messages.py:3621-3632 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/tui/widgets/messages.py:3621` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `libs/code/deepagents_code/tui/widgets/messages.py:3433` calls `_compact_line_gutter` and `libs/code/deepagents_code/tui/widgets/messages.py:3619` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) libs/code/deepagents_code/tui/widgets/thread_selector.py:1764 — libs/code/deepagents_code/tui/widgets/thread_selector.py:1764-1775 | libs/code/deepagents_code/tui/widgets/thread_selector.py:1937-1948 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/tui/widgets/thread_selector.py:1764` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) libs/deepagents/deepagents/backends/composite.py:509 — libs/deepagents/deepagents/backends/composite.py:509-520 | libs/deepagents/deepagents/backends/composite.py:571-582 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) libs/deepagents/deepagents/backends/composite.py:635 — libs/deepagents/deepagents/backends/composite.py:635-646 | libs/deepagents/deepagents/backends/composite.py:678-689 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) libs/deepagents/deepagents/backends/sandbox.py:1929 — libs/deepagents/deepagents/backends/sandbox.py:1929-1940 | libs/deepagents/deepagents/backends/sandbox.py:1984-1995 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/deepagents/deepagents/backends/sandbox.py:1929` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) libs/deepagents/deepagents/backends/store.py:388 — libs/deepagents/deepagents/backends/store.py:388-399 | libs/deepagents/deepagents/backends/store.py:415-426 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) libs/deepagents/deepagents/middleware/filesystem.py:3767 — libs/deepagents/deepagents/middleware/filesystem.py:3767-3778 | libs/deepagents/deepagents/middleware/filesystem.py:3808-3819 — 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) libs/evals/harbor_adapters/contextbench/main.py:106 — libs/evals/harbor_adapters/contextbench/main.py:106-117 | libs/evals/harbor_adapters/drbench/main.py:185-196 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×9
  • Duplicated block (11 lines × 2) libs/code/deepagents_code/_repository_bounds.py:298 — libs/code/deepagents_code/_repository_bounds.py:298-308 | libs/code/deepagents_code/_repository_bounds.py:364-376 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/_repository_bounds.py:364` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) libs/code/deepagents_code/built_in_skills/skill-creator/scripts/init_skill.py:211 — libs/code/deepagents_code/built_in_skills/skill-creator/scripts/init_skill.py:211-221 | libs/deepagents/deepagents/middleware/skills.py:427-437 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) libs/code/deepagents_code/client/commands/extras.py:252 — libs/code/deepagents_code/client/commands/extras.py:252-262 | libs/code/deepagents_code/client/commands/extras.py:364-374 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) libs/code/deepagents_code/main.py:1405 — libs/code/deepagents_code/main.py:1405-1415 | libs/code/deepagents_code/main.py:4166-4176 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `libs/code/deepagents_code/main.py:4165` calls `add` and `libs/code/deepagents_code/main.py:1403` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) libs/deepagents/deepagents/backends/composite.py:522 — libs/deepagents/deepagents/backends/composite.py:522-532 | libs/deepagents/deepagents/backends/composite.py:584-594 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) libs/deepagents/deepagents/backends/context_hub.py:316 — libs/deepagents/deepagents/backends/context_hub.py:316-326 | libs/deepagents/deepagents/backends/context_hub.py:401-411 — 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) libs/deepagents/deepagents/middleware/memory.py:301 — libs/deepagents/deepagents/middleware/memory.py:301-311 | libs/deepagents/deepagents/middleware/memory.py:335-345 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) libs/partners/quickjs/langchain_quickjs/_repl.py:572 — libs/partners/quickjs/langchain_quickjs/_repl.py:572-582 | libs/partners/quickjs/langchain_quickjs/_repl.py:654-664 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) .github/scripts/evals/aggregate_shards.py:129 — .github/scripts/evals/aggregate_shards.py:129-139 | .github/scripts/evals/aggregate_unified.py:107-117 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
X17 · Uncapped recursion over a caller-supplied document · Recursive walk over a caller-supplied document has no depth cap · ×9
  • Recursive walk over a caller-supplied document has no depth cap libs/code/deepagents_code/unicode_security.py:537 — `iter_string_values` is public and takes `data: dict[str, Any]` from its caller, and it calls itself at line 537 (`iter_string_values`) with a piece of `data` — and nowhere in `iter_string_values` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `iter_string_values` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap libs/code/deepagents_code/config_manifest.py:1598 — `resolve_auto_classifier_timeout_with_source` is public and takes `toml_data: dict[str, Any] | None` from its caller, and it calls itself at line 1598 (`resolve_auto_classifier_timeout_with_source`) with a piece of `toml_data` — and nowhere in `resolve_auto_classifier_timeout_with_source` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `resolve_auto_classifier_timeout_with_source` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap libs/code/deepagents_code/configuration/resolver.py:1238 — `merge_toml_tables` is public, takes a document from its caller (line 1032) and hands it to `_leaf_provenance`, which calls itself at line 1238 (`_leaf_provenance`) with a piece of `value` — and nowhere in `_leaf_provenance` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_leaf_provenance` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap libs/code/deepagents_code/hooks/transcript.py:614 — `redact_transcript_value` is public and takes `value: object` from its caller, and it calls itself at line 614 (`redact_transcript_value`) with a piece of `value` (and at line 620) — and nowhere in `redact_transcript_value` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `redact_transcript_value` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap libs/code/deepagents_code/plugins/substitution.py:89 — `substitute_json` is public and takes `value: JsonValue` from its caller, and it calls itself at line 89 (`substitute_json`) with a piece of `value` (and at line 99) — and nowhere in `substitute_json` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `substitute_json` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap libs/code/deepagents_code/plugins/_json.py:22 — `json_value` is public and takes `value: object` from its caller, and it calls itself at line 22 (`json_value`) with a piece of `value` (and at line 31) — and nowhere in `json_value` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `json_value` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap libs/partners/quickjs/langchain_quickjs/_format.py:112 — `coerce_tool_output_for_ptc` is public and takes `value: Any` from its caller, and it calls itself at line 112 (`coerce_tool_output_for_ptc`) with a piece of `value` (and at line 116) — and nowhere in `coerce_tool_output_for_ptc` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `coerce_tool_output_for_ptc` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap libs/partners/quickjs/langchain_quickjs/_format.py:127 — `coerce_tool_output_for_ptc` is public, takes a document from its caller (line 93) and hands it to `_coerce_for_marshal`, which calls itself at line 127 (`_coerce_for_marshal`) with a piece of `value` (and at line 129, line 134) — and nowhere in `_coerce_for_marshal` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_coerce_for_marshal` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap libs/talon/deepagents_talon/observability.py:455 — `redact_for_logging` is public and takes `value: object` from its caller, and it calls itself at line 455 (`redact_for_logging`) with a piece of `value` (and at line 459) — and nowhere in `redact_for_logging` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `redact_for_logging` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×8
  • Duplicated block (13 lines × 2) libs/code/deepagents_code/skills/commands.py:578 — libs/code/deepagents_code/skills/commands.py:578-590 | libs/code/deepagents_code/skills/commands.py:729-741 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/skills/commands.py:578` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) libs/code/deepagents_code/tui/widgets/messages.py:4414 — libs/code/deepagents_code/tui/widgets/messages.py:4414-4427 | libs/code/deepagents_code/tui/widgets/messages.py:4434-4446 — 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 (13 lines × 2) libs/code/deepagents_code/ui.py:121 — libs/code/deepagents_code/ui.py:121-133 | libs/code/deepagents_code/ui.py:987-999 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/ui.py:121` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) libs/code/deepagents_code/ui.py:498 — libs/code/deepagents_code/ui.py:498-510 | libs/code/deepagents_code/ui.py:534-546 — 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 (13 lines × 2) libs/deepagents/deepagents/middleware/filesystem.py:2333 — libs/deepagents/deepagents/middleware/filesystem.py:2333-2345 | libs/deepagents/deepagents/middleware/filesystem.py:2372-2384 — 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 (13 lines × 2) libs/deepagents/deepagents/middleware/filesystem.py:2427 — libs/deepagents/deepagents/middleware/filesystem.py:2427-2439 | libs/deepagents/deepagents/middleware/filesystem.py:2469-2481 — 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 (13 lines × 2) libs/deepagents/deepagents/middleware/filesystem.py:2521 — libs/deepagents/deepagents/middleware/filesystem.py:2521-2533 | libs/deepagents/deepagents/middleware/filesystem.py:2562-2574 — 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 (13 lines × 2) libs/deepagents/deepagents/middleware/skills.py:1200 — libs/deepagents/deepagents/middleware/skills.py:1200-1212 | libs/deepagents/deepagents/middleware/skills.py:1246-1258 — 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×8
  • Duplicated block (10 lines × 2) .github/scripts/checks/raise_langchain_minimums.py:169 — .github/scripts/checks/raise_langchain_minimums.py:169-178 | .github/scripts/release/check_dep_freshness.py:312-321 — 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (10 lines × 2) libs/code/deepagents_code/app.py:15922 — libs/code/deepagents_code/app.py:15922-15931 | libs/code/deepagents_code/app.py:17013-17022 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `libs/code/deepagents_code/app.py:15920` calls `_cancel_goal_proposal_worker`, `_cancel_pending_goal_review` and `libs/code/deepagents_code/app.py:17012` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) libs/code/deepagents_code/main.py:1360 — libs/code/deepagents_code/main.py:1360-1369 | libs/code/deepagents_code/main.py:4078-4087 — 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. Note first that the copies are not typed on the same thing: `Style` names `prompt_toolkit.styles` in one and `rich.style` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (10 lines × 2) libs/code/deepagents_code/tui/widgets/notification_detail.py:192 — libs/code/deepagents_code/tui/widgets/notification_detail.py:192-201 | libs/code/deepagents_code/tui/widgets/update_available.py:229-238 — before extracting anything, compare `libs/code/deepagents_code/tui/widgets/notification_detail.py` and `libs/code/deepagents_code/tui/widgets/update_available.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind `idx` to `markup=False) for` in one and `markup=False) changelog = _ChangelogOption() self._options.append(changelog) yield changelog for` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `libs/code/deepagents_code/tui/widgets/update_available.py:226` calls `_ChangelogOption` and `libs/code/deepagents_code/tui/widgets/notification_detail.py:191` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) libs/deepagents/deepagents/backends/store.py:609 — libs/deepagents/deepagents/backends/store.py:609-618 | libs/deepagents/deepagents/backends/store.py:622-636 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) libs/deepagents/deepagents/middleware/_overflow_clip.py:164 — libs/deepagents/deepagents/middleware/_overflow_clip.py:164-173 | libs/deepagents/deepagents/middleware/_overflow_clip.py:197-206 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) libs/deepagents/deepagents/middleware/summarization.py:1477 — libs/deepagents/deepagents/middleware/summarization.py:1477-1486 | libs/deepagents/deepagents/middleware/summarization.py:1508-1517 — 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) libs/code/deepagents_code/tui/widgets/notification_detail.py:55 — libs/code/deepagents_code/tui/widgets/notification_detail.py:55-64 | libs/code/deepagents_code/tui/widgets/update_available.py:43-52 — before extracting anything, compare `libs/code/deepagents_code/tui/widgets/notification_detail.py` and `libs/code/deepagents_code/tui/widgets/update_available.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×8
  • Duplicated block (9 lines × 2) libs/code/deepagents_code/extras_info.py:126 — libs/code/deepagents_code/extras_info.py:126-134 | libs/deepagents/deepagents/_version.py:100-108 — before extracting anything, compare `libs/code/deepagents_code/extras_info.py` and `libs/deepagents/deepagents/_version.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) libs/code/deepagents_code/tui/widgets/_links.py:156 — libs/code/deepagents_code/tui/widgets/_links.py:156-164 | libs/code/deepagents_code/tui/widgets/_links.py:234-243 — 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) libs/code/deepagents_code/tui/widgets/mcp_viewer.py:467 — libs/code/deepagents_code/tui/widgets/mcp_viewer.py:467-475 | libs/code/deepagents_code/tui/widgets/mcp_viewer.py:482-490 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/tui/widgets/mcp_viewer.py:467` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `libs/code/deepagents_code/tui/widgets/mcp_viewer.py:491` calls `sanitize_control_chars` and `libs/code/deepagents_code/tui/widgets/mcp_viewer.py:476` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) libs/code/deepagents_code/tui/widgets/thread_selector.py:1747 — libs/code/deepagents_code/tui/widgets/thread_selector.py:1747-1755 | libs/code/deepagents_code/tui/widgets/thread_selector.py:1923-1931 — 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) libs/code/deepagents_code/unicode_security.py:533 — libs/code/deepagents_code/unicode_security.py:533-541 | libs/code/deepagents_code/unicode_security.py:557-565 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `prefix` to `str = ""` in one and `str` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9 lines × 2) .github/scripts/evals/aggregate_unified.py:666 — .github/scripts/evals/aggregate_unified.py:666-674 | libs/evals/deepagents_evals/trial_summary.py:7-20 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) libs/code/deepagents_code/plugins/manifest.py:40 — libs/code/deepagents_code/plugins/manifest.py:40-55 | libs/code/deepagents_code/plugins/marketplace.py:495-503 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) REDACTED:75 — REDACTED:75-83 | REDACTED:252-260 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×8
  • Duplicated block (6 lines × 2) libs/code/deepagents_code/client/non_interactive.py:1118 — libs/code/deepagents_code/client/non_interactive.py:1118-1123 | libs/code/deepagents_code/client/non_interactive.py:1134-1139 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/client/non_interactive.py:1118` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) libs/code/deepagents_code/client/non_interactive.py:1124 — libs/code/deepagents_code/client/non_interactive.py:1124-1129 | libs/code/deepagents_code/client/non_interactive.py:1140-1145 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) libs/code/deepagents_code/plugins/adapters/skills_middleware.py:320 — libs/code/deepagents_code/plugins/adapters/skills_middleware.py:320-325 | libs/code/deepagents_code/plugins/adapters/skills_middleware.py:355-360 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) libs/deepagents/deepagents/backends/filesystem.py:524 — libs/deepagents/deepagents/backends/filesystem.py:524-530 | libs/deepagents/deepagents/backends/filesystem.py:1478-1483 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `libs/deepagents/deepagents/backends/filesystem.py:519` calls `except`, `WriteResult` and `libs/deepagents/deepagents/backends/filesystem.py:1475` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) libs/code/deepagents_code/tui/widgets/notification_detail.py:84 — libs/code/deepagents_code/tui/widgets/notification_detail.py:84-89 | libs/code/deepagents_code/tui/widgets/update_available.py:72-77 — before extracting anything, compare `libs/code/deepagents_code/tui/widgets/notification_detail.py` and `libs/code/deepagents_code/tui/widgets/update_available.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) libs/deepagents/deepagents/_tools.py:14 — libs/deepagents/deepagents/_tools.py:14-26 | libs/deepagents/deepagents/middleware/_tool_exclusion.py:26-31 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `tool` to `BaseTool | Callable | dict[str, Any]` in one and `BaseTool | dict[str, str]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (6 lines × 2) REDACTED:806 — REDACTED:806-811 | libs/talon/deepagents_talon/channels/slack.py:712-717 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) libs/code/deepagents_code/tui/widgets/mcp_login.py:219 — libs/code/deepagents_code/tui/widgets/mcp_login.py:219-224 | libs/code/deepagents_code/tui/widgets/update_progress.py:187-192 — 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 (19 lines × 2) · ×6
  • Duplicated block (19 lines × 2) libs/code/deepagents_code/hooks/server_middleware.py:424 — libs/code/deepagents_code/hooks/server_middleware.py:424-442 | libs/code/deepagents_code/hooks/server_middleware.py:455-473 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (19 lines × 2) libs/code/deepagents_code/main.py:2271 — libs/code/deepagents_code/main.py:2271-2289 | libs/code/deepagents_code/main.py:2336-2354 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/main.py:2271` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) libs/code/deepagents_code/model_retry.py:1220 — libs/code/deepagents_code/model_retry.py:1220-1238 | libs/code/deepagents_code/model_retry.py:1275-1293 — 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 (19 lines × 2) libs/code/deepagents_code/skills/commands.py:558 — libs/code/deepagents_code/skills/commands.py:558-576 | libs/code/deepagents_code/skills/commands.py:710-728 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/skills/commands.py:558` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `libs/code/deepagents_code/skills/commands.py:577` calls `get_built_in_skills_dir` and `libs/code/deepagents_code/skills/commands.py:729` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (19 lines × 2) libs/deepagents/deepagents/middleware/_message_eviction.py:177 — libs/deepagents/deepagents/middleware/_message_eviction.py:177-196 | libs/deepagents/deepagents/middleware/filesystem.py:1773-1791 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `message` to `ToolMessage` in one and `HumanMessage` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (19 lines × 2) examples/deep_research/research_agent/tools.py:17 — examples/deep_research/research_agent/tools.py:17-35 | examples/nvidia_deep_agent/src/tools.py:17-35 — before extracting anything, compare `examples/deep_research/research_agent/tools.py` and `examples/nvidia_deep_agent/src/tools.py` as WHOLE FILES: 95% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×6
  • Duplicated block (16 lines × 2) libs/code/deepagents_code/mcp_login_service.py:322 — libs/code/deepagents_code/mcp_login_service.py:322-337 | libs/code/deepagents_code/mcp_tools.py:2763-2778 — 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 (16 lines × 2) libs/code/deepagents_code/skills/commands.py:275 — libs/code/deepagents_code/skills/commands.py:275-290 | libs/code/deepagents_code/skills/commands.py:296-311 — 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 (16 lines × 2) libs/deepagents/deepagents/middleware/filesystem.py:2333 — libs/deepagents/deepagents/middleware/filesystem.py:2333-2348 | libs/deepagents/deepagents/middleware/filesystem.py:2521-2536 — 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 (16 lines × 2) libs/deepagents/deepagents/middleware/filesystem.py:2818 — libs/deepagents/deepagents/middleware/filesystem.py:2818-2833 | libs/deepagents/deepagents/middleware/filesystem.py:2864-2879 — 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 (16 lines × 2) libs/deepagents/deepagents/middleware/filesystem.py:3749 — libs/deepagents/deepagents/middleware/filesystem.py:3749-3764 | libs/deepagents/deepagents/middleware/filesystem.py:3790-3805 — 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 (16 lines × 2) REDACTED:1161 — REDACTED:1161-1177 | libs/talon/deepagents_talon/channels/slack.py:1052-1067 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `state` to `_DiscordConnectionState` in one and `_SlackConnectionState` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:1158` calls `log_debug_event` and `libs/talon/deepagents_talon/channels/slack.py:1049` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×6
  • Duplicated block (15 lines × 2) libs/code/deepagents_code/media_utils.py:254 — libs/code/deepagents_code/media_utils.py:254-268 | libs/code/deepagents_code/media_utils.py:333-347 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 2) libs/code/deepagents_code/tui/modals/plugin_manager/state.py:151 — libs/code/deepagents_code/tui/modals/plugin_manager/state.py:151-165 | libs/code/deepagents_code/tui/modals/plugin_manager/state.py:193-207 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 2) libs/deepagents/deepagents/middleware/filesystem.py:2062 — libs/deepagents/deepagents/middleware/filesystem.py:2062-2076 | libs/deepagents/deepagents/middleware/filesystem.py:2101-2115 — 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 (15 lines × 2) libs/deepagents/deepagents/middleware/summarization.py:1629 — libs/deepagents/deepagents/middleware/summarization.py:1629-1643 | libs/deepagents/deepagents/middleware/summarization.py:1768-1782 — 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 (15 lines × 2) REDACTED:785 — REDACTED:785-799 | libs/talon/deepagents_talon/channels/slack.py:691-705 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:785` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) .github/scripts/evals/aggregate_shards.py:143 — .github/scripts/evals/aggregate_shards.py:143-157 | .github/scripts/evals/aggregate_unified.py:64-79 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×6
  • Duplicated block (7 lines × 2) libs/code/deepagents_code/main.py:4177 — libs/code/deepagents_code/main.py:4177-4183 | libs/code/deepagents_code/main.py:4519-4525 — 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) libs/deepagents/deepagents/middleware/async_subagents.py:1254 — libs/deepagents/deepagents/middleware/async_subagents.py:1254-1260 | libs/deepagents/deepagents/middleware/async_subagents.py:1265-1271 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/deepagents/deepagents/middleware/async_subagents.py:1254` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) libs/deepagents/deepagents/middleware/filesystem.py:2513 — libs/deepagents/deepagents/middleware/filesystem.py:2513-2519 | libs/deepagents/deepagents/middleware/filesystem.py:2552-2560 — 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) libs/code/deepagents_code/extras_info.py:167 — libs/code/deepagents_code/extras_info.py:167-173 | libs/deepagents/deepagents/_version.py:126-132 — before extracting anything, compare `libs/code/deepagents_code/extras_info.py` and `libs/deepagents/deepagents/_version.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) libs/talon/deepagents_talon/pairing.py:828 — libs/talon/deepagents_talon/pairing.py:828-834 | libs/talon/deepagents_talon/tool_approvals.py:62-68 — 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (7 lines × 2) libs/deepagents/deepagents/middleware/filesystem.py:3435 — libs/deepagents/deepagents/middleware/filesystem.py:3435-3441 | libs/deepagents/deepagents/middleware/filesystem.py:3490-3496 — 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.
D17 · Explicit Debt · TodoComment · ×5
  • TodoComment libs/code/deepagents_code/built_in_skills/skill-creator/scripts/init_skill.py:60 — ## [TODO: Replace with the first main section based on chosen structure] — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment libs/code/examples/skills/skill-creator/scripts/init_skill.py:58 — ## [TODO: Replace with the first main section based on chosen structure] — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment libs/code/deepagents_code/built_in_skills/skill-creator/scripts/init_skill.py:122 — # TODO: Add actual script logic here — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment libs/code/examples/skills/skill-creator/scripts/init_skill.py:120 — # TODO: Add actual script logic here — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment libs/deepagents/tests/unit_tests/backends/test_local_shell_backend.py:221 — # Search for TODO — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×5
  • Duplicated block (14 lines × 2) libs/code/deepagents_code/_git.py:98 — libs/code/deepagents_code/_git.py:98-111 | libs/code/deepagents_code/_git.py:147-160 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) libs/code/deepagents_code/goal_rubric.py:967 — libs/code/deepagents_code/goal_rubric.py:967-980 | libs/code/deepagents_code/goal_rubric.py:1000-1014 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/goal_rubric.py:967` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) libs/code/deepagents_code/tui/widgets/notification_detail.py:218 — libs/code/deepagents_code/tui/widgets/notification_detail.py:218-231 | libs/code/deepagents_code/tui/widgets/update_available.py:255-268 — before extracting anything, compare `libs/code/deepagents_code/tui/widgets/notification_detail.py` and `libs/code/deepagents_code/tui/widgets/update_available.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) libs/deepagents/deepagents/backends/composite.py:534 — libs/deepagents/deepagents/backends/composite.py:534-547 | libs/deepagents/deepagents/backends/composite.py:596-609 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) libs/deepagents/deepagents/middleware/summarization.py:1306 — libs/deepagents/deepagents/middleware/summarization.py:1306-1319 | libs/deepagents/deepagents/middleware/summarization.py:1383-1396 — 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 lines × 2) · ×5
  • Duplicated block (8 lines × 2) .github/scripts/release/check_dep_freshness.py:391 — .github/scripts/release/check_dep_freshness.py:391-398 | .github/scripts/release/check_wheel_dep_freshness.py:932-939 — 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (8 lines × 2) libs/code/deepagents_code/plugins/adapters/skills_middleware.py:386 — libs/code/deepagents_code/plugins/adapters/skills_middleware.py:386-393 | libs/code/deepagents_code/plugins/adapters/skills_middleware.py:413-420 — 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (8 lines × 2) libs/deepagents/deepagents/backends/composite.py:648 — libs/deepagents/deepagents/backends/composite.py:648-655 | libs/deepagents/deepagents/backends/composite.py:691-698 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) libs/deepagents/deepagents/backends/composite.py:983 — libs/deepagents/deepagents/backends/composite.py:983-990 | libs/deepagents/deepagents/backends/composite.py:1012-1019 — 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (8 lines × 2) REDACTED:1533 — REDACTED:1533-1547 | libs/code/deepagents_code/update_check.py:958-965 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×5
  • Duplicated block (5 lines × 2) .github/scripts/evals/aggregate_shards.py:590 — .github/scripts/evals/aggregate_shards.py:590-598 | .github/scripts/evals/aggregate_shards.py:601-605 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `.github/scripts/evals/aggregate_shards.py:590` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) libs/acp/examples/local_context.py:340 — libs/acp/examples/local_context.py:340-344 | libs/code/deepagents_code/local_context.py:679-684 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/acp/examples/local_context.py:340` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (5 lines × 2) libs/deepagents/deepagents/backends/store.py:575 — libs/deepagents/deepagents/backends/store.py:575-579 | libs/deepagents/deepagents/backends/store.py:590-594 — 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (5 lines × 2) libs/deepagents/deepagents/middleware/filesystem.py:3424 — libs/deepagents/deepagents/middleware/filesystem.py:3424-3428 | libs/deepagents/deepagents/middleware/filesystem.py:3479-3483 — 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) libs/evals/scripts/run_trials.py:198 — libs/evals/scripts/run_trials.py:198-202 | libs/evals/scripts/run_trials.py:206-210 — 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×5
  • Low cohesion: BaseSandbox (LCOM4 13) libs/deepagents/deepagents/backends/sandbox.py:1587 — BaseSandbox's methods fall into 13 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 13 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: ChatTextArea (LCOM4 11) libs/code/deepagents_code/tui/widgets/chat_input.py:572 — ChatTextArea's methods fall into 11 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 11 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: DeepAgentsApp (LCOM4 8) libs/code/deepagents_code/app.py:3222 — DeepAgentsApp's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: FileTokenStorage (LCOM4 6) libs/talon/deepagents_talon/mcp_auth.py:164 — FileTokenStorage's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: VehicleControlAPI (LCOM4 4) libs/evals/tests/evals/data/bfcl_apis/vehicle_control.py:50 — VehicleControlAPI'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.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×4
  • Duplicated block (25 lines × 2) libs/code/deepagents_code/_git.py:439 — libs/code/deepagents_code/_git.py:439-463 | libs/code/deepagents_code/_git.py:641-665 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (25 lines × 2) libs/deepagents/deepagents/backends/state.py:300 — libs/deepagents/deepagents/backends/state.py:300-324 | libs/deepagents/deepagents/backends/store.py:637-661 — before extracting anything, compare `libs/deepagents/deepagents/backends/state.py` and `libs/deepagents/deepagents/backends/store.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (25 lines × 2) libs/deepagents/deepagents/middleware/skills.py:712 — libs/deepagents/deepagents/middleware/skills.py:712-736 | libs/deepagents/deepagents/middleware/skills.py:778-802 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (25 lines × 2) libs/deepagents/deepagents/middleware/summarization.py:2246 — libs/deepagents/deepagents/middleware/summarization.py:2246-2270 | libs/deepagents/deepagents/middleware/summarization.py:2280-2304 — 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 (22 lines × 2) · ×4
  • Duplicated block (22 lines × 2) libs/code/deepagents_code/_repository_bounds.py:275 — libs/code/deepagents_code/_repository_bounds.py:275-296 | libs/code/deepagents_code/_repository_bounds.py:341-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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (22 lines × 2) libs/deepagents/deepagents/backends/store.py:490 — libs/deepagents/deepagents/backends/store.py:490-511 | libs/deepagents/deepagents/backends/store.py:531-552 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (22 lines × 2) libs/deepagents/deepagents/middleware/summarization.py:1190 — libs/deepagents/deepagents/middleware/summarization.py:1190-1211 | libs/deepagents/deepagents/middleware/summarization.py:1243-1264 — 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 (22 lines × 2) libs/acp/deepagents_acp/utils.py:127 — libs/acp/deepagents_acp/utils.py:127-148 | REDACTED:4271-4295 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×4
  • Duplicated block (20 lines × 2) REDACTED:1643 — REDACTED:1643-1662 | REDACTED:1900-1919 — 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 (20 lines × 2) libs/deepagents/deepagents/middleware/async_subagents.py:1097 — libs/deepagents/deepagents/middleware/async_subagents.py:1097-1116 | libs/deepagents/deepagents/middleware/async_subagents.py:1130-1149 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (20 lines × 2) libs/deepagents/deepagents/middleware/filesystem.py:2372 — libs/deepagents/deepagents/middleware/filesystem.py:2372-2391 | libs/deepagents/deepagents/middleware/filesystem.py:2562-2581 — 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 (20 lines × 2) libs/code/deepagents_code/extras_info.py:46 — libs/code/deepagents_code/extras_info.py:46-65 | libs/deepagents/deepagents/_version.py:25-44 — before extracting anything, compare `libs/code/deepagents_code/extras_info.py` and `libs/deepagents/deepagents/_version.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×3
  • Duplicated block (27 lines × 2) libs/code/deepagents_code/extras_info.py:69 — libs/code/deepagents_code/extras_info.py:69-95 | libs/deepagents/deepagents/_version.py:48-74 — before extracting anything, compare `libs/code/deepagents_code/extras_info.py` and `libs/deepagents/deepagents/_version.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (27 lines × 2) libs/deepagents/deepagents/middleware/async_subagents.py:707 — libs/deepagents/deepagents/middleware/async_subagents.py:707-733 | libs/deepagents/deepagents/middleware/async_subagents.py:749-775 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/deepagents/deepagents/middleware/async_subagents.py:707` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (27 lines × 2) libs/deepagents/deepagents/middleware/async_subagents.py:997 — libs/deepagents/deepagents/middleware/async_subagents.py:997-1023 | libs/deepagents/deepagents/middleware/async_subagents.py:1037-1063 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/deepagents/deepagents/middleware/async_subagents.py:997` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (26 lines × 2) · ×3
  • Duplicated block (26 lines × 2) REDACTED:3944 — REDACTED:3944-3969 | REDACTED:3988-4013 — 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 (26 lines × 2) libs/deepagents/deepagents/backends/filesystem.py:352 — libs/deepagents/deepagents/backends/filesystem.py:352-377 | libs/deepagents/deepagents/backends/filesystem.py:391-416 — 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 (26 lines × 2) libs/evals/harbor_adapters/contextbench/main.py:17 — libs/evals/harbor_adapters/contextbench/main.py:17-42 | libs/evals/harbor_adapters/drbench/main.py:15-40 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/evals/harbor_adapters/contextbench/main.py:17` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×3
  • Duplicated block (23 lines × 2) libs/code/deepagents_code/built_in_skills/skill-creator/scripts/init_skill.py:254 — libs/code/deepagents_code/built_in_skills/skill-creator/scripts/init_skill.py:254-276 | libs/code/examples/skills/skill-creator/scripts/init_skill.py:210-232 — before extracting anything, compare `libs/code/deepagents_code/built_in_skills/skill-creator/scripts/init_skill.py` and `libs/code/examples/skills/skill-creator/scripts/init_skill.py` as WHOLE FILES: 96% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (23 lines × 2) REDACTED:4006 — REDACTED:4006-4028 | REDACTED:4064-4086 — 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 (23 lines × 2) libs/deepagents/deepagents/middleware/filesystem.py:3212 — libs/deepagents/deepagents/middleware/filesystem.py:3212-3234 | libs/deepagents/deepagents/middleware/filesystem.py:3300-3322 — 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 (20–22 lines × 2) · ×3
  • Duplicated block (20–22 lines × 2) libs/code/deepagents_code/app.py:26093 — libs/code/deepagents_code/app.py:26093-26114 | libs/code/deepagents_code/app.py:30842-30861 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `libs/code/deepagents_code/app.py:30862` calls `isinstance` and `libs/code/deepagents_code/app.py:26115` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (20–22 lines × 2) libs/code/deepagents_code/model_retry.py:631 — libs/code/deepagents_code/model_retry.py:631-652 | libs/code/deepagents_code/model_retry.py:680-699 — 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 (20–22 lines × 2) libs/code/deepagents_code/tui/widgets/_paste_textarea.py:838 — libs/code/deepagents_code/tui/widgets/_paste_textarea.py:838-857 | libs/code/deepagents_code/tui/widgets/chat_input.py:1532-1553 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (16–18 lines × 2) · ×3
  • Duplicated block (16–18 lines × 2) libs/code/deepagents_code/client/non_interactive.py:1836 — libs/code/deepagents_code/client/non_interactive.py:1836-1853 | libs/code/deepagents_code/tui/widgets/approval.py:729-744 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (16–18 lines × 2) libs/code/deepagents_code/main.py:6379 — libs/code/deepagents_code/main.py:6379-6396 | libs/code/deepagents_code/main.py:6516-6531 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/main.py:6379` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16–18 lines × 2) libs/deepagents/deepagents/backends/state.py:156 — libs/deepagents/deepagents/backends/state.py:156-173 | libs/deepagents/deepagents/backends/store.py:349-364 — before extracting anything, compare `libs/deepagents/deepagents/backends/state.py` and `libs/deepagents/deepagents/backends/store.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×3
  • Duplicated block (14–15 lines × 2) libs/deepagents/deepagents/middleware/filesystem.py:2496 — libs/deepagents/deepagents/middleware/filesystem.py:2496-2510 | libs/deepagents/deepagents/middleware/filesystem.py:2536-2549 — 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 (14–15 lines × 2) libs/deepagents/deepagents/middleware/summarization.py:1610 — libs/deepagents/deepagents/middleware/summarization.py:1610-1623 | libs/deepagents/deepagents/middleware/summarization.py:1751-1765 — 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 (14–15 lines × 2) REDACTED:1642 — REDACTED:1642-1655 | REDACTED:1382-1396 — 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 (10–12 lines × 2) · ×3
  • Duplicated block (10–12 lines × 2) libs/code/deepagents_code/client/commands/config.py:850 — libs/code/deepagents_code/client/commands/config.py:850-861 | libs/code/deepagents_code/client/commands/config.py:889-898 — 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–12 lines × 2) REDACTED:6858 — REDACTED:6858-6869 | REDACTED:3715-3724 — 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 (10–12 lines × 2) libs/code/deepagents_code/tui/widgets/messages.py:3440 — libs/code/deepagents_code/tui/widgets/messages.py:3440-3449 | libs/code/deepagents_code/tui/widgets/messages.py:3589-3600 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/tui/widgets/messages.py:3440` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `libs/code/deepagents_code/tui/widgets/messages.py:3601` calls `join` and `libs/code/deepagents_code/tui/widgets/messages.py:3450` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (37–38 lines × 2) · ×2
  • Duplicated block (37–38 lines × 2) libs/code/deepagents_code/app.py:23374 — libs/code/deepagents_code/app.py:23374-23410 | libs/code/deepagents_code/app.py:23419-23456 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/app.py:23374` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (37–38 lines × 2) libs/code/deepagents_code/configurable_model.py:570 — libs/code/deepagents_code/configurable_model.py:570-606 | libs/code/deepagents_code/configurable_model.py:654-691 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/configurable_model.py:654` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (25–27 lines × 2) · ×2
  • Duplicated block (25–27 lines × 2) libs/code/deepagents_code/ui.py:172 — libs/code/deepagents_code/ui.py:172-196 | libs/code/deepagents_code/ui.py:255-281 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/ui.py:172` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (25–27 lines × 2) examples/llm-wiki/ingest.py:82 — examples/llm-wiki/ingest.py:82-108 | examples/llm-wiki/ingest.py:126-150 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `examples/llm-wiki/ingest.py:82` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (26–27 lines × 2) · ×2
  • Duplicated block (26–27 lines × 2) libs/deepagents/deepagents/middleware/filesystem.py:2399 — libs/deepagents/deepagents/middleware/filesystem.py:2399-2425 | libs/deepagents/deepagents/middleware/filesystem.py:2442-2467 — 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 (26–27 lines × 2) libs/deepagents/deepagents/middleware/subagents.py:838 — libs/deepagents/deepagents/middleware/subagents.py:838-864 | libs/deepagents/deepagents/middleware/subagents.py:869-894 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/deepagents/deepagents/middleware/subagents.py:869` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (23–24 lines × 2) · ×2
  • Duplicated block (23–24 lines × 2) libs/deepagents/deepagents/middleware/filesystem.py:2241 — libs/deepagents/deepagents/middleware/filesystem.py:2241-2264 | libs/deepagents/deepagents/middleware/filesystem.py:2269-2291 — 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 (23–24 lines × 2) libs/deepagents/deepagents/middleware/filesystem.py:2308 — libs/deepagents/deepagents/middleware/filesystem.py:2308-2331 | libs/deepagents/deepagents/middleware/filesystem.py:2348-2370 — 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 (18–23 lines × 2) · ×2
  • Duplicated block (18–23 lines × 2) libs/code/deepagents_code/sessions.py:1744 — libs/code/deepagents_code/sessions.py:1744-1761 | libs/code/deepagents_code/sessions.py:1816-1838 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (18–23 lines × 2) libs/deepagents/deepagents/middleware/filesystem.py:3652 — libs/deepagents/deepagents/middleware/filesystem.py:3652-3674 | libs/deepagents/deepagents/middleware/filesystem.py:3683-3700 — 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 (21–23 lines × 2) · ×2
  • Duplicated block (21–23 lines × 2) REDACTED:3642 — REDACTED:3642-3664 | REDACTED:3706-3726 — 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 (21–23 lines × 2) libs/code/deepagents_code/tui/widgets/_paste_textarea.py:795 — libs/code/deepagents_code/tui/widgets/_paste_textarea.py:795-815 | libs/code/deepagents_code/tui/widgets/chat_input.py:1441-1463 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (21–22 lines × 2) · ×2
  • Duplicated block (21–22 lines × 2) libs/deepagents/deepagents/middleware/filesystem.py:2039 — libs/deepagents/deepagents/middleware/filesystem.py:2039-2060 | libs/deepagents/deepagents/middleware/filesystem.py:2079-2099 — 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 (21–22 lines × 2) libs/deepagents/deepagents/middleware/summarization.py:1321 — libs/deepagents/deepagents/middleware/summarization.py:1321-1341 | libs/deepagents/deepagents/middleware/summarization.py:1399-1420 — 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–21 lines × 2) · ×2
  • Duplicated block (19–21 lines × 2) libs/code/deepagents_code/auth_store.py:246 — libs/code/deepagents_code/auth_store.py:246-264 | REDACTED:761-781 — 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 (19–21 lines × 2) libs/code/deepagents_code/main.py:4935 — libs/code/deepagents_code/main.py:4935-4953 | libs/code/deepagents_code/main.py:5038-5058 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/main.py:4935` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×2
  • Duplicated block (21 lines × 2) libs/code/deepagents_code/model_api.py:45 — libs/code/deepagents_code/model_api.py:45-65 | libs/code/deepagents_code/model_api.py:155-178 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (21 lines × 2) libs/partners/quickjs/langchain_quickjs/middleware.py:421 — libs/partners/quickjs/langchain_quickjs/middleware.py:421-441 | libs/partners/quickjs/langchain_quickjs/middleware.py:461-481 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (17–19 lines × 2) · ×2
  • Duplicated block (17–19 lines × 2) libs/code/deepagents_code/app.py:16953 — libs/code/deepagents_code/app.py:16953-16969 | libs/code/deepagents_code/app.py:17185-17203 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/app.py:17185` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (17–19 lines × 2) libs/code/deepagents_code/main.py:4156 — libs/code/deepagents_code/main.py:4156-4172 | libs/code/deepagents_code/main.py:4481-4499 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/main.py:4481` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13–18 lines × 2) · ×2
  • Duplicated block (13–18 lines × 2) libs/code/deepagents_code/extras_info.py:99 — libs/code/deepagents_code/extras_info.py:99-116 | libs/deepagents/deepagents/_version.py:78-90 — before extracting anything, compare `libs/code/deepagents_code/extras_info.py` and `libs/deepagents/deepagents/_version.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13–18 lines × 2) libs/code/deepagents_code/sessions.py:1247 — libs/code/deepagents_code/sessions.py:1247-1264 | libs/code/deepagents_code/sessions.py:1413-1425 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `libs/code/deepagents_code/sessions.py:1407` calls `get_running_loop` and `libs/code/deepagents_code/sessions.py:1243` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×2
  • Duplicated block (15 lines × 3) libs/code/deepagents_code/_git.py:452 — libs/code/deepagents_code/_git.py:452-466 | libs/code/deepagents_code/_git.py:583-597 | libs/code/deepagents_code/_git.py:654-668 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/_git.py:452` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 3) libs/code/deepagents_code/app.py:32448 — libs/code/deepagents_code/app.py:32448-32462 | libs/code/deepagents_code/client/launch/server_manager.py:418-432 | libs/code/deepagents_code/client/launch/server_manager.py:605-619 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/app.py:32448` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×2
  • Duplicated block (11 lines × 3) libs/deepagents/deepagents/backends/state.py:240 — libs/deepagents/deepagents/backends/state.py:240-250 | libs/deepagents/deepagents/backends/store.py:498-508 | libs/deepagents/deepagents/backends/store.py:539-549 — before extracting anything, compare `libs/deepagents/deepagents/backends/state.py` and `libs/deepagents/deepagents/backends/store.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 3) libs/evals/deepagents_evals/cli.py:270 — libs/evals/deepagents_evals/cli.py:270-280 | libs/evals/deepagents_evals/cli.py:400-410 | libs/evals/scripts/run_trials.py:281-291 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×2
  • Duplicated block (5 lines × 3) .github/scripts/checks/raise_langchain_minimums.py:168 — .github/scripts/checks/raise_langchain_minimums.py:168-173 | .github/scripts/release/check_dep_freshness.py:311-316 | .github/scripts/release/check_release_deps.py:564-568 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (5 lines × 3) libs/code/deepagents_code/tool_display.py:345 — libs/code/deepagents_code/tool_display.py:345-349 | libs/code/deepagents_code/tool_display.py:350-354 | libs/code/deepagents_code/tool_display.py:355-359 — 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (10 lines × 6) · ×2
  • Duplicated block (10 lines × 6) REDACTED:4500 — REDACTED:4500-4509 | REDACTED:4513-4527 | REDACTED:4531-4546 | REDACTED:4550-4566 | libs/code/deepagents_code/cost_tracking.py:723-742 | libs/code/deepagents_code/tui/widgets/_links.py:63-72 — there are 6 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 6 sites; resolving a subset leaves the remainder to drift apart. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 6) libs/code/deepagents_code/tui/modals/cold_cache.py:87 — libs/code/deepagents_code/tui/modals/cold_cache.py:87-96 | libs/code/deepagents_code/tui/widgets/notification_center.py:191-200 | libs/code/deepagents_code/tui/widgets/notification_center.py:249-258 | libs/code/deepagents_code/tui/widgets/notification_detail.py:72-81 | libs/code/deepagents_code/tui/widgets/update_available.py:60-69 | libs/code/deepagents_code/tui/widgets/update_available.py:107-116 — before extracting anything, compare `libs/code/deepagents_code/tui/widgets/notification_detail.py` and `libs/code/deepagents_code/tui/widgets/update_available.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `libs/code/deepagents_code/tui/modals/cold_cache.py:82` calls `choice` and `libs/code/deepagents_code/tui/widgets/update_available.py:104` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×2
  • Swallowed exception (caught, then discarded) libs/evals/scripts/analyze.py:317 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) libs/talon/deepagents_talon/channels/whatsapp_bridge/bridge.js:297 — `catch (_error)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
X3 · Exception handling · Swallowed exception (empty catch) · ×2
  • Swallowed exception (empty catch) libs/talon/deepagents_talon/channels/whatsapp_bridge/bridge.js:309 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) libs/talon/deepagents_talon/channels/whatsapp_bridge/bridge.js:729 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
D1 · Cyclomatic Complexity · textual_adapter.execute_task_textual (cyclomatic 380) · ×1
  • textual_adapter.execute_task_textual (cyclomatic 380) REDACTED:1797 — textual_adapter.execute_task_textual has cyclomatic complexity 380 (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 · main.cli_main (cyclomatic 194) · ×1
  • main.cli_main (cyclomatic 194) libs/code/deepagents_code/main.py:5335 — main.cli_main has cyclomatic complexity 194 (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 · DeepAgentsApp._handle_command (cyclomatic 124) · ×1
  • DeepAgentsApp._handle_command (cyclomatic 124) libs/code/deepagents_code/app.py:17494 — DeepAgentsApp._handle_command has cyclomatic complexity 124 (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 · agent.create_cli_agent (cyclomatic 113) · ×1
  • agent.create_cli_agent (cyclomatic 113) libs/code/deepagents_code/agent.py:2524 — agent.create_cli_agent has cyclomatic complexity 113 (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 · DeepAgentsApp._run_agent_task (cyclomatic 61) · ×1
  • DeepAgentsApp._run_agent_task (cyclomatic 61) libs/code/deepagents_code/app.py:19801 — DeepAgentsApp._run_agent_task has cyclomatic complexity 61 (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 · graph.create_deep_agent (cyclomatic 59) · ×1
  • graph.create_deep_agent (cyclomatic 59) libs/deepagents/deepagents/graph.py:278 — graph.create_deep_agent has cyclomatic complexity 59 (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 · config.create_model (cyclomatic 55) · ×1
  • config.create_model (cyclomatic 55) REDACTED:6767 — config.create_model has cyclomatic complexity 55 (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 · non_interactive._run_agent_loop (cyclomatic 53) · ×1
  • non_interactive._run_agent_loop (cyclomatic 53) libs/code/deepagents_code/client/non_interactive.py:2121 — non_interactive._run_agent_loop has cyclomatic complexity 53 (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 · DeepAgentsApp._restart_server_for_owned_agent_swap (cyclomatic 52) · ×1
  • DeepAgentsApp._restart_server_for_owned_agent_swap (cyclomatic 52) libs/code/deepagents_code/app.py:25897 — DeepAgentsApp._restart_server_for_owned_agent_swap has cyclomatic complexity 52 (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 · DeepAgentsApp.__init__ (cyclomatic 49) · ×1
  • DeepAgentsApp.__init__ (cyclomatic 49) libs/code/deepagents_code/app.py:3390 — DeepAgentsApp.__init__ has cyclomatic complexity 49 (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 · AutoModeHITLMiddleware.awrap_model_call (cyclomatic 48) · ×1
  • AutoModeHITLMiddleware.awrap_model_call (cyclomatic 48) libs/code/deepagents_code/auto_mode.py:3215 — AutoModeHITLMiddleware.awrap_model_call has cyclomatic complexity 48 (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 · AutoModeHITLMiddleware.aafter_model (cyclomatic 47) · ×1
  • AutoModeHITLMiddleware.aafter_model (cyclomatic 47) libs/code/deepagents_code/auto_mode.py:4096 — AutoModeHITLMiddleware.aafter_model has cyclomatic complexity 47 (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 · providers.coerce_toml_value (cyclomatic 47) · ×1
  • providers.coerce_toml_value (cyclomatic 47) libs/code/deepagents_code/configuration/providers.py:268 — providers.coerce_toml_value has cyclomatic complexity 47 (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 · bridge.handle (cyclomatic 47) · ×1
  • bridge.handle (cyclomatic 47) libs/talon/deepagents_talon/channels/whatsapp_bridge/bridge.js:581 — bridge.handle has cyclomatic complexity 47 (threshold 15). Of this number, 45 points are the body's own statements and 2 belong to one function literal inside it that branches. 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 · mcp_tools.resolve_and_load_mcp_tools (cyclomatic 46) · ×1
  • mcp_tools.resolve_and_load_mcp_tools (cyclomatic 46) libs/code/deepagents_code/mcp_tools.py:2565 — mcp_tools.resolve_and_load_mcp_tools has cyclomatic complexity 46 (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 · bridge.enqueueMessage (cyclomatic 46) · ×1
  • bridge.enqueueMessage (cyclomatic 46) libs/talon/deepagents_talon/channels/whatsapp_bridge/bridge.js:187 — bridge.enqueueMessage has cyclomatic complexity 46 (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.
D1 · Cyclomatic Complexity · app._format_mcp_server_changes (cyclomatic 45) · ×1
  • app._format_mcp_server_changes (cyclomatic 45) libs/code/deepagents_code/app.py:859 — app._format_mcp_server_changes has cyclomatic complexity 45 (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 · DeepAgentsApp._run_reload_unlocked (cyclomatic 42) · ×1
  • DeepAgentsApp._run_reload_unlocked (cyclomatic 42) libs/code/deepagents_code/app.py:18236 — DeepAgentsApp._run_reload_unlocked 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 · AgentServerACP.prompt (cyclomatic 41) · ×1
  • AgentServerACP.prompt (cyclomatic 41) libs/acp/deepagents_acp/server.py:948 — AgentServerACP.prompt 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.
D1 · Cyclomatic Complexity · ModelSelectorScreen._update_display (cyclomatic 41) · ×1
  • ModelSelectorScreen._update_display (cyclomatic 41) libs/code/deepagents_code/tui/widgets/model_selector.py:1310 — ModelSelectorScreen._update_display 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.
D1 · Cyclomatic Complexity · non_interactive._process_stream_chunk (cyclomatic 40) · ×1
  • non_interactive._process_stream_chunk (cyclomatic 40) libs/code/deepagents_code/client/non_interactive.py:1551 — non_interactive._process_stream_chunk has cyclomatic complexity 40 (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 · non_interactive.run_non_interactive (cyclomatic 40) · ×1
  • non_interactive.run_non_interactive (cyclomatic 40) libs/code/deepagents_code/client/non_interactive.py:2795 — non_interactive.run_non_interactive has cyclomatic complexity 40 (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 · CostTrackingMiddleware._charge (cyclomatic 40) · ×1
  • CostTrackingMiddleware._charge (cyclomatic 40) libs/code/deepagents_code/cost_tracking.py:3054 — CostTrackingMiddleware._charge has cyclomatic complexity 40 (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 · AgentServerACP._handle_interrupts (cyclomatic 38) · ×1
  • AgentServerACP._handle_interrupts (cyclomatic 38) libs/acp/deepagents_acp/server.py:1165 — AgentServerACP._handle_interrupts has cyclomatic complexity 38 (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 · DeepAgentsApp._convert_messages_to_data (cyclomatic 38) · ×1
  • DeepAgentsApp._convert_messages_to_data (cyclomatic 38) libs/code/deepagents_code/app.py:20452 — DeepAgentsApp._convert_messages_to_data has cyclomatic complexity 38 (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 · tool_display.format_tool_display (cyclomatic 38) · ×1
  • tool_display.format_tool_display (cyclomatic 38) libs/code/deepagents_code/tool_display.py:164 — tool_display.format_tool_display has cyclomatic complexity 38 (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 · DeepAgentsApp._sync_goal_rubric_state_from_thread (cyclomatic 37) · ×1
  • DeepAgentsApp._sync_goal_rubric_state_from_thread (cyclomatic 37) libs/code/deepagents_code/app.py:15520 — DeepAgentsApp._sync_goal_rubric_state_from_thread 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.
D1 · Cyclomatic Complexity · sessions.list_threads_command (cyclomatic 36) · ×1
  • sessions.list_threads_command (cyclomatic 36) libs/code/deepagents_code/sessions.py:2180 — sessions.list_threads_command has cyclomatic complexity 36 (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 · DeepAgentsApp._format_cost_summary (cyclomatic 35) · ×1
  • DeepAgentsApp._format_cost_summary (cyclomatic 35) libs/code/deepagents_code/app.py:9260 — DeepAgentsApp._format_cost_summary 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 · AutoModeHITLMiddleware._validated_plan (cyclomatic 35) · ×1
  • AutoModeHITLMiddleware._validated_plan (cyclomatic 35) libs/code/deepagents_code/auto_mode.py:3992 — AutoModeHITLMiddleware._validated_plan has cyclomatic complexity 35 (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 · cost_tracking._estimate_cost (cyclomatic 35) · ×1
  • cost_tracking._estimate_cost (cyclomatic 35) libs/code/deepagents_code/cost_tracking.py:1687 — cost_tracking._estimate_cost has cyclomatic complexity 35 (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 · model_config._discover_available_models (cyclomatic 35) · ×1
  • model_config._discover_available_models (cyclomatic 35) REDACTED:1562 — model_config._discover_available_models 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 · aggregate_unified.read_leaf (cyclomatic 35) · ×1
  • aggregate_unified.read_leaf (cyclomatic 35) .github/scripts/evals/aggregate_unified.py:147 — aggregate_unified.read_leaf has cyclomatic complexity 35 (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 · build_release_notes.collect_contributors (cyclomatic 35) · ×1
  • build_release_notes.collect_contributors (cyclomatic 35) .github/scripts/release/build_release_notes.py:981 — build_release_notes.collect_contributors 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 · analyze.print_summary (cyclomatic 34) · ×1
  • analyze.print_summary (cyclomatic 34) libs/evals/scripts/analyze.py:385 — analyze.print_summary has cyclomatic complexity 34 (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 · main._run_startup_auto_update (cyclomatic 33) · ×1
  • main._run_startup_auto_update (cyclomatic 33) libs/code/deepagents_code/main.py:564 — main._run_startup_auto_update has cyclomatic complexity 33 (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 · ChatTextArea._on_key (cyclomatic 33) · ×1
  • ChatTextArea._on_key (cyclomatic 33) libs/code/deepagents_code/tui/widgets/chat_input.py:1239 — ChatTextArea._on_key has cyclomatic complexity 33 (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 · WelcomeBanner._build_banner (cyclomatic 33) · ×1
  • WelcomeBanner._build_banner (cyclomatic 33) libs/code/deepagents_code/tui/widgets/welcome.py:445 — WelcomeBanner._build_banner has cyclomatic complexity 33 (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 · DeepAgentsApp._load_thread_history (cyclomatic 32) · ×1
  • DeepAgentsApp._load_thread_history (cyclomatic 32) libs/code/deepagents_code/app.py:21041 — DeepAgentsApp._load_thread_history has cyclomatic complexity 32 (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 · providers.coerce_environment_value (cyclomatic 32) · ×1
  • providers.coerce_environment_value (cyclomatic 32) libs/code/deepagents_code/configuration/providers.py:138 — providers.coerce_environment_value has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FileOpTracker.complete_with_message (cyclomatic 32) · ×1
  • FileOpTracker.complete_with_message (cyclomatic 32) libs/code/deepagents_code/file_ops.py:805 — FileOpTracker.complete_with_message has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · main._check_mcp_project_trust (cyclomatic 32) · ×1
  • main._check_mcp_project_trust (cyclomatic 32) libs/code/deepagents_code/main.py:4651 — main._check_mcp_project_trust has cyclomatic complexity 32 (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 · PluginManagerScreen._refresh_view (cyclomatic 31) · ×1
  • PluginManagerScreen._refresh_view (cyclomatic 31) libs/code/deepagents_code/tui/modals/plugin_manager/__init__.py:451 — PluginManagerScreen._refresh_view 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.
D1 · Cyclomatic Complexity · AuthPromptScreen.compose (cyclomatic 31) · ×1
  • AuthPromptScreen.compose (cyclomatic 31) libs/code/deepagents_code/tui/widgets/auth.py:757 — AuthPromptScreen.compose has cyclomatic complexity 31 (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 · mcp_login_service.resolve_mcp_config (cyclomatic 30) · ×1
  • mcp_login_service.resolve_mcp_config (cyclomatic 30) libs/code/deepagents_code/mcp_login_service.py:197 — mcp_login_service.resolve_mcp_config 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.
D1 · Cyclomatic Complexity · model_config.get_model_profiles (cyclomatic 30) · ×1
  • model_config.get_model_profiles (cyclomatic 30) REDACTED:1794 — model_config.get_model_profiles 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.
D1 · Cyclomatic Complexity · unified_prep.main (cyclomatic 30) · ×1
  • unified_prep.main (cyclomatic 30) .github/scripts/evals/unified_prep.py:527 — unified_prep.main 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.
D1 · Cyclomatic Complexity · DeepAgentsApp.exit (cyclomatic 29) · ×1
  • DeepAgentsApp.exit (cyclomatic 29) libs/code/deepagents_code/app.py:23093 — DeepAgentsApp.exit has cyclomatic complexity 29 (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 · ModelConfig.load (cyclomatic 29) · ×1
  • ModelConfig.load (cyclomatic 29) REDACTED:3364 — ModelConfig.load has cyclomatic complexity 29 (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 · non_interactive._process_ai_message (cyclomatic 28) · ×1
  • non_interactive._process_ai_message (cyclomatic 28) libs/code/deepagents_code/client/non_interactive.py:781 — non_interactive._process_ai_message 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 · generate_radar.main (cyclomatic 28) · ×1
  • generate_radar.main (cyclomatic 28) libs/evals/scripts/generate_radar.py:119 — generate_radar.main 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 · DeepAgentsApp._resolve_resume_thread (cyclomatic 27) · ×1
  • DeepAgentsApp._resolve_resume_thread (cyclomatic 27) libs/code/deepagents_code/app.py:6110 — DeepAgentsApp._resolve_resume_thread 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.
D1 · Cyclomatic Complexity · quick_validate.validate_skill (cyclomatic 27) · ×1
  • quick_validate.validate_skill (cyclomatic 27) libs/code/deepagents_code/built_in_skills/skill-creator/scripts/quick_validate.py:20 — quick_validate.validate_skill 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.
D1 · Cyclomatic Complexity · non_interactive._process_rubric_event (cyclomatic 27) · ×1
  • non_interactive._process_rubric_event (cyclomatic 27) libs/code/deepagents_code/client/non_interactive.py:1064 — non_interactive._process_rubric_event 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.
D1 · Cyclomatic Complexity · commands._list (cyclomatic 27) · ×1
  • commands._list (cyclomatic 27) libs/code/deepagents_code/skills/commands.py:147 — commands._list 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.
D1 · Cyclomatic Complexity · commands._delete (cyclomatic 27) · ×1
  • commands._delete (cyclomatic 27) libs/code/deepagents_code/skills/commands.py:671 — commands._delete 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.
D1 · Cyclomatic Complexity · DeepAgentRuntime._create_graph (cyclomatic 27) · ×1
  • DeepAgentRuntime._create_graph (cyclomatic 27) libs/talon/deepagents_talon/runtime.py:433 — DeepAgentRuntime._create_graph has cyclomatic complexity 27 (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 · aggregate_unified.combine (cyclomatic 27) · ×1
  • aggregate_unified.combine (cyclomatic 27) .github/scripts/evals/aggregate_unified.py:379 — aggregate_unified.combine 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.
D1 · Cyclomatic Complexity · _session_stats.record_message_usage (cyclomatic 26) · ×1
  • _session_stats.record_message_usage (cyclomatic 26) libs/code/deepagents_code/_session_stats.py:934 — _session_stats.record_message_usage has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DeepAgentsApp._offer_thread_cwd_switch (cyclomatic 26) · ×1
  • DeepAgentsApp._offer_thread_cwd_switch (cyclomatic 26) libs/code/deepagents_code/app.py:31114 — DeepAgentsApp._offer_thread_cwd_switch has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · theme._load_user_themes (cyclomatic 26) · ×1
  • theme._load_user_themes (cyclomatic 26) libs/code/deepagents_code/theme.py:517 — theme._load_user_themes has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · main.run_textual_cli_async (cyclomatic 25) · ×1
  • main.run_textual_cli_async (cyclomatic 25) libs/code/deepagents_code/main.py:3167 — main.run_textual_cli_async has cyclomatic complexity 25 (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 · update_check.perform_upgrade (cyclomatic 25) · ×1
  • update_check.perform_upgrade (cyclomatic 25) libs/code/deepagents_code/update_check.py:2495 — update_check.perform_upgrade has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FilesystemBackend._python_search (cyclomatic 25) · ×1
  • FilesystemBackend._python_search (cyclomatic 25) libs/deepagents/deepagents/backends/filesystem.py:1167 — FilesystemBackend._python_search has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FilesystemBackend.glob (cyclomatic 25) · ×1
  • FilesystemBackend.glob (cyclomatic 25) libs/deepagents/deepagents/backends/filesystem.py:1320 — FilesystemBackend.glob has cyclomatic complexity 25 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · DeepAgentsApp._set_rubric_model (cyclomatic 24) · ×1
  • DeepAgentsApp._set_rubric_model (cyclomatic 24) libs/code/deepagents_code/app.py:17367 — DeepAgentsApp._set_rubric_model has cyclomatic complexity 24 (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 · DeepAgentsApp.action_toggle_tool_output (cyclomatic 24) · ×1
  • DeepAgentsApp.action_toggle_tool_output (cyclomatic 24) libs/code/deepagents_code/app.py:24399 — DeepAgentsApp.action_toggle_tool_output 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.
D1 · Cyclomatic Complexity · DeepAgentsApp._resume_owned_thread (cyclomatic 24) · ×1
  • DeepAgentsApp._resume_owned_thread (cyclomatic 24) libs/code/deepagents_code/app.py:31312 — DeepAgentsApp._resume_owned_thread 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.
D1 · Cyclomatic Complexity · non_interactive._process_message_chunk (cyclomatic 24) · ×1
  • non_interactive._process_message_chunk (cyclomatic 24) libs/code/deepagents_code/client/non_interactive.py:912 — non_interactive._process_message_chunk 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.
D1 · Cyclomatic Complexity · service.managed_policy_violations (cyclomatic 24) · ×1
  • service.managed_policy_violations (cyclomatic 24) libs/code/deepagents_code/configuration/service.py:290 — service.managed_policy_violations 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.
D1 · Cyclomatic Complexity · model_config.load_mcp_server_trust_lists (cyclomatic 24) · ×1
  • model_config.load_mcp_server_trust_lists (cyclomatic 24) REDACTED:5676 — model_config.load_mcp_server_trust_lists has cyclomatic complexity 24 (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 · PluginManagerScreen.on_option_list_option_selected (cyclomatic 24) · ×1
  • PluginManagerScreen.on_option_list_option_selected (cyclomatic 24) libs/code/deepagents_code/tui/modals/plugin_manager/__init__.py:1030 — PluginManagerScreen.on_option_list_option_selected 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.
D1 · Cyclomatic Complexity · MessageData.to_widget (cyclomatic 24) · ×1
  • MessageData.to_widget (cyclomatic 24) libs/code/deepagents_code/tui/widgets/message_store.py:360 — MessageData.to_widget 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 · FilesystemBackend.ls (cyclomatic 24) · ×1
  • FilesystemBackend.ls (cyclomatic 24) libs/deepagents/deepagents/backends/filesystem.py:285 — FilesystemBackend.ls 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.
D1 · Cyclomatic Complexity · analyze.analyze_trial (cyclomatic 24) · ×1
  • analyze.analyze_trial (cyclomatic 24) libs/evals/scripts/analyze.py:254 — analyze.analyze_trial has cyclomatic complexity 24 (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 · _session_stats._record_message_usage (cyclomatic 23) · ×1
  • _session_stats._record_message_usage (cyclomatic 23) libs/code/deepagents_code/_session_stats.py:1062 — _session_stats._record_message_usage has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DeepAgentsApp._run_session_start_sequence (cyclomatic 23) · ×1
  • DeepAgentsApp._run_session_start_sequence (cyclomatic 23) libs/code/deepagents_code/app.py:11872 — DeepAgentsApp._run_session_start_sequence has cyclomatic complexity 23 (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 · DeepAgentsApp._apply_goal_application (cyclomatic 23) · ×1
  • DeepAgentsApp._apply_goal_application (cyclomatic 23) libs/code/deepagents_code/app.py:16632 — DeepAgentsApp._apply_goal_application has cyclomatic complexity 23 (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 · AutoModeHITLMiddleware._human_review (cyclomatic 23) · ×1
  • AutoModeHITLMiddleware._human_review (cyclomatic 23) libs/code/deepagents_code/auto_mode.py:3849 — AutoModeHITLMiddleware._human_review has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · auto_mode._user_answer_evidence (cyclomatic 23) · ×1
  • auto_mode._user_answer_evidence (cyclomatic 23) libs/code/deepagents_code/auto_mode.py:1533 — auto_mode._user_answer_evidence has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · mcp_tools._validate_server_config (cyclomatic 23) · ×1
  • mcp_tools._validate_server_config (cyclomatic 23) libs/code/deepagents_code/mcp_tools.py:415 — mcp_tools._validate_server_config has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · textual_adapter._format_rubric_details (cyclomatic 23) · ×1
  • textual_adapter._format_rubric_details (cyclomatic 23) REDACTED:739 — textual_adapter._format_rubric_details has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · agent._resolve_ptc_option (cyclomatic 22) · ×1
  • agent._resolve_ptc_option (cyclomatic 22) libs/code/deepagents_code/agent.py:987 — agent._resolve_ptc_option 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 · DeepAgentsApp._cleanup_agent_task (cyclomatic 22) · ×1
  • DeepAgentsApp._cleanup_agent_task (cyclomatic 22) libs/code/deepagents_code/app.py:20288 — DeepAgentsApp._cleanup_agent_task has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DeepAgentsApp._mount_message_unlocked (cyclomatic 22) · ×1
  • DeepAgentsApp._mount_message_unlocked (cyclomatic 22) libs/code/deepagents_code/app.py:21561 — DeepAgentsApp._mount_message_unlocked has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DeepAgentsApp.action_interrupt (cyclomatic 22) · ×1
  • DeepAgentsApp.action_interrupt (cyclomatic 22) libs/code/deepagents_code/app.py:22848 — DeepAgentsApp.action_interrupt has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Credentials._reload_values (cyclomatic 22) · ×1
  • Credentials._reload_values (cyclomatic 22) REDACTED:3796 — Credentials._reload_values 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 · ConfigOption.__post_init__ (cyclomatic 22) · ×1
  • ConfigOption.__post_init__ (cyclomatic 22) libs/code/deepagents_code/config_manifest.py:716 — ConfigOption.__post_init__ has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · managed_tools.ensure_ripgrep (cyclomatic 22) · ×1
  • managed_tools.ensure_ripgrep (cyclomatic 22) REDACTED:739 — managed_tools.ensure_ripgrep 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 · commands_cli.execute_plugin_command (cyclomatic 22) · ×1
  • commands_cli.execute_plugin_command (cyclomatic 22) libs/code/deepagents_code/plugins/commands_cli.py:101 — commands_cli.execute_plugin_command 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 · update_check.get_latest_version (cyclomatic 22) · ×1
  • update_check.get_latest_version (cyclomatic 22) libs/code/deepagents_code/update_check.py:682 — update_check.get_latest_version 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 · aggregate_evals.main (cyclomatic 22) · ×1
  • aggregate_evals.main (cyclomatic 22) .github/scripts/evals/aggregate_evals.py:119 — aggregate_evals.main 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 · aggregate_unified_compare.compare (cyclomatic 22) · ×1
  • aggregate_unified_compare.compare (cyclomatic 22) .github/scripts/evals/aggregate_unified_compare.py:518 — aggregate_unified_compare.compare 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 · ToolCallBuffer.parse_args (cyclomatic 21) · ×1
  • ToolCallBuffer.parse_args (cyclomatic 21) libs/code/deepagents_code/_tool_stream.py:622 — ToolCallBuffer.parse_args 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 · DeepAgentsApp._handle_server_offload (cyclomatic 21) · ×1
  • DeepAgentsApp._handle_server_offload (cyclomatic 21) libs/code/deepagents_code/app.py:18617 — DeepAgentsApp._handle_server_offload 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 · ServerHooksMiddleware._after_model (cyclomatic 21) · ×1
  • ServerHooksMiddleware._after_model (cyclomatic 21) libs/code/deepagents_code/hooks/server_middleware.py:601 — ServerHooksMiddleware._after_model 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 · ChatInput.on_text_area_changed (cyclomatic 21) · ×1
  • ChatInput.on_text_area_changed (cyclomatic 21) libs/code/deepagents_code/tui/widgets/chat_input.py:2752 — ChatInput.on_text_area_changed 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 · _ContextUsage.render (cyclomatic 21) · ×1
  • _ContextUsage.render (cyclomatic 21) libs/code/deepagents_code/tui/widgets/context_usage.py:40 — _ContextUsage.render 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 · FilesystemMiddleware.__init__ (cyclomatic 21) · ×1
  • FilesystemMiddleware.__init__ (cyclomatic 21) libs/deepagents/deepagents/middleware/filesystem.py:1891 — FilesystemMiddleware.__init__ 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 · cli._cmd_trials (cyclomatic 21) · ×1
  • cli._cmd_trials (cyclomatic 21) libs/evals/deepagents_evals/cli.py:393 — cli._cmd_trials 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 · raise_langchain_minimums._run (cyclomatic 21) · ×1
  • raise_langchain_minimums._run (cyclomatic 21) .github/scripts/checks/raise_langchain_minimums.py:628 — raise_langchain_minimums._run 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 · RepositoryBounds.apreflight (cyclomatic 20) · ×1
  • RepositoryBounds.apreflight (cyclomatic 20) libs/code/deepagents_code/_repository_bounds.py:340 — RepositoryBounds.apreflight 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 · DeepAgentsApp._handle_update_command (cyclomatic 20) · ×1
  • DeepAgentsApp._handle_update_command (cyclomatic 20) libs/code/deepagents_code/app.py:7295 — DeepAgentsApp._handle_update_command 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 · DeepAgentsApp._confirm_and_switch_model (cyclomatic 20) · ×1
  • DeepAgentsApp._confirm_and_switch_model (cyclomatic 20) libs/code/deepagents_code/app.py:25195 — DeepAgentsApp._confirm_and_switch_model 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 · ask_user._parse_answers (cyclomatic 20) · ×1
  • ask_user._parse_answers (cyclomatic 20) libs/code/deepagents_code/ask_user.py:117 — ask_user._parse_answers 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 · FileOpTracker.start_operation (cyclomatic 20) · ×1
  • FileOpTracker.start_operation (cyclomatic 20) libs/code/deepagents_code/file_ops.py:695 — FileOpTracker.start_operation 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 · file_ops.build_approval_preview (cyclomatic 20) · ×1
  • file_ops.build_approval_preview (cyclomatic 20) libs/code/deepagents_code/file_ops.py:523 — file_ops.build_approval_preview 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 · goal_state_notice.build_goal_state_notice (cyclomatic 20) · ×1
  • goal_state_notice.build_goal_state_notice (cyclomatic 20) libs/code/deepagents_code/goal_state_notice.py:639 — goal_state_notice.build_goal_state_notice has cyclomatic complexity 20 (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 · runner.run_command_handler (cyclomatic 20) · ×1
  • runner.run_command_handler (cyclomatic 20) libs/code/deepagents_code/hooks/runner.py:46 — runner.run_command_handler has cyclomatic complexity 20 (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 · main.apply_stdin_pipe (cyclomatic 20) · ×1
  • main.apply_stdin_pipe (cyclomatic 20) libs/code/deepagents_code/main.py:3750 — main.apply_stdin_pipe has cyclomatic complexity 20 (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 · model_api.model_metadata (cyclomatic 20) · ×1
  • model_api.model_metadata (cyclomatic 20) libs/code/deepagents_code/model_api.py:44 — model_api.model_metadata has cyclomatic complexity 20 (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 · offload_api.workspace (cyclomatic 20) · ×1
  • offload_api.workspace (cyclomatic 20) libs/code/deepagents_code/offload_api.py:242 — offload_api.workspace has cyclomatic complexity 20 (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 · discovery.auto_update_plugins (cyclomatic 20) · ×1
  • discovery.auto_update_plugins (cyclomatic 20) libs/code/deepagents_code/plugins/discovery.py:338 — discovery.auto_update_plugins 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 · history_profiles._validate_profile (cyclomatic 20) · ×1
  • history_profiles._validate_profile (cyclomatic 20) libs/talon/deepagents_talon/history_profiles.py:234 — history_profiles._validate_profile has cyclomatic complexity 20 (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.
D1 · Cyclomatic Complexity · aggregate_shards.main (cyclomatic 20) · ×1
  • aggregate_shards.main (cyclomatic 20) .github/scripts/evals/aggregate_shards.py:675 — aggregate_shards.main has cyclomatic complexity 20 (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 · aggregate_unified.render_markdown (cyclomatic 20) · ×1
  • aggregate_unified.render_markdown (cyclomatic 20) .github/scripts/evals/aggregate_unified.py:551 — aggregate_unified.render_markdown has cyclomatic complexity 20 (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 · build_release_notes.build_release_notes (cyclomatic 20) · ×1
  • build_release_notes.build_release_notes (cyclomatic 20) .github/scripts/release/build_release_notes.py:1673 — build_release_notes.build_release_notes has cyclomatic complexity 20 (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 · RepositoryBounds.preflight (cyclomatic 19) · ×1
  • RepositoryBounds.preflight (cyclomatic 19) libs/code/deepagents_code/_repository_bounds.py:274 — RepositoryBounds.preflight 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 · DeepAgentsApp._install_extra_unlocked (cyclomatic 19) · ×1
  • DeepAgentsApp._install_extra_unlocked (cyclomatic 19) libs/code/deepagents_code/app.py:8037 — DeepAgentsApp._install_extra_unlocked 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 · DeepAgentsApp._run_shell_task (cyclomatic 19) · ×1
  • DeepAgentsApp._run_shell_task (cyclomatic 19) libs/code/deepagents_code/app.py:13719 — DeepAgentsApp._run_shell_task 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 · DeepAgentsApp._handle_context_doctor_command (cyclomatic 19) · ×1
  • DeepAgentsApp._handle_context_doctor_command (cyclomatic 19) libs/code/deepagents_code/app.py:14433 — DeepAgentsApp._handle_context_doctor_command 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 · DeepAgentsApp._handle_goal_command (cyclomatic 19) · ×1
  • DeepAgentsApp._handle_goal_command (cyclomatic 19) libs/code/deepagents_code/app.py:15834 — DeepAgentsApp._handle_goal_command 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 · DeepAgentsApp.action_quit_or_interrupt (cyclomatic 19) · ×1
  • DeepAgentsApp.action_quit_or_interrupt (cyclomatic 19) libs/code/deepagents_code/app.py:22666 — DeepAgentsApp.action_quit_or_interrupt 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 · DeepAgentsApp._switch_model (cyclomatic 19) · ×1
  • DeepAgentsApp._switch_model (cyclomatic 19) libs/code/deepagents_code/app.py:31887 — DeepAgentsApp._switch_model 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 · RemoteAgent.astream (cyclomatic 19) · ×1
  • RemoteAgent.astream (cyclomatic 19) libs/code/deepagents_code/client/remote_client.py:793 — RemoteAgent.astream 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 · configurable_model._build_overrides (cyclomatic 19) · ×1
  • configurable_model._build_overrides (cyclomatic 19) libs/code/deepagents_code/configurable_model.py:379 — configurable_model._build_overrides 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 · resolver._merge (cyclomatic 19) · ×1
  • resolver._merge (cyclomatic 19) libs/code/deepagents_code/configuration/resolver.py:1113 — resolver._merge 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 · _ExpiryAwareOAuthClientProvider.async_auth_flow (cyclomatic 19) · ×1
  • _ExpiryAwareOAuthClientProvider.async_auth_flow (cyclomatic 19) REDACTED:1648 — _ExpiryAwareOAuthClientProvider.async_auth_flow 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 · marketplace.parse_marketplace_source (cyclomatic 19) · ×1
  • marketplace.parse_marketplace_source (cyclomatic 19) libs/code/deepagents_code/plugins/marketplace.py:142 — marketplace.parse_marketplace_source 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 · textual_adapter._handle_interrupt_cleanup (cyclomatic 19) · ×1
  • textual_adapter._handle_interrupt_cleanup (cyclomatic 19) REDACTED:4468 — textual_adapter._handle_interrupt_cleanup 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 · whatsapp._parse_message (cyclomatic 19) · ×1
  • whatsapp._parse_message (cyclomatic 19) REDACTED:839 — whatsapp._parse_message has cyclomatic complexity 19 (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.
D1 · Cyclomatic Complexity · id_compat.installMessageKeyCompatibility (cyclomatic 19) · ×1
  • id_compat.installMessageKeyCompatibility (cyclomatic 19) libs/talon/deepagents_talon/channels/whatsapp_bridge/id_compat.js:131 — id_compat.installMessageKeyCompatibility 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 · DeepAgentsApp._start_server_background (cyclomatic 18) · ×1
  • DeepAgentsApp._start_server_background (cyclomatic 18) libs/code/deepagents_code/app.py:6305 — DeepAgentsApp._start_server_background has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DeepAgentsApp._handle_version_command (cyclomatic 18) · ×1
  • DeepAgentsApp._handle_version_command (cyclomatic 18) libs/code/deepagents_code/app.py:8631 — DeepAgentsApp._handle_version_command 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 · DeepAgentsApp._generate_thread_name (cyclomatic 18) · ×1
  • DeepAgentsApp._generate_thread_name (cyclomatic 18) libs/code/deepagents_code/app.py:19297 — DeepAgentsApp._generate_thread_name 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 · DeepAgentsApp._confirm_then_resume_owned_cross_agent_thread (cyclomatic 18) · ×1
  • DeepAgentsApp._confirm_then_resume_owned_cross_agent_thread (cyclomatic 18) libs/code/deepagents_code/app.py:30176 — DeepAgentsApp._confirm_then_resume_owned_cross_agent_thread has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · app._extract_model_params_flag (cyclomatic 18) · ×1
  • app._extract_model_params_flag (cyclomatic 18) libs/code/deepagents_code/app.py:1949 — app._extract_model_params_flag 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 · _SessionCostRecorder._start (cyclomatic 18) · ×1
  • _SessionCostRecorder._start (cyclomatic 18) libs/code/deepagents_code/cost_tracking.py:2209 — _SessionCostRecorder._start has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SandboxConfig.load (cyclomatic 18) · ×1
  • SandboxConfig.load (cyclomatic 18) libs/code/deepagents_code/integrations/sandbox_config.py:111 — SandboxConfig.load has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · main.build_version_text (cyclomatic 18) · ×1
  • main.build_version_text (cyclomatic 18) libs/code/deepagents_code/main.py:123 — main.build_version_text 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 · ModelConfig._validate (cyclomatic 18) · ×1
  • ModelConfig._validate (cyclomatic 18) REDACTED:3585 — ModelConfig._validate 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 · model_config.get_provider_auth_status (cyclomatic 18) · ×1
  • model_config.get_provider_auth_status (cyclomatic 18) REDACTED:2642 — model_config.get_provider_auth_status 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 · model_config.add_enabled_project_mcp_servers (cyclomatic 18) · ×1
  • model_config.add_enabled_project_mcp_servers (cyclomatic 18) REDACTED:5942 — model_config.add_enabled_project_mcp_servers has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · marketplace._parse_plugin_source (cyclomatic 18) · ×1
  • marketplace._parse_plugin_source (cyclomatic 18) libs/code/deepagents_code/plugins/marketplace.py:686 — marketplace._parse_plugin_source has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _Visitor.__init__ (cyclomatic 18) · ×1
  • _Visitor.__init__ (cyclomatic 18) libs/code/scripts/check_process_cwd.py:257 — _Visitor.__init__ 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 · _messages_reducer._messages_delta_reducer (cyclomatic 18) · ×1
  • _messages_reducer._messages_delta_reducer (cyclomatic 18) libs/deepagents/deepagents/_messages_reducer.py:31 — _messages_reducer._messages_delta_reducer 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 · main.main (cyclomatic 18) · ×1
  • main.main (cyclomatic 18) libs/evals/harbor_adapters/drbench/main.py:111 — main.main 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 · extract_text._from_jsonl (cyclomatic 18) · ×1
  • extract_text._from_jsonl (cyclomatic 18) libs/evals/harbor_adapters/drbench/templates/extract_text.py:121 — extract_text._from_jsonl 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 · CronJobStore.edit_job (cyclomatic 18) · ×1
  • CronJobStore.edit_job (cyclomatic 18) libs/talon/deepagents_talon/cron/jobs.py:977 — CronJobStore.edit_job 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 · StoreConversationArchive.text_entries (cyclomatic 18) · ×1
  • StoreConversationArchive.text_entries (cyclomatic 18) libs/talon/deepagents_talon/store_archive.py:389 — StoreConversationArchive.text_entries 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 · aggregate_shards.render_step_summary (cyclomatic 18) · ×1
  • aggregate_shards.render_step_summary (cyclomatic 18) .github/scripts/evals/aggregate_shards.py:549 — aggregate_shards.render_step_summary 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 · agent._rubric_grader_repo_call_count (cyclomatic 17) · ×1
  • agent._rubric_grader_repo_call_count (cyclomatic 17) libs/code/deepagents_code/agent.py:459 — agent._rubric_grader_repo_call_count 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 · DeepAgentsApp._finish_pending_goal_rubric_review (cyclomatic 17) · ×1
  • DeepAgentsApp._finish_pending_goal_rubric_review (cyclomatic 17) libs/code/deepagents_code/app.py:16403 — DeepAgentsApp._finish_pending_goal_rubric_review 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 · DeepAgentsApp._prune_messages_unlocked (cyclomatic 17) · ×1
  • DeepAgentsApp._prune_messages_unlocked (cyclomatic 17) libs/code/deepagents_code/app.py:21778 — DeepAgentsApp._prune_messages_unlocked 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 · DeepAgentsApp.action_toggle_auto_approve (cyclomatic 17) · ×1
  • DeepAgentsApp.action_toggle_auto_approve (cyclomatic 17) libs/code/deepagents_code/app.py:23668 — DeepAgentsApp.action_toggle_auto_approve 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 · DeepAgentsApp._retry_startup_with_model (cyclomatic 17) · ×1
  • DeepAgentsApp._retry_startup_with_model (cyclomatic 17) libs/code/deepagents_code/app.py:32098 — DeepAgentsApp._retry_startup_with_model 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 · BtwOperation._resolve_context (cyclomatic 17) · ×1
  • BtwOperation._resolve_context (cyclomatic 17) libs/code/deepagents_code/btw.py:474 — BtwOperation._resolve_context 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 · inspect_sessions.main (cyclomatic 17) · ×1
  • inspect_sessions.main (cyclomatic 17) libs/code/deepagents_code/built_in_skills/deepagents-thread-inspector/scripts/inspect_sessions.py:616 — inspect_sessions.main 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 · auth._run_set (cyclomatic 17) · ×1
  • auth._run_set (cyclomatic 17) libs/code/deepagents_code/client/commands/auth.py:372 — auth._run_set 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 · config._dotenv_environment (cyclomatic 17) · ×1
  • config._dotenv_environment (cyclomatic 17) REDACTED:634 — config._dotenv_environment 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 · config._get_provider_kwargs (cyclomatic 17) · ×1
  • config._get_provider_kwargs (cyclomatic 17) REDACTED:5953 — config._get_provider_kwargs 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 · config_manifest._emit_ranked_diagnostics (cyclomatic 17) · ×1
  • config_manifest._emit_ranked_diagnostics (cyclomatic 17) libs/code/deepagents_code/config_manifest.py:1209 — config_manifest._emit_ranked_diagnostics 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 · main._ripgrep_install_hint (cyclomatic 17) · ×1
  • main._ripgrep_install_hint (cyclomatic 17) libs/code/deepagents_code/main.py:1790 — main._ripgrep_install_hint 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 · main._run_acp_cli_async (cyclomatic 17) · ×1
  • main._run_acp_cli_async (cyclomatic 17) libs/code/deepagents_code/main.py:3515 — main._run_acp_cli_async has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · main._select_trust_action (cyclomatic 17) · ×1
  • main._select_trust_action (cyclomatic 17) libs/code/deepagents_code/main.py:4274 — main._select_trust_action 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 · model_catalog.load_model_catalog (cyclomatic 17) · ×1
  • model_catalog.load_model_catalog (cyclomatic 17) libs/code/deepagents_code/model_catalog.py:172 — model_catalog.load_model_catalog 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 · CLICompactionMiddleware._summarization_for_runtime (cyclomatic 17) · ×1
  • CLICompactionMiddleware._summarization_for_runtime (cyclomatic 17) libs/code/deepagents_code/offload_middleware.py:1330 — CLICompactionMiddleware._summarization_for_runtime 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 · server_graph._make_graphs_in_environment (cyclomatic 17) · ×1
  • server_graph._make_graphs_in_environment (cyclomatic 17) libs/code/deepagents_code/server_graph.py:416 — server_graph._make_graphs_in_environment 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 · ModelSelectorScreen._format_option_label (cyclomatic 17) · ×1
  • ModelSelectorScreen._format_option_label (cyclomatic 17) libs/code/deepagents_code/tui/widgets/model_selector.py:1676 — ModelSelectorScreen._format_option_label 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 · thread_selector._format_column_value (cyclomatic 17) · ×1
  • thread_selector._format_column_value (cyclomatic 17) libs/code/deepagents_code/tui/widgets/thread_selector.py:307 — thread_selector._format_column_value 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 · CompositeBackend.grep (cyclomatic 17) · ×1
  • CompositeBackend.grep (cyclomatic 17) libs/deepagents/deepagents/backends/composite.py:459 — CompositeBackend.grep 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. This shape REPEATS in the file: one other method here (CompositeBackend.agrep) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · CompositeBackend.agrep (cyclomatic 17) · ×1
  • CompositeBackend.agrep (cyclomatic 17) libs/deepagents/deepagents/backends/composite.py:551 — CompositeBackend.agrep 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. This shape REPEATS in the file: one other method here (CompositeBackend.grep) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · ReadResult.__post_init__ (cyclomatic 17) · ×1
  • ReadResult.__post_init__ (cyclomatic 17) libs/deepagents/deepagents/backends/protocol.py:234 — ReadResult.__post_init__ 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 · cli._cmd_list (cyclomatic 17) · ×1
  • cli._cmd_list (cyclomatic 17) libs/evals/deepagents_evals/cli.py:190 — cli._cmd_list 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 · _SlackSdkGateway.thread_context (cyclomatic 17) · ×1
  • _SlackSdkGateway.thread_context (cyclomatic 17) libs/talon/deepagents_talon/channels/slack.py:527 — _SlackSdkGateway.thread_context 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 · mcp._remote_connection (cyclomatic 17) · ×1
  • mcp._remote_connection (cyclomatic 17) REDACTED:828 — mcp._remote_connection has cyclomatic complexity 17 (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.
D1 · Cyclomatic Complexity · check_release_deps._affected_extras (cyclomatic 17) · ×1
  • check_release_deps._affected_extras (cyclomatic 17) .github/scripts/release/check_release_deps.py:448 — check_release_deps._affected_extras 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 · _dep_floor_check._find_floor_violations (cyclomatic 16) · ×1
  • _dep_floor_check._find_floor_violations (cyclomatic 16) libs/code/deepagents_code/_dep_floor_check.py:112 — _dep_floor_check._find_floor_violations has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · _git.find_git_common_dir (cyclomatic 16) · ×1
  • _git.find_git_common_dir (cyclomatic 16) libs/code/deepagents_code/_git.py:276 — _git.find_git_common_dir has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ServerConfig.__post_init__ (cyclomatic 16) · ×1
  • ServerConfig.__post_init__ (cyclomatic 16) libs/code/deepagents_code/_server_config.py:748 — ServerConfig.__post_init__ has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DeepAgentsApp._request_approval (cyclomatic 16) · ×1
  • DeepAgentsApp._request_approval (cyclomatic 16) libs/code/deepagents_code/app.py:11015 — DeepAgentsApp._request_approval 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 · DeepAgentsApp._handle_rubric_command (cyclomatic 16) · ×1
  • DeepAgentsApp._handle_rubric_command (cyclomatic 16) libs/code/deepagents_code/app.py:16932 — DeepAgentsApp._handle_rubric_command 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 · DeepAgentsApp._set_rubric_max_iterations (cyclomatic 16) · ×1
  • DeepAgentsApp._set_rubric_max_iterations (cyclomatic 16) libs/code/deepagents_code/app.py:17281 — DeepAgentsApp._set_rubric_max_iterations 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 · DeepAgentsApp._move_transcript_window_to_tail (cyclomatic 16) · ×1
  • DeepAgentsApp._move_transcript_window_to_tail (cyclomatic 16) libs/code/deepagents_code/app.py:21688 — DeepAgentsApp._move_transcript_window_to_tail 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 · DeepAgentsApp._replace_server_after_cwd_switch (cyclomatic 16) · ×1
  • DeepAgentsApp._replace_server_after_cwd_switch (cyclomatic 16) libs/code/deepagents_code/app.py:30710 — DeepAgentsApp._replace_server_after_cwd_switch 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 · auto_mode._ask_user_exchange_rows (cyclomatic 16) · ×1
  • auto_mode._ask_user_exchange_rows (cyclomatic 16) libs/code/deepagents_code/auto_mode.py:1463 — auto_mode._ask_user_exchange_rows 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 · server._terminate_server_process (cyclomatic 16) · ×1
  • server._terminate_server_process (cyclomatic 16) libs/code/deepagents_code/client/launch/server.py:603 — server._terminate_server_process has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · config.detect_provider (cyclomatic 16) · ×1
  • config.detect_provider (cyclomatic 16) REDACTED:5575 — config.detect_provider has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · cost_tracking._read_override_source (cyclomatic 16) · ×1
  • cost_tracking._read_override_source (cyclomatic 16) libs/code/deepagents_code/cost_tracking.py:1020 — cost_tracking._read_override_source 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 · model_config.load_thread_config (cyclomatic 16) · ×1
  • model_config.load_thread_config (cyclomatic 16) REDACTED:6165 — model_config.load_thread_config has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · manifest.load_manifest (cyclomatic 16) · ×1
  • manifest.load_manifest (cyclomatic 16) libs/code/deepagents_code/plugins/manifest.py:256 — manifest.load_manifest 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 · store.cache_and_register_plugin (cyclomatic 16) · ×1
  • store.cache_and_register_plugin (cyclomatic 16) libs/code/deepagents_code/plugins/store.py:485 — store.cache_and_register_plugin 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 · subagents._parse_subagent_file (cyclomatic 16) · ×1
  • subagents._parse_subagent_file (cyclomatic 16) libs/code/deepagents_code/subagents.py:67 — subagents._parse_subagent_file has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PluginManagerScreen._current_options (cyclomatic 16) · ×1
  • PluginManagerScreen._current_options (cyclomatic 16) libs/code/deepagents_code/tui/modals/plugin_manager/__init__.py:323 — PluginManagerScreen._current_options 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 · diff._compose_diff_content (cyclomatic 16) · ×1
  • diff._compose_diff_content (cyclomatic 16) libs/code/deepagents_code/tui/widgets/diff.py:817 — diff._compose_diff_content 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 · ToolCallMessage._restore_deferred_state (cyclomatic 16) · ×1
  • ToolCallMessage._restore_deferred_state (cyclomatic 16) libs/code/deepagents_code/tui/widgets/messages.py:2172 — ToolCallMessage._restore_deferred_state 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 · ModelSelectorScreen._set_default (cyclomatic 16) · ×1
  • ModelSelectorScreen._set_default (cyclomatic 16) libs/code/deepagents_code/tui/widgets/model_selector.py:2297 — ModelSelectorScreen._set_default 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 · _skill_tools._find_skill_reads (cyclomatic 16) · ×1
  • _skill_tools._find_skill_reads (cyclomatic 16) libs/deepagents/deepagents/middleware/_skill_tools.py:271 — _skill_tools._find_skill_reads 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 · analyze.write_trial_analysis (cyclomatic 16) · ×1
  • analyze.write_trial_analysis (cyclomatic 16) libs/evals/scripts/analyze.py:683 — analyze.write_trial_analysis has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · analyze.main (cyclomatic 16) · ×1
  • analyze.main (cyclomatic 16) libs/evals/scripts/analyze.py:779 — analyze.main 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 · build_release_notes._latest_earlier_prerelease_tag (cyclomatic 16) · ×1
  • build_release_notes._latest_earlier_prerelease_tag (cyclomatic 16) .github/scripts/release/build_release_notes.py:277 — build_release_notes._latest_earlier_prerelease_tag 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 · textual_adapter.execute_task_textual (cognitive 1506) · ×1
  • textual_adapter.execute_task_textual (cognitive 1506) REDACTED:1797 — textual_adapter.execute_task_textual has cognitive complexity 1506 (threshold 15). Drivers by points: if/else 212 (942 pts), error handling 45 (211 pts), loops 31 (144 pts), ternaries 27 (131 pts), boolean chains 78 (nesting depth added 1113). 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.
D2 · Cognitive Complexity · main.cli_main (cognitive 304) · ×1
  • main.cli_main (cognitive 304) libs/code/deepagents_code/main.py:5335 — main.cli_main has cognitive complexity 304 (threshold 15). Drivers by points: if/else 115 (192 pts), boolean chains 44, error handling 21 (42 pts), ternaries 11 (24 pts), loops 1 (2 pts) (nesting depth added 112). To reduce it, split the body into named stages: move each independent 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 · agent.create_cli_agent (cognitive 156) · ×1
  • agent.create_cli_agent (cognitive 156) libs/code/deepagents_code/agent.py:2524 — agent.create_cli_agent has cognitive complexity 156 (threshold 15). Drivers by points: if/else 64 (89 pts), ternaries 19 (33 pts), boolean chains 30, loops 3 (4 pts) (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeepAgentsApp._handle_command (cognitive 152) · ×1
  • DeepAgentsApp._handle_command (cognitive 152) libs/code/deepagents_code/app.py:17494 — DeepAgentsApp._handle_command has cognitive complexity 152 (threshold 15). Drivers by points: if/else 37 (76 pts), ternaries 14 (36 pts), boolean chains 24, error handling 5 (14 pts), loops 1 (2 pts) (nesting depth added 71). 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.
D2 · Cognitive Complexity · graph.create_deep_agent (cognitive 106) · ×1
  • graph.create_deep_agent (cognitive 106) libs/deepagents/deepagents/graph.py:278 — graph.create_deep_agent has cognitive complexity 106 (threshold 15). Drivers by points: if/else 39 (70 pts), ternaries 9 (20 pts), boolean chains 14, loops 2 (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeepAgentsApp._convert_messages_to_data (cognitive 103) · ×1
  • DeepAgentsApp._convert_messages_to_data (cognitive 103) libs/code/deepagents_code/app.py:20452 — DeepAgentsApp._convert_messages_to_data has cognitive complexity 103 (threshold 15). Drivers by points: if/else 25 (68 pts), ternaries 4 (15 pts), loops 6 (13 pts), boolean chains 7 (nesting depth added 61). 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.
D2 · Cognitive Complexity · AgentServerACP._handle_interrupts (cognitive 98) · ×1
  • AgentServerACP._handle_interrupts (cognitive 98) libs/acp/deepagents_acp/server.py:1165 — AgentServerACP._handle_interrupts has cognitive complexity 98 (threshold 15). Drivers by points: if/else 16 (59 pts), ternaries 4 (18 pts), boolean chains 11, loops 3 (10 pts) (nesting depth added 64). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AgentServerACP.prompt (cognitive 93) · ×1
  • AgentServerACP.prompt (cognitive 93) libs/acp/deepagents_acp/server.py:948 — AgentServerACP.prompt has cognitive complexity 93 (threshold 15). Drivers by points: if/else 20 (65 pts), loops 6 (18 pts), boolean chains 8, ternaries 1 (2 pts) (nesting depth added 58). 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.
D2 · Cognitive Complexity · DeepAgentsApp._run_agent_task (cognitive 84) · ×1
  • DeepAgentsApp._run_agent_task (cognitive 84) libs/code/deepagents_code/app.py:19801 — DeepAgentsApp._run_agent_task has cognitive complexity 84 (threshold 15). Drivers by points: if/else 28 (46 pts), boolean chains 21, error handling 7 (12 pts), ternaries 3 (5 pts) (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.
D2 · Cognitive Complexity · mcp_tools.resolve_and_load_mcp_tools (cognitive 80) · ×1
  • mcp_tools.resolve_and_load_mcp_tools (cognitive 80) libs/code/deepagents_code/mcp_tools.py:2565 — mcp_tools.resolve_and_load_mcp_tools has cognitive complexity 80 (threshold 15). Drivers by points: if/else 26 (50 pts), loops 7 (12 pts), ternaries 3 (7 pts), error handling 4 (6 pts), boolean chains 5 (nesting depth added 35). To reduce it, split the body into named stages: move each independent 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 · ModelSelectorScreen._update_display (cognitive 77) · ×1
  • ModelSelectorScreen._update_display (cognitive 77) libs/code/deepagents_code/tui/widgets/model_selector.py:1310 — ModelSelectorScreen._update_display has cognitive complexity 77 (threshold 15). Drivers by points: if/else 25 (44 pts), ternaries 6 (19 pts), boolean chains 7, loops 5 (7 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.
D2 · Cognitive Complexity · model_config._discover_available_models (cognitive 74) · ×1
  • model_config._discover_available_models (cognitive 74) REDACTED:1562 — model_config._discover_available_models has cognitive complexity 74 (threshold 15). Drivers by points: if/else 21 (49 pts), error handling 4 (12 pts), loops 4 (8 pts), boolean chains 5 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · non_interactive._process_stream_chunk (cognitive 73) · ×1
  • non_interactive._process_stream_chunk (cognitive 73) libs/code/deepagents_code/client/non_interactive.py:1551 — non_interactive._process_stream_chunk has cognitive complexity 73 (threshold 15). Drivers by points: if/else 20 (47 pts), ternaries 5 (15 pts), boolean chains 11 (nesting depth added 37). 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.
D2 · Cognitive Complexity · config.create_model (cognitive 72) · ×1
  • config.create_model (cognitive 72) REDACTED:6767 — config.create_model has cognitive complexity 72 (threshold 15). Drivers by points: if/else 29 (39 pts), boolean chains 12, error handling 6 (11 pts), ternaries 5 (9 pts), loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AutoModeHITLMiddleware.awrap_model_call (cognitive 68) · ×1
  • AutoModeHITLMiddleware.awrap_model_call (cognitive 68) libs/code/deepagents_code/auto_mode.py:3215 — AutoModeHITLMiddleware.awrap_model_call has cognitive complexity 68 (threshold 15). Drivers by points: if/else 26 (39 pts), loops 7 (12 pts), boolean chains 10, ternaries 3 (5 pts), error handling 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeepAgentsApp._restart_server_for_owned_agent_swap (cognitive 67) · ×1
  • DeepAgentsApp._restart_server_for_owned_agent_swap (cognitive 67) libs/code/deepagents_code/app.py:25897 — DeepAgentsApp._restart_server_for_owned_agent_swap has cognitive complexity 67 (threshold 15). Drivers by points: if/else 28 (36 pts), error handling 10 (16 pts), boolean chains 8, ternaries 5 (6 pts), loops 1 (nesting depth added 15). 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 · DeepAgentsApp._run_reload_unlocked (cognitive 65) · ×1
  • DeepAgentsApp._run_reload_unlocked (cognitive 65) libs/code/deepagents_code/app.py:18236 — DeepAgentsApp._run_reload_unlocked has cognitive complexity 65 (threshold 15). Drivers by points: if/else 28 (40 pts), ternaries 6 (11 pts), error handling 5 (6 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · non_interactive._process_ai_message (cognitive 64) · ×1
  • non_interactive._process_ai_message (cognitive 64) libs/code/deepagents_code/client/non_interactive.py:781 — non_interactive._process_ai_message has cognitive complexity 64 (threshold 15). Drivers by points: if/else 16 (57 pts), boolean chains 6, loops 1 (nesting depth added 41). 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.
D2 · Cognitive Complexity · analyze.print_summary (cognitive 63) · ×1
  • analyze.print_summary (cognitive 63) libs/evals/scripts/analyze.py:385 — analyze.print_summary has cognitive complexity 63 (threshold 15). Drivers by points: if/else 23 (38 pts), loops 6 (11 pts), ternaries 3 (9 pts), error handling 1 (3 pts), boolean chains 2 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · non_interactive._run_agent_loop (cognitive 62) · ×1
  • non_interactive._run_agent_loop (cognitive 62) libs/code/deepagents_code/client/non_interactive.py:2121 — non_interactive._run_agent_loop has cognitive complexity 62 (threshold 15). Drivers by points: if/else 23 (31 pts), boolean chains 13, ternaries 7 (9 pts), error handling 6, loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AutoModeHITLMiddleware.aafter_model (cognitive 60) · ×1
  • AutoModeHITLMiddleware.aafter_model (cognitive 60) libs/code/deepagents_code/auto_mode.py:4096 — AutoModeHITLMiddleware.aafter_model has cognitive complexity 60 (threshold 15). Drivers by points: if/else 25 (32 pts), ternaries 8 (15 pts), boolean chains 12, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mcp_login_service.resolve_mcp_config (cognitive 60) · ×1
  • mcp_login_service.resolve_mcp_config (cognitive 60) libs/code/deepagents_code/mcp_login_service.py:197 — mcp_login_service.resolve_mcp_config has cognitive complexity 60 (threshold 15). Drivers by points: if/else 18 (43 pts), loops 5 (12 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 33). 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.
D2 · Cognitive Complexity · model_config.get_model_profiles (cognitive 60) · ×1
  • model_config.get_model_profiles (cognitive 60) REDACTED:1794 — model_config.get_model_profiles has cognitive complexity 60 (threshold 15). Drivers by points: if/else 14 (26 pts), loops 6 (13 pts), error handling 4 (12 pts), boolean chains 5, ternaries 1 (4 pts) (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.
D2 · Cognitive Complexity · DeepAgentsApp._sync_goal_rubric_state_from_thread (cognitive 56) · ×1
  • DeepAgentsApp._sync_goal_rubric_state_from_thread (cognitive 56) libs/code/deepagents_code/app.py:15520 — DeepAgentsApp._sync_goal_rubric_state_from_thread has cognitive complexity 56 (threshold 15). Drivers by points: if/else 24 (40 pts), boolean chains 12, error handling 1 (2 pts), loops 1, ternaries 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 · sessions.list_threads_command (cognitive 56) · ×1
  • sessions.list_threads_command (cognitive 56) libs/code/deepagents_code/sessions.py:2180 — sessions.list_threads_command has cognitive complexity 56 (threshold 15). Drivers by points: if/else 22 (35 pts), ternaries 8 (15 pts), boolean chains 5, loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CostTrackingMiddleware._charge (cognitive 55) · ×1
  • CostTrackingMiddleware._charge (cognitive 55) libs/code/deepagents_code/cost_tracking.py:3054 — CostTrackingMiddleware._charge has cognitive complexity 55 (threshold 15). Drivers by points: if/else 18 (30 pts), boolean chains 14, ternaries 5 (8 pts), loops 2, error handling 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.
D2 · Cognitive Complexity · app._format_mcp_server_changes (cognitive 54) · ×1
  • app._format_mcp_server_changes (cognitive 54) libs/code/deepagents_code/app.py:859 — app._format_mcp_server_changes has cognitive complexity 54 (threshold 15). Drivers by points: if/else 32 (39 pts), boolean chains 11, loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 9). 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 · tool_display.format_tool_display (cognitive 54) · ×1
  • tool_display.format_tool_display (cognitive 54) libs/code/deepagents_code/tool_display.py:164 — tool_display.format_tool_display has cognitive complexity 54 (threshold 15). Drivers by points: if/else 19 (43 pts), ternaries 2 (6 pts), boolean chains 5 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · providers.coerce_toml_value (cognitive 53) · ×1
  • providers.coerce_toml_value (cognitive 53) libs/code/deepagents_code/configuration/providers.py:268 — providers.coerce_toml_value has cognitive complexity 53 (threshold 15). Drivers by points: if/else 17 (32 pts), boolean chains 9, error handling 4 (9 pts), ternaries 1 (3 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · bridge.handle (cognitive 53) · ×1
  • bridge.handle (cognitive 53) libs/talon/deepagents_talon/channels/whatsapp_bridge/bridge.js:581 — bridge.handle has cognitive complexity 53 (threshold 15). Drivers by points: if/else 18 (28 pts), boolean chains 24, error handling 1 (nesting depth added 10). Of this number, 52 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent 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 · DeepAgentsApp.__init__ (cognitive 52) · ×1
  • DeepAgentsApp.__init__ (cognitive 52) libs/code/deepagents_code/app.py:3390 — DeepAgentsApp.__init__ has cognitive complexity 52 (threshold 15). Drivers by points: boolean chains 23, if/else 18 (20 pts), ternaries 8 (9 pts) (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 · FileOpTracker.complete_with_message (cognitive 52) · ×1
  • FileOpTracker.complete_with_message (cognitive 52) libs/code/deepagents_code/file_ops.py:805 — FileOpTracker.complete_with_message has cognitive complexity 52 (threshold 15). Drivers by points: if/else 19 (37 pts), boolean chains 11, loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · build_release_notes.collect_contributors (cognitive 52) · ×1
  • build_release_notes.collect_contributors (cognitive 52) .github/scripts/release/build_release_notes.py:981 — build_release_notes.collect_contributors has cognitive complexity 52 (threshold 15). Drivers by points: if/else 20 (35 pts), boolean chains 10, ternaries 3 (5 pts), loops 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · non_interactive.run_non_interactive (cognitive 50) · ×1
  • non_interactive.run_non_interactive (cognitive 50) libs/code/deepagents_code/client/non_interactive.py:2795 — non_interactive.run_non_interactive has cognitive complexity 50 (threshold 15). Drivers by points: if/else 16 (21 pts), error handling 10 (12 pts), boolean chains 9, ternaries 5 (8 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FilesystemBackend._python_search (cognitive 50) · ×1
  • FilesystemBackend._python_search (cognitive 50) libs/deepagents/deepagents/backends/filesystem.py:1167 — FilesystemBackend._python_search has cognitive complexity 50 (threshold 15). Drivers by points: if/else 12 (27 pts), error handling 7 (15 pts), boolean chains 3, loops 2 (3 pts), ternaries 2 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FilesystemBackend.ls (cognitive 49) · ×1
  • FilesystemBackend.ls (cognitive 49) libs/deepagents/deepagents/backends/filesystem.py:285 — FilesystemBackend.ls has cognitive complexity 49 (threshold 15). Drivers by points: error handling 10 (29 pts), if/else 9 (17 pts), boolean chains 1, loops 1, ternaries 1 (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 · aggregate_unified_compare.compare (cognitive 49) · ×1
  • aggregate_unified_compare.compare (cognitive 49) .github/scripts/evals/aggregate_unified_compare.py:518 — aggregate_unified_compare.compare has cognitive complexity 49 (threshold 15). Drivers by points: if/else 10 (32 pts), loops 8 (14 pts), boolean chains 3 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeepAgentsApp._format_cost_summary (cognitive 46) · ×1
  • DeepAgentsApp._format_cost_summary (cognitive 46) libs/code/deepagents_code/app.py:9260 — DeepAgentsApp._format_cost_summary has cognitive complexity 46 (threshold 15). Drivers by points: if/else 16 (22 pts), boolean chains 10, ternaries 5 (10 pts), loops 2 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · service.managed_policy_violations (cognitive 46) · ×1
  • service.managed_policy_violations (cognitive 46) libs/code/deepagents_code/configuration/service.py:290 — service.managed_policy_violations has cognitive complexity 46 (threshold 15). Drivers by points: if/else 12 (31 pts), boolean chains 8, loops 2 (5 pts), ternaries 1 (2 pts) (nesting depth added 23). 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.
D2 · Cognitive Complexity · main._run_startup_auto_update (cognitive 46) · ×1
  • main._run_startup_auto_update (cognitive 46) libs/code/deepagents_code/main.py:564 — main._run_startup_auto_update has cognitive complexity 46 (threshold 15). Drivers by points: if/else 19 (26 pts), ternaries 7 (11 pts), error handling 4 (6 pts), boolean chains 3 (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 · theme._load_user_themes (cognitive 46) · ×1
  • theme._load_user_themes (cognitive 46) libs/code/deepagents_code/theme.py:517 — theme._load_user_themes has cognitive complexity 46 (threshold 15). Drivers by points: if/else 17 (31 pts), error handling 3 (7 pts), loops 2 (3 pts), ternaries 2 (3 pts), boolean chains 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FilesystemBackend.glob (cognitive 46) · ×1
  • FilesystemBackend.glob (cognitive 46) libs/deepagents/deepagents/backends/filesystem.py:1320 — FilesystemBackend.glob has cognitive complexity 46 (threshold 15). Drivers by points: error handling 10 (22 pts), if/else 7 (12 pts), ternaries 5 (9 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · generate_radar.main (cognitive 46) · ×1
  • generate_radar.main (cognitive 46) libs/evals/scripts/generate_radar.py:119 — generate_radar.main has cognitive complexity 46 (threshold 15). Drivers by points: error handling 8 (18 pts), if/else 12 (18 pts), loops 3 (5 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · providers.coerce_environment_value (cognitive 45) · ×1
  • providers.coerce_environment_value (cognitive 45) libs/code/deepagents_code/configuration/providers.py:138 — providers.coerce_environment_value has cognitive complexity 45 (threshold 15). Drivers by points: if/else 26 (35 pts), error handling 5 (10 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 · commands_cli.execute_plugin_command (cognitive 45) · ×1
  • commands_cli.execute_plugin_command (cognitive 45) libs/code/deepagents_code/plugins/commands_cli.py:101 — commands_cli.execute_plugin_command has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (22 pts), ternaries 4 (13 pts), error handling 3 (7 pts), loops 1 (3 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.
D2 · Cognitive Complexity · WelcomeBanner._build_banner (cognitive 44) · ×1
  • WelcomeBanner._build_banner (cognitive 44) libs/code/deepagents_code/tui/widgets/welcome.py:445 — WelcomeBanner._build_banner has cognitive complexity 44 (threshold 15). Drivers by points: if/else 18 (21 pts), ternaries 10 (17 pts), boolean chains 4, loops 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.
D2 · Cognitive Complexity · agent._resolve_ptc_option (cognitive 43) · ×1
  • agent._resolve_ptc_option (cognitive 43) libs/code/deepagents_code/agent.py:987 — agent._resolve_ptc_option has cognitive complexity 43 (threshold 15). Drivers by points: if/else 16 (34 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · aggregate_evals.main (cognitive 43) · ×1
  • aggregate_evals.main (cognitive 43) .github/scripts/evals/aggregate_evals.py:119 — aggregate_evals.main has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (27 pts), loops 5 (11 pts), boolean chains 5 (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.
D2 · Cognitive Complexity · unified_prep.main (cognitive 43) · ×1
  • unified_prep.main (cognitive 43) .github/scripts/evals/unified_prep.py:527 — unified_prep.main has cognitive complexity 43 (threshold 15). Drivers by points: if/else 21 (29 pts), loops 4 (7 pts), boolean chains 3, ternaries 2 (3 pts), error handling 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 · non_interactive._process_message_chunk (cognitive 42) · ×1
  • non_interactive._process_message_chunk (cognitive 42) libs/code/deepagents_code/client/non_interactive.py:912 — non_interactive._process_message_chunk has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (27 pts), ternaries 4 (9 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeepAgentsApp.action_toggle_tool_output (cognitive 41) · ×1
  • DeepAgentsApp.action_toggle_tool_output (cognitive 41) libs/code/deepagents_code/app.py:24399 — DeepAgentsApp.action_toggle_tool_output has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (28 pts), boolean chains 7, error handling 2 (3 pts), loops 2 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · non_interactive._process_rubric_event (cognitive 41) · ×1
  • non_interactive._process_rubric_event (cognitive 41) libs/code/deepagents_code/client/non_interactive.py:1064 — non_interactive._process_rubric_event has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 8 (20 pts), if/else 8 (13 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · commands._list (cognitive 41) · ×1
  • commands._list (cognitive 41) libs/code/deepagents_code/skills/commands.py:147 — commands._list has cognitive complexity 41 (threshold 15). Drivers by points: if/else 17 (28 pts), boolean chains 7, loops 3 (6 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 · ChatTextArea._on_key (cognitive 41) · ×1
  • ChatTextArea._on_key (cognitive 41) libs/code/deepagents_code/tui/widgets/chat_input.py:1239 — ChatTextArea._on_key has cognitive complexity 41 (threshold 15). Drivers by points: if/else 21 (30 pts), boolean chains 11 (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 · ask_user._parse_answers (cognitive 40) · ×1
  • ask_user._parse_answers (cognitive 40) libs/code/deepagents_code/ask_user.py:117 — ask_user._parse_answers has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (34 pts), boolean chains 3, match/switch 1 (2 pts), ternaries 1 (nesting depth added 19). 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.
D2 · Cognitive Complexity · cost_tracking._estimate_cost (cognitive 40) · ×1
  • cost_tracking._estimate_cost (cognitive 40) libs/code/deepagents_code/cost_tracking.py:1687 — cost_tracking._estimate_cost has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 15, ternaries 4, error handling 3 (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 · commands._delete (cognitive 40) · ×1
  • commands._delete (cognitive 40) libs/code/deepagents_code/skills/commands.py:671 — commands._delete has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (24 pts), ternaries 4 (8 pts), error handling 3 (5 pts), loops 1 (2 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 · PluginManagerScreen._refresh_view (cognitive 40) · ×1
  • PluginManagerScreen._refresh_view (cognitive 40) libs/code/deepagents_code/tui/modals/plugin_manager/__init__.py:451 — PluginManagerScreen._refresh_view has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 7, ternaries 3 (6 pts), error handling 1 (4 pts), loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · analyze.main (cognitive 40) · ×1
  • analyze.main (cognitive 40) libs/evals/scripts/analyze.py:779 — analyze.main has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (22 pts), ternaries 3 (9 pts), error handling 1 (4 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · aggregate_unified.read_leaf (cognitive 40) · ×1
  • aggregate_unified.read_leaf (cognitive 40) .github/scripts/evals/aggregate_unified.py:147 — aggregate_unified.read_leaf has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 16, loops 1 (2 pts), error handling 1, ternaries 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · aggregate_unified.combine (cognitive 40) · ×1
  • aggregate_unified.combine (cognitive 40) .github/scripts/evals/aggregate_unified.py:379 — aggregate_unified.combine has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 10, ternaries 3 (7 pts), loops 4 (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 · DeepAgentsApp._load_thread_history (cognitive 39) · ×1
  • DeepAgentsApp._load_thread_history (cognitive 39) libs/code/deepagents_code/app.py:21041 — DeepAgentsApp._load_thread_history has cognitive complexity 39 (threshold 15). Drivers by points: if/else 17 (22 pts), error handling 5 (7 pts), boolean chains 4, loops 3 (4 pts), ternaries 2 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · bridge.enqueueMessage (cognitive 39) · ×1
  • bridge.enqueueMessage (cognitive 39) libs/talon/deepagents_talon/channels/whatsapp_bridge/bridge.js:187 — bridge.enqueueMessage has cognitive complexity 39 (threshold 15). Drivers by points: boolean chains 30, if/else 5, ternaries 4. 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.
D2 · Cognitive Complexity · auto_mode._user_answer_evidence (cognitive 38) · ×1
  • auto_mode._user_answer_evidence (cognitive 38) libs/code/deepagents_code/auto_mode.py:1533 — auto_mode._user_answer_evidence has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 5 (8 pts), boolean chains 5 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · config._get_provider_kwargs (cognitive 38) · ×1
  • config._get_provider_kwargs (cognitive 38) REDACTED:5953 — config._get_provider_kwargs has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (23 pts), ternaries 3 (11 pts), boolean chains 4 (nesting depth added 20). 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.
D2 · Cognitive Complexity · ServerHooksMiddleware._after_model (cognitive 38) · ×1
  • ServerHooksMiddleware._after_model (cognitive 38) libs/code/deepagents_code/hooks/server_middleware.py:601 — ServerHooksMiddleware._after_model has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (20 pts), ternaries 3 (11 pts), boolean chains 6, loops 1 (nesting depth added 18). 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.
D2 · Cognitive Complexity · mcp_tools._validate_server_config (cognitive 38) · ×1
  • mcp_tools._validate_server_config (cognitive 38) libs/code/deepagents_code/mcp_tools.py:415 — mcp_tools._validate_server_config has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (31 pts), boolean chains 4, loops 1 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · discovery.auto_update_plugins (cognitive 38) · ×1
  • discovery.auto_update_plugins (cognitive 38) libs/code/deepagents_code/plugins/discovery.py:338 — discovery.auto_update_plugins has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (21 pts), error handling 4 (9 pts), boolean chains 3, loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AuthPromptScreen.compose (cognitive 38) · ×1
  • AuthPromptScreen.compose (cognitive 38) libs/code/deepagents_code/tui/widgets/auth.py:757 — AuthPromptScreen.compose has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (19 pts), ternaries 8 (12 pts), boolean chains 7 (nesting depth added 6). 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 · DeepAgentsApp._resolve_resume_thread (cognitive 37) · ×1
  • DeepAgentsApp._resolve_resume_thread (cognitive 37) libs/code/deepagents_code/app.py:6110 — DeepAgentsApp._resolve_resume_thread has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 5, error handling 5, ternaries 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeepAgentsApp._resume_owned_thread (cognitive 37) · ×1
  • DeepAgentsApp._resume_owned_thread (cognitive 37) libs/code/deepagents_code/app.py:31312 — DeepAgentsApp._resume_owned_thread has cognitive complexity 37 (threshold 15). Drivers by points: if/else 21 (33 pts), error handling 3 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeepAgentsApp._offer_thread_cwd_switch (cognitive 36) · ×1
  • DeepAgentsApp._offer_thread_cwd_switch (cognitive 36) libs/code/deepagents_code/app.py:31114 — DeepAgentsApp._offer_thread_cwd_switch has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 6, ternaries 3 (4 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 · AutoModeHITLMiddleware._validated_plan (cognitive 36) · ×1
  • AutoModeHITLMiddleware._validated_plan (cognitive 36) libs/code/deepagents_code/auto_mode.py:3992 — AutoModeHITLMiddleware._validated_plan has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17 (19 pts), boolean chains 16, 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.
D2 · Cognitive Complexity · quick_validate.validate_skill (cognitive 36) · ×1
  • quick_validate.validate_skill (cognitive 36) libs/code/deepagents_code/built_in_skills/skill-creator/scripts/quick_validate.py:20 — quick_validate.validate_skill has cognitive complexity 36 (threshold 15). Drivers by points: if/else 20 (29 pts), boolean chains 4, loops 1 (2 pts), error handling 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 · resolver._merge (cognitive 36) · ×1
  • resolver._merge (cognitive 36) libs/code/deepagents_code/configuration/resolver.py:1113 — resolver._merge has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (24 pts), boolean chains 6, loops 3 (6 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.
D2 · Cognitive Complexity · main._check_mcp_project_trust (cognitive 35) · ×1
  • main._check_mcp_project_trust (cognitive 35) libs/code/deepagents_code/main.py:4651 — main._check_mcp_project_trust has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (21 pts), boolean chains 6, ternaries 4 (5 pts), loops 2, error handling 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.
D2 · Cognitive Complexity · cli._cmd_list (cognitive 35) · ×1
  • cli._cmd_list (cognitive 35) libs/evals/deepagents_evals/cli.py:190 — cli._cmd_list has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (31 pts), error handling 2 (4 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeepAgentsApp._handle_context_doctor_command (cognitive 34) · ×1
  • DeepAgentsApp._handle_context_doctor_command (cognitive 34) libs/code/deepagents_code/app.py:14433 — DeepAgentsApp._handle_context_doctor_command has cognitive complexity 34 (threshold 15). Drivers by points: error handling 7 (14 pts), if/else 5 (10 pts), boolean chains 4, ternaries 2 (4 pts), loops 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeepAgentsApp.exit (cognitive 34) · ×1
  • DeepAgentsApp.exit (cognitive 34) libs/code/deepagents_code/app.py:23093 — DeepAgentsApp.exit has cognitive complexity 34 (threshold 15). Drivers by points: if/else 18 (23 pts), boolean chains 7, loops 2, error handling 1, ternaries 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · FileOpTracker.start_operation (cognitive 34) · ×1
  • FileOpTracker.start_operation (cognitive 34) libs/code/deepagents_code/file_ops.py:695 — FileOpTracker.start_operation has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 9, error handling 3 (9 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 · analyze.analyze_trial (cognitive 34) · ×1
  • analyze.analyze_trial (cognitive 34) libs/evals/scripts/analyze.py:254 — analyze.analyze_trial has cognitive complexity 34 (threshold 15). Drivers by points: error handling 4 (12 pts), if/else 10 (12 pts), ternaries 6 (7 pts), boolean chains 3 (nesting depth added 11). 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 · raise_langchain_minimums._run (cognitive 33) · ×1
  • raise_langchain_minimums._run (cognitive 33) .github/scripts/checks/raise_langchain_minimums.py:628 — raise_langchain_minimums._run has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (26 pts), boolean chains 2, error handling 1 (2 pts), loops 2, ternaries 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · model_config.get_provider_auth_status (cognitive 32) · ×1
  • model_config.get_provider_auth_status (cognitive 32) REDACTED:2642 — model_config.get_provider_auth_status has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (30 pts), ternaries 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · update_check.release_prerelease_pins (cognitive 32) · ×1
  • update_check.release_prerelease_pins (cognitive 32) libs/code/deepagents_code/update_check.py:795 — update_check.release_prerelease_pins has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (22 pts), loops 1 (5 pts), error handling 3, boolean chains 1, ternaries 1 (nesting depth added 19). 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.
D2 · Cognitive Complexity · update_check.perform_upgrade (cognitive 32) · ×1
  • update_check.perform_upgrade (cognitive 32) libs/code/deepagents_code/update_check.py:2495 — update_check.perform_upgrade has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 7, error handling 2 (3 pts), ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _session_stats.record_message_usage (cognitive 31) · ×1
  • _session_stats.record_message_usage (cognitive 31) libs/code/deepagents_code/_session_stats.py:934 — _session_stats.record_message_usage has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 9 (13 pts), boolean chains 9, if/else 6 (7 pts), loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeepAgentsApp._request_approval (cognitive 31) · ×1
  • DeepAgentsApp._request_approval (cognitive 31) libs/code/deepagents_code/app.py:11015 — DeepAgentsApp._request_approval has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 3 (7 pts), error handling 2 (5 pts), boolean chains 4 (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 · DeepAgentsApp._prune_messages_unlocked (cognitive 31) · ×1
  • DeepAgentsApp._prune_messages_unlocked (cognitive 31) libs/code/deepagents_code/app.py:21778 — DeepAgentsApp._prune_messages_unlocked has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (19 pts), error handling 3 (8 pts), loops 2 (3 pts), ternaries 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AutoModeHITLMiddleware._human_review (cognitive 31) · ×1
  • AutoModeHITLMiddleware._human_review (cognitive 31) libs/code/deepagents_code/auto_mode.py:3849 — AutoModeHITLMiddleware._human_review has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 6, loops 3 (4 pts), error handling 2, ternaries 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.
D2 · Cognitive Complexity · input._resolve_with_unicode_space_variants (cognitive 31) · ×1
  • input._resolve_with_unicode_space_variants (cognitive 31) libs/code/deepagents_code/input.py:1073 — input._resolve_with_unicode_space_variants has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (27 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.build_version_text (cognitive 31) · ×1
  • main.build_version_text (cognitive 31) libs/code/deepagents_code/main.py:123 — main.build_version_text has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 3 (10 pts), error handling 4 (5 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.run_textual_cli_async (cognitive 31) · ×1
  • main.run_textual_cli_async (cognitive 31) libs/code/deepagents_code/main.py:3167 — main.run_textual_cli_async has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 8, error handling 3, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ExpiryAwareOAuthClientProvider.async_auth_flow (cognitive 31) · ×1
  • _ExpiryAwareOAuthClientProvider.async_auth_flow (cognitive 31) REDACTED:1648 — _ExpiryAwareOAuthClientProvider.async_auth_flow has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 3 (5 pts), boolean chains 3, error handling 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli._cmd_trials (cognitive 31) · ×1
  • cli._cmd_trials (cognitive 31) libs/evals/deepagents_evals/cli.py:393 — cli._cmd_trials has cognitive complexity 31 (threshold 15). Drivers by points: if/else 18 (25 pts), boolean chains 4, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · app._extract_model_params_flag (cognitive 30) · ×1
  • app._extract_model_params_flag (cognitive 30) libs/code/deepagents_code/app.py:1949 — app._extract_model_params_flag has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 2 (4 pts), ternaries 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Credentials._reload_values (cognitive 30) · ×1
  • Credentials._reload_values (cognitive 30) REDACTED:3796 — Credentials._reload_values has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 6, error handling 4, ternaries 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PluginManagerScreen.on_option_list_option_selected (cognitive 30) · ×1
  • PluginManagerScreen.on_option_list_option_selected (cognitive 30) libs/code/deepagents_code/tui/modals/plugin_manager/__init__.py:1030 — PluginManagerScreen.on_option_list_option_selected has cognitive complexity 30 (threshold 15). Drivers by points: if/else 20 (26 pts), boolean chains 2, ternaries 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.
D2 · Cognitive Complexity · DeepAgentRuntime._create_graph (cognitive 30) · ×1
  • DeepAgentRuntime._create_graph (cognitive 30) libs/talon/deepagents_talon/runtime.py:433 — DeepAgentRuntime._create_graph has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 10, loops 3 (4 pts), ternaries 4 (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 · _dep_floor_check._find_floor_violations (cognitive 29) · ×1
  • _dep_floor_check._find_floor_violations (cognitive 29) libs/code/deepagents_code/_dep_floor_check.py:112 — _dep_floor_check._find_floor_violations has cognitive complexity 29 (threshold 15). Drivers by points: error handling 7 (15 pts), if/else 5 (11 pts), boolean chains 2, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeepAgentsApp._set_rubric_model (cognitive 29) · ×1
  • DeepAgentsApp._set_rubric_model (cognitive 29) libs/code/deepagents_code/app.py:17367 — DeepAgentsApp._set_rubric_model has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 5, error handling 2 (3 pts), ternaries 1 (nesting depth added 6). 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 · DeepAgentsApp._handle_update_action (cognitive 29) · ×1
  • DeepAgentsApp._handle_update_action (cognitive 29) libs/code/deepagents_code/app.py:27185 — DeepAgentsApp._handle_update_action has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (26 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · inspect_sessions.main (cognitive 29) · ×1
  • inspect_sessions.main (cognitive 29) libs/code/deepagents_code/built_in_skills/deepagents-thread-inspector/scripts/inspect_sessions.py:616 — inspect_sessions.main has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 4, ternaries 1 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServerProcess.wait_for_graph_ready (cognitive 29) · ×1
  • ServerProcess.wait_for_graph_ready (cognitive 29) libs/code/deepagents_code/client/launch/server.py:1067 — ServerProcess.wait_for_graph_ready has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (26 pts), error handling 1 (2 pts), loops 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.
D2 · Cognitive Complexity · RemoteAgent.astream (cognitive 29) · ×1
  • RemoteAgent.astream (cognitive 29) libs/code/deepagents_code/client/remote_client.py:793 — RemoteAgent.astream has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 6, loops 1, ternaries 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 · ModelConfig.load (cognitive 29) · ×1
  • ModelConfig.load (cognitive 29) REDACTED:3364 — ModelConfig.load has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 6, ternaries 6, error handling 2, loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ChatInput.on_text_area_changed (cognitive 29) · ×1
  • ChatInput.on_text_area_changed (cognitive 29) libs/code/deepagents_code/tui/widgets/chat_input.py:2752 — ChatInput.on_text_area_changed has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 6 (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 · _ptc.filter_tools_for_ptc (cognitive 29) · ×1
  • _ptc.filter_tools_for_ptc (cognitive 29) libs/partners/quickjs/langchain_quickjs/_ptc.py:48 — _ptc.filter_tools_for_ptc has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (24 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · aggregate_unified.render_markdown (cognitive 29) · ×1
  • aggregate_unified.render_markdown (cognitive 29) .github/scripts/evals/aggregate_unified.py:551 — aggregate_unified.render_markdown has cognitive complexity 29 (threshold 15). Drivers by points: loops 6 (12 pts), if/else 9 (11 pts), ternaries 3 (5 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · collect_langsmith_usage.collect_all (cognitive 29) · ×1
  • collect_langsmith_usage.collect_all (cognitive 29) .github/scripts/evals/collect_langsmith_usage.py:256 — collect_langsmith_usage.collect_all has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 3 (6 pts), error handling 1 (4 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · check_release_deps._affected_extras (cognitive 29) · ×1
  • check_release_deps._affected_extras (cognitive 29) .github/scripts/release/check_release_deps.py:448 — check_release_deps._affected_extras has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 4 (6 pts), boolean chains 3, error handling 1 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentServerACP._process_tool_call_chunks (cognitive 28) · ×1
  • AgentServerACP._process_tool_call_chunks (cognitive 28) libs/acp/deepagents_acp/server.py:602 — AgentServerACP._process_tool_call_chunks has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 6, error handling 1 (4 pts), loops 2 (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 · _session_stats._record_message_usage (cognitive 28) · ×1
  • _session_stats._record_message_usage (cognitive 28) libs/code/deepagents_code/_session_stats.py:1062 — _session_stats._record_message_usage has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (15 pts), ternaries 6 (7 pts), boolean chains 6 (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 · agent._rubric_grader_repo_call_count (cognitive 28) · ×1
  • agent._rubric_grader_repo_call_count (cognitive 28) libs/code/deepagents_code/agent.py:459 — agent._rubric_grader_repo_call_count has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeepAgentsApp._handle_version_command (cognitive 28) · ×1
  • DeepAgentsApp._handle_version_command (cognitive 28) libs/code/deepagents_code/app.py:8631 — DeepAgentsApp._handle_version_command has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (17 pts), error handling 6 (8 pts), ternaries 1 (2 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.
D2 · Cognitive Complexity · file_ops.build_approval_preview (cognitive 28) · ×1
  • file_ops.build_approval_preview (cognitive 28) libs/code/deepagents_code/file_ops.py:523 — file_ops.build_approval_preview has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 5, ternaries 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · marketplace.parse_marketplace_source (cognitive 28) · ×1
  • marketplace.parse_marketplace_source (cognitive 28) libs/code/deepagents_code/plugins/marketplace.py:142 — marketplace.parse_marketplace_source has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 4, error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ModelSelectorScreen._set_default (cognitive 28) · ×1
  • ModelSelectorScreen._set_default (cognitive 28) libs/code/deepagents_code/tui/widgets/model_selector.py:2297 — ModelSelectorScreen._set_default has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (20 pts), error handling 3 (6 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · update_check.get_latest_version (cognitive 28) · ×1
  • update_check.get_latest_version (cognitive 28) libs/code/deepagents_code/update_check.py:682 — update_check.get_latest_version has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 5, ternaries 3 (5 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.main (cognitive 28) · ×1
  • main.main (cognitive 28) libs/evals/harbor_adapters/drbench/main.py:111 — main.main has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (20 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · extract_text._from_jsonl (cognitive 28) · ×1
  • extract_text._from_jsonl (cognitive 28) libs/evals/harbor_adapters/drbench/templates/extract_text.py:121 — extract_text._from_jsonl has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (17 pts), ternaries 2 (6 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CronJobStore.edit_job (cognitive 28) · ×1
  • CronJobStore.edit_job (cognitive 28) libs/talon/deepagents_talon/cron/jobs.py:977 — CronJobStore.edit_job has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 7 (13 pts), if/else 6 (11 pts), boolean chains 3, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeepAgentsApp._handle_update_command (cognitive 27) · ×1
  • DeepAgentsApp._handle_update_command (cognitive 27) libs/code/deepagents_code/app.py:7295 — DeepAgentsApp._handle_update_command has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (20 pts), ternaries 2 (4 pts), boolean chains 2, error handling 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 · DeepAgentsApp._run_shell_task (cognitive 27) · ×1
  • DeepAgentsApp._run_shell_task (cognitive 27) libs/code/deepagents_code/app.py:13719 — DeepAgentsApp._run_shell_task has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 4, error handling 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 · DeepAgentsApp._cleanup_agent_task (cognitive 27) · ×1
  • DeepAgentsApp._cleanup_agent_task (cognitive 27) libs/code/deepagents_code/app.py:20288 — DeepAgentsApp._cleanup_agent_task has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 7, error handling 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.
D2 · Cognitive Complexity · DeepAgentsApp.action_interrupt (cognitive 27) · ×1
  • DeepAgentsApp.action_interrupt (cognitive 27) libs/code/deepagents_code/app.py:22848 — DeepAgentsApp.action_interrupt has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18 (23 pts), boolean chains 4 (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.
D2 · Cognitive Complexity · DeepAgentsApp._confirm_and_switch_model (cognitive 27) · ×1
  • DeepAgentsApp._confirm_and_switch_model (cognitive 27) libs/code/deepagents_code/app.py:25195 — DeepAgentsApp._confirm_and_switch_model has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 3 (6 pts), boolean chains 5, ternaries 4 (5 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · config._parse_retry_config (cognitive 27) · ×1
  • config._parse_retry_config (cognitive 27) REDACTED:3028 — config._parse_retry_config has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · config_manifest._emit_ranked_diagnostics (cognitive 27) · ×1
  • config_manifest._emit_ranked_diagnostics (cognitive 27) libs/code/deepagents_code/config_manifest.py:1209 — config_manifest._emit_ranked_diagnostics has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 3 (6 pts), boolean chains 5 (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 · managed_tools.ensure_ripgrep (cognitive 27) · ×1
  • managed_tools.ensure_ripgrep (cognitive 27) REDACTED:739 — managed_tools.ensure_ripgrep has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (20 pts), error handling 5, boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server_graph._make_graphs_in_environment (cognitive 27) · ×1
  • server_graph._make_graphs_in_environment (cognitive 27) libs/code/deepagents_code/server_graph.py:416 — server_graph._make_graphs_in_environment has cognitive complexity 27 (threshold 15). Drivers by points: error handling 5 (9 pts), ternaries 4 (8 pts), if/else 4 (6 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChatTextArea._find_placeholder_span (cognitive 27) · ×1
  • ChatTextArea._find_placeholder_span (cognitive 27) libs/code/deepagents_code/tui/widgets/chat_input.py:1492 — ChatTextArea._find_placeholder_span has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (23 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SlackSdkGateway.thread_context (cognitive 27) · ×1
  • _SlackSdkGateway.thread_context (cognitive 27) libs/talon/deepagents_talon/channels/slack.py:527 — _SlackSdkGateway.thread_context has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 7, loops 3 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · check_wheel_dep_freshness._marker_environment_overrides (cognitive 27) · ×1
  • check_wheel_dep_freshness._marker_environment_overrides (cognitive 27) .github/scripts/release/check_wheel_dep_freshness.py:538 — check_wheel_dep_freshness._marker_environment_overrides has cognitive complexity 27 (threshold 15). Drivers by points: loops 5 (12 pts), if/else 5 (8 pts), error handling 1 (5 pts), boolean chains 1, ternaries 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · id_compat.reactionEntry (cognitive 27) · ×1
  • id_compat.reactionEntry (cognitive 27) libs/talon/deepagents_talon/channels/whatsapp_bridge/id_compat.js:54 — id_compat.reactionEntry has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 8 (23 pts), boolean chains 3, if/else 1 (nesting depth added 15). 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.
D2 · Cognitive Complexity · DeepAgentsApp._retarget_hooks_after_cwd_switch (cognitive 26) · ×1
  • DeepAgentsApp._retarget_hooks_after_cwd_switch (cognitive 26) libs/code/deepagents_code/app.py:5619 — DeepAgentsApp._retarget_hooks_after_cwd_switch has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (18 pts), error handling 2 (4 pts), boolean chains 3, ternaries 1 (nesting depth added 13). 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.
D2 · Cognitive Complexity · DeepAgentsApp._apply_goal_application (cognitive 26) · ×1
  • DeepAgentsApp._apply_goal_application (cognitive 26) libs/code/deepagents_code/app.py:16632 — DeepAgentsApp._apply_goal_application has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 8, ternaries 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 · DeepAgentsApp._switch_model (cognitive 26) · ×1
  • DeepAgentsApp._switch_model (cognitive 26) libs/code/deepagents_code/app.py:31887 — DeepAgentsApp._switch_model has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 4, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · configurable_model._build_overrides (cognitive 26) · ×1
  • configurable_model._build_overrides (cognitive 26) libs/code/deepagents_code/configurable_model.py:379 — configurable_model._build_overrides has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 2, ternaries 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ModelConfig._validate (cognitive 26) · ×1
  • ModelConfig._validate (cognitive 26) REDACTED:3585 — ModelConfig._validate has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 7, loops 3 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PluginManagerScreen._current_options (cognitive 26) · ×1
  • PluginManagerScreen._current_options (cognitive 26) libs/code/deepagents_code/tui/modals/plugin_manager/__init__.py:323 — PluginManagerScreen._current_options has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (20 pts), ternaries 2 (4 pts), loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · textual_adapter._format_rubric_details (cognitive 26) · ×1
  • textual_adapter._format_rubric_details (cognitive 26) REDACTED:739 — textual_adapter._format_rubric_details has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 6, loops 2 (4 pts), ternaries 1 (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.
D2 · Cognitive Complexity · ChatInput._build_path_replacement (cognitive 26) · ×1
  • ChatInput._build_path_replacement (cognitive 26) libs/code/deepagents_code/tui/widgets/chat_input.py:3486 — ChatInput._build_path_replacement has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 4 (10 pts), error handling 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompositeBackend.grep (cognitive 26) · ×1
  • CompositeBackend.grep (cognitive 26) libs/deepagents/deepagents/backends/composite.py:459 — CompositeBackend.grep has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 7, loops 1 (2 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. This shape REPEATS in the file: one other method here (CompositeBackend.agrep) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · CompositeBackend.agrep (cognitive 26) · ×1
  • CompositeBackend.agrep (cognitive 26) libs/deepagents/deepagents/backends/composite.py:551 — CompositeBackend.agrep has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 7, loops 1 (2 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. This shape REPEATS in the file: one other method here (CompositeBackend.grep) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · build_release_notes._latest_earlier_prerelease_tag (cognitive 26) · ×1
  • build_release_notes._latest_earlier_prerelease_tag (cognitive 26) .github/scripts/release/build_release_notes.py:277 — build_release_notes._latest_earlier_prerelease_tag has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 3, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · build_release_notes.build_release_notes (cognitive 26) · ×1
  • build_release_notes.build_release_notes (cognitive 26) .github/scripts/release/build_release_notes.py:1673 — build_release_notes.build_release_notes has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (22 pts), boolean chains 3, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeepAgentsApp._install_extra_unlocked (cognitive 25) · ×1
  • DeepAgentsApp._install_extra_unlocked (cognitive 25) libs/code/deepagents_code/app.py:8037 — DeepAgentsApp._install_extra_unlocked has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (15 pts), error handling 4 (5 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeepAgentsApp._handle_server_offload (cognitive 25) · ×1
  • DeepAgentsApp._handle_server_offload (cognitive 25) libs/code/deepagents_code/app.py:18617 — DeepAgentsApp._handle_server_offload has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (13 pts), ternaries 6 (7 pts), error handling 4, boolean chains 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, 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 · DeepAgentsApp._regroup_completed_tools (cognitive 25) · ×1
  • DeepAgentsApp._regroup_completed_tools (cognitive 25) libs/code/deepagents_code/app.py:21873 — DeepAgentsApp._regroup_completed_tools has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (18 pts), ternaries 1 (3 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · config._create_model_via_init (cognitive 25) · ×1
  • config._create_model_via_init (cognitive 25) REDACTED:6533 — config._create_model_via_init has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (17 pts), error handling 4 (5 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main._ripgrep_install_hint (cognitive 25) · ×1
  • main._ripgrep_install_hint (cognitive 25) libs/code/deepagents_code/main.py:1790 — main._ripgrep_install_hint has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (25 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ContextUsage.render (cognitive 25) · ×1
  • _ContextUsage.render (cognitive 25) libs/code/deepagents_code/tui/widgets/context_usage.py:40 — _ContextUsage.render has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 5, ternaries 3, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · diff._compose_diff_content (cognitive 25) · ×1
  • diff._compose_diff_content (cognitive 25) libs/code/deepagents_code/tui/widgets/diff.py:817 — diff._compose_diff_content has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (4 pts), ternaries 2 (4 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · diff._highlighted_rows (cognitive 25) · ×1
  • diff._highlighted_rows (cognitive 25) libs/code/deepagents_code/tui/widgets/diff.py:879 — diff._highlighted_rows has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 2 (3 pts), ternaries 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 · CompositeBackend.glob (cognitive 25) · ×1
  • CompositeBackend.glob (cognitive 25) libs/deepagents/deepagents/backends/composite.py:613 — CompositeBackend.glob has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 5, ternaries 1 (3 pts), loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (CompositeBackend.aglob) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · CompositeBackend.aglob (cognitive 25) · ×1
  • CompositeBackend.aglob (cognitive 25) libs/deepagents/deepagents/backends/composite.py:665 — CompositeBackend.aglob has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 5, ternaries 1 (3 pts), loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (CompositeBackend.glob) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · StoreConversationArchive.text_entries (cognitive 25) · ×1
  • StoreConversationArchive.text_entries (cognitive 25) libs/talon/deepagents_talon/store_archive.py:389 — StoreConversationArchive.text_entries has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 8, ternaries 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RepositoryBounds.preflight (cognitive 24) · ×1
  • RepositoryBounds.preflight (cognitive 24) libs/code/deepagents_code/_repository_bounds.py:274 — RepositoryBounds.preflight has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 3, ternaries 2, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ToolCallBuffer.parse_args (cognitive 24) · ×1
  • ToolCallBuffer.parse_args (cognitive 24) libs/code/deepagents_code/_tool_stream.py:622 — ToolCallBuffer.parse_args has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 5, error handling 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeepAgentsApp._run_session_start_sequence (cognitive 24) · ×1
  • DeepAgentsApp._run_session_start_sequence (cognitive 24) libs/code/deepagents_code/app.py:11872 — DeepAgentsApp._run_session_start_sequence has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 6, error handling 1 (2 pts), ternaries 1 (nesting depth added 2). 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 · DeepAgentsApp._replace_server_after_cwd_switch (cognitive 24) · ×1
  • DeepAgentsApp._replace_server_after_cwd_switch (cognitive 24) libs/code/deepagents_code/app.py:30710 — DeepAgentsApp._replace_server_after_cwd_switch has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (11 pts), error handling 5 (8 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · inspect_sessions._content_text (cognitive 24) · ×1
  • inspect_sessions._content_text (cognitive 24) libs/code/deepagents_code/built_in_skills/deepagents-thread-inspector/scripts/inspect_sessions.py:407 — inspect_sessions._content_text has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 1 (2 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 · cost_tracking._merge_cost_breakdowns (cognitive 24) · ×1
  • cost_tracking._merge_cost_breakdowns (cognitive 24) libs/code/deepagents_code/cost_tracking.py:206 — cost_tracking._merge_cost_breakdowns has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (7 pts), boolean chains 4 (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 · main.apply_stdin_pipe (cognitive 24) · ×1
  • main.apply_stdin_pipe (cognitive 24) libs/code/deepagents_code/main.py:3750 — main.apply_stdin_pipe has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (15 pts), error handling 6 (7 pts), boolean chains 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · offload_api.workspace (cognitive 24) · ×1
  • offload_api.workspace (cognitive 24) libs/code/deepagents_code/offload_api.py:242 — offload_api.workspace has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (15 pts), error handling 5 (6 pts), boolean chains 3 (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 · sessions._count_messages_from_deltas (cognitive 24) · ×1
  • sessions._count_messages_from_deltas (cognitive 24) libs/code/deepagents_code/sessions.py:1488 — sessions._count_messages_from_deltas has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 2 (5 pts), loops 2 (3 pts), error handling 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.
D2 · Cognitive Complexity · state._load_manager_state (cognitive 24) · ×1
  • state._load_manager_state (cognitive 24) libs/code/deepagents_code/tui/modals/plugin_manager/state.py:312 — state._load_manager_state has cognitive complexity 24 (threshold 15). Drivers by points: if/else 3 (9 pts), ternaries 2 (7 pts), boolean chains 3, loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · textual_adapter._handle_interrupt_cleanup (cognitive 24) · ×1
  • textual_adapter._handle_interrupt_cleanup (cognitive 24) REDACTED:4468 — textual_adapter._handle_interrupt_cleanup has cognitive complexity 24 (threshold 15). Drivers by points: error handling 7 (11 pts), if/else 8 (10 pts), boolean chains 1, loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · _DeepAgentsSummarizationMiddleware._truncate_args (cognitive 24) · ×1
  • _DeepAgentsSummarizationMiddleware._truncate_args (cognitive 24) libs/deepagents/deepagents/middleware/summarization.py:1074 — _DeepAgentsSummarizationMiddleware._truncate_args has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 2 (4 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 · aggregate_shards.render_step_summary (cognitive 24) · ×1
  • aggregate_shards.render_step_summary (cognitive 24) .github/scripts/evals/aggregate_shards.py:549 — aggregate_shards.render_step_summary has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 6 (10 pts), if/else 6, boolean chains 4, loops 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · check_release_deps.find_follow_up_conflicts (cognitive 24) · ×1
  • check_release_deps.find_follow_up_conflicts (cognitive 24) .github/scripts/release/check_release_deps.py:797 — check_release_deps.find_follow_up_conflicts has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 4 (5 pts), error handling 2 (4 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.
D2 · Cognitive Complexity · check_wheel_dep_freshness.compare_wheel_with_pypi (cognitive 24) · ×1
  • check_wheel_dep_freshness.compare_wheel_with_pypi (cognitive 24) .github/scripts/release/check_wheel_dep_freshness.py:794 — check_wheel_dep_freshness.compare_wheel_with_pypi has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (14 pts), ternaries 2 (4 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RepositoryBounds.apreflight (cognitive 23) · ×1
  • RepositoryBounds.apreflight (cognitive 23) libs/code/deepagents_code/_repository_bounds.py:340 — RepositoryBounds.apreflight has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 3, ternaries 2, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeepAgentsApp._mount_message_unlocked (cognitive 23) · ×1
  • DeepAgentsApp._mount_message_unlocked (cognitive 23) libs/code/deepagents_code/app.py:21561 — DeepAgentsApp._mount_message_unlocked has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 6, error handling 3 (4 pts), ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · auto_mode._classifier_context (cognitive 23) · ×1
  • auto_mode._classifier_context (cognitive 23) libs/code/deepagents_code/auto_mode.py:1649 — auto_mode._classifier_context has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 3 (4 pts), boolean chains 2, ternaries 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.
D2 · Cognitive Complexity · CostTrackingMiddleware._after_agent_update (cognitive 23) · ×1
  • CostTrackingMiddleware._after_agent_update (cognitive 23) libs/code/deepagents_code/cost_tracking.py:3011 — CostTrackingMiddleware._after_agent_update has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 4, ternaries 2 (4 pts) (nesting depth added 11). 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.
D2 · Cognitive Complexity · mcp_auth.build_oauth_provider (cognitive 23) · ×1
  • mcp_auth.build_oauth_provider (cognitive 23) REDACTED:1789 — mcp_auth.build_oauth_provider has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 3 (9 pts), boolean chains 1 (nesting depth added 12). 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.
D2 · Cognitive Complexity · model_catalog.load_model_catalog (cognitive 23) · ×1
  • model_catalog.load_model_catalog (cognitive 23) libs/code/deepagents_code/model_catalog.py:172 — model_catalog.load_model_catalog has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 2 (4 pts), boolean chains 3, loops 2, ternaries 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · model_config.parse_model_allowlist (cognitive 23) · ×1
  • model_config.parse_model_allowlist (cognitive 23) REDACTED:531 — model_config.parse_model_allowlist has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 3, 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 · model_config.load_mcp_server_trust_lists (cognitive 23) · ×1
  • model_config.load_mcp_server_trust_lists (cognitive 23) REDACTED:5676 — model_config.load_mcp_server_trust_lists has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 7, boolean chains 5 (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, 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 · model_config.add_enabled_project_mcp_servers (cognitive 23) · ×1
  • model_config.add_enabled_project_mcp_servers (cognitive 23) REDACTED:5942 — model_config.add_enabled_project_mcp_servers has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 3, error handling 2, 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 · CLICompactionMiddleware._summarization_for_runtime (cognitive 23) · ×1
  • CLICompactionMiddleware._summarization_for_runtime (cognitive 23) libs/code/deepagents_code/offload_middleware.py:1330 — CLICompactionMiddleware._summarization_for_runtime has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 3 (6 pts), boolean chains 4, error handling 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · commands._trust (cognitive 23) · ×1
  • commands._trust (cognitive 23) libs/code/deepagents_code/skills/commands.py:874 — commands._trust has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (17 pts), error handling 1 (2 pts), loops 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · autocomplete._get_project_files (cognitive 23) · ×1
  • autocomplete._get_project_files (cognitive 23) libs/code/deepagents_code/tui/widgets/autocomplete.py:671 — autocomplete._get_project_files has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (6 pts), boolean chains 1, error handling 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 · messages._markdown_to_content (cognitive 23) · ×1
  • messages._markdown_to_content (cognitive 23) libs/code/deepagents_code/tui/widgets/messages.py:6032 — messages._markdown_to_content has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (13 pts), error handling 1 (4 pts), loops 3 (4 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 · _Visitor.__init__ (cognitive 23) · ×1
  • _Visitor.__init__ (cognitive 23) libs/code/scripts/check_process_cwd.py:257 — _Visitor.__init__ has cognitive complexity 23 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 3 (7 pts), boolean chains 6 (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 · _messages_reducer._messages_delta_reducer (cognitive 23) · ×1
  • _messages_reducer._messages_delta_reducer (cognitive 23) libs/deepagents/deepagents/_messages_reducer.py:31 — _messages_reducer._messages_delta_reducer has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 4, boolean chains 3, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · installMessageKeyCompatibility (cognitive 23) · ×1
  • installMessageKeyCompatibility (cognitive 23) libs/talon/deepagents_talon/channels/whatsapp_bridge/id_compat.js:131 — installMessageKeyCompatibility has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 10, if/else 4 (6 pts), ternaries 3 (6 pts), loops 1 (nesting depth added 5). Most of this is not in the body itself: 6 of the 23 points are its own statements and the rest belongs to 2 function items inside it that branch (get, a function literal at line 169). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · DeepAgentsApp._handle_goal_command (cognitive 22) · ×1
  • DeepAgentsApp._handle_goal_command (cognitive 22) libs/code/deepagents_code/app.py:15834 — DeepAgentsApp._handle_goal_command has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 5, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeepAgentsApp._handle_rubric_command (cognitive 22) · ×1
  • DeepAgentsApp._handle_rubric_command (cognitive 22) libs/code/deepagents_code/app.py:16932 — DeepAgentsApp._handle_rubric_command has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (18 pts), error handling 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeepAgentsApp._set_rubric_max_iterations (cognitive 22) · ×1
  • DeepAgentsApp._set_rubric_max_iterations (cognitive 22) libs/code/deepagents_code/app.py:17281 — DeepAgentsApp._set_rubric_max_iterations has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 2 (5 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 · DeepAgentsApp._generate_thread_name (cognitive 22) · ×1
  • DeepAgentsApp._generate_thread_name (cognitive 22) libs/code/deepagents_code/app.py:19297 — DeepAgentsApp._generate_thread_name has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 5, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BtwOperation._resolve_context (cognitive 22) · ×1
  • BtwOperation._resolve_context (cognitive 22) libs/code/deepagents_code/btw.py:474 — BtwOperation._resolve_context has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 3 (6 pts), boolean chains 5, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · auth._run_set (cognitive 22) · ×1
  • auth._run_set (cognitive 22) libs/code/deepagents_code/client/commands/auth.py:372 — auth._run_set has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 3 (4 pts), boolean chains 3, error handling 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server._terminate_server_process (cognitive 22) · ×1
  • server._terminate_server_process (cognitive 22) libs/code/deepagents_code/client/launch/server.py:603 — server._terminate_server_process has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (11 pts), error handling 6 (8 pts), ternaries 2, boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · config._get_default_model_spec (cognitive 22) · ×1
  • config._get_default_model_spec (cognitive 22) REDACTED:5672 — config._get_default_model_spec has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 2 (3 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.
D2 · Cognitive Complexity · ConfigOption.__post_init__ (cognitive 22) · ×1
  • ConfigOption.__post_init__ (cognitive 22) libs/code/deepagents_code/config_manifest.py:716 — ConfigOption.__post_init__ has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 8 (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 · providers.ranked_environment_value (cognitive 22) · ×1
  • providers.ranked_environment_value (cognitive 22) libs/code/deepagents_code/configuration/providers.py:454 — providers.ranked_environment_value has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 2, ternaries 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cost_tracking._read_override_source (cognitive 22) · ×1
  • cost_tracking._read_override_source (cognitive 22) libs/code/deepagents_code/cost_tracking.py:1020 — cost_tracking._read_override_source has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (16 pts), error handling 4, boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FileOpTracker._populate_after_content (cognitive 22) · ×1
  • FileOpTracker._populate_after_content (cognitive 22) libs/code/deepagents_code/file_ops.py:960 — FileOpTracker._populate_after_content has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 3 (6 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · migration.migrate_legacy_hooks (cognitive 22) · ×1
  • migration.migrate_legacy_hooks (cognitive 22) libs/code/deepagents_code/hooks/migration.py:52 — migration.migrate_legacy_hooks has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (17 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.
D2 · Cognitive Complexity · model_api.model_metadata (cognitive 22) · ×1
  • model_api.model_metadata (cognitive 22) libs/code/deepagents_code/model_api.py:44 — model_api.model_metadata has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 9, error handling 3 (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, 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 · utils._format_grep_with_context (cognitive 22) · ×1
  • utils._format_grep_with_context (cognitive 22) libs/deepagents/deepagents/backends/utils.py:1167 — utils._format_grep_with_context has cognitive complexity 22 (threshold 15). Drivers by points: loops 7 (15 pts), ternaries 1 (4 pts), if/else 1 (3 pts) (nesting depth added 13). 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 · run_trials._print_summary (cognitive 22) · ×1
  • run_trials._print_summary (cognitive 22) libs/evals/scripts/run_trials.py:404 — run_trials._print_summary has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 3 (7 pts), loops 3 (4 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.
D2 · Cognitive Complexity · aggregate_shards.aggregate (cognitive 22) · ×1
  • aggregate_shards.aggregate (cognitive 22) .github/scripts/evals/aggregate_shards.py:304 — aggregate_shards.aggregate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · build_release_notes.resolve_previous_tag (cognitive 22) · ×1
  • build_release_notes.resolve_previous_tag (cognitive 22) .github/scripts/release/build_release_notes.py:367 — build_release_notes.resolve_previous_tag has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (17 pts), error handling 1 (2 pts), ternaries 1 (2 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.
D2 · Cognitive Complexity · _ask_user_types.render_ask_user_transcript_for_display (cognitive 21) · ×1
  • _ask_user_types.render_ask_user_transcript_for_display (cognitive 21) libs/code/deepagents_code/_ask_user_types.py:612 — _ask_user_types.render_ask_user_transcript_for_display has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 1 (4 pts), boolean chains 2, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeepAgentsApp._start_server_background (cognitive 21) · ×1
  • DeepAgentsApp._start_server_background (cognitive 21) libs/code/deepagents_code/app.py:6305 — DeepAgentsApp._start_server_background has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (12 pts), error handling 3 (5 pts), boolean chains 2, ternaries 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.
D2 · Cognitive Complexity · DeepAgentsApp.on_deep_agents_app_server_start_failed (cognitive 21) · ×1
  • DeepAgentsApp.on_deep_agents_app_server_start_failed (cognitive 21) libs/code/deepagents_code/app.py:6550 — DeepAgentsApp.on_deep_agents_app_server_start_failed has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 3, ternaries 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 · DeepAgentsApp._finish_pending_goal_rubric_review (cognitive 21) · ×1
  • DeepAgentsApp._finish_pending_goal_rubric_review (cognitive 21) libs/code/deepagents_code/app.py:16403 — DeepAgentsApp._finish_pending_goal_rubric_review has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 3, error handling 2, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeepAgentsApp._set_auto_classifier_model (cognitive 21) · ×1
  • DeepAgentsApp._set_auto_classifier_model (cognitive 21) libs/code/deepagents_code/app.py:24100 — DeepAgentsApp._set_auto_classifier_model has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (16 pts), error handling 1 (2 pts), ternaries 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.
D2 · Cognitive Complexity · auto_mode._ask_user_exchange_rows (cognitive 21) · ×1
  • auto_mode._ask_user_exchange_rows (cognitive 21) libs/code/deepagents_code/auto_mode.py:1463 — auto_mode._ask_user_exchange_rows has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 5, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · config._dotenv_environment (cognitive 21) · ×1
  • config._dotenv_environment (cognitive 21) REDACTED:634 — config._dotenv_environment has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 6, error handling 3 (4 pts), ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ToolCallMessage._format_ask_user_output (cognitive 21) · ×1
  • ToolCallMessage._format_ask_user_output (cognitive 21) libs/code/deepagents_code/tui/widgets/messages.py:3939 — ToolCallMessage._format_ask_user_output has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 2 (4 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _DeepAgentsSummarizationMiddleware._determine_truncate_cutoff_index (cognitive 21) · ×1
  • _DeepAgentsSummarizationMiddleware._determine_truncate_cutoff_index (cognitive 21) libs/deepagents/deepagents/middleware/summarization.py:957 — _DeepAgentsSummarizationMiddleware._determine_truncate_cutoff_index has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 1 (2 pts) (nesting depth added 11). 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.
D2 · Cognitive Complexity · aggregate_unified_compare._read_tasks (cognitive 21) · ×1
  • aggregate_unified_compare._read_tasks (cognitive 21) .github/scripts/evals/aggregate_unified_compare.py:111 — aggregate_unified_compare._read_tasks has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, error handling 1 (2 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · collect_langsmith_usage.summarize_runs (cognitive 21) · ×1
  • collect_langsmith_usage.summarize_runs (cognitive 21) .github/scripts/evals/collect_langsmith_usage.py:148 — collect_langsmith_usage.summarize_runs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (7 pts), loops 3 (7 pts), ternaries 2 (4 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · build_release_notes._collect_issue_reporters (cognitive 21) · ×1
  • build_release_notes._collect_issue_reporters (cognitive 21) .github/scripts/release/build_release_notes.py:1217 — build_release_notes._collect_issue_reporters has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentServerACP.set_config_option (cognitive 20) · ×1
  • AgentServerACP.set_config_option (cognitive 20) libs/acp/deepagents_acp/server.py:449 — AgentServerACP.set_config_option has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _dep_floor_check._prompt_if_editable_deps_stale (cognitive 20) · ×1
  • _dep_floor_check._prompt_if_editable_deps_stale (cognitive 20) libs/code/deepagents_code/_dep_floor_check.py:704 — _dep_floor_check._prompt_if_editable_deps_stale has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (19 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 · DeepAgentsApp._refresh_cache_expiry_banner (cognitive 20) · ×1
  • DeepAgentsApp._refresh_cache_expiry_banner (cognitive 20) libs/code/deepagents_code/app.py:9698 — DeepAgentsApp._refresh_cache_expiry_banner has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 2 (7 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 11). 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.
D2 · Cognitive Complexity · DeepAgentsApp._move_transcript_window_to_tail (cognitive 20) · ×1
  • DeepAgentsApp._move_transcript_window_to_tail (cognitive 20) libs/code/deepagents_code/app.py:21688 — DeepAgentsApp._move_transcript_window_to_tail has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 2 (3 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeepAgentsApp._fingerprint_component_paths (cognitive 20) · ×1
  • DeepAgentsApp._fingerprint_component_paths (cognitive 20) libs/code/deepagents_code/app.py:27422 — DeepAgentsApp._fingerprint_component_paths has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 5 (9 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 · auto_mode._ask_user_question_count (cognitive 20) · ×1
  • auto_mode._ask_user_question_count (cognitive 20) libs/code/deepagents_code/auto_mode.py:1334 — auto_mode._ask_user_question_count has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 5, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server.wait_for_server_healthy (cognitive 20) · ×1
  • server.wait_for_server_healthy (cognitive 20) libs/code/deepagents_code/client/launch/server.py:305 — server.wait_for_server_healthy has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 2 (4 pts), error handling 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.
D2 · Cognitive Complexity · RemoteAgent.aoffload (cognitive 20) · ×1
  • RemoteAgent.aoffload (cognitive 20) libs/code/deepagents_code/client/remote_client.py:657 — RemoteAgent.aoffload has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 3 (5 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · extras_info.get_optional_dependency_status (cognitive 20) · ×1
  • extras_info.get_optional_dependency_status (cognitive 20) libs/code/deepagents_code/extras_info.py:1229 — extras_info.get_optional_dependency_status has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 3 (5 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runner.run_command_handler (cognitive 20) · ×1
  • runner.run_command_handler (cognitive 20) libs/code/deepagents_code/hooks/runner.py:46 — runner.run_command_handler has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (10 pts), error handling 6, boolean chains 2, ternaries 2 (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 · HooksSnapshot.from_config (cognitive 20) · ×1
  • HooksSnapshot.from_config (cognitive 20) libs/code/deepagents_code/hooks/snapshot.py:77 — HooksSnapshot.from_config has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 3 (6 pts), ternaries 1 (4 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · model_config._profile_from_ollama_show_payload (cognitive 20) · ×1
  • model_config._profile_from_ollama_show_payload (cognitive 20) REDACTED:2308 — model_config._profile_from_ollama_show_payload has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 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 · store.cache_and_register_plugin (cognitive 20) · ×1
  • store.cache_and_register_plugin (cognitive 20) libs/code/deepagents_code/plugins/store.py:485 — store.cache_and_register_plugin has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 pts), error handling 3 (4 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 · ToolCallMessage._update_output_display (cognitive 20) · ×1
  • ToolCallMessage._update_output_display (cognitive 20) libs/code/deepagents_code/tui/widgets/messages.py:4039 — ToolCallMessage._update_output_display has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 6 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LazyToolGroupSummary._set_expanded (cognitive 20) · ×1
  • LazyToolGroupSummary._set_expanded (cognitive 20) libs/code/deepagents_code/tui/widgets/messages.py:5431 — LazyToolGroupSummary._set_expanded has cognitive complexity 20 (threshold 15). Drivers by points: error handling 3 (7 pts), ternaries 2 (5 pts), if/else 4, boolean chains 2, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContextHubBackend.grep (cognitive 20) · ×1
  • ContextHubBackend.grep (cognitive 20) libs/deepagents/deepagents/backends/context_hub.py:596 — ContextHubBackend.grep has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (11 pts), boolean chains 3, loops 2 (3 pts), ternaries 2, error handling 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 · FilesystemMiddleware.__init__ (cognitive 20) · ×1
  • FilesystemMiddleware.__init__ (cognitive 20) libs/deepagents/deepagents/middleware/filesystem.py:1891 — FilesystemMiddleware.__init__ has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9, boolean chains 8, ternaries 3. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · _DeepAgentsSummarizationMiddleware._offload_inline_media (cognitive 20) · ×1
  • _DeepAgentsSummarizationMiddleware._offload_inline_media (cognitive 20) libs/deepagents/deepagents/middleware/summarization.py:1131 — _DeepAgentsSummarizationMiddleware._offload_inline_media has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (13 pts), error handling 1 (3 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (_DeepAgentsSummarizationMiddleware._aoffload_inline_media) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · _DeepAgentsSummarizationMiddleware._aoffload_inline_media (cognitive 20) · ×1
  • _DeepAgentsSummarizationMiddleware._aoffload_inline_media (cognitive 20) libs/deepagents/deepagents/middleware/summarization.py:1213 — _DeepAgentsSummarizationMiddleware._aoffload_inline_media has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (13 pts), error handling 1 (3 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (_DeepAgentsSummarizationMiddleware._offload_inline_media) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · run_trials.main (cognitive 20) · ×1
  • run_trials.main (cognitive 20) libs/evals/scripts/run_trials.py:562 — run_trials.main has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TalonHost._dispatch_background_results (cognitive 20) · ×1
  • TalonHost._dispatch_background_results (cognitive 20) libs/talon/deepagents_talon/host.py:950 — TalonHost._dispatch_background_results has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 4, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · curated_apply_only._changelog_path (cognitive 20) · ×1
  • curated_apply_only._changelog_path (cognitive 20) .github/scripts/checks/curated_apply_only.py:25 — curated_apply_only._changelog_path has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 4, loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · aggregate_shards.main (cognitive 20) · ×1
  • aggregate_shards.main (cognitive 20) .github/scripts/evals/aggregate_shards.py:675 — aggregate_shards.main has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 7, ternaries 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.
D2 · Cognitive Complexity · utils.extract_command_types (cognitive 19) · ×1
  • utils.extract_command_types (cognitive 19) libs/acp/deepagents_acp/utils.py:151 — utils.extract_command_types has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts), error handling 1 (2 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.
D2 · Cognitive Complexity · DeepAgentsApp._handle_tools_command (cognitive 19) · ×1
  • DeepAgentsApp._handle_tools_command (cognitive 19) libs/code/deepagents_code/app.py:14337 — DeepAgentsApp._handle_tools_command has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 2 (4 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeepAgentsApp.action_quit_or_interrupt (cognitive 19) · ×1
  • DeepAgentsApp.action_quit_or_interrupt (cognitive 19) libs/code/deepagents_code/app.py:22666 — DeepAgentsApp.action_quit_or_interrupt has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 5 (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.
D2 · Cognitive Complexity · DeepAgentsApp.check_action (cognitive 19) · ×1
  • DeepAgentsApp.check_action (cognitive 19) libs/code/deepagents_code/app.py:26433 — DeepAgentsApp.check_action has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · extras._run_install_extra (cognitive 19) · ×1
  • extras._run_install_extra (cognitive 19) libs/code/deepagents_code/client/commands/extras.py:295 — extras._run_install_extra has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 2 (3 pts), error handling 2, 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.
D2 · Cognitive Complexity · non_interactive._terminate_startup_process (cognitive 19) · ×1
  • non_interactive._terminate_startup_process (cognitive 19) libs/code/deepagents_code/client/non_interactive.py:301 — non_interactive._terminate_startup_process has cognitive complexity 19 (threshold 15). Drivers by points: error handling 9 (13 pts), if/else 5 (6 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CliProvider._coerce (cognitive 19) · ×1
  • CliProvider._coerce (cognitive 19) libs/code/deepagents_code/configuration/provider.py:177 — CliProvider._coerce has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 4 (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 · goal_rubric._summarize_criteria_result (cognitive 19) · ×1
  • goal_rubric._summarize_criteria_result (cognitive 19) libs/code/deepagents_code/goal_rubric.py:1170 — goal_rubric._summarize_criteria_result has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), ternaries 1 (4 pts), boolean chains 1 (nesting depth added 11). 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.
D2 · Cognitive Complexity · goal_state_notice.build_goal_state_notice (cognitive 19) · ×1
  • goal_state_notice.build_goal_state_notice (cognitive 19) libs/code/deepagents_code/goal_state_notice.py:639 — goal_state_notice.build_goal_state_notice has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9, boolean chains 5, error handling 2 (3 pts), ternaries 2 (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 · loading._validate_hooks_document (cognitive 19) · ×1
  • loading._validate_hooks_document (cognitive 19) libs/code/deepagents_code/hooks/loading.py:444 — loading._validate_hooks_document has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (3 pts), boolean chains 2, error handling 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.
D2 · Cognitive Complexity · input._leading_token_end (cognitive 19) · ×1
  • input._leading_token_end (cognitive 19) libs/code/deepagents_code/input.py:855 — input._leading_token_end has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · model_retry._extract_status_code (cognitive 19) · ×1
  • model_retry._extract_status_code (cognitive 19) libs/code/deepagents_code/model_retry.py:259 — model_retry._extract_status_code has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · model_retry._retry_call (cognitive 19) · ×1
  • model_retry._retry_call (cognitive 19) libs/code/deepagents_code/model_retry.py:611 — model_retry._retry_call has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (12 pts), error handling 2 (4 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. This shape REPEATS in the file: one other method here (model_retry._aretry_call) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · model_retry._aretry_call (cognitive 19) · ×1
  • model_retry._aretry_call (cognitive 19) libs/code/deepagents_code/model_retry.py:658 — model_retry._aretry_call has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (12 pts), error handling 2 (4 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. This shape REPEATS in the file: one other method here (model_retry._retry_call) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · _json.json_value (cognitive 19) · ×1
  • _json.json_value (cognitive 19) libs/code/deepagents_code/plugins/_json.py:11 — _json.json_value has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · marketplace._parse_plugin_source (cognitive 19) · ×1
  • marketplace._parse_plugin_source (cognitive 19) libs/code/deepagents_code/plugins/marketplace.py:686 — marketplace._parse_plugin_source has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 4 (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.
D2 · Cognitive Complexity · commands._info (cognitive 19) · ×1
  • commands._info (cognitive 19) libs/code/deepagents_code/skills/commands.py:534 — commands._info has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (11 pts), loops 3 (5 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ApprovalMenu._collect_security_warnings (cognitive 19) · ×1
  • ApprovalMenu._collect_security_warnings (cognitive 19) libs/code/deepagents_code/tui/widgets/approval.py:715 — ApprovalMenu._collect_security_warnings has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _QuestionWidget.get_answer (cognitive 19) · ×1
  • _QuestionWidget.get_answer (cognitive 19) libs/code/deepagents_code/tui/widgets/ask_user.py:977 — _QuestionWidget.get_answer has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, loops 1 (2 pts), ternaries 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.
D2 · Cognitive Complexity · _QuestionWidget.action_select_or_submit (cognitive 19) · ×1
  • _QuestionWidget.action_select_or_submit (cognitive 19) libs/code/deepagents_code/tui/widgets/ask_user.py:1227 — _QuestionWidget.action_select_or_submit has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (18 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.
D2 · Cognitive Complexity · ToolCallMessage._restore_deferred_state (cognitive 19) · ×1
  • ToolCallMessage._restore_deferred_state (cognitive 19) libs/code/deepagents_code/tui/widgets/messages.py:2172 — ToolCallMessage._restore_deferred_state has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 1 (3 pts), boolean chains 2, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · update_check.get_sdk_release_time (cognitive 19) · ×1
  • update_check.get_sdk_release_time (cognitive 19) libs/code/deepagents_code/update_check.py:1096 — update_check.get_sdk_release_time has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), error handling 3, boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · update_check._run_install_subprocess (cognitive 19) · ×1
  • update_check._run_install_subprocess (cognitive 19) libs/code/deepagents_code/update_check.py:2156 — update_check._run_install_subprocess has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), error handling 4 (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 · ReadResult.__post_init__ (cognitive 19) · ×1
  • ReadResult.__post_init__ (cognitive 19) libs/deepagents/deepagents/backends/protocol.py:234 — ReadResult.__post_init__ has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 8 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · utils.grep_matches_from_files (cognitive 19) · ×1
  • utils.grep_matches_from_files (cognitive 19) libs/deepagents/deepagents/backends/utils.py:1091 — utils.grep_matches_from_files has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), error handling 2 (3 pts), loops 2 (3 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.
D2 · Cognitive Complexity · _skill_tools._find_skill_reads (cognitive 19) · ×1
  • _skill_tools._find_skill_reads (cognitive 19) libs/deepagents/deepagents/middleware/_skill_tools.py:271 — _skill_tools._find_skill_reads has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 6, ternaries 1 (3 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.
D2 · Cognitive Complexity · PatchToolCallsMiddleware.before_agent (cognitive 19) · ×1
  • PatchToolCallsMiddleware.before_agent (cognitive 19) libs/deepagents/deepagents/middleware/patch_tool_calls.py:17 — PatchToolCallsMiddleware.before_agent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · history_profiles._validate_profile (cognitive 19) · ×1
  • history_profiles._validate_profile (cognitive 19) libs/talon/deepagents_talon/history_profiles.py:234 — history_profiles._validate_profile has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 10, 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.
D2 · Cognitive Complexity · mcp.load_mcp_tools (cognitive 19) · ×1
  • mcp.load_mcp_tools (cognitive 19) REDACTED:398 — mcp.load_mcp_tools has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 4 (11 pts), loops 2 (3 pts), boolean chains 2, error handling 1 (2 pts), if/else 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 · build_release_notes.generate_git_log (cognitive 19) · ×1
  • build_release_notes.generate_git_log (cognitive 19) .github/scripts/release/build_release_notes.py:665 — build_release_notes.generate_git_log has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (15 pts), ternaries 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · check_release_deps._follow_up_markdown (cognitive 19) · ×1
  • check_release_deps._follow_up_markdown (cognitive 19) .github/scripts/release/check_release_deps.py:890 — check_release_deps._follow_up_markdown has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 2 (4 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentServerACP._create_tool_call_start (cognitive 18) · ×1
  • AgentServerACP._create_tool_call_start (cognitive 18) libs/acp/deepagents_acp/server.py:670 — AgentServerACP._create_tool_call_start has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 6, if/else 5 (6 pts), ternaries 3 (6 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · agent.get_system_prompt (cognitive 18) · ×1
  • agent.get_system_prompt (cognitive 18) libs/code/deepagents_code/agent.py:1604 — agent.get_system_prompt has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 5, error handling 1 (3 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · DeepAgentsApp._mount_hydration_batch (cognitive 18) · ×1
  • DeepAgentsApp._mount_hydration_batch (cognitive 18) libs/code/deepagents_code/app.py:10418 — DeepAgentsApp._mount_hydration_batch has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 3 (4 pts), loops 1 (2 pts), boolean chains 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeepAgentsApp._on_auto_approve_enabled (cognitive 18) · ×1
  • DeepAgentsApp._on_auto_approve_enabled (cognitive 18) libs/code/deepagents_code/app.py:11343 — DeepAgentsApp._on_auto_approve_enabled has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeepAgentsApp._toggle_mcp_server_disabled (cognitive 18) · ×1
  • DeepAgentsApp._toggle_mcp_server_disabled (cognitive 18) libs/code/deepagents_code/app.py:28210 — DeepAgentsApp._toggle_mcp_server_disabled has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 2, error handling 1 (2 pts), ternaries 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 · DeepAgentsApp._resolve_threads_resume_target (cognitive 18) · ×1
  • DeepAgentsApp._resolve_threads_resume_target (cognitive 18) libs/code/deepagents_code/app.py:30048 — DeepAgentsApp._resolve_threads_resume_target has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 2, error handling 2, ternaries 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 · auto_mode._merge_temp_artifacts (cognitive 18) · ×1
  • auto_mode._merge_temp_artifacts (cognitive 18) libs/code/deepagents_code/auto_mode.py:599 — auto_mode._merge_temp_artifacts has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 5, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · btw._tool_free_transcript (cognitive 18) · ×1
  • btw._tool_free_transcript (cognitive 18) libs/code/deepagents_code/btw.py:282 — btw._tool_free_transcript has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (17 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 · config._run_get (cognitive 18) · ×1
  • config._run_get (cognitive 18) libs/code/deepagents_code/client/commands/config.py:1091 — config._run_get has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 3 (4 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · config._parse_interpreter_ptc (cognitive 18) · ×1
  • config._parse_interpreter_ptc (cognitive 18) REDACTED:2928 — config._parse_interpreter_ptc has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, loops 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.
D2 · Cognitive Complexity · config_manifest.load_bool_display_preference (cognitive 18) · ×1
  • config_manifest.load_bool_display_preference (cognitive 18) libs/code/deepagents_code/config_manifest.py:1395 — config_manifest.load_bool_display_preference has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (6 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SessionCostRecorder._start (cognitive 18) · ×1
  • _SessionCostRecorder._start (cognitive 18) libs/code/deepagents_code/cost_tracking.py:2209 — _SessionCostRecorder._start has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 6, ternaries 6, if/else 3, loops 2 (3 pts) (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 · diff_utils.file_header_indexes (cognitive 18) · ×1
  • diff_utils.file_header_indexes (cognitive 18) libs/code/deepagents_code/diff_utils.py:121 — diff_utils.file_header_indexes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 4, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · goal_rubric._conversation_context (cognitive 18) · ×1
  • goal_rubric._conversation_context (cognitive 18) libs/code/deepagents_code/goal_rubric.py:1306 — goal_rubric._conversation_context has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2, ternaries 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.
D2 · Cognitive Complexity · main._run_acp_cli_async (cognitive 18) · ×1
  • main._run_acp_cli_async (cognitive 18) libs/code/deepagents_code/main.py:3515 — main._run_acp_cli_async has cognitive complexity 18 (threshold 15). Drivers by points: error handling 7 (8 pts), if/else 4, ternaries 3, boolean chains 2, loops 1 (nesting depth added 1). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main._select_trust_action (cognitive 18) · ×1
  • main._select_trust_action (cognitive 18) libs/code/deepagents_code/main.py:4274 — main._select_trust_action has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 3, ternaries 2 (3 pts), error handling 2 (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, 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 · mcp_auth.find_oauth_challenge (cognitive 18) · ×1
  • mcp_auth.find_oauth_challenge (cognitive 18) REDACTED:2128 — mcp_auth.find_oauth_challenge has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ManagedMemoryGuardMiddleware._without_managed_block_edits (cognitive 18) · ×1
  • ManagedMemoryGuardMiddleware._without_managed_block_edits (cognitive 18) libs/code/deepagents_code/memory_guard.py:230 — ManagedMemoryGuardMiddleware._without_managed_block_edits has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · model_config.load_thread_config (cognitive 18) · ×1
  • model_config.load_thread_config (cognitive 18) REDACTED:6165 — model_config.load_thread_config has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 3, loops 1 (2 pts), error handling 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · manifest.load_manifest (cognitive 18) · ×1
  • manifest.load_manifest (cognitive 18) libs/code/deepagents_code/plugins/manifest.py:256 — manifest.load_manifest has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 3, error handling 2, ternaries 2, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · subagents._parse_subagent_file (cognitive 18) · ×1
  • subagents._parse_subagent_file (cognitive 18) libs/code/deepagents_code/subagents.py:67 — subagents._parse_subagent_file has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, error handling 2, ternaries 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · subagents._load_subagents_from_dir (cognitive 18) · ×1
  • subagents._load_subagents_from_dir (cognitive 18) libs/code/deepagents_code/subagents.py:177 — subagents._load_subagents_from_dir has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _QuestionWidget._update_choice_selection (cognitive 18) · ×1
  • _QuestionWidget._update_choice_selection (cognitive 18) libs/code/deepagents_code/tui/widgets/ask_user.py:1280 — _QuestionWidget._update_choice_selection has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ToolCallMessage._format_js_eval_output (cognitive 18) · ×1
  • ToolCallMessage._format_js_eval_output (cognitive 18) libs/code/deepagents_code/tui/widgets/messages.py:3652 — ToolCallMessage._format_js_eval_output has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 5 (7 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ToolGroupSummary._render_line (cognitive 18) · ×1
  • ToolGroupSummary._render_line (cognitive 18) libs/code/deepagents_code/tui/widgets/messages.py:5271 — ToolGroupSummary._render_line has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffMessage.compose (cognitive 18) · ×1
  • DiffMessage.compose (cognitive 18) libs/code/deepagents_code/tui/widgets/messages.py:5623 — DiffMessage.compose has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ThreadSelectorScreen.on_select_changed (cognitive 18) · ×1
  • ThreadSelectorScreen.on_select_changed (cognitive 18) libs/code/deepagents_code/tui/widgets/thread_selector.py:2842 — ThreadSelectorScreen.on_select_changed has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), ternaries 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContextHubBackend.ls (cognitive 18) · ×1
  • ContextHubBackend.ls (cognitive 18) libs/deepagents/deepagents/backends/context_hub.py:564 — ContextHubBackend.ls has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 2 (5 pts), boolean chains 1, error handling 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FilesystemBackend._ripgrep_search (cognitive 18) · ×1
  • FilesystemBackend._ripgrep_search (cognitive 18) libs/deepagents/deepagents/backends/filesystem.py:913 — FilesystemBackend._ripgrep_search has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 1, error handling 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 · FilesystemMiddleware._with_filtered_grep_description (cognitive 18) · ×1
  • FilesystemMiddleware._with_filtered_grep_description (cognitive 18) libs/deepagents/deepagents/middleware/filesystem.py:2894 — FilesystemMiddleware._with_filtered_grep_description has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, loops 1, ternaries 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. This shape REPEATS in the file: one other method here (FilesystemMiddleware._with_filtered_execute_description) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · FilesystemMiddleware._with_filtered_execute_description (cognitive 18) · ×1
  • FilesystemMiddleware._with_filtered_execute_description (cognitive 18) libs/deepagents/deepagents/middleware/filesystem.py:2957 — FilesystemMiddleware._with_filtered_execute_description has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, loops 1, ternaries 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. This shape REPEATS in the file: one other method here (FilesystemMiddleware._with_filtered_grep_description) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · FilesystemMiddleware.wrap_model_call (cognitive 18) · ×1
  • FilesystemMiddleware.wrap_model_call (cognitive 18) libs/deepagents/deepagents/middleware/filesystem.py:3381 — FilesystemMiddleware.wrap_model_call has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 3 (6 pts), boolean chains 1, error handling 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. This shape REPEATS in the file: one other method here (FilesystemMiddleware.awrap_model_call) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · FilesystemMiddleware.awrap_model_call (cognitive 18) · ×1
  • FilesystemMiddleware.awrap_model_call (cognitive 18) libs/deepagents/deepagents/middleware/filesystem.py:3443 — FilesystemMiddleware.awrap_model_call has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 3 (6 pts), boolean chains 1, error handling 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. This shape REPEATS in the file: one other method here (FilesystemMiddleware.wrap_model_call) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · filesystem._move_media_results_after_tool_results (cognitive 18) · ×1
  • filesystem._move_media_results_after_tool_results (cognitive 18) libs/deepagents/deepagents/middleware/filesystem.py:233 — filesystem._move_media_results_after_tool_results has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · run_trials._collect_numeric_values (cognitive 18) · ×1
  • run_trials._collect_numeric_values (cognitive 18) libs/evals/scripts/run_trials.py:122 — run_trials._collect_numeric_values has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · provider._ensure_blueprint (cognitive 18) · ×1
  • provider._ensure_blueprint (cognitive 18) libs/partners/runloop/langchain_runloop/provider.py:69 — provider._ensure_blueprint has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), error handling 2 (3 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConversationSaver._messages (cognitive 18) · ×1
  • ConversationSaver._messages (cognitive 18) libs/talon/deepagents_talon/archive_saver.py:210 — ConversationSaver._messages has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 11). 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.
D2 · Cognitive Complexity · whatsapp._parse_message (cognitive 18) · ×1
  • whatsapp._parse_message (cognitive 18) REDACTED:839 — whatsapp._parse_message has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 15, if/else 2, ternaries 1. 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.
D2 · Cognitive Complexity · store_archive._chunks (cognitive 18) · ×1
  • store_archive._chunks (cognitive 18) libs/talon/deepagents_talon/store_archive.py:69 — store_archive._chunks has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 6, if/else 3 (6 pts), loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · check_dep_freshness.check_dependency_freshness (cognitive 18) · ×1
  • check_dep_freshness.check_dependency_freshness (cognitive 18) .github/scripts/release/check_dep_freshness.py:488 — check_dep_freshness.check_dependency_freshness has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 3 (4 pts), error handling 1 (2 pts), loops 2, 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.
D2 · Cognitive Complexity · ServerConfig.__post_init__ (cognitive 17) · ×1
  • ServerConfig.__post_init__ (cognitive 17) libs/code/deepagents_code/_server_config.py:748 — ServerConfig.__post_init__ has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 4 (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.
D2 · Cognitive Complexity · agent.load_async_subagents (cognitive 17) · ×1
  • agent.load_async_subagents (cognitive 17) libs/code/deepagents_code/agent.py:1152 — agent.load_async_subagents has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeepAgentsApp._sync_cache_state_from_state (cognitive 17) · ×1
  • DeepAgentsApp._sync_cache_state_from_state (cognitive 17) libs/code/deepagents_code/app.py:9471 — DeepAgentsApp._sync_cache_state_from_state has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 5, ternaries 2, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeepAgentsApp._set_spinner (cognitive 17) · ×1
  • DeepAgentsApp._set_spinner (cognitive 17) libs/code/deepagents_code/app.py:10916 — DeepAgentsApp._set_spinner has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 3 (6 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.
D2 · Cognitive Complexity · DeepAgentsApp._confirm_then_resume_owned_cross_agent_thread (cognitive 17) · ×1
  • DeepAgentsApp._confirm_then_resume_owned_cross_agent_thread (cognitive 17) libs/code/deepagents_code/app.py:30176 — DeepAgentsApp._confirm_then_resume_owned_cross_agent_thread has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, error handling 4, 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.
D2 · Cognitive Complexity · DeepAgentsApp._retry_startup_with_model (cognitive 17) · ×1
  • DeepAgentsApp._retry_startup_with_model (cognitive 17) libs/code/deepagents_code/app.py:32098 — DeepAgentsApp._retry_startup_with_model has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, boolean chains 6, error handling 1, ternaries 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 · inspect_sessions._ensure_runtime (cognitive 17) · ×1
  • inspect_sessions._ensure_runtime (cognitive 17) libs/code/deepagents_code/built_in_skills/deepagents-thread-inspector/scripts/inspect_sessions.py:42 — inspect_sessions._ensure_runtime has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 2 (4 pts), loops 2, 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.
D2 · Cognitive Complexity · inspect_sessions._reconstruct_messages (cognitive 17) · ×1
  • inspect_sessions._reconstruct_messages (cognitive 17) libs/code/deepagents_code/built_in_skills/deepagents-thread-inspector/scripts/inspect_sessions.py:346 — inspect_sessions._reconstruct_messages has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · inspect_sessions._message_record (cognitive 17) · ×1
  • inspect_sessions._message_record (cognitive 17) libs/code/deepagents_code/built_in_skills/deepagents-thread-inspector/scripts/inspect_sessions.py:465 — inspect_sessions._message_record has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 1 (2 pts), ternaries 2, boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · non_interactive._process_hitl_interrupts (cognitive 17) · ×1
  • non_interactive._process_hitl_interrupts (cognitive 17) libs/code/deepagents_code/client/non_interactive.py:1865 — non_interactive._process_hitl_interrupts has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (7 pts), ternaries 2 (6 pts), loops 2 (3 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.
D2 · Cognitive Complexity · cold_cache.resolve_prompt_cache_policy (cognitive 17) · ×1
  • cold_cache.resolve_prompt_cache_policy (cognitive 17) libs/code/deepagents_code/cold_cache.py:815 — cold_cache.resolve_prompt_cache_policy has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 3, ternaries 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, 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 · config.langsmith_key_shadowed_by_empty_override (cognitive 17) · ×1
  • config.langsmith_key_shadowed_by_empty_override (cognitive 17) REDACTED:4419 — config.langsmith_key_shadowed_by_empty_override has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 3, error handling 1 (3 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · config.detect_provider (cognitive 17) · ×1
  • config.detect_provider (cognitive 17) REDACTED:5575 — config.detect_provider has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · doctor._render_text (cognitive 17) · ×1
  • doctor._render_text (cognitive 17) libs/code/deepagents_code/doctor.py:774 — doctor._render_text has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (13 pts), loops 2 (3 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.
D2 · Cognitive Complexity · goal_rubric._goal_criteria_request (cognitive 17) · ×1
  • goal_rubric._goal_criteria_request (cognitive 17) libs/code/deepagents_code/goal_rubric.py:1200 — goal_rubric._goal_criteria_request has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · input._token_to_path (cognitive 17) · ×1
  • input._token_to_path (cognitive 17) libs/code/deepagents_code/input.py:811 — input._token_to_path has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _DaytonaProvider.get_or_create (cognitive 17) · ×1
  • _DaytonaProvider.get_or_create (cognitive 17) libs/code/deepagents_code/integrations/sandbox_factory.py:490 — _DaytonaProvider.get_or_create has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (6 pts), ternaries 3 (5 pts), error handling 2 (3 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · _ModalProvider.get_or_create (cognitive 17) · ×1
  • _ModalProvider.get_or_create (cognitive 17) libs/code/deepagents_code/integrations/sandbox_factory.py:712 — _ModalProvider.get_or_create has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 1 (3 pts), ternaries 1 (3 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mcp_auth._run_device_flow (cognitive 17) · ×1
  • mcp_auth._run_device_flow (cognitive 17) REDACTED:1883 — mcp_auth._run_device_flow has cognitive complexity 17 (threshold 15). Drivers by points: error handling 5 (8 pts), if/else 4 (7 pts), loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · model_config.resolve_env_var (cognitive 17) · ×1
  • model_config.resolve_env_var (cognitive 17) REDACTED:102 — model_config.resolve_env_var has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 4 (nesting depth added 8). 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.
D2 · Cognitive Complexity · load.list_skills (cognitive 17) · ×1
  • load.list_skills (cognitive 17) libs/code/deepagents_code/skills/load.py:48 — load.list_skills has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (3 pts), boolean chains 2, error handling 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.
D2 · Cognitive Complexity · SlashCommandController._score_command (cognitive 17) · ×1
  • SlashCommandController._score_command (cognitive 17) libs/code/deepagents_code/tui/widgets/autocomplete.py:213 — SlashCommandController._score_command has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, loops 1 (2 pts), ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UserMessage._append_highlighted_body (cognitive 17) · ×1
  • UserMessage._append_highlighted_body (cognitive 17) libs/code/deepagents_code/tui/widgets/messages.py:874 — UserMessage._append_highlighted_body has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _excluded_middleware._apply_excluded_middleware (cognitive 17) · ×1
  • _excluded_middleware._apply_excluded_middleware (cognitive 17) libs/deepagents/deepagents/_excluded_middleware.py:90 — _excluded_middleware._apply_excluded_middleware has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _video._sample_frames_in_window (cognitive 17) · ×1
  • _video._sample_frames_in_window (cognitive 17) libs/deepagents/deepagents/middleware/_video.py:301 — _video._sample_frames_in_window has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 1, error handling 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · filesystem._parallel_file_mutation_error (cognitive 17) · ×1
  • filesystem._parallel_file_mutation_error (cognitive 17) libs/deepagents/deepagents/middleware/filesystem.py:199 — filesystem._parallel_file_mutation_error has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), error handling 2 (3 pts), boolean chains 2, ternaries 2, 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.
D2 · Cognitive Complexity · filesystem._find_delete_deny_patterns (cognitive 17) · ×1
  • filesystem._find_delete_deny_patterns (cognitive 17) libs/deepagents/deepagents/middleware/filesystem.py:635 — filesystem._find_delete_deny_patterns has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SummarizationToolMiddleware._is_compaction_clause_met (cognitive 17) · ×1
  • SummarizationToolMiddleware._is_compaction_clause_met (cognitive 17) libs/deepagents/deepagents/middleware/summarization.py:2206 — SummarizationToolMiddleware._is_compaction_clause_met has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · harness_profiles._harness_profile_for_model (cognitive 17) · ×1
  • harness_profiles._harness_profile_for_model (cognitive 17) libs/deepagents/deepagents/profiles/harness/harness_profiles.py:1319 — harness_profiles._harness_profile_for_model has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 2, loops 2, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli._collect_failed_nodeids (cognitive 17) · ×1
  • cli._collect_failed_nodeids (cognitive 17) libs/evals/deepagents_evals/cli.py:350 — cli._collect_failed_nodeids has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), boolean chains 1, ternaries 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 · whatsapp._enforce_inbound_media_cap (cognitive 17) · ×1
  • whatsapp._enforce_inbound_media_cap (cognitive 17) REDACTED:915 — whatsapp._enforce_inbound_media_cap has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 2 (4 pts), boolean chains 1, loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mcp._remote_connection (cognitive 17) · ×1
  • mcp._remote_connection (cognitive 17) REDACTED:828 — mcp._remote_connection has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 5 (7 pts), ternaries 1 (nesting depth added 2). 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.
D2 · Cognitive Complexity · aggregate_shards.build_summary (cognitive 17) · ×1
  • aggregate_shards.build_summary (cognitive 17) .github/scripts/evals/aggregate_shards.py:371 — aggregate_shards.build_summary has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (7 pts), if/else 2 (5 pts), loops 2 (3 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 · aggregate_unified_compare.render_markdown (cognitive 17) · ×1
  • aggregate_unified_compare.render_markdown (cognitive 17) .github/scripts/evals/aggregate_unified_compare.py:692 — aggregate_unified_compare.render_markdown has cognitive complexity 17 (threshold 15). Drivers by points: loops 8 (12 pts), if/else 2, ternaries 1 (2 pts), boolean chains 1 (nesting depth added 5). 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 · check_release_deps._manifest_requirements (cognitive 17) · ×1
  • check_release_deps._manifest_requirements (cognitive 17) .github/scripts/release/check_release_deps.py:549 — check_release_deps._manifest_requirements has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), error handling 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.
D2 · Cognitive Complexity · _git.find_git_common_dir (cognitive 16) · ×1
  • _git.find_git_common_dir (cognitive 16) libs/code/deepagents_code/_git.py:276 — _git.find_git_common_dir has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 3, error handling 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.
D2 · Cognitive Complexity · SessionStats.retract_request (cognitive 16) · ×1
  • SessionStats.retract_request (cognitive 16) libs/code/deepagents_code/_session_stats.py:332 — SessionStats.retract_request has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 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.
D2 · Cognitive Complexity · ToolCallBuffer._scan_args_fragment (cognitive 16) · ×1
  • ToolCallBuffer._scan_args_fragment (cognitive 16) libs/code/deepagents_code/_tool_stream.py:431 — ToolCallBuffer._scan_args_fragment has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (15 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 · DeepAgentsApp._check_optional_tools_background (cognitive 16) · ×1
  • DeepAgentsApp._check_optional_tools_background (cognitive 16) libs/code/deepagents_code/app.py:5812 — DeepAgentsApp._check_optional_tools_background has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), error handling 4 (5 pts), boolean chains 2, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeepAgentsApp._check_for_updates_impl (cognitive 16) · ×1
  • DeepAgentsApp._check_for_updates_impl (cognitive 16) libs/code/deepagents_code/app.py:7037 — DeepAgentsApp._check_for_updates_impl has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), error handling 3, ternaries 3 (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.
D2 · Cognitive Complexity · DeepAgentsApp._perform_app_upgrade_unlocked (cognitive 16) · ×1
  • DeepAgentsApp._perform_app_upgrade_unlocked (cognitive 16) libs/code/deepagents_code/app.py:7616 — DeepAgentsApp._perform_app_upgrade_unlocked has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 2 (4 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeepAgentsApp._uninstall_extra_unlocked (cognitive 16) · ×1
  • DeepAgentsApp._uninstall_extra_unlocked (cognitive 16) libs/code/deepagents_code/app.py:8312 — DeepAgentsApp._uninstall_extra_unlocked has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (7 pts), if/else 5, error handling 3, boolean chains 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeepAgentsApp._run_launch_init_sequence (cognitive 16) · ×1
  • DeepAgentsApp._run_launch_init_sequence (cognitive 16) libs/code/deepagents_code/app.py:12459 — DeepAgentsApp._run_launch_init_sequence has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, error handling 3 (4 pts) (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 · DeepAgentsApp._handle_trace_command (cognitive 16) · ×1
  • DeepAgentsApp._handle_trace_command (cognitive 16) libs/code/deepagents_code/app.py:14136 — DeepAgentsApp._handle_trace_command has cognitive complexity 16 (threshold 15). Drivers by points: error handling 7 (8 pts), if/else 6 (7 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body into named stages: move each independent 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 · DeepAgentsApp._sync_status_model (cognitive 16) · ×1
  • DeepAgentsApp._sync_status_model (cognitive 16) libs/code/deepagents_code/app.py:19469 — DeepAgentsApp._sync_status_model has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 4, error handling 3 (4 pts), if/else 4, ternaries 2 (4 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeepAgentsApp.action_toggle_auto_approve (cognitive 16) · ×1
  • DeepAgentsApp.action_toggle_auto_approve (cognitive 16) libs/code/deepagents_code/app.py:23668 — DeepAgentsApp.action_toggle_auto_approve has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, 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.
D2 · Cognitive Complexity · DeepAgentsApp._apply_optimistic_disabled_state (cognitive 16) · ×1
  • DeepAgentsApp._apply_optimistic_disabled_state (cognitive 16) libs/code/deepagents_code/app.py:28316 — DeepAgentsApp._apply_optimistic_disabled_state has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · config._display_value (cognitive 16) · ×1
  • config._display_value (cognitive 16) libs/code/deepagents_code/client/commands/config.py:395 — config._display_value has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 2 (5 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · remote_client._validated_offload_result (cognitive 16) · ×1
  • remote_client._validated_offload_result (cognitive 16) libs/code/deepagents_code/client/remote_client.py:124 — remote_client._validated_offload_result has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · config_manifest.resolve_auto_classifier_timeout_with_source (cognitive 16) · ×1
  • config_manifest.resolve_auto_classifier_timeout_with_source (cognitive 16) libs/code/deepagents_code/config_manifest.py:1510 — config_manifest.resolve_auto_classifier_timeout_with_source has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · configurable_model._effective_cache_params (cognitive 16) · ×1
  • configurable_model._effective_cache_params (cognitive 16) libs/code/deepagents_code/configurable_model.py:699 — configurable_model._effective_cache_params has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, ternaries 3 (6 pts), if/else 3, error handling 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · resolver.get_config_resolver (cognitive 16) · ×1
  • resolver.get_config_resolver (cognitive 16) libs/code/deepagents_code/configuration/resolver.py:514 — resolver.get_config_resolver has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cost_tracking._find_override_model (cognitive 16) · ×1
  • cost_tracking._find_override_model (cognitive 16) libs/code/deepagents_code/cost_tracking.py:1285 — cost_tracking._find_override_model has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server_middleware._ask_permission_via_hitl (cognitive 16) · ×1
  • server_middleware._ask_permission_via_hitl (cognitive 16) libs/code/deepagents_code/hooks/server_middleware.py:1225 — server_middleware._ask_permission_via_hitl has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 3, ternaries 2 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · trust._load_store (cognitive 16) · ×1
  • trust._load_store (cognitive 16) libs/code/deepagents_code/hooks/trust.py:148 — trust._load_store has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 4 (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 · SandboxConfig.load (cognitive 16) · ×1
  • SandboxConfig.load (cognitive 16) libs/code/deepagents_code/integrations/sandbox_config.py:111 — SandboxConfig.load has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 4, ternaries 3 (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 · _ExpiryAwareOAuthClientProvider._refresh_lock_guard (cognitive 16) · ×1
  • _ExpiryAwareOAuthClientProvider._refresh_lock_guard (cognitive 16) REDACTED:1530 — _ExpiryAwareOAuthClientProvider._refresh_lock_guard has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), error handling 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · offload_api._validate_context (cognitive 16) · ×1
  • offload_api._validate_context (cognitive 16) libs/code/deepagents_code/offload_api.py:595 — offload_api._validate_context has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 5 (7 pts), loops 2 (nesting depth added 2). To reduce it, split the body into named stages: move each independent 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 · state_migration.migrate_legacy_state (cognitive 16) · ×1
  • state_migration.migrate_legacy_state (cognitive 16) libs/code/deepagents_code/state_migration.py:57 — state_migration.migrate_legacy_state has cognitive complexity 16 (threshold 15). Drivers by points: error handling 4 (7 pts), if/else 5 (7 pts), loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · textual_adapter._settle_attempt_for_retry (cognitive 16) · ×1
  • textual_adapter._settle_attempt_for_retry (cognitive 16) REDACTED:507 — textual_adapter._settle_attempt_for_retry has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), error handling 2 (5 pts), loops 1 (2 pts), boolean chains 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CollapsingPasteTextArea._find_placeholder_span (cognitive 16) · ×1
  • CollapsingPasteTextArea._find_placeholder_span (cognitive 16) libs/code/deepagents_code/tui/widgets/_paste_textarea.py:817 — CollapsingPasteTextArea._find_placeholder_span has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AuthPromptScreen.on_input_submitted (cognitive 16) · ×1
  • AuthPromptScreen.on_input_submitted (cognitive 16) libs/code/deepagents_code/tui/widgets/auth.py:1276 — AuthPromptScreen.on_input_submitted has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, error handling 1, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MessageData.from_widget (cognitive 16) · ×1
  • MessageData.from_widget (cognitive 16) libs/code/deepagents_code/tui/widgets/message_store.py:496 — MessageData.from_widget has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (12 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · _blob_offload._pending_blobs (cognitive 16) · ×1
  • _blob_offload._pending_blobs (cognitive 16) libs/deepagents/deepagents/middleware/_blob_offload.py:60 — _blob_offload._pending_blobs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 2 (5 pts), error handling 1 (3 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RubricMiddleware._revision_prompt (cognitive 16) · ×1
  • RubricMiddleware._revision_prompt (cognitive 16) libs/deepagents/deepagents/middleware/rubric.py:1166 — RubricMiddleware._revision_prompt has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · summarization._rewrite_data_url_blocks (cognitive 16) · ×1
  • summarization._rewrite_data_url_blocks (cognitive 16) libs/deepagents/deepagents/middleware/summarization.py:427 — summarization._rewrite_data_url_blocks has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EntityResolutionGuardMiddleware._missing_current_branch_resolutions (cognitive 16) · ×1
  • EntityResolutionGuardMiddleware._missing_current_branch_resolutions (cognitive 16) libs/deepagents/deepagents/profiles/harness/_nvidia_nemotron_3_ultra.py:1500 — EntityResolutionGuardMiddleware._missing_current_branch_resolutions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · radar.generate_radar (cognitive 16) · ×1
  • radar.generate_radar (cognitive 16) libs/evals/deepagents_evals/radar.py:132 — radar.generate_radar has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), loops 3 (5 pts), boolean chains 2, ternaries 1 (2 pts), error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · failure._extract_observation_texts (cognitive 16) · ×1
  • failure._extract_observation_texts (cognitive 16) libs/evals/deepagents_harbor/failure.py:95 — failure._extract_observation_texts has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (3 pts), boolean chains 2, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · failure.classify_failure (cognitive 16) · ×1
  • failure.classify_failure (cognitive 16) libs/evals/deepagents_harbor/failure.py:178 — failure.classify_failure has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _prompt._json_schema_to_ts (cognitive 16) · ×1
  • _prompt._json_schema_to_ts (cognitive 16) libs/partners/quickjs/langchain_quickjs/_prompt.py:519 — _prompt._json_schema_to_ts has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 2 (5 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _repl._inject_tool_args_for_ptc (cognitive 16) · ×1
  • _repl._inject_tool_args_for_ptc (cognitive 16) libs/partners/quickjs/langchain_quickjs/_repl.py:251 — _repl._inject_tool_args_for_ptc has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 1 (4 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TelegramChannel._poll_updates (cognitive 16) · ×1
  • TelegramChannel._poll_updates (cognitive 16) REDACTED:591 — TelegramChannel._poll_updates has cognitive complexity 16 (threshold 15). Drivers by points: error handling 3 (6 pts), if/else 2 (4 pts), loops 2 (3 pts), ternaries 1 (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.
D2 · Cognitive Complexity · WhatsAppChannel._poll_messages (cognitive 16) · ×1
  • WhatsAppChannel._poll_messages (cognitive 16) REDACTED:600 — WhatsAppChannel._poll_messages has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (3 pts), error handling 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.
D2 · Cognitive Complexity · HistoryVectorIndex.close (cognitive 16) · ×1
  • HistoryVectorIndex.close (cognitive 16) libs/talon/deepagents_talon/history_vectors.py:105 — HistoryVectorIndex.close has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TalonHost._effort_command (cognitive 16) · ×1
  • TalonHost._effort_command (cognitive 16) libs/talon/deepagents_talon/host.py:752 — TalonHost._effort_command has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, error handling 1, ternaries 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, 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 · models._resolve_models (cognitive 16) · ×1
  • models._resolve_models (cognitive 16) .github/scripts/evals/models.py:825 — models._resolve_models has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (16 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · check_pr_scope_files._release_files (cognitive 16) · ×1
  • check_pr_scope_files._release_files (cognitive 16) .github/scripts/labeling/check_pr_scope_files.py:30 — check_pr_scope_files._release_files has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (3 pts), boolean chains 2, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · build_release_notes.build_base_body (cognitive 16) · ×1
  • build_release_notes.build_base_body (cognitive 16) .github/scripts/release/build_release_notes.py:1548 — build_release_notes.build_base_body has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D22 · Internal API Consistency · Inconsistent session lifecycle naming and parameter structure. `new_session` creates a session and returns a response, while `load_session` retrieves an existing one. However, `load_session` requires the `session_id` as an explicit argument, whereas `new_session` does not return the ID in its signature (implied in response). More critically, the naming convention `new_` vs `load_` is inconsistent with standard CRUD patterns (e.g., `create`/`get` or `init`/`restore`). Additionally, `new_session` accepts `mcp_servers` as a parameter to configure the new session, but `load_session` also accepts `mcp_servers`, implying that loading a session might override or merge MCP configurations, which is a subtle behavioral inconsistency not reflected in the naming. · ×1
  • Inconsistent session lifecycle naming and parameter structure. `new_session` creates a session and returns a response, while `load_session` retrieves an existing one. However, `load_session` requires the `session_id` as an explicit argument, whereas `new_session` does not return the ID in its signature (implied in response). More critically, the naming convention `new_` vs `load_` is inconsistent with standard CRUD patterns (e.g., `create`/`get` or `init`/`restore`). Additionally, `new_session` accepts `mcp_servers` as a parameter to configure the new session, but `load_session` also accepts `mcp_servers`, implying that loading a session might override or merge MCP configurations, which is a subtle behavioral inconsistency not reflected in the naming. — Unify session management under a consistent lifecycle pattern. Consider renaming `new_session` to `create_session` and `load_session` to `restore_session` or `get_session`. Ensure that if `mcp_servers` is a configuration parameter for creation, it should be clearly documented whether it applies to restoration (likely it should be ignored or merged explicitly). Alternatively, use a single `manage_session` operation with an action enum. (signatures: libs.acp.deepagents_acp.server.AgentServerACP.new_session(self, cwd: str, ...) | libs.acp.deepagents_acp.server.AgentServerACP.load_session(self, cwd: str, session_id: str, ...))
D22 · Internal API Consistency · Duplicate intent with inconsistent return types and naming. `read_git_branch_from_filesystem` and `read_git_branch_via_subprocess` perform the same logical operation (reading the current git branch) but use different mechanisms. The naming `from_filesystem` vs `via_subprocess` exposes implementation details rather than intent. Furthermore, their return types differ · ×1
  • Duplicate intent with inconsistent return types and naming. `read_git_branch_from_filesystem` and `read_git_branch_via_subprocess` perform the same logical operation (reading the current git branch) but use different mechanisms. The naming `from_filesystem` vs `via_subprocess` exposes implementation details rather than intent. Furthermore, their return types differ: the filesystem version returns `str | None` (allowing for 'no branch' state), while the subprocess version returns `str` (likely raising an exception or returning a default on failure). This inconsistency forces callers to handle different error states for the same logical outcome. — Abstract these into a single public method, e.g., `get_current_branch(path: str | Path) -> str | None`, which internally chooses the best strategy (filesystem first, then subprocess) and handles errors consistently. Expose only the unified interface. (signatures: libs.code.deepagents_code._git.read_git_branch_from_filesystem(path: str | Path): str | None | libs.code.deepagents_code._git.read_git_branch_via_subprocess(path: str | Path): str)
D22 · Internal API Consistency · Same inconsistency as branch reading. Duplicate intent with implementation-specific naming (`from_filesystem` vs `via_subprocess`) and inconsistent return types (`str | None` vs `str`). This pattern repeats for `read_git_remote_url` as well. · ×1
  • Same inconsistency as branch reading. Duplicate intent with implementation-specific naming (`from_filesystem` vs `via_subprocess`) and inconsistent return types (`str | None` vs `str`). This pattern repeats for `read_git_remote_url` as well. — Unify into `get_current_commit_sha(path: str | Path) -> str | None` and `get_remote_url(path: str | Path) -> str | None`, hiding the implementation strategy from the public API. (signatures: libs.code.deepagents_code._git.read_git_commit_sha_from_filesystem(path: str | Path): str | None | libs.code.deepagents_code._git.read_git_commit_sha_via_subprocess(path: str | Path): str)
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D35 · Change Coupling · Change coupling · ×1
  • Change coupling: _server_config.py ↔ ui.py libs/code/deepagents_code/_server_config.py:1 — `libs/code/deepagents_code/_server_config.py` and `libs/code/deepagents_code/ui.py` change together 59% of the time (10 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 between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `4f34c51d` feat(code): add `/summarization-model` (#5884); `4379a463` fix(code): defer the recursion limit to the LangGraph server (#5882); `94962a5f` feat(code): raise agent recursion limit to 2000 and make it configura… — run `git show` on any of them.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member pair (100 shared lines) · ×1
  • Near-duplicate member pair (100 shared lines) libs/deepagents/deepagents/middleware/summarization.py:1531 — libs/deepagents/deepagents/middleware/summarization.py:1531-1662 | libs/deepagents/deepagents/middleware/summarization.py:1669-1801 — These two members are variants of one another: 100 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (62 shared lines) · ×1
  • Near-duplicate member pair (62 shared lines) libs/deepagents/deepagents/middleware/filesystem.py:2305 — libs/deepagents/deepagents/middleware/filesystem.py:2305-2393 | libs/deepagents/deepagents/middleware/filesystem.py:2493-2583 — These two members are variants of one another: 62 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (46 shared lines) · ×1
  • Near-duplicate member pair (46 shared lines) libs/code/deepagents_code/_repository_bounds.py:275 — libs/code/deepagents_code/_repository_bounds.py:275-338 | libs/code/deepagents_code/_repository_bounds.py:341-401 — These two members are variants of one another: 46 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (45 shared lines) · ×1
  • Near-duplicate member pair (45 shared lines) libs/code/deepagents_code/main.py:1339 — libs/code/deepagents_code/main.py:1339-1446 | libs/code/deepagents_code/main.py:4047-4216 — These two members are variants of one another: 45 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (41 shared lines) · ×1
  • Near-duplicate member pair (41 shared lines) libs/code/deepagents_code/main.py:4047 — libs/code/deepagents_code/main.py:4047-4216 | libs/code/deepagents_code/main.py:4393-4570 — These two members are variants of one another: 41 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (37 shared lines) · ×1
  • Near-duplicate member pair (37 shared lines) libs/deepagents/deepagents/backends/composite.py:467 — libs/deepagents/deepagents/backends/composite.py:467-549 | libs/deepagents/deepagents/backends/composite.py:559-611 — These two members are variants of one another: 37 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Edited copy of a member (32 corresponding lines) · ×1
  • Edited copy of a member (32 corresponding lines) libs/code/deepagents_code/client/launch/server_manager.py:331 — libs/code/deepagents_code/client/launch/server_manager.py:331-488 | libs/code/deepagents_code/client/launch/server_manager.py:532-633 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Members sharing a duplicated core (11 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (11 members, 50+ identical tokens) REDACTED:4095 — REDACTED:4095-4154 | REDACTED:4334-4402 | REDACTED:4514-4576 | REDACTED:4654-4734 | REDACTED:4738-4800 | REDACTED:5949-6072 | REDACTED:6320-6360 | REDACTED:6388-6424 | REDACTED:6609-6653 | REDACTED:6657-6703 | REDACTED:6892-6938 — These 11 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 11 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 11 times.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (5 members, 50+ identical tokens) libs/code/deepagents_code/app.py:21439 — libs/code/deepagents_code/app.py:21439-21462 | libs/code/deepagents_code/app.py:21484-21515 | libs/code/deepagents_code/app.py:21518-21543 | libs/code/deepagents_code/app.py:25417-25473 | libs/code/deepagents_code/app.py:26590-26627 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (4 members, 50+ identical tokens) libs/code/deepagents_code/ui.py:378 — libs/code/deepagents_code/ui.py:378-393 | libs/code/deepagents_code/ui.py:654-670 | libs/code/deepagents_code/ui.py:841-863 | libs/code/deepagents_code/ui.py:1007-1027 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Duplicated block (53–55 lines × 2) · ×1
  • Duplicated block (53–55 lines × 2) libs/deepagents/deepagents/middleware/filesystem.py:3147 — libs/deepagents/deepagents/middleware/filesystem.py:3147-3201 | libs/deepagents/deepagents/middleware/filesystem.py:3237-3289 — 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 (24–53 lines × 2) · ×1
  • Duplicated block (24–53 lines × 2) libs/deepagents/deepagents/middleware/summarization.py:1136 — libs/deepagents/deepagents/middleware/summarization.py:1136-1188 | libs/deepagents/deepagents/middleware/summarization.py:1218-1241 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (53 lines × 2) · ×1
  • Duplicated block (53 lines × 2) libs/deepagents/deepagents/middleware/summarization.py:1531 — libs/deepagents/deepagents/middleware/summarization.py:1531-1583 | libs/deepagents/deepagents/middleware/summarization.py:1669-1721 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `handler` to `Callable[[ModelRequest], ModelResponse]` in one and `Callable[[ModelRequest], Awaitable[ModelResponse]]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (50 lines × 2) · ×1
  • Duplicated block (50 lines × 2) libs/code/deepagents_code/built_in_skills/skill-creator/scripts/quick_validate.py:36 — libs/code/deepagents_code/built_in_skills/skill-creator/scripts/quick_validate.py:36-85 | libs/code/examples/skills/skill-creator/scripts/quick_validate.py:36-85 — before extracting anything, compare `libs/code/deepagents_code/built_in_skills/skill-creator/scripts/quick_validate.py` and `libs/code/examples/skills/skill-creator/scripts/quick_validate.py` as WHOLE FILES: 93% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (47 lines × 2) · ×1
  • Duplicated block (47 lines × 2) libs/code/deepagents_code/built_in_skills/skill-creator/scripts/quick_validate.py:102 — libs/code/deepagents_code/built_in_skills/skill-creator/scripts/quick_validate.py:102-148 | libs/code/examples/skills/skill-creator/scripts/quick_validate.py:96-142 — before extracting anything, compare `libs/code/deepagents_code/built_in_skills/skill-creator/scripts/quick_validate.py` and `libs/code/examples/skills/skill-creator/scripts/quick_validate.py` as WHOLE FILES: 93% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (33–39 lines × 2) · ×1
  • Duplicated block (33–39 lines × 2) libs/code/deepagents_code/configurable_model.py:530 — libs/code/deepagents_code/configurable_model.py:530-568 | libs/code/deepagents_code/configurable_model.py:617-649 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (34–36 lines × 2) · ×1
  • Duplicated block (34–36 lines × 2) libs/deepagents/deepagents/middleware/filesystem.py:2659 — libs/deepagents/deepagents/middleware/filesystem.py:2659-2694 | libs/deepagents/deepagents/middleware/filesystem.py:2736-2769 — 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 (26–34 lines × 2) · ×1
  • Duplicated block (26–34 lines × 2) libs/code/deepagents_code/ui.py:157 — libs/code/deepagents_code/ui.py:157-190 | libs/code/deepagents_code/ui.py:292-317 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/ui.py:292` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (28–32 lines × 2) · ×1
  • Duplicated block (28–32 lines × 2) libs/code/deepagents_code/ui.py:216 — libs/code/deepagents_code/ui.py:216-247 | libs/code/deepagents_code/ui.py:261-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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/ui.py:216` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (27–32 lines × 2) · ×1
  • Duplicated block (27–32 lines × 2) libs/deepagents/deepagents/_excluded_middleware.py:29 — libs/deepagents/deepagents/_excluded_middleware.py:29-55 | libs/deepagents/deepagents/_excluded_middleware.py:176-207 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (30–31 lines × 2) · ×1
  • Duplicated block (30–31 lines × 2) libs/deepagents/deepagents/middleware/filesystem.py:2589 — libs/deepagents/deepagents/middleware/filesystem.py:2589-2619 | libs/deepagents/deepagents/middleware/filesystem.py:2697-2726 — 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–30 lines × 2) · ×1
  • Duplicated block (17–30 lines × 2) libs/code/deepagents_code/ui.py:137 — libs/code/deepagents_code/ui.py:137-166 | libs/code/deepagents_code/ui.py:477-493 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/ui.py:137` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (30 lines × 2) · ×1
  • Duplicated block (30 lines × 2) libs/deepagents/deepagents/middleware/filesystem.py:2906 — libs/deepagents/deepagents/middleware/filesystem.py:2906-2935 | libs/deepagents/deepagents/middleware/filesystem.py:2982-3011 — 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 (25–29 lines × 2) · ×1
  • Duplicated block (25–29 lines × 2) libs/code/deepagents_code/_git.py:406 — libs/code/deepagents_code/_git.py:406-430 | libs/code/deepagents_code/_git.py:490-518 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (16–29 lines × 2) · ×1
  • Duplicated block (16–29 lines × 2) libs/deepagents/deepagents/backends/composite.py:878 — libs/deepagents/deepagents/backends/composite.py:878-906 | libs/deepagents/deepagents/backends/composite.py:921-936 — 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 (27–28 lines × 2) · ×1
  • Duplicated block (27–28 lines × 2) libs/deepagents/deepagents/middleware/filesystem.py:2789 — libs/deepagents/deepagents/middleware/filesystem.py:2789-2816 | libs/deepagents/deepagents/middleware/filesystem.py:2836-2862 — 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–27 lines × 2) · ×1
  • Duplicated block (14–27 lines × 2) libs/deepagents/deepagents/backends/composite.py:951 — libs/deepagents/deepagents/backends/composite.py:951-977 | libs/deepagents/deepagents/backends/composite.py:993-1006 — 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 (22–26 lines × 3) · ×1
  • Duplicated block (22–26 lines × 3) libs/code/deepagents_code/ui.py:169 — libs/code/deepagents_code/ui.py:169-192 | libs/code/deepagents_code/ui.py:252-277 | libs/code/deepagents_code/ui.py:296-317 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/ui.py:169` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (24–25 lines × 2) · ×1
  • Duplicated block (24–25 lines × 2) libs/code/deepagents_code/main.py:1377 — libs/code/deepagents_code/main.py:1377-1400 | libs/code/deepagents_code/main.py:4135-4159 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/main.py:4135` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (20–23 lines × 2) · ×1
  • Duplicated block (20–23 lines × 2) libs/code/deepagents_code/app.py:25696 — libs/code/deepagents_code/app.py:25696-25718 | libs/code/deepagents_code/app.py:32213-32232 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (19–23 lines × 2) · ×1
  • Duplicated block (19–23 lines × 2) libs/code/deepagents_code/tui/widgets/_paste_textarea.py:774 — libs/code/deepagents_code/tui/widgets/_paste_textarea.py:774-792 | libs/code/deepagents_code/tui/widgets/chat_input.py:1556-1578 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (11–23 lines × 3) · ×1
  • Duplicated block (11–23 lines × 3) libs/evals/scripts/harbor_langsmith.py:40 — libs/evals/scripts/harbor_langsmith.py:40-62 | libs/evals/scripts/harbor_langsmith.py:64-86 | libs/evals/scripts/harbor_langsmith.py:87-97 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/evals/scripts/harbor_langsmith.py:40` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (18–22 lines × 2) · ×1
  • Duplicated block (18–22 lines × 2) libs/code/deepagents_code/main.py:2425 — libs/code/deepagents_code/main.py:2425-2442 | libs/code/deepagents_code/main.py:2445-2466 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/main.py:2425` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (14–22 lines × 2) · ×1
  • Duplicated block (14–22 lines × 2) libs/code/deepagents_code/tui/widgets/messages.py:2865 — libs/code/deepagents_code/tui/widgets/messages.py:2865-2886 | libs/code/deepagents_code/tui/widgets/messages.py:2904-2917 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/tui/widgets/messages.py:2865` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (9–21 lines × 3) · ×1
  • Duplicated block (9–21 lines × 3) libs/code/deepagents_code/ui.py:140 — libs/code/deepagents_code/ui.py:140-160 | libs/code/deepagents_code/ui.py:483-491 | libs/code/deepagents_code/ui.py:970-980 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/ui.py:140` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (20 lines × 4) · ×1
  • Duplicated block (20 lines × 4) libs/deepagents/deepagents/middleware/filesystem.py:2312 — libs/deepagents/deepagents/middleware/filesystem.py:2312-2331 | libs/deepagents/deepagents/middleware/filesystem.py:2351-2370 | libs/deepagents/deepagents/middleware/filesystem.py:2406-2425 | libs/deepagents/deepagents/middleware/filesystem.py:2448-2467 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (19 lines × 5) · ×1
  • Duplicated block (19 lines × 5) libs/code/deepagents_code/app.py:21444 — libs/code/deepagents_code/app.py:21444-21462 | libs/code/deepagents_code/app.py:21497-21515 | libs/code/deepagents_code/app.py:21525-21543 | libs/code/deepagents_code/app.py:25441-25459 | libs/code/deepagents_code/app.py:26607-26625 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/app.py:21444` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (19 lines × 3) · ×1
  • Duplicated block (19 lines × 3) REDACTED:4654 — REDACTED:4654-4683 | REDACTED:6320-6340 | REDACTED:6388-6406 — 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 (18–19 lines × 2) · ×1
  • Duplicated block (18–19 lines × 2) libs/code/deepagents_code/ui.py:622 — libs/code/deepagents_code/ui.py:622-640 | libs/code/deepagents_code/ui.py:699-716 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/ui.py:622` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (18 lines × 3) · ×1
  • Duplicated block (18 lines × 3) libs/code/deepagents_code/agent.py:1132 — libs/code/deepagents_code/agent.py:1132-1149 | libs/code/deepagents_code/app.py:434-451 | libs/code/deepagents_code/client/non_interactive.py:1724-1741 — 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (17–18 lines × 2) · ×1
  • Duplicated block (17–18 lines × 2) REDACTED:1582 — REDACTED:1582-1599 | REDACTED:1837-1853 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1582` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (12–18 lines × 3) · ×1
  • Duplicated block (12–18 lines × 3) libs/code/deepagents_code/skills/commands.py:1093 — libs/code/deepagents_code/skills/commands.py:1093-1110 | libs/code/deepagents_code/skills/commands.py:1115-1132 | libs/code/deepagents_code/skills/commands.py:1136-1147 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/skills/commands.py:1093` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `libs/code/deepagents_code/skills/commands.py:1115` calls `add_argument` and `libs/code/deepagents_code/skills/commands.py:1136` does not — after which the two agree again for 5 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×1
  • Duplicated block (18 lines × 2) libs/deepagents/deepagents/middleware/summarization.py:1645 — libs/deepagents/deepagents/middleware/summarization.py:1645-1662 | libs/deepagents/deepagents/middleware/summarization.py:1784-1801 — 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–17 lines × 4) · ×1
  • Duplicated block (14–17 lines × 4) REDACTED:6334 — REDACTED:6334-6350 | REDACTED:6401-6414 | REDACTED:6630-6643 | REDACTED:6676-6689 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×1
  • Duplicated block (16–17 lines × 2) .github/scripts/evals/aggregate_unified_compare.py:599 — .github/scripts/evals/aggregate_unified_compare.py:599-615 | .github/scripts/evals/aggregate_unified_compare.py:622-637 — 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 (15–17 lines × 2) · ×1
  • Duplicated block (15–17 lines × 2) libs/code/deepagents_code/agent.py:745 — libs/code/deepagents_code/agent.py:745-759 | libs/code/deepagents_code/agent.py:784-800 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/agent.py:745` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×1
  • Duplicated block (17 lines × 2) libs/code/deepagents_code/main.py:4199 — libs/code/deepagents_code/main.py:4199-4215 | libs/code/deepagents_code/main.py:4551-4567 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/main.py:4199` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (9–16 lines × 5) · ×1
  • Duplicated block (9–16 lines × 5) libs/code/deepagents_code/ui.py:153 — libs/code/deepagents_code/ui.py:153-168 | libs/code/deepagents_code/ui.py:446-455 | libs/code/deepagents_code/ui.py:478-486 | libs/code/deepagents_code/ui.py:990-1001 | libs/code/deepagents_code/ui.py:1062-1071 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/ui.py:153` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×1
  • Duplicated block (15–16 lines × 2) REDACTED:4612 — REDACTED:4612-4627 | REDACTED:4765-4779 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (9–15 lines × 6) · ×1
  • Duplicated block (9–15 lines × 6) REDACTED:4136 — REDACTED:4136-4145 | REDACTED:4387-4395 | REDACTED:4561-4570 | REDACTED:6053-6067 | REDACTED:6686-6695 | REDACTED:6923-6931 — all 6 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. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:4561` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (14–15 lines × 6) · ×1
  • Duplicated block (14–15 lines × 6) libs/deepagents/deepagents/middleware/filesystem.py:2047 — libs/deepagents/deepagents/middleware/filesystem.py:2047-2060 | libs/deepagents/deepagents/middleware/filesystem.py:2086-2099 | libs/deepagents/deepagents/middleware/filesystem.py:2317-2331 | libs/deepagents/deepagents/middleware/filesystem.py:2356-2370 | libs/deepagents/deepagents/middleware/filesystem.py:2411-2425 | libs/deepagents/deepagents/middleware/filesystem.py:2453-2467 — all 6 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 (12–15 lines × 5) · ×1
  • Duplicated block (12–15 lines × 5) REDACTED:4672 — REDACTED:4672-4686 | REDACTED:6329-6343 | REDACTED:6397-6408 | REDACTED:6626-6637 | REDACTED:6672-6683 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (11–15 lines × 4) · ×1
  • Duplicated block (11–15 lines × 4) libs/code/deepagents_code/ui.py:378 — libs/code/deepagents_code/ui.py:378-388 | libs/code/deepagents_code/ui.py:654-664 | libs/code/deepagents_code/ui.py:841-851 | libs/code/deepagents_code/ui.py:1007-1021 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (13–15 lines × 2) · ×1
  • Duplicated block (13–15 lines × 2) libs/code/deepagents_code/_repository_bounds.py:321 — libs/code/deepagents_code/_repository_bounds.py:321-333 | libs/code/deepagents_code/_repository_bounds.py:382-396 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/_repository_bounds.py:382` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (12–15 lines × 2) · ×1
  • Duplicated block (12–15 lines × 2) libs/code/deepagents_code/plugins/adapters/skills_middleware.py:629 — libs/code/deepagents_code/plugins/adapters/skills_middleware.py:629-643 | libs/code/deepagents_code/plugins/adapters/skills_middleware.py:673-684 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×1
  • Duplicated block (13–14 lines × 2) libs/code/deepagents_code/tui/widgets/messages.py:3447 — libs/code/deepagents_code/tui/widgets/messages.py:3447-3459 | libs/code/deepagents_code/tui/widgets/messages.py:3637-3650 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/tui/widgets/messages.py:3637` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (13 lines × 4) · ×1
  • Duplicated block (13 lines × 4) libs/deepagents/deepagents/middleware/filesystem.py:2311 — libs/deepagents/deepagents/middleware/filesystem.py:2311-2323 | libs/deepagents/deepagents/middleware/filesystem.py:2350-2362 | libs/deepagents/deepagents/middleware/filesystem.py:2498-2510 | libs/deepagents/deepagents/middleware/filesystem.py:2537-2549 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×1
  • Duplicated block (12–13 lines × 2) libs/acp/deepagents_acp/server.py:686 — libs/acp/deepagents_acp/server.py:686-697 | libs/acp/deepagents_acp/server.py:724-736 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/acp/deepagents_acp/server.py:724` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (10–13 lines × 2) · ×1
  • Duplicated block (10–13 lines × 2) libs/code/deepagents_code/plugins/commands_cli.py:60 — libs/code/deepagents_code/plugins/commands_cli.py:60-69 | libs/code/deepagents_code/plugins/commands_cli.py:78-90 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/plugins/commands_cli.py:78` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–13 lines × 2) · ×1
  • Duplicated block (11–13 lines × 2) libs/code/deepagents_code/tui/modals/cost_breakdown.py:114 — libs/code/deepagents_code/tui/modals/cost_breakdown.py:114-124 | libs/code/deepagents_code/tui/widgets/mcp_viewer.py:605-617 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/tui/modals/cost_breakdown.py:114` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (9–13 lines × 2) · ×1
  • Duplicated block (9–13 lines × 2) libs/code/deepagents_code/tui/modals/plugin_manager/content.py:206 — libs/code/deepagents_code/tui/modals/plugin_manager/content.py:206-218 | libs/code/deepagents_code/tui/modals/plugin_manager/content.py:242-250 — 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 lines × 3) · ×1
  • Duplicated block (12 lines × 3) libs/acp/deepagents_acp/utils.py:225 — libs/acp/deepagents_acp/utils.py:225-236 | libs/acp/deepagents_acp/utils.py:238-249 | libs/acp/deepagents_acp/utils.py:259-270 — 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–12 lines × 2) · ×1
  • Duplicated block (11–12 lines × 2) libs/code/deepagents_code/app.py:14047 — libs/code/deepagents_code/app.py:14047-14058 | libs/code/deepagents_code/app.py:14315-14325 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `libs/code/deepagents_code/app.py:14059` calls `styled`, `TStyle` and `libs/code/deepagents_code/app.py:14326` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (6–11 lines × 3) · ×1
  • Duplicated block (6–11 lines × 3) libs/deepagents/deepagents/backends/sandbox.py:1307 — libs/deepagents/deepagents/backends/sandbox.py:1307-1312 | libs/deepagents/deepagents/backends/sandbox.py:1957-1967 | libs/deepagents/deepagents/backends/sandbox.py:2010-2017 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/deepagents/deepagents/backends/sandbox.py:1957` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×1
  • Duplicated block (10–11 lines × 2) libs/code/deepagents_code/tool_display.py:239 — libs/code/deepagents_code/tool_display.py:239-249 | libs/code/deepagents_code/tool_display.py:287-296 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/tool_display.py:239` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (9–10 lines × 10) · ×1
  • Duplicated block (9–10 lines × 10) REDACTED:4135 — REDACTED:4135-4144 | REDACTED:4386-4394 | REDACTED:4560-4568 | REDACTED:4713-4721 | REDACTED:4787-4795 | REDACTED:6052-6060 | REDACTED:6346-6354 | REDACTED:6410-6418 | REDACTED:6685-6694 | REDACTED:6922-6930 — all 10 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) libs/code/deepagents_code/ui.py:121 — libs/code/deepagents_code/ui.py:121-134 | libs/code/deepagents_code/ui.py:944-953 | libs/code/deepagents_code/ui.py:988-999 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/ui.py:121` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8–10 lines × 2) · ×1
  • Duplicated block (8–10 lines × 2) libs/code/deepagents_code/agent.py:531 — libs/code/deepagents_code/agent.py:531-538 | libs/code/deepagents_code/goal_rubric.py:1670-1679 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×1
  • Duplicated block (9–10 lines × 2) libs/code/deepagents_code/model_retry.py:1209 — libs/code/deepagents_code/model_retry.py:1209-1218 | libs/code/deepagents_code/model_retry.py:1265-1273 — 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 (7–10 lines × 2) · ×1
  • Duplicated block (7–10 lines × 2) libs/code/deepagents_code/tui/widgets/messages.py:3880 — libs/code/deepagents_code/tui/widgets/messages.py:3880-3886 | libs/code/deepagents_code/tui/widgets/messages.py:3897-3906 — 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note first that the copies are not typed on the same thing: the declarations holding them bind `is_preview` to `bool` in one and `bool = False` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `libs/code/deepagents_code/tui/widgets/messages.py:3896` calls `split` and `libs/code/deepagents_code/tui/widgets/messages.py:3878` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×1
  • Duplicated block (9 lines × 4) libs/code/deepagents_code/ui.py:426 — libs/code/deepagents_code/ui.py:426-438 | libs/code/deepagents_code/ui.py:474-482 | libs/code/deepagents_code/ui.py:572-580 | libs/code/deepagents_code/ui.py:959-972 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (7–9 lines × 2) · ×1
  • Duplicated block (7–9 lines × 2) libs/deepagents/deepagents/backends/sandbox.py:1803 — libs/deepagents/deepagents/backends/sandbox.py:1803-1811 | libs/deepagents/deepagents/backends/sandbox.py:1819-1825 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×1
  • Duplicated block (8–9 lines × 2) libs/talon/deepagents_talon/host.py:2355 — libs/talon/deepagents_talon/host.py:2355-2363 | libs/talon/deepagents_talon/host.py:2402-2409 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/talon/deepagents_talon/host.py:2355` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×1
  • Duplicated block (7–8 lines × 2) libs/code/deepagents_code/model_api.py:137 — libs/code/deepagents_code/model_api.py:137-144 | libs/code/deepagents_code/model_api.py:217-223 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/code/deepagents_code/model_api.py:137` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (5 lines × 8) · ×1
  • Duplicated block (5 lines × 8) libs/code/deepagents_code/tui/widgets/agent_selector.py:226 — libs/code/deepagents_code/tui/widgets/agent_selector.py:226-230 | libs/code/deepagents_code/tui/widgets/auth.py:424-428 | libs/code/deepagents_code/tui/widgets/auth.py:1242-1246 | libs/code/deepagents_code/tui/widgets/codex_auth.py:408-412 | libs/code/deepagents_code/tui/widgets/effort_selector.py:152-156 | libs/code/deepagents_code/tui/widgets/launch_init.py:182-186 | libs/code/deepagents_code/tui/widgets/launch_init.py:340-344 | libs/code/deepagents_code/tui/widgets/theme_selector.py:177-181 — there are 8 copies across 6 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 8 sites; resolving a subset leaves the remainder to drift apart. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `libs/code/deepagents_code/tui/widgets/auth.py:1237` calls `on_leave` and `libs/code/deepagents_code/tui/widgets/agent_selector.py:223` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (29–32 lines × 2) · ×1
  • Duplicated block (29–32 lines × 2) examples/deep_research/research_agent/tools.py:46 — examples/deep_research/research_agent/tools.py:46-77 | examples/nvidia_deep_agent/src/tools.py:46-74 — before extracting anything, compare `examples/deep_research/research_agent/tools.py` and `examples/nvidia_deep_agent/src/tools.py` as WHOLE FILES: 95% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (11–18 lines × 2) · ×1
  • Duplicated block (11–18 lines × 2) examples/llm-wiki/ingest.py:225 — examples/llm-wiki/ingest.py:225-242 | examples/llm-wiki/lint.py:45-55 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `examples/llm-wiki/ingest.py:225` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D5 · Coupling · Off the main sequence · ×1
  • Off the main sequence: deepagents — deepagents: abstractness 0.01, instability 0.00, distance 0.99 — zone of pain — concrete and depended on by 9 project(s), so it's rigid to change.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×1
  • Sync-over-async blocking libs/talon/deepagents_talon/channels/whatsapp_bridge/bridge.js:400 — `fs.writeFileSync` in `downloadMessageMedia` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
X28 · Index access outside its own emptiness guard · Index access outside its own emptiness guard · ×1
  • Index access outside its own emptiness guard libs/code/deepagents_code/app.py:30765 — This condition tests `results` for emptiness and then indexes it on a branch that test does not reach. `results[0]` is evaluated whenever the guarded half is false — which includes the case the guard exists to anticipate, `results` being empty — so an empty `results` indexes position 0 of nothing and throws. This same condition already shows the intended bracketing at line 30767: `results[1]` sits INSIDE the guard. Either the guard is load-bearing, in which case this access escapes it and crashes, or `results` cannot be empty here, in which case the guard beside it is dead code — the condition is wrong under both readings. Move the parenthesis so the emptiness test brackets every access to `results`.
Minor — 73 finding(s)
X10 · Duplicated predicate · Duplicated predicate · ×25
  • Duplicated predicate libs/talon/deepagents_talon/channels/whatsapp_bridge/bridge.js:190 — `widString(message.from) || widString(data.from)` appears character-identically in 2 files — libs/talon/deepagents_talon/channels/whatsapp_bridge/bridge.js, libs/talon/deepagents_talon/channels/whatsapp_bridge/id_compat.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate libs/talon/deepagents_talon/channels/whatsapp_bridge/bridge.js:199 — `widString(message.to) || widString(data.to)` appears character-identically in 2 files — libs/talon/deepagents_talon/channels/whatsapp_bridge/bridge.js, libs/talon/deepagents_talon/channels/whatsapp_bridge/id_compat.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate libs/code/deepagents_code/app.py:29414 — `active is not None and not active.done()` appears character-identically in 3 files — libs/code/deepagents_code/app.py, libs/code/deepagents_code/configuration/providers.py, libs/talon/deepagents_talon/host.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:1554 — `cached is not None and cached[0] == cache_key` appears character-identically in 2 files — REDACTED, libs/code/deepagents_code/offload_middleware.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate libs/talon/deepagents_talon/history_backends.py:44 — `config.history_uri or config.checkpoint_path.as_uri()` appears character-identically in 2 files — libs/talon/deepagents_talon/history_backends.py, libs/talon/deepagents_talon/history_vector_backends.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate libs/code/deepagents_code/hooks/trust.py:338 — `context.project_root or context.user_cwd` appears character-identically in 2 files — libs/code/deepagents_code/hooks/trust.py, libs/code/deepagents_code/main.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate libs/code/deepagents_code/tui/widgets/launch_init.py:567 — `current is not None and current.cells == max_height` appears character-identically in 2 files — libs/code/deepagents_code/tui/widgets/launch_init.py, libs/code/deepagents_code/tui/widgets/model_selector.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:2057 — `current.__cause__ or current.__context__` appears character-identically in 2 files — REDACTED, libs/code/deepagents_code/model_retry.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate libs/code/deepagents_code/hooks/client_lifecycle.py:315 — `decision.stop_reason or "Permission stopped by hook"` appears character-identically in 2 files — libs/code/deepagents_code/hooks/client_lifecycle.py, libs/code/deepagents_code/hooks/permissions.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:3621 — `enabled is not None and not isinstance(enabled, bool)` appears character-identically in 2 files — REDACTED, libs/deepagents/deepagents/profiles/harness/harness_profiles.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate libs/code/deepagents_code/tui/widgets/_inline_prompt.py:172 — `event.key == "backspace" and self._delete_placeholder_token(backwards=True)` appears character-identically in 2 files — libs/code/deepagents_code/tui/widgets/_inline_prompt.py, libs/code/deepagents_code/tui/widgets/chat_input.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:1642 — `expected is not None and expected > max_bytes` appears character-identically in 3 files — REDACTED, libs/talon/deepagents_talon/channels/slack.py, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate libs/code/deepagents_code/app.py:11632 — `future is not None and not future.done()` appears character-identically in 2 files — libs/code/deepagents_code/app.py, libs/code/deepagents_code/tui/widgets/mcp_login.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate libs/talon/deepagents_talon/config.py:249 — `generation and re.fullmatch(r"[a-f0-9]{64}", generation) is None` appears character-identically in 2 files — libs/talon/deepagents_talon/config.py, libs/talon/deepagents_talon/history_vector_backends.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate libs/partners/quickjs/langchain_quickjs/_prompt.py:502 — `getattr(tool, "func", None) or getattr(tool, "coroutine", None)` appears character-identically in 2 files — libs/partners/quickjs/langchain_quickjs/_prompt.py, libs/partners/quickjs/langchain_quickjs/_repl.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:6011 — `headers is not None and not isinstance(headers, dict)` appears character-identically in 2 files — REDACTED, libs/code/deepagents_code/mcp_tools.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate libs/code/deepagents_code/mcp_config.py:216 — `host == "slack.com" or host.endswith(".slack.com")` appears character-identically in 4 files — libs/code/deepagents_code/mcp_config.py, libs/code/deepagents_code/mcp_providers/slack.py, libs/talon/deepagents_talon/channels/slack.py, libs/talon/deepagents_talon/mcp_auth.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate libs/code/deepagents_code/_testing_models.py:185 — `isinstance(block, dict) and block.get("type") == "text"` appears character-identically in 2 files — libs/code/deepagents_code/_testing_models.py, libs/deepagents/deepagents/profiles/harness/_nvidia_nemotron_3_ultra.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate libs/talon/deepagents_talon/archive_saver.py:315 — `isinstance(channel, str) and isinstance(chat, str)` appears character-identically in 2 files — libs/talon/deepagents_talon/archive_saver.py, libs/talon/deepagents_talon/runtime.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate libs/code/deepagents_code/client/non_interactive.py:1617 — `isinstance(data, dict) and data.get("type") == "model_attempt"` appears character-identically in 2 files — libs/code/deepagents_code/client/non_interactive.py, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate libs/code/deepagents_code/client/non_interactive.py:1621 — `isinstance(data, dict) and data.get("type") == "model_retry"` appears character-identically in 2 files — libs/code/deepagents_code/client/non_interactive.py, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate libs/code/deepagents_code/update_check.py:1190 — `isinstance(k, str) and isinstance(v, str)` appears character-identically in 2 files — libs/code/deepagents_code/update_check.py, libs/deepagents/deepagents/middleware/_skill_tools.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate libs/code/deepagents_code/auto_mode.py:4020 — `isinstance(key, str) and isinstance(value, str)` appears character-identically in 3 files — libs/code/deepagents_code/auto_mode.py, REDACTED, libs/talon/deepagents_talon/mcp_config.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate libs/code/deepagents_code/hooks/server_middleware.py:1503 — `isinstance(message, AIMessage) and message.tool_calls` appears character-identically in 2 files — libs/code/deepagents_code/hooks/server_middleware.py, libs/talon/deepagents_talon/store_archive.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:3010 — `isinstance(raw, int) and not isinstance(raw, bool) and raw >= 0` appears character-identically in 2 files — REDACTED, libs/code/deepagents_code/configuration/providers.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
D29 · Static Analysis (SAST) · REDACTED · ×11
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
X7 · Silent fallback defaults · Silent fallback default on parse failure · ×11
  • Silent fallback default on parse failure libs/code/deepagents_code/auto_mode.py:748 — `_redact_url` returns `'[redacted URL]'` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure REDACTED:5064 — `_langsmith_runs_endpoint_urls_from` returns `()` when `(TypeError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure libs/code/deepagents_code/doctor.py:377 — `_endpoint_gateway_state` returns `'unknown'` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure libs/code/deepagents_code/hooks/migration.py:156 — `_run_adapter` returns `1` when `(json.JSONDecodeError, UnicodeDecodeError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure libs/code/deepagents_code/hooks/transcript.py:643 — `_redact_url` returns `'[redacted URL]'` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure libs/code/deepagents_code/tui/widgets/agent_selector.py:197 — `_current_index` returns `0` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure libs/code/deepagents_code/tui/widgets/autocomplete.py:841 — `_scope_files_to_cwd` returns `[]` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure libs/deepagents/deepagents/backends/utils.py:1034 — `_glob_search_files` returns `'No files found'` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure libs/deepagents/deepagents/middleware/_fs_interrupt.py:87 — `_candidate_paths` returns `[]` when `(ValueError, OSError, RuntimeError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure libs/deepagents/deepagents/middleware/_fs_interrupt.py:103 — `when` (in `_make_exact_when_predicate`) returns `False` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure libs/deepagents/deepagents/middleware/_fs_interrupt.py:135 — `when` (in `_make_bulk_when_predicate`) returns `False` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
X23 · Unguarded diagnostic materialisation · Diagnostic log message is built whether or not it is wanted · ×5
  • Diagnostic log message is built whether or not it is wanted REDACTED:2347 — `debug` at line 2347 is called with an argument built by `sorted(str(key) for key in payload_dict)` (line 2350), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on.
  • Diagnostic log message is built whether or not it is wanted libs/code/deepagents_code/mcp_middleware.py:88 — `debug` at line 88 is called with an argument built by `sorted(set(arguments) - set(cleaned))` (line 90), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on.
  • Diagnostic log message is built whether or not it is wanted libs/code/deepagents_code/cost_tracking.py:1403 — `debug` at line 1403 is called with an argument built by `sum(len(provider.models) for provider in providers)` (line 1408), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on.
  • Diagnostic log message is built whether or not it is wanted libs/code/deepagents_code/client/remote_client.py:1123 — `debug` at line 1123 is called with an argument built by `"…".join(namespace)` (line 1125), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on.
  • Diagnostic log message is built whether or not it is wanted libs/deepagents/deepagents/_excluded_middleware.py:158 — `debug` at line 158 is called with an argument built by `sorted(repr(entry) for entry in profile.excluded_middleware)` (line 161), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on.
D16 · Bus Factor · Off-boarding risk · ×4
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 95 significant file(s) lose their only recent owner: libs/code/deepagents_code/update_check.py, libs/code/deepagents_code/tui/widgets/chat_input.py, libs/code/deepagents_code/auto_mode.py, libs/code/deepagents_code/cost_tracking.py, libs/code/deepagents_code/tui/widgets/thread_selector.py, REDACTED, libs/code/deepagents_code/tui/widgets/auth.py, libs/code/deepagents_code/goal_rubric.py (+87 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 19 significant file(s) lose their only recent owner: libs/code/deepagents_code/hooks/manager.py, libs/code/deepagents_code/hooks/reducer.py, libs/code/deepagents_code/hooks/trust.py, libs/code/deepagents_code/hooks/client_lifecycle.py, libs/code/deepagents_code/hooks/snapshot.py, libs/code/deepagents_code/hooks/runtime.py, libs/code/deepagents_code/plugins/adapters/mcp.py, libs/code/deepagents_code/extensions/registry.py (+11 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 5 significant file(s) lose their only recent owner: REDACTED, libs/talon/deepagents_talon/observability.py, libs/talon/deepagents_talon/speech.py, libs/talon/deepagents_talon/authorization.py, libs/talon/deepagents_talon/messaging.py. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #4 — If anonymized user #4 becomes unavailable, 3 significant file(s) lose their only recent owner: libs/talon/deepagents_talon/cron/scheduler.py, libs/talon/deepagents_talon/timezones.py, libs/talon/deepagents_talon/clock.py. Pair on, review, or document these before any departure.
M4 · Documentation accuracy · README/code drift · ×4
  • README/code drift libs/acp/README.md:25 — libs/acp/README.md changes into `deepagents/libs/acp`, but no such folder exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift libs/talon/README.md:844 — libs/talon/README.md names `cron/jobs.json`, but no file or folder `cron/jobs.json` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift libs/evals/datasets/context-retrieval-evals/README.md:15 — libs/evals/datasets/context-retrieval-evals/README.md names `tests/judge.py`, but no file or folder `tests/judge.py` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift libs/evals/datasets/context-retrieval-evals/README.md:21 — libs/evals/datasets/context-retrieval-evals/README.md names `environment/files/`, but no file or folder `environment/files` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
D34 · Knowledge Freshness · Orphaned file · ×2
  • Orphaned file libs/partners/vercel/langchain_vercel_sandbox/sandbox.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file libs/partners/runloop/langchain_runloop/provider.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 3 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (126 single-owned of 370 analysed files in total, 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; 370 of the 465 production source files in this repository met that bar). They are anonymized user #5 (2 file(s)), anonymized user #6 (1 file(s)), anonymized user #7 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: libs/evals/deepagents_clbench/system/system.py, libs/evals/deepagents_evals/tau3_subset.py, libs/partners/quickjs/langchain_quickjs/_snapshot.py, libs/partners/daytona/langchain_daytona/sandbox.py.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 3 of 12 project(s) overshoot their size bounds, lowering Project Cohesion to 5.0/10. The most over is `libs/code` (187997 LoC, 1045 module-visible types across 24 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D34 · Knowledge Freshness · Orphaned files with no living knowledge · ×1
  • Orphaned files with no living knowledge — 2 of 370 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; 370 of the 465 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: libs/partners/vercel/langchain_vercel_sandbox/sandbox.py, libs/partners/runloop/langchain_runloop/provider.py. 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.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
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 7/9 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `libs/acp`, `libs/talon/deepagents_talon/channels/whatsapp_bridge`.
P3 · Security & performance tooling · No SAST · ×1
  • No SAST — No static application security testing detected. For this repository's stack, add bandit, `semgrep --config=p/python`, or CodeQL's python pack as a CI step. What was searched, so you can tell an absence from a miss: the 935415 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
X7 · Silent fallback defaults · Silent fallback default in catch · ×1
  • Silent fallback default in catch libs/evals/tests/evals/pytest_reporter.py:116 — `_langsmith_version` swallows every exception into `return 'unknown'` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.

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-f436b5d3eacc43c99167f8141393b609/history.json --exit-code 0 --source .2artifacts/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-f436b5d3eacc43c99167f8141393b609/tree.json --exit-code 0 --source .2artifacts/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 .62artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update2artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .64artifacts/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. semgrep could not parse 37 file(s) — `libs/code/deepagents_code/_async.py`, `libs/code/deepagents_code/_tool_free.py`, `libs/code/deepagents_code/btw_api.py`, `libs/code/deepagents_code/client/remote_client.py`, `libs/code/deepagents_code/config_manifest.py`, … (+32 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.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 Dependenciestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update0artifacts/raw/trivy-fs.json

Run 01a15a4b-4f53-701c-a405-26e652553da5 · 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