Public report of github/spec-kit, published 23 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, 23 October 2026, 04:08 UTC · Survey ID cd_87453b8bfc52469ea7c8d5de7671ef51

github/spec-kit

Measured 23 October 2026, 04:05 UTC, at code version 27d14e2

No regression since the last survey

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

CAI score 73out of 100 Strong
CriticalWeakAdequateStrongExemplary
Down 1 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 medium codebase: 65,784 lines of product code in 1 project, tests not counted · Estimated rebuild effort: about 2.0 person-years · Weakest lens: Security and Compliance, 66

Findings by how serious they are

14 critical 743 serious 51 minor

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

This survey was produced by

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
23 October 2026, 04:05 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 ▸

50of 56 dimensions measured by tools. The other 6 are advisory notes from an AI model, which explain the code but don't count towards the score.
795of 808 findings point to an exact file and line, so you can open each one in the code. The other 13 concern the repository as a whole, such as missing documentation.
56dimensions across 5 lenses, read from 65,784 lines of product code in 1 project.
Chapters

Executive summary

github/spec-kit scores 73 out of 100 and is rated Strong, while four of its five lenses score higher still: Architecture at 88 and Code Health at 78, both rated Adequate, and Production Readiness at 81 and Maturity at 79, both rated Strong.

The score is lower than those four because the weakest lens counts most, and here that is Security and Compliance, which scores 66 and is rated Adequate. Its Static Analysis (SAST) dimension scores 0.7 out of 10, and until that reaches 4, Security and Compliance can't be rated higher than Adequate. The first actions are to resolve the 8 REDACTED finding(s) in Static Analysis (SAST) and to resolve the 2 REDACTED finding(s) in Static Analysis (SAST), and if Security and Compliance rose to 70, the score would rise from 73 to about 75.

14 findings are critical, all in Static Analysis (SAST).

Watchdog couldn't measure 12 dimensions in this code, among them Code Coverage, Test Reliability and Navigability, so they are left out of the score. The product code is 65,784 lines, which would take an estimated 2.0 person-years, around €290,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.
Security and Compliance 66 · counts for 47%Code Health 78 · counts for 26%Maturity 79 · counts for 14%Production Readiness 81 · counts for 8%Architecture 88 · counts for 4%

If Security and Compliance rose from 66 to 70, the lowest score rated Strong, the score would rise from 73 to about 75.

Code composition: what the lines of code are
Product code 32%Tests 68%
New since the last survey: 112 findings

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

  • Cyclomatic Complexity · _execution.check_node (cyclomatic 66) src/specify_cli/workflows/_execution.py
  • Cyclomatic Complexity · VibeIntegration._managed_hook_spans (cyclomatic 43) src/specify_cli/integrations/vibe/__init__.py
  • Cyclomatic Complexity · validate_community_workflow_step.catalog_snapshot (cyclomatic 42) .github/scripts/validate_community_workflow_step.py
  • Cyclomatic Complexity · _lifecycle._transaction (cyclomatic 33) src/specify_cli/integrations/_lifecycle.py
  • Cyclomatic Complexity · installer.catalog_package (cyclomatic 31) src/specify_cli/integrations/installer.py
  • Cyclomatic Complexity · installer.load_installed_integrations (cyclomatic 29) src/specify_cli/integrations/installer.py
  • Cyclomatic Complexity · installer._check_installed_pins (cyclomatic 28) src/specify_cli/bundles/installer.py
  • Cyclomatic Complexity · VibeIntegration._parse_toml_header (cyclomatic 27) src/specify_cli/integrations/vibe/__init__.py
  • Cyclomatic Complexity · Execution.transition (cyclomatic 26) src/specify_cli/workflows/_execution.py
  • Cyclomatic Complexity · installer._validate_implementation (cyclomatic 21) src/specify_cli/integrations/installer.py
  • Cyclomatic Complexity · _capture.run_captured (cyclomatic 20) src/specify_cli/integrations/_capture.py
  • Cyclomatic Complexity · _FileJournal.observe (cyclomatic 20) src/specify_cli/integrations/_lifecycle.py
  • Cyclomatic Complexity · _lifecycle._restore_snapshots (cyclomatic 19) src/specify_cli/integrations/_lifecycle.py
  • Cyclomatic Complexity · Execution.execute_step (cyclomatic 19) src/specify_cli/workflows/_execution.py
  • Cyclomatic Complexity · validate_community_workflow_step.validate_files (cyclomatic 18) .github/scripts/validate_community_workflow_step.py
  • Cyclomatic Complexity · FileHelper._walk (cyclomatic 18) src/specify_cli/file_helper.py
  • Cyclomatic Complexity · installer._read_trust_state (cyclomatic 18) src/specify_cli/integrations/installer.py
  • Cyclomatic Complexity · validate_community_workflow_step.validate_identity (cyclomatic 17) .github/scripts/validate_community_workflow_step.py
  • Cyclomatic Complexity · CopilotIntegration.dispatch_command (cyclomatic 17) src/specify_cli/integrations/copilot/__init__.py
  • Cyclomatic Complexity · installer._validate_registrar_config (cyclomatic 17) src/specify_cli/integrations/installer.py
  • Cyclomatic Complexity · installer._import_package (cyclomatic 17) src/specify_cli/integrations/installer.py
  • Cyclomatic Complexity · references._resolved_locally (cyclomatic 16) src/specify_cli/bundles/references.py
  • Cyclomatic Complexity · installer.read_records (cyclomatic 16) src/specify_cli/integrations/installer.py
  • Cyclomatic Complexity · GitHubStep.validate (cyclomatic 16) src/specify_cli/workflows/step/github/__init__.py
  • Cyclomatic Complexity · PromptStep._try_dispatch (cyclomatic 16) src/specify_cli/workflows/step/prompt/__init__.py
  • Cognitive Complexity · VibeIntegration._managed_hook_spans (cognitive 98) src/specify_cli/integrations/vibe/__init__.py
  • Cognitive Complexity · _execution.check_node (cognitive 85) src/specify_cli/workflows/_execution.py
  • Cognitive Complexity · validate_community_workflow_step.catalog_snapshot (cognitive 76) .github/scripts/validate_community_workflow_step.py
  • Cognitive Complexity · installer._check_installed_pins (cognitive 62) src/specify_cli/bundles/installer.py
  • Cognitive Complexity · _lifecycle._transaction (cognitive 50) src/specify_cli/integrations/_lifecycle.py
  • Cognitive Complexity · VibeIntegration._parse_toml_header (cognitive 50) src/specify_cli/integrations/vibe/__init__.py
  • Cognitive Complexity · installer.load_installed_integrations (cognitive 49) src/specify_cli/integrations/installer.py
  • Cognitive Complexity · _FileJournal.observe (cognitive 40) src/specify_cli/integrations/_lifecycle.py
  • Cognitive Complexity · Execution.execute_step (cognitive 38) src/specify_cli/workflows/_execution.py
  • Cognitive Complexity · FileHelper._walk (cognitive 35) src/specify_cli/file_helper.py
  • Cognitive Complexity · _lifecycle._restore_snapshots (cognitive 35) src/specify_cli/integrations/_lifecycle.py
  • Cognitive Complexity · installer.catalog_package (cognitive 35) src/specify_cli/integrations/installer.py
  • Cognitive Complexity · Execution.transition (cognitive 30) src/specify_cli/workflows/_execution.py
  • Cognitive Complexity · installer.package_hashes (cognitive 27) src/specify_cli/integrations/installer.py
  • Cognitive Complexity · _catalog_cache._cache_directory (cognitive 26) src/specify_cli/workflows/_catalog_cache.py
  • Cognitive Complexity · installer.read_records (cognitive 25) src/specify_cli/integrations/installer.py
  • Cognitive Complexity · installer._validate_implementation (cognitive 25) src/specify_cli/integrations/installer.py
  • Cognitive Complexity · references._validate_pinned_install_metadata (cognitive 23) src/specify_cli/bundles/references.py
  • Cognitive Complexity · _capture._join (cognitive 23) src/specify_cli/integrations/_capture.py
  • Cognitive Complexity · _capture.run_captured (cognitive 22) src/specify_cli/integrations/_capture.py
  • Cognitive Complexity · validate_community_workflow_step.validate_files (cognitive 21) .github/scripts/validate_community_workflow_step.py
  • Cognitive Complexity · component_catalog._matching_entry (cognitive 21) src/specify_cli/bundles/component_catalog.py
  • Cognitive Complexity · events._refresh_loaded_integration_events (cognitive 20) src/specify_cli/events/__init__.py
  • Cognitive Complexity · installer._read_trust_state (cognitive 20) src/specify_cli/integrations/installer.py
  • Cognitive Complexity · installer._commit_event_recovery_updates (cognitive 20) src/specify_cli/integrations/installer.py
  • Cognitive Complexity · installer._import_package (cognitive 20) src/specify_cli/integrations/installer.py
  • Cognitive Complexity · references._resolved_locally (cognitive 19) src/specify_cli/bundles/references.py
  • Cognitive Complexity · events._cleanup_shared_dispatcher (cognitive 19) src/specify_cli/events/__init__.py
  • Cognitive Complexity · CopilotIntegration.dispatch_command (cognitive 19) src/specify_cli/integrations/copilot/__init__.py
  • Cognitive Complexity · validate_community_workflow_step.validate_identity (cognitive 18) .github/scripts/validate_community_workflow_step.py
  • Cognitive Complexity · conflict.detect_conflicts (cognitive 18) src/specify_cli/bundles/conflict.py
  • Cognitive Complexity · Execution.fan_out (cognitive 18) src/specify_cli/workflows/_execution.py
  • Cognitive Complexity · _execution.check_sequence (cognitive 18) src/specify_cli/workflows/_execution.py
  • Cognitive Complexity · installer._validate_registrar_config (cognitive 17) src/specify_cli/integrations/installer.py
  • Cognitive Complexity · command_init.ensure_constitution_from_template (cognitive 16) src/specify_cli/command_init.py
  • Cognitive Complexity · ExtensionManager._extension_skill_candidate_dirs (cognitive 16) src/specify_cli/extensions/__init__.py
  • Cognitive Complexity · Execution.workflow (cognitive 16) src/specify_cli/workflows/_execution.py
  • Cognitive Complexity · PromptStep._try_dispatch (cognitive 16) src/specify_cli/workflows/step/prompt/__init__.py
  • God Classes · FileTooLong: integrations/installer.py src/specify_cli/integrations/installer.py
  • God Classes · FileTooLong: workflows/_execution.py src/specify_cli/workflows/_execution.py
  • God Classes · FileTooLong: integrations/_lifecycle.py src/specify_cli/integrations/_lifecycle.py
  • Code Duplication · Near-duplicate member pair (56 shared lines) src/specify_cli/workflows/catalog/_domain.py
  • Code Duplication · Edited copy of a member (21 corresponding lines) src/specify_cli/extensions/_commands.py
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) src/specify_cli/integrations/base.py
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) src/specify_cli/extensions/__init__.py
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) src/specify_cli/integrations/base.py
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) src/specify_cli/catalogs.py
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) src/specify_cli/integrations/alquimia/__init__.py
  • Code Duplication · Duplicated block (44–46 lines × 2) src/specify_cli/integrations/command_uninstall.py
  • Code Duplication · Duplicated block (41–44 lines × 2) src/specify_cli/integrations/base.py
  • Code Duplication · Duplicated block (33 lines × 2) src/specify_cli/workflows/step/command/__init__.py
  • Code Duplication · Duplicated block (20–21 lines × 2) src/specify_cli/workflows/engine.py
  • Code Duplication · Duplicated block (11–18 lines × 2) src/specify_cli/events/__init__.py
  • Code Duplication · Duplicated block (16–18 lines × 2) src/specify_cli/workflows/_execution.py
  • Code Duplication · Duplicated block (11–17 lines × 3) src/specify_cli/events/__init__.py
  • Code Duplication · Duplicated block (13–17 lines × 2) src/specify_cli/events/__init__.py
  • Code Duplication · Duplicated block (15–16 lines × 3) src/specify_cli/integrations/base.py
  • Code Duplication · Duplicated block (14–15 lines × 2) src/specify_cli/integrations/vibe/__init__.py
  • Code Duplication · Duplicated block (14 lines × 2) src/specify_cli/integrations/kimi/__init__.py
  • Code Duplication · Duplicated block (13–14 lines × 2) src/specify_cli/workflows/catalog/_domain.py
  • Code Duplication · Duplicated block (10 lines × 2) src/specify_cli/workflows/catalog/_domain.py
  • Code Duplication · Duplicated block (6 lines × 2) src/specify_cli/file_helper.py
  • Code Duplication · Duplicated block (15 lines × 2) src/specify_cli/integrations/vibe/__init__.py
  • Churn × Complexity Hotspots · Hotspot: src/specify_cli/extensions/_command_update_transaction.py src/specify_cli/extensions/_command_update_transaction.py
  • Churn × Complexity Hotspots · Hotspot: src/specify_cli/bundles/manifest.py src/specify_cli/bundles/manifest.py
  • Churn × Complexity Hotspots · Hotspot: src/specify_cli/extensions/command_add.py src/specify_cli/extensions/command_add.py
  • Churn × Complexity Hotspots · Hotspot: src/specify_cli/integrations/command_upgrade.py src/specify_cli/integrations/command_upgrade.py
  • Churn × Complexity Hotspots · Hotspot: src/specify_cli/workflows/command_run.py src/specify_cli/workflows/command_run.py
  • Churn × Complexity Hotspots · Hotspot: src/specify_cli/integrations/command_info.py src/specify_cli/integrations/command_info.py
  • Churn × Complexity Hotspots · Hotspot: src/specify_cli/bundles/references.py src/specify_cli/bundles/references.py
  • Churn × Complexity Hotspots · Hotspot: src/specify_cli/workflows/command_resume.py src/specify_cli/workflows/command_resume.py
  • Churn × Complexity Hotspots · Hotspot: src/specify_cli/integrations/command_switch.py src/specify_cli/integrations/command_switch.py
  • Churn × Complexity Hotspots · Hotspot: src/specify_cli/integrations/hermes/__init__.py src/specify_cli/integrations/hermes/__init__.py
  • Churn × Complexity Hotspots · Hotspot: src/specify_cli/integrations/command_uninstall.py src/specify_cli/integrations/command_uninstall.py
  • Churn × Complexity Hotspots · Hotspot: src/specify_cli/presets/_manager.py src/specify_cli/presets/_manager.py

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: 41 findings

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

  • Cyclomatic Complexity · WorkflowEngine._execute_steps (cyclomatic 32) src/specify_cli/workflows/engine.py
  • Cyclomatic Complexity · command_search.integration_search (cyclomatic 16) src/specify_cli/integrations/command_search.py
  • Cyclomatic Complexity · WorkflowEngine._run_fan_out (cyclomatic 16) src/specify_cli/workflows/engine.py
  • Cyclomatic Complexity · StepCatalog._fetch_single_catalog (cyclomatic 16) src/specify_cli/workflows/step/catalog/_domain.py
  • Cognitive Complexity · WorkflowEngine._execute_steps (cognitive 77) src/specify_cli/workflows/engine.py
  • Cognitive Complexity · WorkflowEngine._run_fan_out (cognitive 27) src/specify_cli/workflows/engine.py
  • Cognitive Complexity · events.refresh_integration_events (cognitive 17) src/specify_cli/events/__init__.py
  • Cognitive Complexity · WorkflowCatalog._fetch_single_catalog (cognitive 17) src/specify_cli/workflows/catalog/_domain.py
  • Cognitive Complexity · KimiIntegration.teardown (cognitive 16) src/specify_cli/integrations/kimi/__init__.py
  • Code Duplication · Near-duplicate member pair (53 shared lines) src/specify_cli/workflows/catalog/_domain.py
  • Code Duplication · Edited copy of a member (21 corresponding lines) src/specify_cli/extensions/_commands.py
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) src/specify_cli/integrations/base.py
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) src/specify_cli/extensions/__init__.py
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) src/specify_cli/catalogs.py
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) src/specify_cli/events/__init__.py
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) src/specify_cli/integrations/alquimia/__init__.py
  • Code Duplication · Duplicated block (33–36 lines × 2) src/specify_cli/integrations/base.py
  • Code Duplication · Duplicated block (23–33 lines × 2) src/specify_cli/events/__init__.py
  • Code Duplication · Duplicated block (28–29 lines × 2) src/specify_cli/events/__init__.py
  • Code Duplication · Duplicated block (24–25 lines × 2) src/specify_cli/integrations/command_uninstall.py
  • Code Duplication · Duplicated block (12–19 lines × 2) src/specify_cli/events/__init__.py
  • Code Duplication · Duplicated block (11–18 lines × 4) src/specify_cli/events/__init__.py
  • Code Duplication · Duplicated block (17–18 lines × 2) src/specify_cli/workflows/engine.py
  • Code Duplication · Duplicated block (16–17 lines × 2) src/specify_cli/workflows/command_resume.py
  • Code Duplication · Duplicated block (12–17 lines × 2) src/specify_cli/workflows/step/command/__init__.py
  • Code Duplication · Duplicated block (12–16 lines × 2) src/specify_cli/events/__init__.py
  • Code Duplication · Duplicated block (14–15 lines × 3) src/specify_cli/integrations/base.py
  • Code Duplication · Duplicated block (11–14 lines × 2) src/specify_cli/agents.py
  • Code Duplication · Duplicated block (13 lines × 2) src/specify_cli/workflows/catalog/_domain.py
  • Code Duplication · Duplicated block (9–10 lines × 2) src/specify_cli/events/__init__.py
  • Code Duplication · Duplicated block (10 lines × 2) src/specify_cli/workflows/catalog/_domain.py
  • Code Duplication · Duplicated block (9 lines × 3) src/specify_cli/events/__init__.py
  • Code Duplication · Duplicated block (9 lines × 2) src/specify_cli/events/__init__.py
  • Code Duplication · Duplicated block (9 lines × 2) src/specify_cli/workflows/step/command/__init__.py
  • Churn × Complexity Hotspots · Hotspot: src/specify_cli/workflows/catalog/_domain.py src/specify_cli/workflows/catalog/_domain.py
  • Churn × Complexity Hotspots · Hotspot: src/specify_cli/workflows/step/catalog/_domain.py src/specify_cli/workflows/step/catalog/_domain.py
  • Churn × Complexity Hotspots · Hotspot: src/specify_cli/workflows/overlay/merge.py src/specify_cli/workflows/overlay/merge.py
  • Churn × Complexity Hotspots · Repeated repair: src/specify_cli/presets/_commands.py src/specify_cli/presets/_commands.py
  • Churn × Complexity Hotspots · Repeated repair: src/specify_cli/authentication/http.py src/specify_cli/authentication/http.py
  • Churn × Complexity Hotspots · Repeated repair: src/specify_cli/authentication/azure_devops.py src/specify_cli/authentication/azure_devops.py
  • Churn × Complexity Hotspots · Repeated repair: src/specify_cli/integrations/cline/__init__.py src/specify_cli/integrations/cline/__init__.py
Rebuild cost: about €290,000 · Estimate
Cost to rebuild€97,000 to €490,000, for 1,610 to 5,107 hours of work, about 2.0 person-years for 1 to 4 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×1.1 at a score of 73. 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.
SizeMedium: 65,784 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 8 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED, REDACTED.
Raises the score by about 5 points · Low effort · Static Analysis (SAST)
2
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED.
Raises the score by about 2 points · Low effort · Static Analysis (SAST)
3
Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3).
Raises the score by about 2 points · Low effort · Static Analysis (SAST)

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.

If you do one thing first · First action
Resolve the 8 REDACTED finding(s) in Static Analysis (SAST). Of all the actions in this report, it raises the score most for the work it takes: about 5 points for low effort, because it clears the 8 Static Analysis (SAST) 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 5.6 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 6% to 13% on every change. The history of the code shows how much it changes: about 257,624 lines over the last 90 days, which is about 1,044,808 lines a year. At that pace, the extra work comes to an estimated 155.4 to 932.3 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: 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.

176 modules, with 139 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; 136 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 scripts.python2 src.specify_cli.artifacts.models3 src.specify_cli.authentication.config4 src.specify_cli.bundles.catalogs5 src.specify_cli.bundles.manifest6 src.specify_cli.catalogs7 src.specify_cli.integrations.manifest8 src.specify_cli.presets._manifest9 src.specify_cli.workflows.base10 src.specify_cli.artifacts._operation_info11 src.specify_cli.artifacts._operation_list12 src.specify_cli.authentication.base13 src.specify_cli.bundles.installer14 src.specify_cli.bundles.primitives15 src.specify_cli.extensions16 src.specify_cli.integrations.base17 src.specify_cli.presets._manager_commands18 src.specify_cli.workflows.engine19 src.specify_cli20 src.specify_cli.artifacts21 src.specify_cli.authentication.azure_devops22 src.specify_cli.authentication.bitbucket23 src.specify_cli.bundles24 src.specify_cli.integrations25 src.specify_cli.integrations.agy26 src.specify_cli.integrations.bob27 src.specify_cli.integrations.claude28 src.specify_cli.integrations.cline29 src.specify_cli.integrations.copilot30 src.specify_cli.integrations.forge31 src.specify_cli.integrations.generic32 src.specify_cli.integrations.hermes33 src.specify_cli.integrations.junie34 src.specify_cli.integrations.kimi35 src.specify_cli.integrations.none36 src.specify_cli.integrations.rovodev37 src.specify_cli.integrations.vibe38 src.specify_cli.presets._manager39 src.specify_cli.workflows40 src.specify_cli.bundles.adapters
1 scripts.python
2 src.specify_cli.artifacts.models
3 src.specify_cli.authentication.config
4 src.specify_cli.bundles.catalogs
5 src.specify_cli.bundles.manifest
6 src.specify_cli.catalogs
7 src.specify_cli.integrations.manifest
8 src.specify_cli.presets._manifest
9 src.specify_cli.workflows.base
10 src.specify_cli.artifacts._operation_info1
11 src.specify_cli.artifacts._operation_list1
12 src.specify_cli.authentication.base1
13 src.specify_cli.bundles.installer1
14 src.specify_cli.bundles.primitives5
15 src.specify_cli.extensions2
16 src.specify_cli.integrations.base5
17 src.specify_cli.presets._manager_commands1
18 src.specify_cli.workflows.engine1
19 src.specify_cli3112
20 src.specify_cli.artifacts143
21 src.specify_cli.authentication.azure_devops11
22 src.specify_cli.authentication.bitbucket11
23 src.specify_cli.bundles3831
24 src.specify_cli.integrations211
25 src.specify_cli.integrations.agy11
26 src.specify_cli.integrations.bob13
27 src.specify_cli.integrations.claude11
28 src.specify_cli.integrations.cline11
29 src.specify_cli.integrations.copilot12
30 src.specify_cli.integrations.forge11
31 src.specify_cli.integrations.generic12
32 src.specify_cli.integrations.hermes11
33 src.specify_cli.integrations.junie11
34 src.specify_cli.integrations.kimi11
35 src.specify_cli.integrations.none11
36 src.specify_cli.integrations.rovodev11
37 src.specify_cli.integrations.vibe11
38 src.specify_cli.presets._manager11
39 src.specify_cli.workflows11
40 src.specify_cli.bundles.adapters11
Uses a module listed above itPart of a loopThe module itself
1 scripts.python2 src.specify_cli.artifacts.models3 src.specify_cli.authentication.config4 src.specify_cli.bundles.catalogs5 src.specify_cli.bundles.manifest6 src.specify_cli.catalogs7 src.specify_cli.integrations.manifest8 src.specify_cli.presets._manifest9 src.specify_cli.workflows.base10 src.specify_cli.artifacts._operation_info11 src.specify_cli.artifacts._operation_list12 src.specify_cli.authentication.base13 src.specify_cli.bundles.installer14 src.specify_cli.bundles.primitives15 src.specify_cli.extensions16 src.specify_cli.integrations.base17 src.specify_cli.presets._manager_commands18 src.specify_cli.workflows.engine19 src.specify_cli20 src.specify_cli.artifacts21 src.specify_cli.authentication.azure_devops22 src.specify_cli.authentication.bitbucket23 src.specify_cli.bundles24 src.specify_cli.integrations25 src.specify_cli.integrations.agy26 src.specify_cli.integrations.bob27 src.specify_cli.integrations.claude28 src.specify_cli.integrations.cline29 src.specify_cli.integrations.copilot30 src.specify_cli.integrations.forge31 src.specify_cli.integrations.generic32 src.specify_cli.integrations.hermes33 src.specify_cli.integrations.junie34 src.specify_cli.integrations.kimi35 src.specify_cli.integrations.none36 src.specify_cli.integrations.rovodev37 src.specify_cli.integrations.vibe38 src.specify_cli.presets._manager39 src.specify_cli.workflows40 src.specify_cli.bundles.adaptersscripts.python1src.specify_cli.artifacts.models2src.specify_cli.authentication.config3src.specify_cli.bundles.catalogs4src.specify_cli.bundles.manifest5src.specify_cli.catalogs6src.specify_cli.integrations.manifest7src.specify_cli.presets._manifest8src.specify_cli.workflows.base9src.specify_cli.artifacts._operation_info10src.specify_cli.artifacts._operation_list11src.specify_cli.authentication.base12src.specify_cli.bundles.installer13src.specify_cli.bundles.primitives14src.specify_cli.extensions15src.specify_cli.integrations.base16src.specify_cli.presets._manager_commands17src.specify_cli.workflows.engine18src.specify_cli19src.specify_cli.artifacts20src.specify_cli.authentication.azure_devops21src.specify_cli.authentication.bitbucket22src.specify_cli.bundles23src.specify_cli.integrations24src.specify_cli.integrations.agy25src.specify_cli.integrations.bob26src.specify_cli.integrations.claude27src.specify_cli.integrations.cline28src.specify_cli.integrations.copilot29src.specify_cli.integrations.forge30src.specify_cli.integrations.generic31src.specify_cli.integrations.hermes32src.specify_cli.integrations.junie33src.specify_cli.integrations.kimi34src.specify_cli.integrations.none35src.specify_cli.integrations.rovodev36src.specify_cli.integrations.vibe37src.specify_cli.presets._manager38src.specify_cli.workflows39src.specify_cli.bundles.adapters4011115251131121431111383121111131111121112111111111111111111+136 more modules (most-connected shown)

At a glance — Code Health · 78% · Adequate · gated by D1, D2 ·

At a glance — Architecture · 88% · Adequate · gated by D26 ·

At a glance — Maturity · 79% · Strong ·

At a glance — Readiness · 81% · Strong ·

At a glance — Security · 66% · Adequate · gated by D29, D36 ·

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
A05:2025 — Injection15High / Critical
A03:2025 — Software Supply Chain Failures5Medium

Roadmap

Begin by addressing the eight Docker socket mount findings in static analysis, prioritizing the community bundle and extension lock files. Next, resolve the two unpinned package installations and the three environment secret exposures, focusing on the docs and PR assessment workflows. Finally, strengthen supply-chain security by verifying third-party binaries in the feature assessment workflow and establishing build provenance.

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

Do thisHelpsEffortDimension
Resolve the 8 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED, REDACTED.+4.7 ptsLowStatic Analysis (SAST)
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED.+1.9 ptsLowStatic Analysis (SAST)
Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3).+1.9 ptsLowStatic Analysis (SAST)
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED.+1.4 ptsLowSupply-chain Provenance & Signing
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing.+1.4 ptsLowSupply-chain Provenance & Signing
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing.+1.4 ptsLowSupply-chain Provenance & Signing
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion.+0.5 ptsLowProject Cohesion
Add a build/run (quick start) section to the root README — the first thing a newcomer needs.+0.9 ptsMediumDocumentation (README)

File quality

Per-file score 0–10 — a quality signature. Of 158 files carrying findings, judged against the Production bar: 0% slop · 77% mixed · 23% near-clean.

FileScoreBandWorst signal
REDACTED4.8MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
src/specify_cli/integrations/base.py5.5MixedCyclomatic Complexity: IntegrationBase.process_template (cyclomatic 20)
src/specify_cli/presets/_manager.py6.0MixedExplicit Debt: TodoComment
src/specify_cli/integrations/codex/__init__.py6.3MixedCode Duplication: Duplicated block (8 lines × 2)
src/specify_cli/extensions/__init__.py7.0MixedCyclomatic Complexity: ExtensionManager.install_from_directory (cyclomatic 119)
src/specify_cli/presets/_manager_commands.py7.0MixedCyclomatic Complexity: _PresetCommandMethods.register_enabled_presets_for_agent (cyclomatic 75)
src/specify_cli/workflows/_execution.py7.0MixedCyclomatic Complexity: _execution.check_node (cyclomatic 66)
src/specify_cli/agents.py7.0MixedCyclomatic Complexity: CommandRegistrar.register_commands (cyclomatic 53)
src/specify_cli/integrations/__init__.py7.0MixedCyclomatic Complexity: IntegrationDescriptor._validate (cyclomatic 48)
src/specify_cli/presets/_resolver.py7.0MixedCyclomatic Complexity: PresetResolver.resolve (cyclomatic 43)
src/specify_cli/workflows/engine.py7.0MixedCyclomatic Complexity: engine._validate_steps (cyclomatic 38)
src/specify_cli/presets/_manager_skills.py7.0MixedCyclomatic Complexity: _PresetSkillMethods._register_skills (cyclomatic 37)
src/specify_cli/events/__init__.py7.0MixedCyclomatic Complexity: events.install_integration_events (cyclomatic 32)
src/specify_cli/integrations/installer.py7.0MixedCyclomatic Complexity: installer.catalog_package (cyclomatic 31)
src/specify_cli/_download_security.py7.0MixedCyclomatic Complexity: _download_security.safe_extract_tar (cyclomatic 30)
src/specify_cli/workflows/overlay/merge.py7.0MixedCyclomatic Complexity: merge._traverse_and_apply (cyclomatic 22)
src/specify_cli/artifacts/catalog.py7.0MixedCyclomatic Complexity: ArtifactCatalog._collect_hook_inventory (cyclomatic 20)
src/specify_cli/workflows/catalog/_domain.py7.0MixedCyclomatic Complexity: WorkflowRegistry.save (cyclomatic 16)
src/specify_cli/shared_infra.py7.0MixedCyclomatic Complexity: shared_infra.install_shared_infra (cyclomatic 63)

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

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

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

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

Could not be resolved — 13

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

Methodology & how to trust this report

Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 50 of 56 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 6 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 — 56 dimensions across the health lenses
D1D2D3D4D6D7D9D13D14D15D16D17D19D20D21D22D25D26D28D29D34D35D36D37D44AX10AX3AX4M1M2M3M4P1P10P2P3P4P6X1X12X13X14X15X17X19X21X22X23X24X25X26X27X28X3X30X4

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, 795 of 808 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 · trivySecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3✓ 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 01a166ef-0932-71bb-adc8-6caae8807c9d.

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

Run transparency — what happened this run

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

  • D8 Code Coverage — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: test source is present (.py) but the built-in coverage collector has no runner for this repository's ecosystem — so this suite was never executed by it. Not scored — this is a gap in the analyzer's language coverage, not a defect in the repo. To have real coverage read, produce a coverage report in a standard format (`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. 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 the real number is read on the next scan.
  • 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 included — the Python suite (repository root, 298 test files) did not finish re-running within its budget: the Python suite did not finish re-running within its tier budget.
  • D12 Dependency Hygiene — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. This repository's 10 shipped Python distribution(s) across 1 manifest(s) WERE read; what went unanswered is the currency half, because it grades an EXACT pin against the newest release and every declaration here is a floor or a range — which installs the newest release it admits and so cannot be behind one. So pypi.org was never asked. This is a true statement about the repository, and the healthy one, NOT a gap on our side: no reader we could write would find a currency question here.
  • 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.
  • AX6 Interface segregation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
  • GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and no C#, F#, JavaScript/TypeScript, Dart, Ruby or Scala was found, and this repository's Python is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and no C#, JavaScript/TypeScript, Java, Dart, Ruby or Scala was found, and this repository's Python 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.
  • P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
  • 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.
  • X16 Unfloored truncation loop — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X18 Disposal-pattern correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala or PHP was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X29 Per-element action decided by a fixed element — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Rust, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, Rust, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • 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: 2 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.

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.
  • 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.
  • D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
  • 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.
  • 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.
  • D25 ADR Conformance: ADR conformance is the LLM-scored fraction of sampled code that follows recorded decisions — it checks the decisions that were written down and the slices it sampled, not unrecorded rules or the whole tree.
  • 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").
  • 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.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • 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 (6): D19, D20, D21, D22, D25, 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 Complexity2.0 / 10Critical✓ 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 2.0 / 10 · rule-coverage 100% · ceiling Prevented

171 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was _command_update_transaction.run_update_command at 149.

_catalog_versions._validated_releases (cyclomatic 22) · ×2src/specify_cli/extensions/_catalog_versions.py:33
_command_update_transaction.run_update_command (cyclomatic 149)src/specify_cli/extensions/_command_update_transaction.py:24
ExtensionManager.install_from_directory (cyclomatic 119)src/specify_cli/extensions/__init__.py:2367
_PresetCommandMethods.register_enabled_presets_for_agent (cyclomatic 75)src/specify_cli/presets/_manager_commands.py:235
ExtensionManifest._validate (cyclomatic 71)src/specify_cli/extensions/__init__.py:273

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

What to do

  1. Bring the 7 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with _command_update_transaction.run_update_command (cyclomatic 149), ExtensionManager.install_from_directory (cyclomatic 119), _PresetCommandMethods.register_enabled_presets_for_agent (cyclomatic 75). — 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 7 together lifts Cyclomatic Complexity from 2.0 to about 3.2/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

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

279 method(s) exceeded the cognitive complexity threshold of 15; the worst was _command_update_transaction.run_update_command at 418.

_command_update_transaction.run_update_command (cognitive 418)src/specify_cli/extensions/_command_update_transaction.py:24
ExtensionManager.install_from_directory (cognitive 204)src/specify_cli/extensions/__init__.py:2367
ExtensionManager.register_enabled_extensions_for_agent (cognitive 189)src/specify_cli/extensions/__init__.py:3867
shared_infra.install_shared_infra (cognitive 176)src/specify_cli/shared_infra.py:467
_PresetCommandMethods._reconcile_composed_commands (cognitive 160)src/specify_cli/presets/_manager_commands.py:894

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

What to do

  1. Bring the 33 bodies over 60 down to 60 or less in Cognitive Complexity — start with _command_update_transaction.run_update_command (cognitive 418), ExtensionManager.install_from_directory (cognitive 204), ExtensionManager.register_enabled_extensions_for_agent (cognitive 189). — 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 33 together lifts Cognitive Complexity from 2.0 to about 3.2/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

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

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

28 god class(es) detected.

FileTooLong: extensions/__init__.py · ×25src/specify_cli/extensions/__init__.py
TooManyMethods: ExtensionManager · ×3src/specify_cli/extensions/__init__.py:1028

What to do

  1. Resolve the 25 FileTooLong finding(s) in God Classes — start with REDACTED (2), _domain.py (2), _commands.py. — One of this dimension's main actionable groups (25 warning-level).
  2. Resolve the 3 TooManyMethods finding(s) in God Classes — start with REDACTED, base.py, agents.py. — One of this dimension's main actionable groups (3 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 Duplication8.8 / 10Strong✓ 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 8.8 / 10 · rule-coverage 100% · ceiling Verified

167 duplicated block group(s) detected. A further 12 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted.

Duplicated block (9 lines × 2) · ×9extensions/github/scripts/python/resolve_tasks.py:113
Duplicated block (10 lines × 2) · ×8src/specify_cli/presets/_manager_commands.py:859
Duplicated block (16 lines × 2) · ×7scripts/python/setup_plan.py:41
Duplicated block (6 lines × 2) · ×7src/specify_cli/bundles/adapters.py:190
Duplicated block (11 lines × 2) · ×6src/specify_cli/bundles/catalogs.py:117

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

What to do

  1. Resolve the 9 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with command_info.py (2), resolve_tasks.py, check_prerequisites.py. — One of this dimension's main actionable groups (9 warning-level).
  2. Resolve the 8 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with REDACTED (3), _domain.py (2), _manager_commands.py. — One of this dimension's main actionable groups (8 warning-level).
  3. Resolve the 7 Duplicated block (16 lines × 2) finding(s) in Code Duplication — start with setup_plan.py, mcp_info.py, REDACTED. — One of this dimension's main actionable groups (7 warning-level).

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

D6 · Cohesion (LCOM4)9.7 / 10Stronggated by 1 serious finding✓ 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

1 of 42 classes have LCOM4 above 3.

Low cohesion: IntegrationBase (LCOM4 4)src/specify_cli/integrations/base.py:113

What to do

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

D7 · Architectural Integrity10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the code respects its intended layering / architecture rules.

Method: Enforcement rung (Prevented/Verified/Documented) per checkable ADR via Roslyn, plus dependency cycles via the engine shared with D5/AX3. Deterministic, exact.

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

All 2 mechanizable ADR(s) are enforced: 2 by analyzers, 0 by tests. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).

Checkable ADR rule enforced only by prose: Specify CLI Command Architecture · ×2design/cli.md

✓ On the Gold path — maintain.

Detailed fixes: d7_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

6553 test methods: 5722 unit, 831 integration, 0 BDD, 0 e2e. The Python suite contributes 6553 test function(s) across 292 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.

D13 · Secret Scanning10.0 / 10Exemplary○ Nothing flagged

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

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.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 41 shipped Python distribution(s) use a banned license. Licences were resolved from PyPI over the distributions a consumer installs — this repository's 10 declared runtime requirement(s) closed transitively over each distribution's published `requires_dist` (31 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. 1 of them publish no licence on PyPI this pass can read; that is missing data, not a violation, and none of them is charged.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

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

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

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

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

Top hotspots: src/specify_cli/extensions/__init__.py (35×119=4165); src/specify_cli/workflows/_commands.py (21×50=1050); src/specify_cli/workflows/engine.py (20×38=760) Repeated repair below the complexity floor: src/specify_cli/_invocation_style.py (6 of 10 changes were fixes); src/specify_cli/integrations/_helpers.py (6 of 8 changes were fixes); src/specify_cli/bundles/versioning.py (4 of 6 changes were fixes)

Hotspot: src/specify_cli/extensions/__init__.py · ×51src/specify_cli/extensions/__init__.py:2367
Repeated repair: src/specify_cli/_invocation_style.py · ×5src/specify_cli/_invocation_style.py:62

What to do

  1. Resolve the 51 Hotspot finding(s) in Churn × Complexity Hotspots — start with REDACTED (10), command_info.py (5), command_add.py (4). — One of this dimension's main actionable groups (51 warning-level).
  2. Resolve the 5 Repeated repair finding(s) in Churn × Complexity Hotspots — start with _invocation_style.py, _helpers.py, versioning.py. — One of this dimension's main actionable groups (5 warning-level).

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

D16 · Bus Factor9.2 / 10Exemplary✓ 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 9.2 / 10 · rule-coverage 100% · ceiling Documented

16 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is src/specify_cli/workflows/command_add.py. Counted over 190 of the 279 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
Further sole-owners (lower concentration)

✓ On the Gold path — maintain.

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

D17 · Explicit Debt10.0 / 10Stronggated by 1 serious finding✓ 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

1 deducted task-comment markers across 65784 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.

TodoCommentsrc/specify_cli/presets/_manager.py:498

What to do

  1. Resolve the 1 TodoComment finding(s) in Explicit Debt — start with _manager.py. — One of this dimension's main actionable groups (1 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

This repository is well documented: the root README gives a strong overview and links to releases, stars, license, and multilingual documentation (English, Chinese, Japanese, Korean), while docs/README.md documents the project's build-and-deploy pipeline with installation, structure, and deployment instructions. The architecture/design docs are also present and fully outline every document in the set. The repository is well documented with a strong README for each directory (e.g. bug-triage, git-branching, github-integration, template) that explains what the directory does and how to use it. The architecture/design docs are also present (20+ markdown files), covering topics like the constitution sync preset, lean workflow, and the SDD composable stack. A dedicated history document traces the project's conception through two stewardship periods and ends with enduring themes. The repository's documentation is clear and complete for a project that is itself the GitHub Spec Kit tool. The landing page gives an overview of what the project does (SDD, bug fixing, idea assessment) and directs readers to installation, guides, and existing-project content. Installation is explicit with prerequisites (Linux/macOS, AI coding agents, uv/pipx, Python 3.11+, Git), two install routes (source from GitHub or PyPI), a local development guide covering cloning, running the CLI directly, an editable-uvv isolated environment, and uvx invocation from Git, plus a detailed local-development outline. The quickstart is also thorough with a Taskify example and a recommended process that explains context-aware feature resolution versus git branches.

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D20 · ADR QualityStrong◐ Sampled · advisory

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

Evaluated 5 ADR(s) individually; mean quality 8.2/10 (consistently complete and clear). 0 flagged with a specific gap.

What to do

  1. Improve ADR Quality — currently 8.2/10. — Evaluated 5 ADR(s) individually; mean quality 8.2/10 (consistently complete and clear). 0 flagged with a specific gap.

Detailed fixes: d20_recommendation.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 ConsistencyStrong◐ 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

4 API inconsistencies across a 400-member sample of 501 exposed types.

Two methods with nearly identical names and signatures in the same module, likely performing overlapping setup or validation steps for initialization.
Redundant normalization functions. `normalize_zip_member_name` is a specific case of `normalize_archive_member_name` (since ZIP is an archive format), yet both are exposed publicly.
Redundant key generation functions. Similar to the normalization issue, `portable_zip_path_key` duplicates the intent of `portable_archive_path_key` for the ZIP format.
Inconsistent naming and scope for command registration. `register_commands` is generic, while the other two are specific to agent types, creating confusion about which method to use for general vs. specific registration.

What to do

  1. Resolve the 1 Two methods with nearly identical names and signatures in the same… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 Redundant normalization functions. `normalize_zip_member_name` is a… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 Redundant key generation functions. Similar to the normalization issue,… 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.

D25 · ADR ConformanceExemplary◐ Sampled · advisory

What it measures: Whether the code actually follows the decisions recorded in the project's ADRs.

Method: Judged by language model at low temperature against ADRs plus a deterministic structural code summary; findings linked to repo-rooted ADR paths for traceability. Advisory.

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

1 conform / 0 violate across 5 ADRs.

✓ On the Gold path — maintain.

Detailed fixes: d25_recommendation.md.

D26 · Project Cohesion0.0 / 10Critical✓ 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 0.0 / 10 · rule-coverage 100% · ceiling Documented

1 of 1 build units (Python) 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.7 / 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.7 / 10 · rule-coverage 100% · ceiling Documented

16 finding(s): 0 critical, 15 high, 0 medium, 1 low. semgrep hit a parse error in 5 file(s) — `.github/workflows/bug-assess.lock.yml`, `extensions/agent-context/scripts/bash/update-agent-context.sh` (lines 35–39, lines 41–43, lines 237–258, …), `extensions/git/scripts/bash/create-new-feature-branch.sh`, `scripts/bash/common.sh`, `scripts/bash/create-new-feature.sh` — 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 11 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

What to do

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

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

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

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

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

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

Every significant source file has living knowledge — recently and meaningfully worked. Counted over 190 of the 279 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

✓ On the Gold path — maintain.

Detailed fixes: d34_recommendation.md.

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

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

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

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

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

Strongest change-coupling: _invocation_style.py↔command_init.py 64%; REDACTED↔REDACTED 60%; _invocation_style.py↔REDACTED 50%

Change coupling: _invocation_style.py ↔ command_init.py · ×3src/specify_cli/_invocation_style.py:1

What to do

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

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

D36 · Supply-chain Provenance & Signing2.5 / 10Weak✓ 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 2.5 / 10 · rule-coverage 100% · ceiling Documented

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

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — 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 warning-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.

D37 · Vulnerability-disclosure Policy10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.

Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.

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

A vulnerability-disclosure policy (SECURITY.md) is published with a reporting contact.

✓ On the Gold path — maintain.

Detailed fixes: d37_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 1 platform declaration(s) and 10 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.9 / 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.

M1 · Documentation (README)6.0 / 10Adequate✓ 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.
M2 · Architecture documentation7.0 / 10Strong✓ 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.

  • 5 ADR-shaped document(s) detected by content — `design/cli.md`, `design/extension.md`, `design/mcp.md`, `design/shared.md`, `extensions/assess/commands/speckit.assess.decide.md`. They are not under a conventional ADR folder (docs/adr/) and are not named NNNN-title.md, and this check found them by their decision signature rather than by where they live — so a reader who does not already know these paths has no route to them. Detected by content signature only: records kept outside the repository, or written without a Status/Decision/Consequences shape, are not visible to this check and are not counted here.

What to do

  • Move ADRs under docs/adr/ (or docs/adrs/) and name them NNNN-title.md so they're easy to find.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

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

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

M4 · Documentation accuracy10.0 / 10Exemplary◐ Sampled · advisory

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

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

  • CONTRIBUTING.md names `docs/2677-branch-naming-convention`, but no file or folder `docs/2677-branch-naming-convention` 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. — CONTRIBUTING.md:189
  • docs/local-development.md documents the environment variable `SPEC_KIT_SRC`, but no code, script or configuration file names it. 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. — docs/local-development.md:82
  • docs/community/workflow-steps.md documents the environment variable `TYPESAFE_API_KEY`, but no code, script or configuration file names it. 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. — docs/community/workflow-steps.md:48
  • docs/community/workflow-steps.md names `docs/deploy.md`, but no file or folder `docs/deploy.md` 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. — docs/community/workflow-steps.md:134
  • docs/guides/monorepo.md changes into `apps/web`, 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. — docs/guides/monorepo.md:51
  • docs/install/uv.md runs `powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1`, but `https:/astral.sh/uv/install.ps1` does not exist. 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. — docs/install/uv.md:25
  • docs/reference/presets.md names `docs/api.md`, but no file or folder `docs/api.md` 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. — docs/reference/presets.md:80

What to do

  • Reconcile the README with reality: CONTRIBUTING.md names `docs/2677-branch-naming-convention`, but no file or folder `docs/2677-branch-naming-convention` exists; docs/local-development.md documents the environment variable `SPEC_KIT_SRC`, but no code, script or configuration file names it; docs/community/workflow-steps.md documents the environment variable `TYPESAFE_API_KEY`, but no code, script or configuration file names it; docs/community/workflow-steps.md names `docs/deploy.md`, but no file or folder `docs/deploy.md` exists; docs/guides/monorepo.md changes into `apps/web`, but no such folder 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.0 / 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.

P3 · Security & performance tooling7.0 / 10Strong✓ Tool-verified

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

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

What to do

  • 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 Hygiene10.0 / 10Exemplary✓ Tool-verified

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

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

X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

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

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

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

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

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

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

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

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

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

X17 · Uncapped recursion over a caller-supplied document3.5 / 10Weak✓ 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.

  • `merge_json_files` is public, takes a document from its caller (line 263) and hands it to `deep_merge_polite`, which calls itself at line 323 (`deep_merge_polite`) with a piece of `base` — and nowhere in `deep_merge_polite` 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 `deep_merge_polite` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/specify_cli/_utils.py:323

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.
X19 · Unrestored process-global state10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

X3 · Exception handling7.6 / 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. (×13) — extensions/agent-context/scripts/python/update_agent_context.py:83, extensions/agent-context/scripts/python/update_agent_context.py:152, src/specify_cli/__init__.py:237, …
  • 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. (×4) — scripts/python/common.py:237, src/specify_cli/events/__init__.py:757, src/specify_cli/events/__init__.py:1071, …
  • `except (OSError, UnicodeDecodeError, 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. — src/specify_cli/extensions/__init__.py:2317

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 Health78%Adequate — gated by D1, D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture88%Adequate — gated by D26Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity79%StrongSolid.
Readiness81%StrongStrongest area.
Security66%Adequate — gated by D29, D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
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 — 8 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 control(s) we could not find positive evidence for

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

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

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

  • AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
  • AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
  • AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
  • AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
  • AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
  • AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
  • AC7 A11y enforcement — No web markup found — accessibility is not applicable to this repository.
  • AX1 Captive dependencies — Not applicable: this repository's Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • 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.
  • 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
  • AXB1 Runtime evidence locked — no reproducible boot — This repository has nothing the runtime tiers could boot or serve — no markup, no UI framework or web-server dependency, no UI component source, no native UI project and no API definition — nothing here is a surface to boot — so runtime a11y/egress/header evidence has no subject here. Not applicable: this is neither a gap in the scan nor a finding about your code.
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C2 Access Controls — No access-control surface detected in the analyzed source — this repository registers no route and starts no server another machine can reach (no Flask/FastAPI/Starlette route, Django urlpatterns or class-based view, Tornado handler). Access control is therefore N/A here — a library or command-line tool is authorized by the application that serves it, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
  • C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Django, SQLAlchemy, SQLModel, Peewee, Tortoise or MongoEngine model, a migration or a SQL schema — and no database or data-store client (Django ORM, SQLAlchemy, psycopg, PyMongo, …) in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a store configured outside this repository, for instance), the trail belongs to wherever that data is stored.
  • C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential on a Django, SQLAlchemy, SQLModel, Peewee, Tortoise or mongoengine model, in a migration or in a SQL schema — and no database or data-store client (django.db, sqlalchemy, psycopg2, pymongo, sqlite3, …) imported either, so this repository keeps no personal data whose lifetime a retention limit would bound.
  • C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential on a Django, SQLAlchemy, SQLModel, Peewee, Tortoise or mongoengine model, in a migration or in a SQL schema — and no database or data-store client (django.db, sqlalchemy, psycopg2, pymongo, sqlite3, …) imported either, so this repository keeps no personal data for a data subject to erase, export or consent over.
  • D10 Test Quality — ~137820 lines of test source are present (.py) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D11 Test Reliability — Test reliability not included
  • D12 Dependency Hygiene — Dependency currency not established — no declaration carries an exact pin to grade
  • 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, nor 2+ projects each declaring an entity of their own. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — No inline comments to assess — comment value is not applicable here.
  • 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.
  • D30 Dependency Vulnerabilities — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Python pyproject.toml/requirements.txt (pip/uv/Poetry) — not scanned yet).
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
  • D32 Data Compliance (PII/GDPR) — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
  • 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.
  • D43 Malicious Dependencies — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Python pyproject.toml/requirements.txt (pip/uv/Poetry) — not scanned yet).
  • D5 Coupling — Not applicable — this Python build ships 1 production module(s), so there is no coupling BETWEEN modules to measure. (Its test and non-production modules are not part of the shipped graph.)
  • D8 Code Coverage — Coverage not included — suite not readable by the collector
  • DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (87 value object(s))
  • 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'.
  • P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the Python source, so there is no service whose uptime a failing dependency could take down
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — no coverage report found on disk — 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, or wire coverage collection into CI, to enable this cross-layer check
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for a pytest-benchmark or pytest-codspeed dependency with tests taking the `benchmark` fixture, an asv.conf.json with its `time_`/`mem_`/`peakmem_` benchmarks, or a pyperf Runner, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
  • 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.
  • PF3 Async & latency hygiene — Not applicable: this repository declares no async functions, so there is no asynchronous code for a blocking call to stall.
  • 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.
  • X16 Unfloored truncation loop — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X18 Disposal-pattern correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X2 Cancellation propagation — no C# was loaded; this repository's Python 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.
  • X29 Per-element action decided by a fixed element — 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
  • 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 — 14 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
Serious — 743 finding(s)
D15 · Churn × Complexity Hotspots · Hotspot · ×51
  • Hotspot: src/specify_cli/extensions/__init__.py src/specify_cli/extensions/__init__.py:2367 — src/specify_cli/extensions/__init__.py changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 119 in ExtensionManager.install_from_directory at line 2367. 19 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 09:12:35 -05:00' --until='2026-10-22 09:12:35 -05:00' --full-history --no-merges -- src/specify_cli/extensions/__init__.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: src/specify_cli/workflows/_commands.py src/specify_cli/workflows/_commands.py:1103 — src/specify_cli/workflows/_commands.py changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 50 in _commands._install_workflow_from_catalog at line 1103. 11 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 09:12:35 -05:00' --until='2026-10-22 09:12:35 -05:00' --full-history --no-merges -- src/specify_cli/workflows/_commands.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: src/specify_cli/workflows/engine.py src/specify_cli/workflows/engine.py:385 — src/specify_cli/workflows/engine.py changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in engine._validate_steps at line 385. 13 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 09:12:35 -05:00' --until='2026-10-22 09:12:35 -05:00' --full-history --no-merges -- src/specify_cli/workflows/engine.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: src/specify_cli/agents.py src/specify_cli/agents.py:669 — src/specify_cli/agents.py changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 53 in CommandRegistrar.register_commands at line 669. 10 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 09:12:35 -05:00' --until='2026-10-22 09:12:35 -05:00' --full-history --no-merges -- src/specify_cli/agents.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: src/specify_cli/events/__init__.py src/specify_cli/events/__init__.py:1344 — src/specify_cli/events/__init__.py changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in events.install_integration_events at line 1344. 5 of those changes were fix/bug commits, and the other 16 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 09:12:35 -05:00' --until='2026-10-22 09:12:35 -05:00' --full-history --no-merges -- src/specify_cli/events/__init__.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: src/specify_cli/workflows/expressions.py src/specify_cli/workflows/expressions.py:782 — src/specify_cli/workflows/expressions.py changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 41 in expressions._evaluate_simple_expression at line 782. 11 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 09:12:35 -05:00' --until='2026-10-22 09:12:35 -05:00' --full-history --no-merges -- src/specify_cli/workflows/expressions.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: src/specify_cli/integrations/__init__.py src/specify_cli/integrations/__init__.py:889 — src/specify_cli/integrations/__init__.py changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in IntegrationDescriptor._validate at line 889. 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 09:12:35 -05:00' --until='2026-10-22 09:12:35 -05:00' --full-history --no-merges -- src/specify_cli/integrations/__init__.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: src/specify_cli/shared_infra.py src/specify_cli/shared_infra.py:467 — src/specify_cli/shared_infra.py changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 63 in shared_infra.install_shared_infra at line 467. 2 of those changes were fix/bug commits, and the other 3 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 09:12:35 -05:00' --until='2026-10-22 09:12:35 -05:00' --full-history --no-merges -- src/specify_cli/shared_infra.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: src/specify_cli/extensions/_command_update_transaction.py src/specify_cli/extensions/_command_update_transaction.py:24 — src/specify_cli/extensions/_command_update_transaction.py changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 149 in _command_update_transaction.run_update_command at line 24. 1 of those changes was a fix/bug commit, and the other 1 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 09:12:35 -05:00' --until='2026-10-22 09:12:35 -05:00' --full-history --no-merges -- src/specify_cli/extensions/_command_update_transaction.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: src/specify_cli/command_init.py src/specify_cli/command_init.py:101 — src/specify_cli/command_init.py changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in command_init._install_extension_during_init at line 101. 2 of those changes were fix/bug commits, and the other 14 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 09:12:35 -05:00' --until='2026-10-22 09:12:35 -05:00' --full-history --no-merges -- src/specify_cli/command_init.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: src/specify_cli/authentication/config.py src/specify_cli/authentication/config.py:84 — src/specify_cli/authentication/config.py changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in config.load_auth_config at line 84. 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 09:12:35 -05:00' --until='2026-10-22 09:12:35 -05:00' --full-history --no-merges -- src/specify_cli/authentication/config.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: src/specify_cli/integrations/base.py src/specify_cli/integrations/base.py:1831 — src/specify_cli/integrations/base.py changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in SkillsIntegration.setup at line 1831. 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 09:12:35 -05:00' --until='2026-10-22 09:12:35 -05:00' --full-history --no-merges -- src/specify_cli/integrations/base.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: src/specify_cli/integrations/copilot/__init__.py src/specify_cli/integrations/copilot/__init__.py:361 — src/specify_cli/integrations/copilot/__init__.py changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in CopilotIntegration.dispatch_command at line 361. 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 09:12:35 -05:00' --until='2026-10-22 09:12:35 -05:00' --full-history --no-merges -- src/specify_cli/integrations/copilot/__init__.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: src/specify_cli/bundles/installer.py src/specify_cli/bundles/installer.py:73 — src/specify_cli/bundles/installer.py changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in installer.install_bundle at line 73. 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 09:12:35 -05:00' --until='2026-10-22 09:12:35 -05:00' --full-history --no-merges -- src/specify_cli/bundles/installer.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: scripts/python/create_new_feature.py scripts/python/create_new_feature.py:266 — scripts/python/create_new_feature.py changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in create_new_feature.main at line 266. 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 09:12:35 -05:00' --until='2026-10-22 09:12:35 -05:00' --full-history --no-merges -- scripts/python/create_new_feature.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: src/specify_cli/authentication/github_http.py src/specify_cli/authentication/github_http.py:119 — src/specify_cli/authentication/github_http.py changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in github_http.resolve_github_release_asset_api_url at line 119. 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 09:12:35 -05:00' --until='2026-10-22 09:12:35 -05:00' --full-history --no-merges -- src/specify_cli/authentication/github_http.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: src/specify_cli/workflows/step/command_add.py src/specify_cli/workflows/step/command_add.py:261 — src/specify_cli/workflows/step/command_add.py changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 52 in command_add._install_from_catalog at line 261. 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 09:12:35 -05:00' --until='2026-10-22 09:12:35 -05:00' --full-history --no-merges -- src/specify_cli/workflows/step/command_add.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: src/specify_cli/workflows/step/prompt/__init__.py src/specify_cli/workflows/step/prompt/__init__.py:49 — src/specify_cli/workflows/step/prompt/__init__.py changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in PromptStep.execute at line 49. 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 09:12:35 -05:00' --until='2026-10-22 09:12:35 -05:00' --full-history --no-merges -- src/specify_cli/workflows/step/prompt/__init__.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: src/specify_cli/workflows/step/command/__init__.py src/specify_cli/workflows/step/command/__init__.py:46 — src/specify_cli/workflows/step/command/__init__.py changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in CommandStep.execute at line 46. 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 09:12:35 -05:00' --until='2026-10-22 09:12:35 -05:00' --full-history --no-merges -- src/specify_cli/workflows/step/command/__init__.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: src/specify_cli/workflows/command_add.py src/specify_cli/workflows/command_add.py:79 — src/specify_cli/workflows/command_add.py changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in command_add.workflow_add at line 79. 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 09:12:35 -05:00' --until='2026-10-22 09:12:35 -05:00' --full-history --no-merges -- src/specify_cli/workflows/command_add.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: src/specify_cli/_download_security.py src/specify_cli/_download_security.py:1070 — src/specify_cli/_download_security.py changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in _download_security.safe_extract_tar at line 1070. 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 09:12:35 -05:00' --until='2026-10-22 09:12:35 -05:00' --full-history --no-merges -- src/specify_cli/_download_security.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: src/specify_cli/bundles/manifest.py src/specify_cli/bundles/manifest.py:162 — src/specify_cli/bundles/manifest.py changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in BundleManifest.structural_errors at line 162. 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 09:12:35 -05:00' --until='2026-10-22 09:12:35 -05:00' --full-history --no-merges -- src/specify_cli/bundles/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: src/specify_cli/extensions/command_add.py src/specify_cli/extensions/command_add.py:21 — src/specify_cli/extensions/command_add.py changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 55 in command_add.extension_add at line 21. 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 09:12:35 -05:00' --until='2026-10-22 09:12:35 -05:00' --full-history --no-merges -- src/specify_cli/extensions/command_add.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: src/specify_cli/workflows/step/gate/__init__.py src/specify_cli/workflows/step/gate/__init__.py:40 — src/specify_cli/workflows/step/gate/__init__.py changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in GateStep.execute at line 40. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 09:12:35 -05:00' --until='2026-10-22 09:12:35 -05:00' --full-history --no-merges -- src/specify_cli/workflows/step/gate/__init__.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: src/specify_cli/workflows/overlay/operations.py src/specify_cli/workflows/overlay/operations.py:163 — src/specify_cli/workflows/overlay/operations.py changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in operations.workflow_overlay_add at line 163. 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 09:12:35 -05:00' --until='2026-10-22 09:12:35 -05:00' --full-history --no-merges -- src/specify_cli/workflows/overlay/operations.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.
  • + 26 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×25
  • FileTooLong: extensions/__init__.py src/specify_cli/extensions/__init__.py — FileTooLong — 3645 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3145 over it, 7.29× 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: workflows/_commands.py src/specify_cli/workflows/_commands.py — FileTooLong — 1100 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 600 over it, 2.20× 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: integrations/base.py src/specify_cli/integrations/base.py — FileTooLong — 1075 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 575 over it, 2.15× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: specify_cli/_download_security.py src/specify_cli/_download_security.py — FileTooLong — 949 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 449 over it, 1.90× 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: presets/_manager_skills.py src/specify_cli/presets/_manager_skills.py — FileTooLong — 934 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 434 over it, 1.87× 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: workflows/engine.py src/specify_cli/workflows/engine.py — FileTooLong — 896 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 396 over it, 1.79× 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: integrations/installer.py src/specify_cli/integrations/installer.py — FileTooLong — 890 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 390 over it, 1.78× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: specify_cli/agents.py src/specify_cli/agents.py — FileTooLong — 884 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 384 over it, 1.77× 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: specify_cli/command_init.py src/specify_cli/command_init.py — FileTooLong — 877 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 377 over it, 1.75× 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: artifacts/catalog.py src/specify_cli/artifacts/catalog.py — FileTooLong — 850 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 350 over it, 1.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: workflows/_execution.py src/specify_cli/workflows/_execution.py — FileTooLong — 784 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 284 over it, 1.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: specify_cli/_version.py src/specify_cli/_version.py — FileTooLong — 757 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 257 over it, 1.51× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: presets/_manager_commands.py src/specify_cli/presets/_manager_commands.py — FileTooLong — 746 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 246 over it, 1.49× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: integrations/__init__.py src/specify_cli/integrations/__init__.py — FileTooLong — 717 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 217 over it, 1.43× 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: workflows/expressions.py src/specify_cli/workflows/expressions.py — FileTooLong — 706 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 206 over it, 1.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: extensions/_command_update_transaction.py src/specify_cli/extensions/_command_update_transaction.py — FileTooLong — 640 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 140 over it, 1.28× 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: presets/_manager.py src/specify_cli/presets/_manager.py — FileTooLong — 612 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 112 over it, 1.22× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: presets/_catalog.py src/specify_cli/presets/_catalog.py — FileTooLong — 591 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 91 over it, 1.18× 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: presets/_resolver.py src/specify_cli/presets/_resolver.py — FileTooLong — 590 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 90 over it, 1.18× 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: catalog/_domain.py src/specify_cli/workflows/catalog/_domain.py — FileTooLong — 580 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 80 over it, 1.16× 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: catalog/_domain.py src/specify_cli/workflows/step/catalog/_domain.py — FileTooLong — 569 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 69 over it, 1.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.
  • FileTooLong: specify_cli/shared_infra.py src/specify_cli/shared_infra.py — FileTooLong — 538 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 38 over it, 1.08× 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: python/common.py scripts/python/common.py — FileTooLong — 532 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 32 over it, 1.06× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: specify_cli/integration_status.py src/specify_cli/integration_status.py — FileTooLong — 526 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 26 over it, 1.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: integrations/_lifecycle.py src/specify_cli/integrations/_lifecycle.py — FileTooLong — 512 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 12 over it, 1.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.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×14
  • Swallowed exception (caught, then discarded) extensions/agent-context/scripts/python/update_agent_context.py:83 — `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) extensions/agent-context/scripts/python/update_agent_context.py:152 — `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) src/specify_cli/__init__.py:237 — `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) src/specify_cli/bundles/primitives.py:314 — `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) src/specify_cli/bundles/primitives.py:405 — `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) src/specify_cli/bundles/primitives.py:500 — `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) src/specify_cli/bundles/primitives.py:596 — `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) src/specify_cli/events/__init__.py:664 — `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) src/specify_cli/events/__init__.py:1131 — `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) src/specify_cli/events/__init__.py:1688 — `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) src/specify_cli/extensions/__init__.py:2317 — `except (OSError, UnicodeDecodeError, 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) src/specify_cli/integrations/kimi/__init__.py:387 — `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) src/specify_cli/presets/_manager_skills.py:558 — `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) src/specify_cli/workflows/_commands.py:251 — `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.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×9
  • Duplicated block (9 lines × 2) extensions/github/scripts/python/resolve_tasks.py:113 — extensions/github/scripts/python/resolve_tasks.py:113-121 | scripts/python/common.py:84-92 — 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) scripts/python/check_prerequisites.py:130 — scripts/python/check_prerequisites.py:130-138 | scripts/python/setup_tasks.py:51-59 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (9 lines × 2) src/specify_cli/extensions/command_info.py:190 — src/specify_cli/extensions/command_info.py:190-198 | src/specify_cli/extensions/command_info.py:204-212 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) src/specify_cli/integrations/command_info.py:103 — src/specify_cli/integrations/command_info.py:103-111 | src/specify_cli/integrations/command_search.py:78-86 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (9 lines × 2) src/specify_cli/integrations/command_install.py:40 — src/specify_cli/integrations/command_install.py:40-48 | src/specify_cli/integrations/command_switch.py:48-56 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (9 lines × 2) src/specify_cli/presets/_resolver.py:359 — src/specify_cli/presets/_resolver.py:359-368 | src/specify_cli/presets/_resolver.py:713-721 — 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 (9 lines × 2) src/specify_cli/workflows/command_update.py:56 — src/specify_cli/workflows/command_update.py:56-64 | src/specify_cli/workflows/command_update.py:76-84 — 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 `src/specify_cli/workflows/command_update.py:56` 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 (9 lines × 2) src/specify_cli/workflows/expressions.py:385 — src/specify_cli/workflows/expressions.py:385-393 | src/specify_cli/workflows/expressions.py:411-419 — 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) src/specify_cli/artifacts/mcp_info.py:319 — src/specify_cli/artifacts/mcp_info.py:319-327 | src/specify_cli/artifacts/mcp_list.py:342-350 — before extracting anything, compare `src/specify_cli/artifacts/mcp_info.py` and `src/specify_cli/artifacts/mcp_list.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 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.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×8
  • Duplicated block (10 lines × 2) src/specify_cli/presets/_manager_commands.py:859 — src/specify_cli/presets/_manager_commands.py:859-868 | src/specify_cli/presets/_manager_skills.py:89-98 — 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 (10 lines × 2) src/specify_cli/workflows/catalog/_domain.py:447 — src/specify_cli/workflows/catalog/_domain.py:447-456 | src/specify_cli/workflows/step/catalog/_domain.py:396-405 — before extracting anything, compare `src/specify_cli/workflows/catalog/_domain.py` and `src/specify_cli/workflows/step/catalog/_domain.py` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 293 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/specify_cli/workflows/catalog/_domain.py:447` 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 (10 lines × 2) src/specify_cli/workflows/catalog/_domain.py:520 — src/specify_cli/workflows/catalog/_domain.py:520-529 | src/specify_cli/workflows/step/catalog/_domain.py:469-478 — before extracting anything, compare `src/specify_cli/workflows/catalog/_domain.py` and `src/specify_cli/workflows/step/catalog/_domain.py` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 293 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 (10 lines × 2) src/specify_cli/workflows/command_add.py:335 — src/specify_cli/workflows/command_add.py:335-344 | src/specify_cli/workflows/step/command_add.py:123-132 — 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 `src/specify_cli/workflows/command_add.py:335` 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 (10 lines × 2) src/specify_cli/workflows/overlay/merge.py:72 — src/specify_cli/workflows/overlay/merge.py:72-81 | src/specify_cli/workflows/overlay/merge.py:87-96 — 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 (10 lines × 2) src/specify_cli/integrations/bob/__init__.py:39 — src/specify_cli/integrations/bob/__init__.py:39-53 | src/specify_cli/integrations/copilot/__init__.py:96-105 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) src/specify_cli/integrations/devin/__init__.py:90 — src/specify_cli/integrations/devin/__init__.py:90-99 | src/specify_cli/integrations/vibe/__init__.py:100-109 — 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) src/specify_cli/extensions/__init__.py:4454 — src/specify_cli/extensions/__init__.py:4454-4463 | src/specify_cli/presets/_catalog.py:98-107 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×7
  • Duplicated block (16 lines × 2) scripts/python/setup_plan.py:41 — scripts/python/setup_plan.py:41-56 | scripts/python/setup_tasks.py:93-108 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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 lines × 2) src/specify_cli/artifacts/mcp_info.py:331 — src/specify_cli/artifacts/mcp_info.py:331-346 | src/specify_cli/artifacts/mcp_list.py:354-369 — before extracting anything, compare `src/specify_cli/artifacts/mcp_info.py` and `src/specify_cli/artifacts/mcp_list.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 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.
  • Duplicated block (16 lines × 2) src/specify_cli/events/__init__.py:2187 — src/specify_cli/events/__init__.py:2187-2202 | src/specify_cli/events/__init__.py:2226-2244 — 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) src/specify_cli/integrations/command_uninstall.py:27 — src/specify_cli/integrations/command_uninstall.py:27-42 | src/specify_cli/integrations/command_upgrade.py:48-63 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/specify_cli/integrations/command_upgrade.py:66` calls `Exit` and `src/specify_cli/integrations/command_uninstall.py:44` 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 (16 lines × 2) src/specify_cli/workflows/catalog/_domain.py:430 — src/specify_cli/workflows/catalog/_domain.py:430-445 | src/specify_cli/workflows/step/catalog/_domain.py:379-394 — before extracting anything, compare `src/specify_cli/workflows/catalog/_domain.py` and `src/specify_cli/workflows/step/catalog/_domain.py` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 293 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/specify_cli/workflows/catalog/_domain.py:430` 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 lines × 2) src/specify_cli/workflows/command_add.py:277 — src/specify_cli/workflows/command_add.py:277-292 | src/specify_cli/workflows/command_add.py:529-544 — 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 (16 lines × 2) scripts/python/check_prerequisites.py:169 — scripts/python/check_prerequisites.py:169-184 | scripts/python/setup_tasks.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 (6 lines × 2) · ×7
  • Duplicated block (6 lines × 2) src/specify_cli/bundles/adapters.py:190 — src/specify_cli/bundles/adapters.py:190-195 | src/specify_cli/bundles/adapters.py:199-204 — 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) src/specify_cli/bundles/catalogs.py:204 — src/specify_cli/bundles/catalogs.py:204-209 | src/specify_cli/bundles/manifest.py:106-111 — 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) src/specify_cli/extensions/__init__.py:4671 — src/specify_cli/extensions/__init__.py:4671-4676 | src/specify_cli/integrations/__init__.py:329-334 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) src/specify_cli/file_helper.py:195 — src/specify_cli/file_helper.py:195-200 | src/specify_cli/shared_infra.py:335-340 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `content` to `bytes` 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 (6 lines × 2) src/specify_cli/artifacts/command_info.py:26 — src/specify_cli/artifacts/command_info.py:26-31 | src/specify_cli/artifacts/command_list.py:26-31 — 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 (6 lines × 2) src/specify_cli/integrations/cline/__init__.py:150 — src/specify_cli/integrations/cline/__init__.py:150-155 | src/specify_cli/integrations/junie/__init__.py:129-134 — `src/specify_cli/integrations/cline/__init__.py` and `src/specify_cli/integrations/junie/__init__.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 61 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (6 lines × 2) src/specify_cli/workflows/command_list.py:31 — src/specify_cli/workflows/command_list.py:31-36 | src/specify_cli/workflows/step/command_search.py:42-47 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×6
  • Duplicated block (11 lines × 2) src/specify_cli/bundles/catalogs.py:117 — src/specify_cli/bundles/catalogs.py:117-129 | src/specify_cli/bundles/manifest.py:259-269 — 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 (11 lines × 2) src/specify_cli/extensions/__init__.py:5009 — src/specify_cli/extensions/__init__.py:5009-5019 | src/specify_cli/presets/_catalog.py:776-786 — 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 `src/specify_cli/extensions/__init__.py:5009` 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.
  • Duplicated block (11 lines × 2) src/specify_cli/integrations/base.py:1946 — src/specify_cli/integrations/base.py:1946-1956 | src/specify_cli/integrations/generic/__init__.py:204-214 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (11 lines × 2) src/specify_cli/presets/_manager_skills.py:1262 — src/specify_cli/presets/_manager_skills.py:1262-1272 | src/specify_cli/presets/_manager_skills.py:1382-1392 — 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) src/specify_cli/workflows/catalog/_domain.py:755 — src/specify_cli/workflows/catalog/_domain.py:755-765 | src/specify_cli/workflows/step/catalog/_domain.py:693-703 — before extracting anything, compare `src/specify_cli/workflows/catalog/_domain.py` and `src/specify_cli/workflows/step/catalog/_domain.py` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 293 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.
  • Duplicated block (11 lines × 2) src/specify_cli/extensions/__init__.py:913 — src/specify_cli/extensions/__init__.py:913-923 | src/specify_cli/presets/_registry.py:84-94 — before extracting anything, compare `src/specify_cli/extensions/__init__.py` and `src/specify_cli/presets/_registry.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 149 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.
D15 · Churn × Complexity Hotspots · Repeated repair · ×5
  • Repeated repair: src/specify_cli/_invocation_style.py src/specify_cli/_invocation_style.py:62 — src/specify_cli/_invocation_style.py changed 10 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 _invocation_style.get_invocation_prefix 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(integrations): show hyphenated command names for docker-agent and junie (#4910)”; “fix(alquimia): render `/speckit-<name>` invocations for the skills-only Alquimia agent (#4137)”; “fix: support SKILL.md rendering for the generic integration (#4562)”; “[bug-fix] Fix qodercli-skills-migration: migrate QodercliIntegration to SkillsIntegration (#4205)”. 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 09:12:35 -05:00' --until='2026-10-22 09:12:35 -05:00' --full-history --no-merges -- src/specify_cli/_invocation_style.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: src/specify_cli/integrations/_helpers.py src/specify_cli/integrations/_helpers.py:192 — src/specify_cli/integrations/_helpers.py changed 8 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is _helpers._parse_integration_options at line 192), 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: sync integration manifest hashes after preset re-registration on upgrade (#4697)”; “fix: eliminate TOCTOU race in file unlink calls (#3811)”; “[bug-fix] Fix upgrade-overwrites-copilot-skills: pass force=True to extension skill re-registration after upgrade (#3853)”; “fix(integrations): preserve native skill invocation prefixes (#3663)”. 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 09:12:35 -05:00' --until='2026-10-22 09:12:35 -05:00' --full-history --no-merges -- src/specify_cli/integrations/_helpers.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: src/specify_cli/bundles/versioning.py src/specify_cli/bundles/versioning.py:128 — src/specify_cli/bundles/versioning.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 6 (its worst body is versioning.is_newer_patch at line 128), 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(bundles): allow newer packaged patch releases with warnings (#4942)”; “fix(bundler): report a newline-containing version constraint instead of crashing (#4538)”; “fix(bundles): reject non-ASCII digits in SemVer identifiers (#4835)”; “fix(bundles): verify pins of independently installed components (#4789)”. 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 09:12:35 -05:00' --until='2026-10-22 09:12:35 -05:00' --full-history --no-merges -- src/specify_cli/bundles/versioning.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: scripts/python/setup_plan.py scripts/python/setup_plan.py:37 — scripts/python/setup_plan.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 14 (its worst body is setup_plan.main at line 37), 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(scripts): write --json output of the Python helpers as ASCII (#5048)”; “[bug-fix] Fix missing-plan-template: reject empty plan setup (#4962)”; “fix(scripts): name setup-plan's feature directory key FEATURE_DIR (#4397)”; “fix: reject unknown setup-plan arguments (#4371)”. 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 09:12:35 -05:00' --until='2026-10-22 09:12:35 -05:00' --full-history --no-merges -- scripts/python/setup_plan.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: src/specify_cli/integrations/forge/__init__.py src/specify_cli/integrations/forge/__init__.py:198 — src/specify_cli/integrations/forge/__init__.py changed 3 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 13 (its worst body is ForgeIntegration._apply_forge_transformations at line 198), 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(integrations): remove duplicate Forge dispatch override (#4714)”; “fix(integrations): drop invalid --model/--output-format flags from Forge dispatch (#4667)”; “fix(integrations): dispatch Forge via prompt flag only (#4668)”. 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-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 09:12:35 -05:00' --until='2026-10-22 09:12:35 -05:00' --full-history --no-merges -- src/specify_cli/integrations/forge/__init__.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.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×5
  • Duplicated block (19 lines × 2) src/specify_cli/presets/_manager_skills.py:917 — src/specify_cli/presets/_manager_skills.py:917-935 | src/specify_cli/presets/_manager_skills.py:1254-1272 — 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) src/specify_cli/presets/command_disable.py:15 — src/specify_cli/presets/command_disable.py:15-33 | src/specify_cli/presets/command_enable.py:15-33 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `preset_id` to `str = typer.Argument(help="Preset ID to disable")` in one and `str = typer.Argument(help="Preset ID to enable")` 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) src/specify_cli/workflows/catalog/_domain.py:542 — src/specify_cli/workflows/catalog/_domain.py:542-560 | src/specify_cli/workflows/step/catalog/_domain.py:495-513 — before extracting anything, compare `src/specify_cli/workflows/catalog/_domain.py` and `src/specify_cli/workflows/step/catalog/_domain.py` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 293 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.
  • Duplicated block (19 lines × 2) src/specify_cli/workflows/catalog/command_list.py:20 — src/specify_cli/workflows/catalog/command_list.py:20-38 | src/specify_cli/workflows/step/catalog/command_list.py:20-38 — 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 (19 lines × 2) src/specify_cli/extensions/__init__.py:926 — src/specify_cli/extensions/__init__.py:926-944 | src/specify_cli/presets/_registry.py:152-170 — before extracting anything, compare `src/specify_cli/extensions/__init__.py` and `src/specify_cli/presets/_registry.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 149 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 (14 lines × 2) · ×5
  • Duplicated block (14 lines × 2) src/specify_cli/extensions/__init__.py:5171 — src/specify_cli/extensions/__init__.py:5171-5184 | src/specify_cli/presets/_catalog.py:929-942 — 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 `src/specify_cli/extensions/__init__.py:5171` 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 first that the copies are not typed on the same thing: the declarations holding them bind `target_dir` to `Optional[Path] = None` in one and `Path | None = None` 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 (14 lines × 2) src/specify_cli/integrations/_catalog_versions.py:123 — src/specify_cli/integrations/_catalog_versions.py:123-136 | src/specify_cli/presets/_catalog_versions.py:126-139 — 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 `src/specify_cli/integrations/_catalog_versions.py:123` 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.
  • Duplicated block (14 lines × 2) src/specify_cli/integrations/kimi/__init__.py:75 — src/specify_cli/integrations/kimi/__init__.py:75-88 | src/specify_cli/integrations/pi/__init__.py:39-52 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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) src/specify_cli/presets/_manager_skills.py:806 — src/specify_cli/presets/_manager_skills.py:806-819 | src/specify_cli/presets/_manager_skills.py:1527-1540 — 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 `src/specify_cli/presets/_manager_skills.py:806` 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 (14 lines × 2) src/specify_cli/workflows/overlay/operations.py:75 — src/specify_cli/workflows/overlay/operations.py:75-88 | src/specify_cli/workflows/overlay/operations.py:132-145 — 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 (12 lines × 2) · ×4
  • Duplicated block (12 lines × 2) src/specify_cli/_download_security.py:693 — src/specify_cli/_download_security.py:693-704 | src/specify_cli/_download_security.py:810-821 — 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 `src/specify_cli/_download_security.py:693` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/specify_cli/_download_security.py:822` calls `unpack_from` and `src/specify_cli/_download_security.py:705` 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 (12 lines × 2) src/specify_cli/extensions/command_add.py:317 — src/specify_cli/extensions/command_add.py:317-328 | src/specify_cli/extensions/command_enable.py:111-122 — 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 (12 lines × 2) src/specify_cli/integrations/_command_upgrade_layout.py:38 — src/specify_cli/integrations/_command_upgrade_layout.py:38-49 | src/specify_cli/integrations/_command_upgrade_layout.py:66-77 — 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 (12 lines × 2) src/specify_cli/extensions/__init__.py:966 — src/specify_cli/extensions/__init__.py:966-977 | src/specify_cli/presets/_registry.py:192-203 — before extracting anything, compare `src/specify_cli/extensions/__init__.py` and `src/specify_cli/presets/_registry.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 149 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 (8 lines × 2) · ×4
  • Duplicated block (8 lines × 2) extensions/git/scripts/python/auto_commit.py:179 — extensions/git/scripts/python/auto_commit.py:179-186 | extensions/git/scripts/python/initialize_repo.py:72-80 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) src/specify_cli/integrations/__init__.py:1021 — src/specify_cli/integrations/__init__.py:1021-1028 | src/specify_cli/integrations/__init__.py:1030-1037 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) src/specify_cli/integrations/command_info.py:64 — src/specify_cli/integrations/command_info.py:64-71 | src/specify_cli/presets/command_info.py:51-58 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) src/specify_cli/integrations/codex/__init__.py:60 — src/specify_cli/integrations/codex/__init__.py:60-67 | src/specify_cli/integrations/muse/__init__.py:64-71 — 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.
X3 · Exception handling · Swallowed exception (empty catch) · ×4
  • Swallowed exception (empty catch) scripts/python/common.py:237 — 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) src/specify_cli/events/__init__.py:757 — 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) src/specify_cli/events/__init__.py:1071 — 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) src/specify_cli/events/__init__.py:1116 — 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.
D3 · God Classes · TooManyMethods · ×3
  • TooManyMethods: ExtensionManager src/specify_cli/extensions/__init__.py:1028 — 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: IntegrationBase src/specify_cli/integrations/base.py:113 — TooManyMethods — 36 methods. The bar is 30 methods; this is 6 over it, 1.20× 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: CommandRegistrar src/specify_cli/agents.py:40 — 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.
D35 · Change Coupling · Change coupling · ×3
  • Change coupling: _invocation_style.py ↔ command_init.py src/specify_cli/_invocation_style.py:1 — `src/specify_cli/_invocation_style.py` and `src/specify_cli/command_init.py` change together 64% of the time (9 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency 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 9 shared commits counted here, the most recent 3 are `9801d2b8` fix(integrations): show hyphenated command names for docker-agent and…; `9b8e5d81` feat(integrations): add MiniMax Code (mcode) integration (#4644) (#4645); `4dd8afa3` feat(integrations): add Muse Code (muse) agent integration (#4413) (at that commit the file was still `src/specify_cli/commands/init.py`) — run `git show` on any of them.
  • Change coupling: REDACTED ↔ REDACTED src/specify_cli/integrations/codex/__init__.py:1 — `src/specify_cli/integrations/codex/__init__.py` and `src/specify_cli/integrations/copilot/__init__.py` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `04c99dac` fix(agy): support --model, --add-dir workspace, and pre-prompt extra …; `f43768d2` feat(workflows): add per-step integration configuration (#4425); `f8e474d6` feat: first-class agent-native runtime hooks for integrations (#3704) — run `git show` on any of them.
  • Change coupling: _invocation_style.py ↔ REDACTED src/specify_cli/_invocation_style.py:1 — `src/specify_cli/_invocation_style.py` and `src/specify_cli/integrations/__init__.py` change together 50% of the time (7 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `9b8e5d81` feat(integrations): add MiniMax Code (mcode) integration (#4644) (#4645); `4dd8afa3` feat(integrations): add Muse Code (muse) agent integration (#4413); `ea5b856d` Add DeepSeek Harness (DSH) integration (#4336) — run `git show` on any of them.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×3
  • Members sharing a duplicated core (5 members, 50+ identical tokens) src/specify_cli/extensions/__init__.py:4643 — src/specify_cli/extensions/__init__.py:4643-4782 | src/specify_cli/extensions/__init__.py:4848-4883 | src/specify_cli/integrations/__init__.py:322-413 | src/specify_cli/presets/_catalog.py:421-451 | src/specify_cli/presets/_catalog.py:605-644 — 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.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) src/specify_cli/extensions/_catalog_versions.py:116 — src/specify_cli/extensions/_catalog_versions.py:116-144 | src/specify_cli/integrations/_catalog_versions.py:117-140 | src/specify_cli/presets/_catalog_versions.py:122-143 | src/specify_cli/workflows/catalog/_versions.py:99-120 | src/specify_cli/workflows/step/catalog/_versions.py:148-169 — 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.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) src/specify_cli/integrations/base.py:1161 — src/specify_cli/integrations/base.py:1161-1170 | src/specify_cli/integrations/base.py:1257-1266 | src/specify_cli/integrations/base.py:1732-1741 | src/specify_cli/integrations/kimi/__init__.py:75-91 | src/specify_cli/integrations/pi/__init__.py:39-55 — 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 · Duplicated block (13–14 lines × 2) · ×3
  • Duplicated block (13–14 lines × 2) src/specify_cli/integrations/__init__.py:583 — src/specify_cli/integrations/__init__.py:583-596 | src/specify_cli/integrations/__init__.py:701-713 — 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.
  • Duplicated block (13–14 lines × 2) src/specify_cli/integrations/base.py:1950 — src/specify_cli/integrations/base.py:1950-1962 | src/specify_cli/integrations/hermes/__init__.py:194-207 — before extracting anything, compare `src/specify_cli/integrations/base.py` and `src/specify_cli/integrations/hermes/__init__.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 102 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/specify_cli/integrations/base.py:1950` 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–14 lines × 2) src/specify_cli/workflows/catalog/_domain.py:616 — src/specify_cli/workflows/catalog/_domain.py:616-629 | src/specify_cli/workflows/step/catalog/_domain.py:575-587 — before extracting anything, compare `src/specify_cli/workflows/catalog/_domain.py` and `src/specify_cli/workflows/step/catalog/_domain.py` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 293 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/specify_cli/workflows/catalog/_domain.py:616` 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 (10 lines × 5) · ×3
  • Duplicated block (10 lines × 5) src/specify_cli/extensions/_catalog_versions.py:129 — src/specify_cli/extensions/_catalog_versions.py:129-140 | src/specify_cli/integrations/_catalog_versions.py:127-136 | src/specify_cli/presets/_catalog_versions.py:130-139 | src/specify_cli/workflows/catalog/_versions.py:107-116 | src/specify_cli/workflows/step/catalog/_versions.py:156-165 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 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 5 times. Read the line range as the matched WINDOW rather than a finished unit: at `src/specify_cli/extensions/_catalog_versions.py:129` 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.
  • Duplicated block (10 lines × 5) src/specify_cli/integrations/base.py:1161 — src/specify_cli/integrations/base.py:1161-1170 | src/specify_cli/integrations/base.py:1257-1266 | src/specify_cli/integrations/base.py:1732-1741 | src/specify_cli/integrations/kimi/__init__.py:82-91 | src/specify_cli/integrations/pi/__init__.py:46-55 — there are 5 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 5 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 × 5) src/specify_cli/integrations/base.py:1191 — src/specify_cli/integrations/base.py:1191-1200 | src/specify_cli/integrations/base.py:1406-1415 | src/specify_cli/integrations/base.py:1638-1647 | src/specify_cli/integrations/forge/__init__.py:160-169 | src/specify_cli/integrations/generic/__init__.py:252-261 — there are 5 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 5 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×3
  • Duplicated block (7 lines × 2) src/specify_cli/extensions/__init__.py:5014 — src/specify_cli/extensions/__init__.py:5014-5024 | src/specify_cli/integrations/__init__.py:476-482 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/specify_cli/extensions/__init__.py:5026` calls `lower` and `src/specify_cli/integrations/__init__.py:483` 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 (7 lines × 2) src/specify_cli/workflows/step/command_info.py:94 — src/specify_cli/workflows/step/command_info.py:94-100 | src/specify_cli/workflows/step/command_info.py:122-128 — 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 `src/specify_cli/workflows/step/command_info.py:94` 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 (7 lines × 2) src/specify_cli/extensions/__init__.py:5071 — src/specify_cli/extensions/__init__.py:5071-5077 | src/specify_cli/integrations/__init__.py:513-519 — 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 (6 lines × 3) · ×3
  • Duplicated block (6 lines × 3) src/specify_cli/catalogs.py:165 — src/specify_cli/catalogs.py:165-170 | src/specify_cli/workflows/catalog/_domain.py:431-437 | src/specify_cli/workflows/step/catalog/_domain.py:380-386 — before extracting anything, compare `src/specify_cli/workflows/catalog/_domain.py` and `src/specify_cli/workflows/step/catalog/_domain.py` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 293 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/specify_cli/catalogs.py:165` 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.
  • Duplicated block (6 lines × 3) src/specify_cli/extensions/__init__.py:740 — src/specify_cli/extensions/__init__.py:740-745 | src/specify_cli/integrations/__init__.py:1074-1079 | src/specify_cli/presets/_manifest.py:433-438 — 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 (6 lines × 3) src/specify_cli/workflows/overlay/command_disable.py:14 — src/specify_cli/workflows/overlay/command_disable.py:14-19 | src/specify_cli/workflows/overlay/command_enable.py:14-19 | src/specify_cli/workflows/overlay/command_remove.py:14-19 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
D1 · Cyclomatic Complexity · _catalog_versions._validated_releases (cyclomatic 22) · ×2
  • _catalog_versions._validated_releases (cyclomatic 22) src/specify_cli/extensions/_catalog_versions.py:33 — _catalog_versions._validated_releases 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.
  • _catalog_versions._validated_releases (cyclomatic 22) src/specify_cli/integrations/_catalog_versions.py:40 — _catalog_versions._validated_releases 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.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/specify_cli/catalogs.py:99 — src/specify_cli/catalogs.py:99-197 | src/specify_cli/presets/_catalog.py:243-340 | src/specify_cli/workflows/catalog/_domain.py:368-461 | src/specify_cli/workflows/step/catalog/_domain.py:330-410 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/specify_cli/integrations/alquimia/__init__.py:140 — src/specify_cli/integrations/alquimia/__init__.py:140-179 | src/specify_cli/integrations/claude/__init__.py:206-245 | src/specify_cli/integrations/droid/__init__.py:41-76 | src/specify_cli/integrations/vibe/__init__.py:159-198 — 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 (33 lines × 2) · ×2
  • Duplicated block (33 lines × 2) src/specify_cli/extensions/__init__.py:4940 — src/specify_cli/extensions/__init__.py:4940-4972 | src/specify_cli/presets/_catalog.py:705-737 — 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 `src/specify_cli/extensions/__init__.py:4940` 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 (33 lines × 2) src/specify_cli/workflows/step/command/__init__.py:203 — src/specify_cli/workflows/step/command/__init__.py:203-235 | src/specify_cli/workflows/step/prompt/__init__.py:136-168 — `src/specify_cli/workflows/step/command/__init__.py` and `src/specify_cli/workflows/step/prompt/__init__.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 108 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/specify_cli/workflows/step/command/__init__.py:203` 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 (25 lines × 2) · ×2
  • Duplicated block (25 lines × 2) src/specify_cli/shared_infra.py:602 — src/specify_cli/shared_infra.py:602-626 | src/specify_cli/shared_infra.py:658-682 — 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 (25 lines × 2) src/specify_cli/workflows/command_add.py:251 — src/specify_cli/workflows/command_add.py:251-275 | src/specify_cli/workflows/command_add.py:503-527 — 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 `src/specify_cli/workflows/command_add.py:251` 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 (20–22 lines × 2) · ×2
  • Duplicated block (20–22 lines × 2) src/specify_cli/extensions/__init__.py:889 — src/specify_cli/extensions/__init__.py:889-910 | src/specify_cli/presets/_registry.py:130-149 — before extracting anything, compare `src/specify_cli/extensions/__init__.py` and `src/specify_cli/presets/_registry.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 149 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.
  • Duplicated block (20–22 lines × 2) src/specify_cli/extensions/_commands.py:322 — src/specify_cli/extensions/_commands.py:322-341 | src/specify_cli/extensions/_commands.py:390-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/specify_cli/extensions/_commands.py:322` 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–21 lines × 2) · ×2
  • Duplicated block (20–21 lines × 2) src/specify_cli/integrations/command_install.py:131 — src/specify_cli/integrations/command_install.py:131-151 | src/specify_cli/integrations/command_switch.py:283-302 — 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 (20–21 lines × 2) src/specify_cli/workflows/engine.py:1144 — src/specify_cli/workflows/engine.py:1144-1163 | src/specify_cli/workflows/engine.py:1258-1278 — 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 `src/specify_cli/workflows/engine.py:1258` 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 (20 lines × 2) · ×2
  • Duplicated block (20 lines × 2) src/specify_cli/extensions/command_info.py:224 — src/specify_cli/extensions/command_info.py:224-243 | src/specify_cli/extensions/command_search.py:68-87 — 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 (20 lines × 2) src/specify_cli/workflows/overlay/operations.py:253 — src/specify_cli/workflows/overlay/operations.py:253-272 | src/specify_cli/workflows/overlay/operations.py:314-333 — 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, `src/specify_cli/workflows/overlay/operations.py:252` calls `mkdir` and `src/specify_cli/workflows/overlay/operations.py:313` 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 (16–18 lines × 2) · ×2
  • Duplicated block (16–18 lines × 2) src/specify_cli/extensions/__init__.py:534 — src/specify_cli/extensions/__init__.py:534-551 | src/specify_cli/extensions/__init__.py:563-578 — 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 (16–18 lines × 2) src/specify_cli/workflows/_execution.py:152 — src/specify_cli/workflows/_execution.py:152-169 | src/specify_cli/workflows/_execution.py:283-298 — 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 lines × 2) · ×2
  • Duplicated block (18 lines × 2) src/specify_cli/extensions/__init__.py:5206 — src/specify_cli/extensions/__init__.py:5206-5223 | src/specify_cli/presets/_catalog.py:981-998 — 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 `src/specify_cli/extensions/__init__.py:5206` 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 (18 lines × 2) src/specify_cli/extensions/command_disable.py:22 — src/specify_cli/extensions/command_disable.py:22-39 | src/specify_cli/extensions/command_enable.py:22-39 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `extension` to `str = typer.Argument(help="Extension ID or name to disable")` in one and `str = typer.Argument(help="Extension ID or name to enable")` 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 (17 lines × 2) · ×2
  • Duplicated block (17 lines × 2) src/specify_cli/extensions/__init__.py:4819 — src/specify_cli/extensions/__init__.py:4819-4842 | src/specify_cli/integrations/__init__.py:438-454 — 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 `src/specify_cli/extensions/__init__.py:4819` 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 (17 lines × 2) src/specify_cli/extensions/__init__.py:947 — src/specify_cli/extensions/__init__.py:947-963 | src/specify_cli/presets/_registry.py:173-189 — before extracting anything, compare `src/specify_cli/extensions/__init__.py` and `src/specify_cli/presets/_registry.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 149 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.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×2
  • Duplicated block (15–16 lines × 2) src/specify_cli/extensions/__init__.py:5021 — src/specify_cli/extensions/__init__.py:5021-5036 | src/specify_cli/presets/_catalog.py:788-802 — 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 `src/specify_cli/extensions/__init__.py:5021` 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–16 lines × 2) src/specify_cli/workflows/command_resume.py:121 — src/specify_cli/workflows/command_resume.py:121-136 | src/specify_cli/workflows/command_run.py:167-181 — 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 `src/specify_cli/workflows/command_resume.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.
D4 · Code Duplication · Duplicated block (11–15 lines × 2) · ×2
  • Duplicated block (11–15 lines × 2) src/specify_cli/catalogs.py:166 — src/specify_cli/catalogs.py:166-180 | src/specify_cli/presets/_catalog.py:320-330 — 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 `src/specify_cli/catalogs.py:166` 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.
  • Duplicated block (11–15 lines × 2) src/specify_cli/integrations/claude/__init__.py:249 — src/specify_cli/integrations/claude/__init__.py:249-259 | src/specify_cli/integrations/vibe/__init__.py:202-216 — `src/specify_cli/integrations/claude/__init__.py` and `src/specify_cli/integrations/vibe/__init__.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 58 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. 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, `src/specify_cli/integrations/vibe/__init__.py:217` calls `startswith` and `src/specify_cli/integrations/claude/__init__.py:260` 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 (14–15 lines × 2) · ×2
  • Duplicated block (14–15 lines × 2) src/specify_cli/extensions/__init__.py:1810 — src/specify_cli/extensions/__init__.py:1810-1824 | src/specify_cli/extensions/__init__.py:2303-2316 — 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–15 lines × 2) src/specify_cli/integrations/vibe/__init__.py:564 — src/specify_cli/integrations/vibe/__init__.py:564-578 | src/specify_cli/integrations/vibe/__init__.py:607-620 — 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 (15 lines × 2) · ×2
  • Duplicated block (15 lines × 2) src/specify_cli/workflows/command_add.py:11 — src/specify_cli/workflows/command_add.py:11-25 | src/specify_cli/workflows/step/command_add.py:23-37 — 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 (15 lines × 2) src/specify_cli/integrations/vibe/__init__.py:121 — src/specify_cli/integrations/vibe/__init__.py:121-136 | src/specify_cli/integrations/zcode/__init__.py:58-72 — 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.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×2
  • Duplicated block (14 lines × 3) src/specify_cli/presets/command_disable.py:20 — src/specify_cli/presets/command_disable.py:20-33 | src/specify_cli/presets/command_enable.py:20-33 | src/specify_cli/presets/command_set_priority.py:24-37 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Note first that the copies are not typed on the same thing: the declarations holding them bind `preset_id` to `str = typer.Argument(help="Preset ID to disable")` in one and `str = typer.Argument(help="Preset ID to enable")` 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, `src/specify_cli/presets/command_set_priority.py:22` calls `_validate_priority` and `src/specify_cli/presets/command_disable.py:19` 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 (14 lines × 3) src/specify_cli/extensions/__init__.py:1204 — src/specify_cli/extensions/__init__.py:1204-1217 | src/specify_cli/integrations/cline/__init__.py:23-50 | src/specify_cli/integrations/junie/__init__.py:21-48 — `src/specify_cli/integrations/cline/__init__.py` and `src/specify_cli/integrations/junie/__init__.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 61 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. 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 × 2) · ×2
  • Duplicated block (13 lines × 2) src/specify_cli/_version.py:532 — src/specify_cli/_version.py:532-544 | src/specify_cli/_version.py:552-564 — 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) src/specify_cli/presets/_manager_skills.py:1472 — src/specify_cli/presets/_manager_skills.py:1472-1484 | src/specify_cli/presets/_manager_skills.py:1530-1542 — 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, `src/specify_cli/presets/_manager_skills.py:1471` calls `_skill_title_from_command` and `src/specify_cli/presets/_manager_skills.py:1529` 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 (11–12 lines × 2) · ×2
  • Duplicated block (11–12 lines × 2) src/specify_cli/workflows/catalog/_domain.py:408 — src/specify_cli/workflows/catalog/_domain.py:408-419 | src/specify_cli/workflows/step/catalog/_domain.py:358-368 — before extracting anything, compare `src/specify_cli/workflows/catalog/_domain.py` and `src/specify_cli/workflows/step/catalog/_domain.py` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 293 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/specify_cli/workflows/catalog/_domain.py:408` 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–12 lines × 2) src/specify_cli/workflows/catalog/_domain.py:645 — src/specify_cli/workflows/catalog/_domain.py:645-656 | src/specify_cli/workflows/step/catalog/_domain.py:603-613 — before extracting anything, compare `src/specify_cli/workflows/catalog/_domain.py` and `src/specify_cli/workflows/step/catalog/_domain.py` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 293 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/specify_cli/workflows/step/catalog/_domain.py:614` calls `set` and `src/specify_cli/workflows/catalog/_domain.py:657` 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 (10–12 lines × 2) · ×2
  • Duplicated block (10–12 lines × 2) src/specify_cli/workflows/catalog/_domain.py:858 — src/specify_cli/workflows/catalog/_domain.py:858-867 | src/specify_cli/workflows/step/catalog/_domain.py:796-807 — before extracting anything, compare `src/specify_cli/workflows/catalog/_domain.py` and `src/specify_cli/workflows/step/catalog/_domain.py` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 293 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/specify_cli/workflows/catalog/_domain.py:858` 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 (10–12 lines × 2) src/specify_cli/workflows/catalog/command_add.py:22 — src/specify_cli/workflows/catalog/command_add.py:22-31 | src/specify_cli/workflows/step/catalog/command_add.py:23-34 — 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. 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 lines × 3) · ×2
  • Duplicated block (10 lines × 3) src/specify_cli/integrations/base.py:1209 — src/specify_cli/integrations/base.py:1209-1218 | src/specify_cli/integrations/copilot/__init__.py:566-575 | src/specify_cli/integrations/generic/__init__.py:278-287 — 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 (10 lines × 3) src/specify_cli/authentication/__init__.py:21 — src/specify_cli/authentication/__init__.py:21-30 | src/specify_cli/integrations/__init__.py:34-43 | src/specify_cli/workflows/__init__.py:26-35 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×2
  • Duplicated block (5 lines × 2) src/specify_cli/__init__.py:353 — src/specify_cli/__init__.py:353-357 | src/specify_cli/integrations/_helpers.py:603-607 — 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 (5 lines × 2) src/specify_cli/workflows/catalog/_domain.py:513 — src/specify_cli/workflows/catalog/_domain.py:513-517 | src/specify_cli/workflows/step/catalog/_domain.py:462-466 — before extracting anything, compare `src/specify_cli/workflows/catalog/_domain.py` and `src/specify_cli/workflows/step/catalog/_domain.py` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 293 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 `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.
D1 · Cyclomatic Complexity · _command_update_transaction.run_update_command (cyclomatic 149) · ×1
  • _command_update_transaction.run_update_command (cyclomatic 149) src/specify_cli/extensions/_command_update_transaction.py:24 — _command_update_transaction.run_update_command has cyclomatic complexity 149 (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 · ExtensionManager.install_from_directory (cyclomatic 119) · ×1
  • ExtensionManager.install_from_directory (cyclomatic 119) src/specify_cli/extensions/__init__.py:2367 — ExtensionManager.install_from_directory has cyclomatic complexity 119 (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 · _PresetCommandMethods.register_enabled_presets_for_agent (cyclomatic 75) · ×1
  • _PresetCommandMethods.register_enabled_presets_for_agent (cyclomatic 75) src/specify_cli/presets/_manager_commands.py:235 — _PresetCommandMethods.register_enabled_presets_for_agent has cyclomatic complexity 75 (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 · ExtensionManifest._validate (cyclomatic 71) · ×1
  • ExtensionManifest._validate (cyclomatic 71) src/specify_cli/extensions/__init__.py:273 — ExtensionManifest._validate has cyclomatic complexity 71 (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 · _execution.check_node (cyclomatic 66) · ×1
  • _execution.check_node (cyclomatic 66) src/specify_cli/workflows/_execution.py:179 — _execution.check_node has cyclomatic complexity 66 (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 · ExtensionManager.register_enabled_extensions_for_agent (cyclomatic 65) · ×1
  • ExtensionManager.register_enabled_extensions_for_agent (cyclomatic 65) src/specify_cli/extensions/__init__.py:3867 — ExtensionManager.register_enabled_extensions_for_agent has cyclomatic complexity 65 (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 · shared_infra.install_shared_infra (cyclomatic 63) · ×1
  • shared_infra.install_shared_infra (cyclomatic 63) src/specify_cli/shared_infra.py:467 — shared_infra.install_shared_infra has cyclomatic complexity 63 (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 · command_add.extension_add (cyclomatic 55) · ×1
  • command_add.extension_add (cyclomatic 55) src/specify_cli/extensions/command_add.py:21 — command_add.extension_add 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 · CommandRegistrar.register_commands (cyclomatic 53) · ×1
  • CommandRegistrar.register_commands (cyclomatic 53) src/specify_cli/agents.py:669 — CommandRegistrar.register_commands has cyclomatic complexity 53 (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 · command_add._install_from_catalog (cyclomatic 52) · ×1
  • command_add._install_from_catalog (cyclomatic 52) src/specify_cli/workflows/step/command_add.py:261 — command_add._install_from_catalog has cyclomatic complexity 52 (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._install_workflow_from_catalog (cyclomatic 50) · ×1
  • _commands._install_workflow_from_catalog (cyclomatic 50) src/specify_cli/workflows/_commands.py:1103 — _commands._install_workflow_from_catalog has cyclomatic complexity 50 (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 · IntegrationDescriptor._validate (cyclomatic 48) · ×1
  • IntegrationDescriptor._validate (cyclomatic 48) src/specify_cli/integrations/__init__.py:889 — IntegrationDescriptor._validate 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 · PresetManager.remove (cyclomatic 48) · ×1
  • PresetManager.remove (cyclomatic 48) src/specify_cli/presets/_manager.py:672 — PresetManager.remove 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 · _PresetCommandMethods._reconcile_composed_commands (cyclomatic 48) · ×1
  • _PresetCommandMethods._reconcile_composed_commands (cyclomatic 48) src/specify_cli/presets/_manager_commands.py:894 — _PresetCommandMethods._reconcile_composed_commands 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 · config.load_auth_config (cyclomatic 43) · ×1
  • config.load_auth_config (cyclomatic 43) src/specify_cli/authentication/config.py:84 — config.load_auth_config has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VibeIntegration._managed_hook_spans (cyclomatic 43) · ×1
  • VibeIntegration._managed_hook_spans (cyclomatic 43) src/specify_cli/integrations/vibe/__init__.py:340 — VibeIntegration._managed_hook_spans has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PresetResolver.resolve (cyclomatic 43) · ×1
  • PresetResolver.resolve (cyclomatic 43) src/specify_cli/presets/_resolver.py:223 — PresetResolver.resolve has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · command_add.workflow_add (cyclomatic 43) · ×1
  • command_add.workflow_add (cyclomatic 43) src/specify_cli/workflows/command_add.py:79 — command_add.workflow_add has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · validate_community_workflow_step.catalog_snapshot (cyclomatic 42) · ×1
  • validate_community_workflow_step.catalog_snapshot (cyclomatic 42) .github/scripts/validate_community_workflow_step.py:346 — validate_community_workflow_step.catalog_snapshot 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 · create_new_feature_branch.main (cyclomatic 42) · ×1
  • create_new_feature_branch.main (cyclomatic 42) extensions/git/scripts/python/create_new_feature_branch.py:427 — create_new_feature_branch.main 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 · expressions._evaluate_simple_expression (cyclomatic 41) · ×1
  • expressions._evaluate_simple_expression (cyclomatic 41) src/specify_cli/workflows/expressions.py:782 — expressions._evaluate_simple_expression 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 · PresetResolver.collect_all_layers (cyclomatic 40) · ×1
  • PresetResolver.collect_all_layers (cyclomatic 40) src/specify_cli/presets/_resolver.py:507 — PresetResolver.collect_all_layers 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 · command_add.preset_add (cyclomatic 38) · ×1
  • command_add.preset_add (cyclomatic 38) src/specify_cli/presets/command_add.py:136 — command_add.preset_add 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 · engine._validate_steps (cyclomatic 38) · ×1
  • engine._validate_steps (cyclomatic 38) src/specify_cli/workflows/engine.py:385 — engine._validate_steps 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 · integration_status.build_integration_status_report (cyclomatic 37) · ×1
  • integration_status.build_integration_status_report (cyclomatic 37) src/specify_cli/integration_status.py:337 — integration_status.build_integration_status_report has cyclomatic complexity 37 (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 · _PresetSkillMethods._register_skills (cyclomatic 37) · ×1
  • _PresetSkillMethods._register_skills (cyclomatic 37) src/specify_cli/presets/_manager_skills.py:622 — _PresetSkillMethods._register_skills 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 · installer.install_bundle (cyclomatic 36) · ×1
  • installer.install_bundle (cyclomatic 36) src/specify_cli/bundles/installer.py:73 — installer.install_bundle 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 · PresetManifest._validate (cyclomatic 36) · ×1
  • PresetManifest._validate (cyclomatic 36) src/specify_cli/presets/_manifest.py:77 — PresetManifest._validate 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 · ExtensionManager._register_extension_skills (cyclomatic 35) · ×1
  • ExtensionManager._register_extension_skills (cyclomatic 35) src/specify_cli/extensions/__init__.py:1520 — ExtensionManager._register_extension_skills 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 · engine.validate_workflow (cyclomatic 35) · ×1
  • engine.validate_workflow (cyclomatic 35) src/specify_cli/workflows/engine.py:196 — engine.validate_workflow 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 · command_info.integration_info (cyclomatic 34) · ×1
  • command_info.integration_info (cyclomatic 34) src/specify_cli/integrations/command_info.py:17 — command_info.integration_info 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 · create_new_feature.main (cyclomatic 33) · ×1
  • create_new_feature.main (cyclomatic 33) scripts/python/create_new_feature.py:266 — create_new_feature.main 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 · _lifecycle._transaction (cyclomatic 33) · ×1
  • _lifecycle._transaction (cyclomatic 33) src/specify_cli/integrations/_lifecycle.py:298 — _lifecycle._transaction 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 · _commands._install_workflow_package (cyclomatic 33) · ×1
  • _commands._install_workflow_package (cyclomatic 33) src/specify_cli/workflows/_commands.py:731 — _commands._install_workflow_package has cyclomatic complexity 33 (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 · CommandRegistrar.register_commands_for_all_agents (cyclomatic 32) · ×1
  • CommandRegistrar.register_commands_for_all_agents (cyclomatic 32) src/specify_cli/agents.py:1139 — CommandRegistrar.register_commands_for_all_agents 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 · events.install_integration_events (cyclomatic 32) · ×1
  • events.install_integration_events (cyclomatic 32) src/specify_cli/events/__init__.py:1344 — events.install_integration_events 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 · command_upgrade.integration_upgrade (cyclomatic 32) · ×1
  • command_upgrade.integration_upgrade (cyclomatic 32) src/specify_cli/integrations/command_upgrade.py:32 — command_upgrade.integration_upgrade 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 · _PresetSkillMethods._unregister_skills_in_dir (cyclomatic 32) · ×1
  • _PresetSkillMethods._unregister_skills_in_dir (cyclomatic 32) src/specify_cli/presets/_manager_skills.py:1309 — _PresetSkillMethods._unregister_skills_in_dir 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 · command_upgrade.self_upgrade (cyclomatic 32) · ×1
  • command_upgrade.self_upgrade (cyclomatic 32) src/specify_cli/selfs/command_upgrade.py:12 — command_upgrade.self_upgrade 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 · installer.catalog_package (cyclomatic 31) · ×1
  • installer.catalog_package (cyclomatic 31) src/specify_cli/integrations/installer.py:874 — installer.catalog_package 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 · _catalog_versions._validated_releases (cyclomatic 31) · ×1
  • _catalog_versions._validated_releases (cyclomatic 31) src/specify_cli/presets/_catalog_versions.py:20 — _catalog_versions._validated_releases 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 · _PresetCommandMethods.unregister_agent_artifacts (cyclomatic 31) · ×1
  • _PresetCommandMethods.unregister_agent_artifacts (cyclomatic 31) src/specify_cli/presets/_manager_commands.py:673 — _PresetCommandMethods.unregister_agent_artifacts 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 · _download_security.safe_extract_tar (cyclomatic 30) · ×1
  • _download_security.safe_extract_tar (cyclomatic 30) src/specify_cli/_download_security.py:1070 — _download_security.safe_extract_tar 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 · ExtensionManager.disable_generic_extension_artifacts (cyclomatic 30) · ×1
  • ExtensionManager.disable_generic_extension_artifacts (cyclomatic 30) src/specify_cli/extensions/__init__.py:3568 — ExtensionManager.disable_generic_extension_artifacts 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 · command_switch.integration_switch (cyclomatic 30) · ×1
  • command_switch.integration_switch (cyclomatic 30) src/specify_cli/integrations/command_switch.py:35 — command_switch.integration_switch 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 · installer.load_installed_integrations (cyclomatic 29) · ×1
  • installer.load_installed_integrations (cyclomatic 29) src/specify_cli/integrations/installer.py:795 — installer.load_installed_integrations has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PresetResolver.resolve_content (cyclomatic 29) · ×1
  • PresetResolver.resolve_content (cyclomatic 29) src/specify_cli/presets/_resolver.py:735 — PresetResolver.resolve_content has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · check_extension_version_bump.main (cyclomatic 28) · ×1
  • check_extension_version_bump.main (cyclomatic 28) .github/scripts/check_extension_version_bump.py:99 — check_extension_version_bump.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 · resolution._materialized_command_source_path (cyclomatic 28) · ×1
  • resolution._materialized_command_source_path (cyclomatic 28) src/specify_cli/artifacts/resolution.py:189 — resolution._materialized_command_source_path 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 · installer._check_installed_pins (cyclomatic 28) · ×1
  • installer._check_installed_pins (cyclomatic 28) src/specify_cli/bundles/installer.py:307 — installer._check_installed_pins 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 · command_info._print_extension_info (cyclomatic 28) · ×1
  • command_info._print_extension_info (cyclomatic 28) src/specify_cli/extensions/command_info.py:161 — command_info._print_extension_info 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 · command_run.workflow_run (cyclomatic 28) · ×1
  • command_run.workflow_run (cyclomatic 28) src/specify_cli/workflows/command_run.py:10 — command_run.workflow_run has cyclomatic complexity 28 (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 · github_http.resolve_github_release_asset_api_url (cyclomatic 27) · ×1
  • github_http.resolve_github_release_asset_api_url (cyclomatic 27) src/specify_cli/authentication/github_http.py:119 — github_http.resolve_github_release_asset_api_url 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 · catalog_versions._validated_releases (cyclomatic 27) · ×1
  • catalog_versions._validated_releases (cyclomatic 27) src/specify_cli/bundles/catalog_versions.py:38 — catalog_versions._validated_releases 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 · VibeIntegration._parse_toml_header (cyclomatic 27) · ×1
  • VibeIntegration._parse_toml_header (cyclomatic 27) src/specify_cli/integrations/vibe/__init__.py:271 — VibeIntegration._parse_toml_header 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 · command_info.preset_info (cyclomatic 27) · ×1
  • command_info.preset_info (cyclomatic 27) src/specify_cli/presets/command_info.py:18 — command_info.preset_info 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 · CommandStep.execute (cyclomatic 27) · ×1
  • CommandStep.execute (cyclomatic 27) src/specify_cli/workflows/step/command/__init__.py:46 — CommandStep.execute 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 · GateStep.execute (cyclomatic 27) · ×1
  • GateStep.execute (cyclomatic 27) src/specify_cli/workflows/step/gate/__init__.py:40 — GateStep.execute 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 · _download_security._preflight_zip_central_directory (cyclomatic 26) · ×1
  • _download_security._preflight_zip_central_directory (cyclomatic 26) src/specify_cli/_download_security.py:723 — _download_security._preflight_zip_central_directory 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 · HookExecutor.register_hooks (cyclomatic 26) · ×1
  • HookExecutor.register_hooks (cyclomatic 26) src/specify_cli/extensions/__init__.py:5806 — HookExecutor.register_hooks 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 · command_uninstall.integration_uninstall (cyclomatic 26) · ×1
  • command_uninstall.integration_uninstall (cyclomatic 26) src/specify_cli/integrations/command_uninstall.py:18 — command_uninstall.integration_uninstall 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 · Execution.transition (cyclomatic 26) · ×1
  • Execution.transition (cyclomatic 26) src/specify_cli/workflows/_execution.py:468 — Execution.transition 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 · _download_security.safe_extract_zip (cyclomatic 25) · ×1
  • _download_security.safe_extract_zip (cyclomatic 25) src/specify_cli/_download_security.py:905 — _download_security.safe_extract_zip 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 · _version._detect_install_method (cyclomatic 25) · ×1
  • _version._detect_install_method (cyclomatic 25) src/specify_cli/_version.py:480 — _version._detect_install_method 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 · _version._emit_failure (cyclomatic 25) · ×1
  • _version._emit_failure (cyclomatic 25) src/specify_cli/_version.py:1014 — _version._emit_failure 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 · command_info.bundle_info (cyclomatic 25) · ×1
  • command_info.bundle_info (cyclomatic 25) src/specify_cli/bundles/command_info.py:27 — command_info.bundle_info 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 · command_info.extension_info (cyclomatic 25) · ×1
  • command_info.extension_info (cyclomatic 25) src/specify_cli/extensions/command_info.py:18 — command_info.extension_info 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 · _PresetSkillMethods._reconcile_skills (cyclomatic 25) · ×1
  • _PresetSkillMethods._reconcile_skills (cyclomatic 25) src/specify_cli/presets/_manager_skills.py:101 — _PresetSkillMethods._reconcile_skills 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 · workflows.load_custom_steps (cyclomatic 25) · ×1
  • workflows.load_custom_steps (cyclomatic 25) src/specify_cli/workflows/__init__.py:105 — workflows.load_custom_steps 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 · _versions._validated_releases (cyclomatic 25) · ×1
  • _versions._validated_releases (cyclomatic 25) src/specify_cli/workflows/step/catalog/_versions.py:61 — _versions._validated_releases 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 · validate_community_preset.generated (cyclomatic 24) · ×1
  • validate_community_preset.generated (cyclomatic 24) .github/scripts/validate_community_preset.py:442 — validate_community_preset.generated 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 · IntegrationManifest.uninstall (cyclomatic 24) · ×1
  • IntegrationManifest.uninstall (cyclomatic 24) src/specify_cli/integrations/manifest.py:368 — IntegrationManifest.uninstall 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 · command_info.workflow_info (cyclomatic 24) · ×1
  • command_info.workflow_info (cyclomatic 24) src/specify_cli/workflows/command_info.py:9 — command_info.workflow_info 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 · InitStep.execute (cyclomatic 24) · ×1
  • InitStep.execute (cyclomatic 24) src/specify_cli/workflows/step/init/__init__.py:78 — InitStep.execute 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 · validate_community_preset.check_readme (cyclomatic 23) · ×1
  • validate_community_preset.check_readme (cyclomatic 23) .github/scripts/validate_community_preset.py:184 — validate_community_preset.check_readme 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 · BundleManifest.structural_errors (cyclomatic 23) · ×1
  • BundleManifest.structural_errors (cyclomatic 23) src/specify_cli/bundles/manifest.py:162 — BundleManifest.structural_errors 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 · events._find_command_template (cyclomatic 23) · ×1
  • events._find_command_template (cyclomatic 23) src/specify_cli/events/__init__.py:532 — events._find_command_template 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 · ExtensionManager._remove_generic_artifact_paths (cyclomatic 23) · ×1
  • ExtensionManager._remove_generic_artifact_paths (cyclomatic 23) src/specify_cli/extensions/__init__.py:2101 — ExtensionManager._remove_generic_artifact_paths 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 · command_install.integration_install (cyclomatic 23) · ×1
  • command_install.integration_install (cyclomatic 23) src/specify_cli/integrations/command_install.py:28 — command_install.integration_install 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 · command_add._install_from_url (cyclomatic 23) · ×1
  • command_add._install_from_url (cyclomatic 23) src/specify_cli/workflows/step/command_add.py:75 — command_add._install_from_url 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 · events._resolve_event_command_argv (cyclomatic 22) · ×1
  • events._resolve_event_command_argv (cyclomatic 22) src/specify_cli/events/__init__.py:634 — events._resolve_event_command_argv 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 · ExtensionManager._snapshot_generic_refresh_artifacts (cyclomatic 22) · ×1
  • ExtensionManager._snapshot_generic_refresh_artifacts (cyclomatic 22) src/specify_cli/extensions/__init__.py:1932 — ExtensionManager._snapshot_generic_refresh_artifacts 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 · PresetCatalog.download_pack_info (cyclomatic 22) · ×1
  • PresetCatalog.download_pack_info (cyclomatic 22) src/specify_cli/presets/_catalog.py:846 — PresetCatalog.download_pack_info 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 · _versions._validated_releases (cyclomatic 22) · ×1
  • _versions._validated_releases (cyclomatic 22) src/specify_cli/workflows/catalog/_versions.py:23 — _versions._validated_releases 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 · command_update.workflow_update (cyclomatic 22) · ×1
  • command_update.workflow_update (cyclomatic 22) src/specify_cli/workflows/command_update.py:9 — command_update.workflow_update 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 · merge._traverse_and_apply (cyclomatic 22) · ×1
  • merge._traverse_and_apply (cyclomatic 22) src/specify_cli/workflows/overlay/merge.py:278 — merge._traverse_and_apply 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 · CommandStep.validate (cyclomatic 22) · ×1
  • CommandStep.validate (cyclomatic 22) src/specify_cli/workflows/step/command/__init__.py:387 — CommandStep.validate 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 · auto_commit._parse_auto_commit_config (cyclomatic 21) · ×1
  • auto_commit._parse_auto_commit_config (cyclomatic 21) extensions/git/scripts/python/auto_commit.py:49 — auto_commit._parse_auto_commit_config 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 · specify_cli.ensure_executable_scripts (cyclomatic 21) · ×1
  • specify_cli.ensure_executable_scripts (cyclomatic 21) src/specify_cli/__init__.py:216 — specify_cli.ensure_executable_scripts 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 · ExtensionManager.remove (cyclomatic 21) · ×1
  • ExtensionManager.remove (cyclomatic 21) src/specify_cli/extensions/__init__.py:3473 — ExtensionManager.remove 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 · IntegrationCatalog.remove_catalog (cyclomatic 21) · ×1
  • IntegrationCatalog.remove_catalog (cyclomatic 21) src/specify_cli/integrations/__init__.py:684 — IntegrationCatalog.remove_catalog 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 · installer._validate_implementation (cyclomatic 21) · ×1
  • installer._validate_implementation (cyclomatic 21) src/specify_cli/integrations/installer.py:691 — installer._validate_implementation 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 · _PresetSkillMethods._unregister_skills (cyclomatic 21) · ×1
  • _PresetSkillMethods._unregister_skills (cyclomatic 21) src/specify_cli/presets/_manager_skills.py:1084 — _PresetSkillMethods._unregister_skills 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 · command_resume.workflow_resume (cyclomatic 21) · ×1
  • command_resume.workflow_resume (cyclomatic 21) src/specify_cli/workflows/command_resume.py:10 — command_resume.workflow_resume has cyclomatic complexity 21 (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 · RunState.load (cyclomatic 21) · ×1
  • RunState.load (cyclomatic 21) src/specify_cli/workflows/engine.py:815 — RunState.load 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 · PromptStep.execute (cyclomatic 21) · ×1
  • PromptStep.execute (cyclomatic 21) src/specify_cli/workflows/step/prompt/__init__.py:49 — PromptStep.execute 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 · _version._run_installer (cyclomatic 20) · ×1
  • _version._run_installer (cyclomatic 20) src/specify_cli/_version.py:767 — _version._run_installer 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 · ArtifactCatalog._collect_hook_inventory (cyclomatic 20) · ×1
  • ArtifactCatalog._collect_hook_inventory (cyclomatic 20) src/specify_cli/artifacts/catalog.py:580 — ArtifactCatalog._collect_hook_inventory 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 · catalog_config.add_source (cyclomatic 20) · ×1
  • catalog_config.add_source (cyclomatic 20) src/specify_cli/bundles/catalog_config.py:135 — catalog_config.add_source 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 · events.resolve_events (cyclomatic 20) · ×1
  • events.resolve_events (cyclomatic 20) src/specify_cli/events/__init__.py:935 — events.resolve_events 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 · events.collect_extension_events (cyclomatic 20) · ×1
  • events.collect_extension_events (cyclomatic 20) src/specify_cli/events/__init__.py:1076 — events.collect_extension_events 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 · ExtensionManager._restore_generic_refresh_artifacts (cyclomatic 20) · ×1
  • ExtensionManager._restore_generic_refresh_artifacts (cyclomatic 20) src/specify_cli/extensions/__init__.py:1994 — ExtensionManager._restore_generic_refresh_artifacts 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 · command_enable.extension_enable (cyclomatic 20) · ×1
  • command_enable.extension_enable (cyclomatic 20) src/specify_cli/extensions/command_enable.py:16 — command_enable.extension_enable 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 · IntegrationCatalog.add_catalog (cyclomatic 20) · ×1
  • IntegrationCatalog.add_catalog (cyclomatic 20) src/specify_cli/integrations/__init__.py:566 — IntegrationCatalog.add_catalog 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 · _capture.run_captured (cyclomatic 20) · ×1
  • _capture.run_captured (cyclomatic 20) src/specify_cli/integrations/_capture.py:436 — _capture.run_captured 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 · _FileJournal.observe (cyclomatic 20) · ×1
  • _FileJournal.observe (cyclomatic 20) src/specify_cli/integrations/_lifecycle.py:200 — _FileJournal.observe 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 · IntegrationBase.process_template (cyclomatic 20) · ×1
  • IntegrationBase.process_template (cyclomatic 20) src/specify_cli/integrations/base.py:886 — IntegrationBase.process_template 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 · command_list.integration_list (cyclomatic 20) · ×1
  • command_list.integration_list (cyclomatic 20) src/specify_cli/integrations/command_list.py:20 — command_list.integration_list 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 · PresetManager.find_unmet_extension_dependencies (cyclomatic 20) · ×1
  • PresetManager.find_unmet_extension_dependencies (cyclomatic 20) src/specify_cli/presets/_manager.py:215 — PresetManager.find_unmet_extension_dependencies 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 · operations.workflow_overlay_add (cyclomatic 20) · ×1
  • operations.workflow_overlay_add (cyclomatic 20) src/specify_cli/workflows/overlay/operations.py:163 — operations.workflow_overlay_add 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 · update_agent_context._upsert_section (cyclomatic 19) · ×1
  • update_agent_context._upsert_section (cyclomatic 19) extensions/agent-context/scripts/python/update_agent_context.py:259 — update_agent_context._upsert_section 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 · common._preset_template_layer (cyclomatic 19) · ×1
  • common._preset_template_layer (cyclomatic 19) scripts/python/common.py:555 — common._preset_template_layer 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 · _download_security.detect_archive_format (cyclomatic 19) · ×1
  • _download_security.detect_archive_format (cyclomatic 19) src/specify_cli/_download_security.py:125 — _download_security.detect_archive_format 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 · CommandRegistrar.unregister_commands (cyclomatic 19) · ×1
  • CommandRegistrar.unregister_commands (cyclomatic 19) src/specify_cli/agents.py:1372 — CommandRegistrar.unregister_commands 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 · ExtensionManager._find_extension_skill_dirs (cyclomatic 19) · ×1
  • ExtensionManager._find_extension_skill_dirs (cyclomatic 19) src/specify_cli/extensions/__init__.py:1745 — ExtensionManager._find_extension_skill_dirs 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 · ExtensionManager.scaffold_config (cyclomatic 19) · ×1
  • ExtensionManager.scaffold_config (cyclomatic 19) src/specify_cli/extensions/__init__.py:3341 — ExtensionManager.scaffold_config 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 · _command_update_artifacts.preflight_update_archive (cyclomatic 19) · ×1
  • _command_update_artifacts.preflight_update_archive (cyclomatic 19) src/specify_cli/extensions/_command_update_artifacts.py:43 — _command_update_artifacts.preflight_update_archive 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 · _lifecycle._restore_snapshots (cyclomatic 19) · ×1
  • _lifecycle._restore_snapshots (cyclomatic 19) src/specify_cli/integrations/_lifecycle.py:260 — _lifecycle._restore_snapshots 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 · Execution.execute_step (cyclomatic 19) · ×1
  • Execution.execute_step (cyclomatic 19) src/specify_cli/workflows/_execution.py:692 — Execution.execute_step 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 · validate_community_preset.published_manifest (cyclomatic 18) · ×1
  • validate_community_preset.published_manifest (cyclomatic 18) .github/scripts/validate_community_preset.py:113 — validate_community_preset.published_manifest 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 · validate_community_workflow_step.validate_files (cyclomatic 18) · ×1
  • validate_community_workflow_step.validate_files (cyclomatic 18) .github/scripts/validate_community_workflow_step.py:137 — validate_community_workflow_step.validate_files 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 · resolve_tasks.main (cyclomatic 18) · ×1
  • resolve_tasks.main (cyclomatic 18) extensions/github/scripts/python/resolve_tasks.py:166 — resolve_tasks.main 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 · check_prerequisites.main (cyclomatic 18) · ×1
  • check_prerequisites.main (cyclomatic 18) scripts/python/check_prerequisites.py:206 — check_prerequisites.main 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 · ArtifactCatalog._iter_core_candidates (cyclomatic 18) · ×1
  • ArtifactCatalog._iter_core_candidates (cyclomatic 18) src/specify_cli/artifacts/catalog.py:971 — ArtifactCatalog._iter_core_candidates 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 · ExtensionManifest._validate_provided_artifacts (cyclomatic 18) · ×1
  • ExtensionManifest._validate_provided_artifacts (cyclomatic 18) src/specify_cli/extensions/__init__.py:581 — ExtensionManifest._validate_provided_artifacts 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 · ExtensionManager.unregister_agent_artifacts (cyclomatic 18) · ×1
  • ExtensionManager.unregister_agent_artifacts (cyclomatic 18) src/specify_cli/extensions/__init__.py:3663 — ExtensionManager.unregister_agent_artifacts 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 · ExtensionCatalog.search (cyclomatic 18) · ×1
  • ExtensionCatalog.search (cyclomatic 18) src/specify_cli/extensions/__init__.py:4979 — ExtensionCatalog.search 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 · ExtensionCatalog.download_extension_info (cyclomatic 18) · ×1
  • ExtensionCatalog.download_extension_info (cyclomatic 18) src/specify_cli/extensions/__init__.py:5101 — ExtensionCatalog.download_extension_info 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 · FileHelper._walk (cyclomatic 18) · ×1
  • FileHelper._walk (cyclomatic 18) src/specify_cli/file_helper.py:91 — FileHelper._walk 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 · installer._read_trust_state (cyclomatic 18) · ×1
  • installer._read_trust_state (cyclomatic 18) src/specify_cli/integrations/installer.py:346 — installer._read_trust_state 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 · _PresetSkillMethods._infer_legacy_skill_provenance (cyclomatic 18) · ×1
  • _PresetSkillMethods._infer_legacy_skill_provenance (cyclomatic 18) src/specify_cli/presets/_manager_skills.py:832 — _PresetSkillMethods._infer_legacy_skill_provenance 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 · _commands._commit_workflow_file (cyclomatic 18) · ×1
  • _commands._commit_workflow_file (cyclomatic 18) src/specify_cli/workflows/_commands.py:496 — _commands._commit_workflow_file has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · WorkflowEngine._coerce_input (cyclomatic 18) · ×1
  • WorkflowEngine._coerce_input (cyclomatic 18) src/specify_cli/workflows/engine.py:1414 — WorkflowEngine._coerce_input 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 · command_info.workflow_step_info (cyclomatic 18) · ×1
  • command_info.workflow_step_info (cyclomatic 18) src/specify_cli/workflows/step/command_info.py:29 — command_info.workflow_step_info 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 · validate_community_workflow_step.validate_identity (cyclomatic 17) · ×1
  • validate_community_workflow_step.validate_identity (cyclomatic 17) .github/scripts/validate_community_workflow_step.py:72 — validate_community_workflow_step.validate_identity 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 · resolution._build_stack (cyclomatic 17) · ×1
  • resolution._build_stack (cyclomatic 17) src/specify_cli/artifacts/resolution.py:373 — resolution._build_stack 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 · CatalogStackBase._load_catalog_config (cyclomatic 17) · ×1
  • CatalogStackBase._load_catalog_config (cyclomatic 17) src/specify_cli/catalogs.py:98 — CatalogStackBase._load_catalog_config 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 · command_init._install_extension_during_init (cyclomatic 17) · ×1
  • command_init._install_extension_during_init (cyclomatic 17) src/specify_cli/command_init.py:101 — command_init._install_extension_during_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 · ExtensionManager._extension_owned_skill_names (cyclomatic 17) · ×1
  • ExtensionManager._extension_owned_skill_names (cyclomatic 17) src/specify_cli/extensions/__init__.py:2231 — ExtensionManager._extension_owned_skill_names 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 · command_search.extension_search (cyclomatic 17) · ×1
  • command_search.extension_search (cyclomatic 17) src/specify_cli/extensions/command_search.py:18 — command_search.extension_search 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 · IntegrationCatalog.search (cyclomatic 17) · ×1
  • IntegrationCatalog.search (cyclomatic 17) src/specify_cli/integrations/__init__.py:463 — IntegrationCatalog.search 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 · CopilotIntegration.dispatch_command (cyclomatic 17) · ×1
  • CopilotIntegration.dispatch_command (cyclomatic 17) src/specify_cli/integrations/copilot/__init__.py:361 — CopilotIntegration.dispatch_command 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 · installer._validate_registrar_config (cyclomatic 17) · ×1
  • installer._validate_registrar_config (cyclomatic 17) src/specify_cli/integrations/installer.py:667 — installer._validate_registrar_config 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 · installer._import_package (cyclomatic 17) · ×1
  • installer._import_package (cyclomatic 17) src/specify_cli/integrations/installer.py:744 — installer._import_package 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 · kimi._migrate_legacy_kimi_skills_dir (cyclomatic 17) · ×1
  • kimi._migrate_legacy_kimi_skills_dir (cyclomatic 17) src/specify_cli/integrations/kimi/__init__.py:257 — kimi._migrate_legacy_kimi_skills_dir 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 · PresetCatalog._load_catalog_config (cyclomatic 17) · ×1
  • PresetCatalog._load_catalog_config (cyclomatic 17) src/specify_cli/presets/_catalog.py:242 — PresetCatalog._load_catalog_config 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 · PresetManager.install_from_directory (cyclomatic 17) · ×1
  • PresetManager.install_from_directory (cyclomatic 17) src/specify_cli/presets/_manager.py:364 — PresetManager.install_from_directory 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 · schema._parse_edit (cyclomatic 17) · ×1
  • schema._parse_edit (cyclomatic 17) src/specify_cli/workflows/overlay/schema.py:61 — schema._parse_edit 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 · StepRegistry.save (cyclomatic 17) · ×1
  • StepRegistry.save (cyclomatic 17) src/specify_cli/workflows/step/catalog/_domain.py:132 — StepRegistry.save 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 · ArtifactCatalog._selected_core_script_paths (cyclomatic 16) · ×1
  • ArtifactCatalog._selected_core_script_paths (cyclomatic 16) src/specify_cli/artifacts/catalog.py:1032 — ArtifactCatalog._selected_core_script_paths 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 · command_install.bundle_install (cyclomatic 16) · ×1
  • command_install.bundle_install (cyclomatic 16) src/specify_cli/bundles/command_install.py:32 — command_install.bundle_install 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 · references._resolved_locally (cyclomatic 16) · ×1
  • references._resolved_locally (cyclomatic 16) src/specify_cli/bundles/references.py:25 — references._resolved_locally 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 · yamlio.dump_json (cyclomatic 16) · ×1
  • yamlio.dump_json (cyclomatic 16) src/specify_cli/bundles/yamlio.py:136 — yamlio.dump_json 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 · ExtensionManager._get_skills_dir (cyclomatic 16) · ×1
  • ExtensionManager._get_skills_dir (cyclomatic 16) src/specify_cli/extensions/__init__.py:1281 — ExtensionManager._get_skills_dir 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 · _command_update_discovery.discover_updates (cyclomatic 16) · ×1
  • _command_update_discovery.discover_updates (cyclomatic 16) src/specify_cli/extensions/_command_update_discovery.py:42 — _command_update_discovery.discover_updates 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 · _command_upgrade_layout._installed_presets_affecting_agent (cyclomatic 16) · ×1
  • _command_upgrade_layout._installed_presets_affecting_agent (cyclomatic 16) src/specify_cli/integrations/_command_upgrade_layout.py:91 — _command_upgrade_layout._installed_presets_affecting_agent 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 · CopilotIntegration.is_skills_mode (cyclomatic 16) · ×1
  • CopilotIntegration.is_skills_mode (cyclomatic 16) src/specify_cli/integrations/copilot/__init__.py:189 — CopilotIntegration.is_skills_mode 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 · DockerAgentIntegration.validate_runtime_config (cyclomatic 16) · ×1
  • DockerAgentIntegration.validate_runtime_config (cyclomatic 16) src/specify_cli/integrations/docker_agent/__init__.py:153 — DockerAgentIntegration.validate_runtime_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 · installer.read_records (cyclomatic 16) · ×1
  • installer.read_records (cyclomatic 16) src/specify_cli/integrations/installer.py:271 — installer.read_records 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 · PresetCatalog.search (cyclomatic 16) · ×1
  • PresetCatalog.search (cyclomatic 16) src/specify_cli/presets/_catalog.py:746 — PresetCatalog.search 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 · command_resolve.preset_resolve (cyclomatic 16) · ×1
  • command_resolve.preset_resolve (cyclomatic 16) src/specify_cli/presets/command_resolve.py:15 — command_resolve.preset_resolve 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 · WorkflowRegistry.save (cyclomatic 16) · ×1
  • WorkflowRegistry.save (cyclomatic 16) src/specify_cli/workflows/catalog/_domain.py:153 — WorkflowRegistry.save 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 · WorkflowCatalog.add_catalog (cyclomatic 16) · ×1
  • WorkflowCatalog.add_catalog (cyclomatic 16) src/specify_cli/workflows/catalog/_domain.py:754 — WorkflowCatalog.add_catalog 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 · ProjectOverlaySource.collect (cyclomatic 16) · ×1
  • ProjectOverlaySource.collect (cyclomatic 16) src/specify_cli/workflows/overlay/layer_sources.py:127 — ProjectOverlaySource.collect 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 · StepCatalog.add_catalog (cyclomatic 16) · ×1
  • StepCatalog.add_catalog (cyclomatic 16) src/specify_cli/workflows/step/catalog/_domain.py:692 — StepCatalog.add_catalog 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 · command_add.workflow_step_add (cyclomatic 16) · ×1
  • command_add.workflow_step_add (cyclomatic 16) src/specify_cli/workflows/step/command_add.py:558 — command_add.workflow_step_add 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 · command_remove._remove_step_locked (cyclomatic 16) · ×1
  • command_remove._remove_step_locked (cyclomatic 16) src/specify_cli/workflows/step/command_remove.py:11 — command_remove._remove_step_locked 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 · GitHubStep.validate (cyclomatic 16) · ×1
  • GitHubStep.validate (cyclomatic 16) src/specify_cli/workflows/step/github/__init__.py:105 — GitHubStep.validate 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 · PromptStep._try_dispatch (cyclomatic 16) · ×1
  • PromptStep._try_dispatch (cyclomatic 16) src/specify_cli/workflows/step/prompt/__init__.py:216 — PromptStep._try_dispatch 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.
D17 · Explicit Debt · TodoComment · ×1
  • TodoComment src/specify_cli/presets/_manager.py:498 — # TODO: constitution-sync is a named preset with core-owned side effects. — 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.
D2 · Cognitive Complexity · _command_update_transaction.run_update_command (cognitive 418) · ×1
  • _command_update_transaction.run_update_command (cognitive 418) src/specify_cli/extensions/_command_update_transaction.py:24 — _command_update_transaction.run_update_command has cognitive complexity 418 (threshold 15). Drivers by points: if/else 81 (262 pts), loops 25 (79 pts), error handling 14 (43 pts), boolean chains 27, ternaries 3 (7 pts) (nesting depth added 268). 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 · ExtensionManager.install_from_directory (cognitive 204) · ×1
  • ExtensionManager.install_from_directory (cognitive 204) src/specify_cli/extensions/__init__.py:2367 — ExtensionManager.install_from_directory has cognitive complexity 204 (threshold 15). Drivers by points: if/else 44 (91 pts), error handling 15 (40 pts), boolean chains 30, loops 11 (23 pts), ternaries 10 (20 pts) (nesting depth added 94). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExtensionManager.register_enabled_extensions_for_agent (cognitive 189) · ×1
  • ExtensionManager.register_enabled_extensions_for_agent (cognitive 189) src/specify_cli/extensions/__init__.py:3867 — ExtensionManager.register_enabled_extensions_for_agent has cognitive complexity 189 (threshold 15). Drivers by points: if/else 43 (138 pts), error handling 4 (14 pts), loops 4 (14 pts), boolean chains 12, ternaries 3 (11 pts) (nesting depth added 123). 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 · shared_infra.install_shared_infra (cognitive 176) · ×1
  • shared_infra.install_shared_infra (cognitive 176) src/specify_cli/shared_infra.py:467 — shared_infra.install_shared_infra has cognitive complexity 176 (threshold 15). Drivers by points: if/else 39 (116 pts), error handling 5 (26 pts), loops 10 (23 pts), boolean chains 8, ternaries 3 (nesting depth added 111). 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 · _PresetCommandMethods._reconcile_composed_commands (cognitive 160) · ×1
  • _PresetCommandMethods._reconcile_composed_commands (cognitive 160) src/specify_cli/presets/_manager_commands.py:894 — _PresetCommandMethods._reconcile_composed_commands has cognitive complexity 160 (threshold 15). Drivers by points: if/else 29 (108 pts), loops 8 (35 pts), boolean chains 10, error handling 2 (7 pts) (nesting depth added 111). 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 · _PresetCommandMethods.register_enabled_presets_for_agent (cognitive 148) · ×1
  • _PresetCommandMethods.register_enabled_presets_for_agent (cognitive 148) src/specify_cli/presets/_manager_commands.py:235 — _PresetCommandMethods.register_enabled_presets_for_agent has cognitive complexity 148 (threshold 15). Drivers by points: if/else 42 (102 pts), loops 11 (22 pts), boolean chains 19, error handling 3 (5 pts) (nesting depth added 73). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExtensionManifest._validate (cognitive 134) · ×1
  • ExtensionManifest._validate (cognitive 134) src/specify_cli/extensions/__init__.py:273 — ExtensionManifest._validate has cognitive complexity 134 (threshold 15). Drivers by points: if/else 49 (102 pts), loops 9 (15 pts), boolean chains 13, ternaries 1 (3 pts), error handling 1 (nesting depth added 61). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · command_add.extension_add (cognitive 112) · ×1
  • command_add.extension_add (cognitive 112) src/specify_cli/extensions/command_add.py:21 — command_add.extension_add has cognitive complexity 112 (threshold 15). Drivers by points: if/else 35 (79 pts), ternaries 4 (11 pts), error handling 5 (10 pts), boolean chains 8, loops 3 (4 pts) (nesting depth added 57). 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 · CommandRegistrar.register_commands (cognitive 103) · ×1
  • CommandRegistrar.register_commands (cognitive 103) src/specify_cli/agents.py:669 — CommandRegistrar.register_commands has cognitive complexity 103 (threshold 15). Drivers by points: if/else 30 (72 pts), loops 5 (10 pts), boolean chains 9, ternaries 2 (7 pts), error handling 3 (5 pts) (nesting depth added 54). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PresetResolver.collect_all_layers (cognitive 103) · ×1
  • PresetResolver.collect_all_layers (cognitive 103) src/specify_cli/presets/_resolver.py:507 — PresetResolver.collect_all_layers has cognitive complexity 103 (threshold 15). Drivers by points: if/else 31 (82 pts), loops 3 (9 pts), error handling 1 (5 pts), ternaries 1 (4 pts), boolean chains 3 (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 · create_new_feature_branch.main (cognitive 99) · ×1
  • create_new_feature_branch.main (cognitive 99) extensions/git/scripts/python/create_new_feature_branch.py:427 — create_new_feature_branch.main has cognitive complexity 99 (threshold 15). Drivers by points: if/else 38 (84 pts), boolean chains 7, ternaries 1 (4 pts), error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 51). 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 · VibeIntegration._managed_hook_spans (cognitive 98) · ×1
  • VibeIntegration._managed_hook_spans (cognitive 98) src/specify_cli/integrations/vibe/__init__.py:340 — VibeIntegration._managed_hook_spans has cognitive complexity 98 (threshold 15). Drivers by points: if/else 19 (66 pts), loops 5 (15 pts), boolean chains 12, ternaries 2 (4 pts), error handling 1 (nesting depth added 59). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PresetManager.remove (cognitive 98) · ×1
  • PresetManager.remove (cognitive 98) src/specify_cli/presets/_manager.py:672 — PresetManager.remove has cognitive complexity 98 (threshold 15). Drivers by points: if/else 25 (58 pts), ternaries 6 (14 pts), loops 4 (10 pts), error handling 5 (9 pts), boolean chains 7 (nesting depth added 51). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _execution.check_node (cognitive 85) · ×1
  • _execution.check_node (cognitive 85) src/specify_cli/workflows/_execution.py:179 — _execution.check_node has cognitive complexity 85 (threshold 15). Drivers by points: if/else 30 (47 pts), boolean chains 32, loops 2 (4 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 · command_add.workflow_add (cognitive 83) · ×1
  • command_add.workflow_add (cognitive 83) src/specify_cli/workflows/command_add.py:79 — command_add.workflow_add has cognitive complexity 83 (threshold 15). Drivers by points: if/else 23 (45 pts), error handling 8 (19 pts), ternaries 7 (14 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 · PresetResolver.resolve (cognitive 82) · ×1
  • PresetResolver.resolve (cognitive 82) src/specify_cli/presets/_resolver.py:223 — PresetResolver.resolve has cognitive complexity 82 (threshold 15). Drivers by points: if/else 36 (73 pts), loops 4 (8 pts), boolean chains 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 · engine._validate_steps (cognitive 80) · ×1
  • engine._validate_steps (cognitive 80) src/specify_cli/workflows/engine.py:385 — engine._validate_steps has cognitive complexity 80 (threshold 15). Drivers by points: if/else 23 (60 pts), loops 4 (10 pts), boolean chains 5, ternaries 1 (5 pts) (nesting depth added 47). 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 · command_add.preset_add (cognitive 79) · ×1
  • command_add.preset_add (cognitive 79) src/specify_cli/presets/command_add.py:136 — command_add.preset_add has cognitive complexity 79 (threshold 15). Drivers by points: if/else 19 (47 pts), ternaries 6 (14 pts), error handling 6 (12 pts), boolean chains 6 (nesting depth added 42). 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 · validate_community_workflow_step.catalog_snapshot (cognitive 76) · ×1
  • validate_community_workflow_step.catalog_snapshot (cognitive 76) .github/scripts/validate_community_workflow_step.py:346 — validate_community_workflow_step.catalog_snapshot has cognitive complexity 76 (threshold 15). Drivers by points: if/else 24 (46 pts), boolean chains 10, ternaries 3 (9 pts), loops 3 (6 pts), error handling 2 (5 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · expressions._evaluate_simple_expression (cognitive 74) · ×1
  • expressions._evaluate_simple_expression (cognitive 74) src/specify_cli/workflows/expressions.py:782 — expressions._evaluate_simple_expression has cognitive complexity 74 (threshold 15). Drivers by points: if/else 29 (57 pts), loops 3 (6 pts), boolean chains 5, error handling 2 (4 pts), ternaries 1 (2 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IntegrationDescriptor._validate (cognitive 73) · ×1
  • IntegrationDescriptor._validate (cognitive 73) src/specify_cli/integrations/__init__.py:889 — IntegrationDescriptor._validate has cognitive complexity 73 (threshold 15). Drivers by points: if/else 28 (50 pts), boolean chains 11, error handling 3 (6 pts), loops 5 (6 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · create_new_feature.main (cognitive 72) · ×1
  • create_new_feature.main (cognitive 72) scripts/python/create_new_feature.py:266 — create_new_feature.main has cognitive complexity 72 (threshold 15). Drivers by points: if/else 31 (58 pts), loops 1 (4 pts), ternaries 2 (4 pts), boolean chains 3, error handling 1 (3 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _PresetSkillMethods._unregister_skills_in_dir (cognitive 71) · ×1
  • _PresetSkillMethods._unregister_skills_in_dir (cognitive 71) src/specify_cli/presets/_manager_skills.py:1309 — _PresetSkillMethods._unregister_skills_in_dir has cognitive complexity 71 (threshold 15). Drivers by points: if/else 20 (47 pts), ternaries 4 (10 pts), error handling 3 (9 pts), boolean chains 4, loops 1 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExtensionManager.disable_generic_extension_artifacts (cognitive 70) · ×1
  • ExtensionManager.disable_generic_extension_artifacts (cognitive 70) src/specify_cli/extensions/__init__.py:3568 — ExtensionManager.disable_generic_extension_artifacts has cognitive complexity 70 (threshold 15). Drivers by points: if/else 14 (40 pts), loops 3 (10 pts), ternaries 3 (8 pts), boolean chains 6, error handling 3 (6 pts) (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 · _PresetCommandMethods.unregister_agent_artifacts (cognitive 70) · ×1
  • _PresetCommandMethods.unregister_agent_artifacts (cognitive 70) src/specify_cli/presets/_manager_commands.py:673 — _PresetCommandMethods.unregister_agent_artifacts has cognitive complexity 70 (threshold 15). Drivers by points: if/else 20 (57 pts), boolean chains 7, loops 2 (5 pts), error handling 1 (nesting depth added 40). 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 · command_add._install_from_catalog (cognitive 69) · ×1
  • command_add._install_from_catalog (cognitive 69) src/specify_cli/workflows/step/command_add.py:261 — command_add._install_from_catalog has cognitive complexity 69 (threshold 15). Drivers by points: if/else 24 (33 pts), boolean chains 16, error handling 10 (15 pts), ternaries 2 (4 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 · config.load_auth_config (cognitive 68) · ×1
  • config.load_auth_config (cognitive 68) src/specify_cli/authentication/config.py:84 — config.load_auth_config has cognitive complexity 68 (threshold 15). Drivers by points: if/else 22 (44 pts), boolean chains 15, loops 3 (6 pts), error handling 2 (3 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CommandRegistrar.register_commands_for_all_agents (cognitive 67) · ×1
  • CommandRegistrar.register_commands_for_all_agents (cognitive 67) src/specify_cli/agents.py:1139 — CommandRegistrar.register_commands_for_all_agents has cognitive complexity 67 (threshold 15). Drivers by points: if/else 15 (41 pts), error handling 4 (14 pts), boolean chains 10, loops 1, ternaries 1 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · command_switch.integration_switch (cognitive 65) · ×1
  • command_switch.integration_switch (cognitive 65) src/specify_cli/integrations/command_switch.py:35 — command_switch.integration_switch has cognitive complexity 65 (threshold 15). Drivers by points: if/else 25 (47 pts), error handling 5 (15 pts), boolean chains 3 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · installer.install_bundle (cognitive 63) · ×1
  • installer.install_bundle (cognitive 63) src/specify_cli/bundles/installer.py:73 — installer.install_bundle has cognitive complexity 63 (threshold 15). Drivers by points: if/else 20 (42 pts), loops 5 (8 pts), boolean chains 6, ternaries 3 (5 pts), error handling 2 (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 · installer._check_installed_pins (cognitive 62) · ×1
  • installer._check_installed_pins (cognitive 62) src/specify_cli/bundles/installer.py:307 — installer._check_installed_pins has cognitive complexity 62 (threshold 15). Drivers by points: if/else 19 (49 pts), boolean chains 6, ternaries 1 (4 pts), loops 2 (3 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExtensionManager._register_extension_skills (cognitive 61) · ×1
  • ExtensionManager._register_extension_skills (cognitive 61) src/specify_cli/extensions/__init__.py:1520 — ExtensionManager._register_extension_skills has cognitive complexity 61 (threshold 15). Drivers by points: if/else 18 (38 pts), boolean chains 11, error handling 4 (11 pts), loops 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 · command_info.integration_info (cognitive 61) · ×1
  • command_info.integration_info (cognitive 61) src/specify_cli/integrations/command_info.py:17 — command_info.integration_info has cognitive complexity 61 (threshold 15). Drivers by points: if/else 22 (39 pts), ternaries 4 (11 pts), error handling 3 (5 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _PresetSkillMethods._register_skills (cognitive 59) · ×1
  • _PresetSkillMethods._register_skills (cognitive 59) src/specify_cli/presets/_manager_skills.py:622 — _PresetSkillMethods._register_skills has cognitive complexity 59 (threshold 15). Drivers by points: if/else 19 (39 pts), boolean chains 11, loops 3 (6 pts), ternaries 3 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _commands._install_workflow_from_catalog (cognitive 59) · ×1
  • _commands._install_workflow_from_catalog (cognitive 59) src/specify_cli/workflows/_commands.py:1103 — _commands._install_workflow_from_catalog has cognitive complexity 59 (threshold 15). Drivers by points: if/else 22 (25 pts), error handling 13 (16 pts), boolean chains 10, ternaries 4 (6 pts), loops 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 · resolution._materialized_command_source_path (cognitive 58) · ×1
  • resolution._materialized_command_source_path (cognitive 58) src/specify_cli/artifacts/resolution.py:189 — resolution._materialized_command_source_path has cognitive complexity 58 (threshold 15). Drivers by points: if/else 18 (40 pts), loops 3 (7 pts), error handling 4 (6 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · command_info.extension_info (cognitive 55) · ×1
  • command_info.extension_info (cognitive 55) src/specify_cli/extensions/command_info.py:18 — command_info.extension_info has cognitive complexity 55 (threshold 15). Drivers by points: if/else 18 (34 pts), ternaries 4 (9 pts), loops 2 (7 pts), error handling 2 (5 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _download_security.safe_extract_tar (cognitive 54) · ×1
  • _download_security.safe_extract_tar (cognitive 54) src/specify_cli/_download_security.py:1070 — _download_security.safe_extract_tar has cognitive complexity 54 (threshold 15). Drivers by points: if/else 16 (36 pts), error handling 6 (10 pts), loops 4 (5 pts), boolean chains 2, ternaries 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _version._detect_install_method (cognitive 54) · ×1
  • _version._detect_install_method (cognitive 54) src/specify_cli/_version.py:480 — _version._detect_install_method has cognitive complexity 54 (threshold 15). Drivers by points: if/else 14 (34 pts), ternaries 2 (7 pts), error handling 2 (6 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 30). 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 · CommandRegistrar.unregister_commands (cognitive 54) · ×1
  • CommandRegistrar.unregister_commands (cognitive 54) src/specify_cli/agents.py:1372 — CommandRegistrar.unregister_commands has cognitive complexity 54 (threshold 15). Drivers by points: if/else 8 (28 pts), error handling 2 (12 pts), loops 4 (10 pts), boolean chains 4 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _catalog_versions._validated_releases (cognitive 53) · ×1
  • _catalog_versions._validated_releases (cognitive 53) src/specify_cli/presets/_catalog_versions.py:20 — _catalog_versions._validated_releases has cognitive complexity 53 (threshold 15). Drivers by points: if/else 17 (34 pts), error handling 4 (9 pts), boolean chains 7, loops 2 (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 · PresetManifest._validate (cognitive 53) · ×1
  • PresetManifest._validate (cognitive 53) src/specify_cli/presets/_manifest.py:77 — PresetManifest._validate has cognitive complexity 53 (threshold 15). Drivers by points: if/else 24 (42 pts), loops 5 (6 pts), boolean chains 4, error handling 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 · merge._traverse_and_apply (cognitive 53) · ×1
  • merge._traverse_and_apply (cognitive 53) src/specify_cli/workflows/overlay/merge.py:278 — merge._traverse_and_apply has cognitive complexity 53 (threshold 15). Drivers by points: if/else 11 (29 pts), loops 7 (17 pts), ternaries 2 (4 pts), boolean chains 3 (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 · engine.validate_workflow (cognitive 52) · ×1
  • engine.validate_workflow (cognitive 52) src/specify_cli/workflows/engine.py:196 — engine.validate_workflow has cognitive complexity 52 (threshold 15). Drivers by points: if/else 17 (34 pts), boolean chains 9, error handling 1 (4 pts), loops 2 (4 pts), ternaries 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · events.resolve_events (cognitive 51) · ×1
  • events.resolve_events (cognitive 51) src/specify_cli/events/__init__.py:935 — events.resolve_events has cognitive complexity 51 (threshold 15). Drivers by points: if/else 12 (30 pts), error handling 2 (8 pts), loops 3 (8 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 30). 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 · events.install_integration_events (cognitive 51) · ×1
  • events.install_integration_events (cognitive 51) src/specify_cli/events/__init__.py:1344 — events.install_integration_events has cognitive complexity 51 (threshold 15). Drivers by points: loops 11 (26 pts), if/else 15 (25 pts) (nesting depth added 25). 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 · _lifecycle._transaction (cognitive 50) · ×1
  • _lifecycle._transaction (cognitive 50) src/specify_cli/integrations/_lifecycle.py:298 — _lifecycle._transaction has cognitive complexity 50 (threshold 15). Drivers by points: if/else 15 (24 pts), error handling 4 (9 pts), boolean chains 8, loops 4 (6 pts), ternaries 2 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VibeIntegration._parse_toml_header (cognitive 50) · ×1
  • VibeIntegration._parse_toml_header (cognitive 50) src/specify_cli/integrations/vibe/__init__.py:271 — VibeIntegration._parse_toml_header has cognitive complexity 50 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 5 (11 pts), boolean chains 8, ternaries 1 (5 pts) (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 · HookExecutor.register_hooks (cognitive 49) · ×1
  • HookExecutor.register_hooks (cognitive 49) src/specify_cli/extensions/__init__.py:5806 — HookExecutor.register_hooks has cognitive complexity 49 (threshold 15). Drivers by points: if/else 19 (39 pts), loops 4 (6 pts), boolean chains 4 (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 · integration_status.build_integration_status_report (cognitive 49) · ×1
  • integration_status.build_integration_status_report (cognitive 49) src/specify_cli/integration_status.py:337 — integration_status.build_integration_status_report has cognitive complexity 49 (threshold 15). Drivers by points: if/else 24 (31 pts), boolean chains 7, error handling 3 (5 pts), loops 4 (5 pts), ternaries 1 (nesting depth added 10). 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 · installer.load_installed_integrations (cognitive 49) · ×1
  • installer.load_installed_integrations (cognitive 49) src/specify_cli/integrations/installer.py:795 — installer.load_installed_integrations has cognitive complexity 49 (threshold 15). Drivers by points: if/else 16 (31 pts), loops 5 (10 pts), ternaries 3 (4 pts), boolean chains 3, error handling 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 · specify_cli.ensure_executable_scripts (cognitive 47) · ×1
  • specify_cli.ensure_executable_scripts (cognitive 47) src/specify_cli/__init__.py:216 — specify_cli.ensure_executable_scripts has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (30 pts), error handling 2 (6 pts), loops 3 (6 pts), ternaries 2 (4 pts), boolean chains 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · events._find_command_template (cognitive 47) · ×1
  • events._find_command_template (cognitive 47) src/specify_cli/events/__init__.py:532 — events._find_command_template has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (33 pts), loops 5 (10 pts), boolean chains 2, error handling 1, ternaries 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _download_security.safe_extract_zip (cognitive 46) · ×1
  • _download_security.safe_extract_zip (cognitive 46) src/specify_cli/_download_security.py:905 — _download_security.safe_extract_zip has cognitive complexity 46 (threshold 15). Drivers by points: if/else 12 (28 pts), error handling 6 (11 pts), loops 4 (5 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 · command_info.workflow_info (cognitive 46) · ×1
  • command_info.workflow_info (cognitive 46) src/specify_cli/workflows/command_info.py:9 — command_info.workflow_info has cognitive complexity 46 (threshold 15). Drivers by points: if/else 14 (26 pts), ternaries 2 (7 pts), loops 2 (6 pts), error handling 4 (5 pts), boolean chains 2 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PresetResolver.resolve_content (cognitive 45) · ×1
  • PresetResolver.resolve_content (cognitive 45) src/specify_cli/presets/_resolver.py:735 — PresetResolver.resolve_content has cognitive complexity 45 (threshold 15). Drivers by points: if/else 19 (35 pts), loops 3 (5 pts), boolean chains 3, 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 · ExtensionCatalog.search (cognitive 44) · ×1
  • ExtensionCatalog.search (cognitive 44) src/specify_cli/extensions/__init__.py:4979 — ExtensionCatalog.search has cognitive complexity 44 (threshold 15). Drivers by points: if/else 10 (26 pts), ternaries 5 (16 pts), boolean chains 1, loops 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 · workflows.load_custom_steps (cognitive 44) · ×1
  • workflows.load_custom_steps (cognitive 44) src/specify_cli/workflows/__init__.py:105 — workflows.load_custom_steps has cognitive complexity 44 (threshold 15). Drivers by points: if/else 13 (27 pts), loops 4 (7 pts), boolean chains 5, error handling 2 (5 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 · catalog_versions._validated_releases (cognitive 43) · ×1
  • catalog_versions._validated_releases (cognitive 43) src/specify_cli/bundles/catalog_versions.py:38 — catalog_versions._validated_releases has cognitive complexity 43 (threshold 15). Drivers by points: if/else 16 (30 pts), boolean chains 5, error handling 3 (5 pts), loops 2 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _PresetSkillMethods._reconcile_skills (cognitive 43) · ×1
  • _PresetSkillMethods._reconcile_skills (cognitive 43) src/specify_cli/presets/_manager_skills.py:101 — _PresetSkillMethods._reconcile_skills has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (30 pts), loops 4 (6 pts), ternaries 2 (4 pts), boolean chains 3 (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 · check_extension_version_bump.main (cognitive 42) · ×1
  • check_extension_version_bump.main (cognitive 42) .github/scripts/check_extension_version_bump.py:99 — check_extension_version_bump.main has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (18 pts), error handling 7 (14 pts), ternaries 3 (4 pts), boolean chains 3, loops 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · command_info.bundle_info (cognitive 42) · ×1
  • command_info.bundle_info (cognitive 42) src/specify_cli/bundles/command_info.py:27 — command_info.bundle_info has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (21 pts), loops 5 (11 pts), ternaries 2 (5 pts), boolean chains 4, error handling 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 · command_upgrade.integration_upgrade (cognitive 42) · ×1
  • command_upgrade.integration_upgrade (cognitive 42) src/specify_cli/integrations/command_upgrade.py:32 — command_upgrade.integration_upgrade has cognitive complexity 42 (threshold 15). Drivers by points: if/else 21 (27 pts), error handling 5 (8 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 10). 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 · IntegrationManifest.uninstall (cognitive 42) · ×1
  • IntegrationManifest.uninstall (cognitive 42) src/specify_cli/integrations/manifest.py:368 — IntegrationManifest.uninstall has cognitive complexity 42 (threshold 15). Drivers by points: if/else 8 (17 pts), error handling 6 (15 pts), boolean chains 5, loops 3 (5 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 · ArtifactCatalog._collect_hook_inventory (cognitive 41) · ×1
  • ArtifactCatalog._collect_hook_inventory (cognitive 41) src/specify_cli/artifacts/catalog.py:580 — ArtifactCatalog._collect_hook_inventory has cognitive complexity 41 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 5 (10 pts), error handling 3 (9 pts), boolean chains 3 (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 · command_info._print_extension_info (cognitive 41) · ×1
  • command_info._print_extension_info (cognitive 41) src/specify_cli/extensions/command_info.py:161 — command_info._print_extension_info has cognitive complexity 41 (threshold 15). Drivers by points: if/else 21 (26 pts), ternaries 5 (11 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IntegrationBase.process_template (cognitive 41) · ×1
  • IntegrationBase.process_template (cognitive 41) src/specify_cli/integrations/base.py:886 — IntegrationBase.process_template has cognitive complexity 41 (threshold 15). Drivers by points: if/else 16 (37 pts), loops 2, boolean chains 1, ternaries 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 · command_info.preset_info (cognitive 41) · ×1
  • command_info.preset_info (cognitive 41) src/specify_cli/presets/command_info.py:18 — command_info.preset_info has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (22 pts), ternaries 3 (7 pts), error handling 4 (6 pts), loops 2 (4 pts), boolean chains 2 (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 · ExtensionManager._restore_generic_refresh_artifacts (cognitive 40) · ×1
  • ExtensionManager._restore_generic_refresh_artifacts (cognitive 40) src/specify_cli/extensions/__init__.py:1994 — ExtensionManager._restore_generic_refresh_artifacts has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (29 pts), error handling 2 (6 pts), boolean chains 4, 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 · IntegrationCatalog.search (cognitive 40) · ×1
  • IntegrationCatalog.search (cognitive 40) src/specify_cli/integrations/__init__.py:463 — IntegrationCatalog.search has cognitive complexity 40 (threshold 15). Drivers by points: if/else 8 (20 pts), ternaries 6 (18 pts), boolean chains 1, loops 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _FileJournal.observe (cognitive 40) · ×1
  • _FileJournal.observe (cognitive 40) src/specify_cli/integrations/_lifecycle.py:200 — _FileJournal.observe has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (34 pts), boolean chains 5, 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 · command_uninstall.integration_uninstall (cognitive 40) · ×1
  • command_uninstall.integration_uninstall (cognitive 40) src/specify_cli/integrations/command_uninstall.py:18 — command_uninstall.integration_uninstall has cognitive complexity 40 (threshold 15). Drivers by points: if/else 20 (27 pts), ternaries 5 (7 pts), boolean chains 3, 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 · command_upgrade.self_upgrade (cognitive 40) · ×1
  • command_upgrade.self_upgrade (cognitive 40) src/specify_cli/selfs/command_upgrade.py:12 — command_upgrade.self_upgrade has cognitive complexity 40 (threshold 15). Drivers by points: if/else 21 (27 pts), boolean chains 5, ternaries 4, error handling 1 (2 pts), loops 1 (2 pts) (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, 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._install_workflow_package (cognitive 40) · ×1
  • _commands._install_workflow_package (cognitive 40) src/specify_cli/workflows/_commands.py:731 — _commands._install_workflow_package has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (17 pts), error handling 9 (13 pts), boolean chains 8, 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 · ExtensionManager.remove (cognitive 39) · ×1
  • ExtensionManager.remove (cognitive 39) src/specify_cli/extensions/__init__.py:3473 — ExtensionManager.remove has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (28 pts), loops 2 (6 pts), ternaries 3, boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · auto_commit._parse_auto_commit_config (cognitive 38) · ×1
  • auto_commit._parse_auto_commit_config (cognitive 38) extensions/git/scripts/python/auto_commit.py:49 — auto_commit._parse_auto_commit_config has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (33 pts), boolean chains 3, error handling 1, 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 · command_install.integration_install (cognitive 38) · ×1
  • command_install.integration_install (cognitive 38) src/specify_cli/integrations/command_install.py:28 — command_install.integration_install has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (27 pts), boolean chains 5, error handling 2 (4 pts), loops 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Execution.execute_step (cognitive 38) · ×1
  • Execution.execute_step (cognitive 38) src/specify_cli/workflows/_execution.py:692 — Execution.execute_step has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (26 pts), ternaries 3 (6 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GateStep.execute (cognitive 38) · ×1
  • GateStep.execute (cognitive 38) src/specify_cli/workflows/step/gate/__init__.py:40 — GateStep.execute has cognitive complexity 38 (threshold 15). Drivers by points: if/else 18 (30 pts), boolean chains 7, 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 · ArtifactCatalog._selected_core_script_paths (cognitive 37) · ×1
  • ArtifactCatalog._selected_core_script_paths (cognitive 37) src/specify_cli/artifacts/catalog.py:1032 — ArtifactCatalog._selected_core_script_paths has cognitive complexity 37 (threshold 15). Drivers by points: if/else 8 (21 pts), error handling 2 (6 pts), loops 3 (6 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PresetCatalog.search (cognitive 37) · ×1
  • PresetCatalog.search (cognitive 37) src/specify_cli/presets/_catalog.py:746 — PresetCatalog.search has cognitive complexity 37 (threshold 15). Drivers by points: if/else 7 (18 pts), ternaries 5 (16 pts), error handling 2, loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _PresetSkillMethods._unregister_skills (cognitive 37) · ×1
  • _PresetSkillMethods._unregister_skills (cognitive 37) src/specify_cli/presets/_manager_skills.py:1084 — _PresetSkillMethods._unregister_skills has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (20 pts), ternaries 5 (8 pts), loops 3 (7 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 · command_resolve.preset_resolve (cognitive 37) · ×1
  • command_resolve.preset_resolve (cognitive 37) src/specify_cli/presets/command_resolve.py:15 — command_resolve.preset_resolve has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (24 pts), loops 2 (6 pts), error handling 1 (3 pts), boolean chains 2, ternaries 2 (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 · events.collect_extension_events (cognitive 36) · ×1
  • events.collect_extension_events (cognitive 36) src/specify_cli/events/__init__.py:1076 — events.collect_extension_events has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (22 pts), error handling 3 (7 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExtensionManager._find_extension_skill_dirs (cognitive 36) · ×1
  • ExtensionManager._find_extension_skill_dirs (cognitive 36) src/specify_cli/extensions/__init__.py:1745 — ExtensionManager._find_extension_skill_dirs has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (18 pts), error handling 3 (8 pts), ternaries 2 (5 pts), loops 2 (3 pts), boolean chains 2 (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 · ExtensionManager._extension_owned_skill_names (cognitive 36) · ×1
  • ExtensionManager._extension_owned_skill_names (cognitive 36) src/specify_cli/extensions/__init__.py:2231 — ExtensionManager._extension_owned_skill_names has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (21 pts), error handling 3 (8 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _PresetCommandMethods._register_command_from_path (cognitive 36) · ×1
  • _PresetCommandMethods._register_command_from_path (cognitive 36) src/specify_cli/presets/_manager_commands.py:1175 — _PresetCommandMethods._register_command_from_path has cognitive complexity 36 (threshold 15). Drivers by points: if/else 7 (25 pts), loops 2 (7 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 24). 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 · command_update.workflow_update (cognitive 36) · ×1
  • command_update.workflow_update (cognitive 36) src/specify_cli/workflows/command_update.py:9 — command_update.workflow_update has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (25 pts), error handling 4 (8 pts), loops 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 · StepCatalog._get_merged_steps (cognitive 36) · ×1
  • StepCatalog._get_merged_steps (cognitive 36) src/specify_cli/workflows/step/catalog/_domain.py:589 — StepCatalog._get_merged_steps has cognitive complexity 36 (threshold 15). Drivers by points: if/else 7 (24 pts), loops 3 (7 pts), error handling 2 (4 pts), boolean chains 1 (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 · ExtensionManager._remove_generic_artifact_paths (cognitive 35) · ×1
  • ExtensionManager._remove_generic_artifact_paths (cognitive 35) src/specify_cli/extensions/__init__.py:2101 — ExtensionManager._remove_generic_artifact_paths has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 7, error handling 2 (5 pts), loops 1, 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 · ExtensionManager.unregister_agent_artifacts (cognitive 35) · ×1
  • ExtensionManager.unregister_agent_artifacts (cognitive 35) src/specify_cli/extensions/__init__.py:3663 — ExtensionManager.unregister_agent_artifacts has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (28 pts), boolean chains 3, ternaries 1 (3 pts), loops 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 · FileHelper._walk (cognitive 35) · ×1
  • FileHelper._walk (cognitive 35) src/specify_cli/file_helper.py:91 — FileHelper._walk has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (28 pts), boolean chains 4, error handling 1 (2 pts), loops 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 · _catalog_versions._validated_releases (cognitive 35) · ×1
  • _catalog_versions._validated_releases (cognitive 35) src/specify_cli/integrations/_catalog_versions.py:40 — _catalog_versions._validated_releases has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 6, ternaries 1 (4 pts), error handling 2 (3 pts), loops 2 (3 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 · _lifecycle._restore_snapshots (cognitive 35) · ×1
  • _lifecycle._restore_snapshots (cognitive 35) src/specify_cli/integrations/_lifecycle.py:260 — _lifecycle._restore_snapshots has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 2 (6 pts), boolean chains 5, error handling 1 (4 pts), loops 2 (4 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · installer.catalog_package (cognitive 35) · ×1
  • installer.catalog_package (cognitive 35) src/specify_cli/integrations/installer.py:874 — installer.catalog_package has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 9, error handling 2 (3 pts), loops 2, ternaries 2 (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 · command_run.workflow_run (cognitive 35) · ×1
  • command_run.workflow_run (cognitive 35) src/specify_cli/workflows/command_run.py:10 — command_run.workflow_run has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (17 pts), error handling 8 (9 pts), ternaries 3 (4 pts), boolean chains 3, loops 1 (2 pts) (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 · _version._emit_failure (cognitive 34) · ×1
  • _version._emit_failure (cognitive 34) src/specify_cli/_version.py:1014 — _version._emit_failure has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 9, ternaries 2 (4 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 · _catalog_versions._validated_releases (cognitive 34) · ×1
  • _catalog_versions._validated_releases (cognitive 34) src/specify_cli/extensions/_catalog_versions.py:33 — _catalog_versions._validated_releases has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 5, error handling 2 (3 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IntegrationCatalog.add_catalog (cognitive 34) · ×1
  • IntegrationCatalog.add_catalog (cognitive 34) src/specify_cli/integrations/__init__.py:566 — IntegrationCatalog.add_catalog has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (22 pts), error handling 3 (7 pts), boolean chains 3, loops 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 · _PresetSkillMethods._infer_legacy_skill_provenance (cognitive 34) · ×1
  • _PresetSkillMethods._infer_legacy_skill_provenance (cognitive 34) src/specify_cli/presets/_manager_skills.py:832 — _PresetSkillMethods._infer_legacy_skill_provenance has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 4 (6 pts), ternaries 2 (5 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _versions._validated_releases (cognitive 34) · ×1
  • _versions._validated_releases (cognitive 34) src/specify_cli/workflows/step/catalog/_versions.py:61 — _versions._validated_releases has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 9, error handling 2 (3 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _download_security._preflight_zip_central_directory (cognitive 33) · ×1
  • _download_security._preflight_zip_central_directory (cognitive 33) src/specify_cli/_download_security.py:723 — _download_security._preflight_zip_central_directory has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (25 pts), boolean chains 6, loops 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 · command_enable.extension_enable (cognitive 33) · ×1
  • command_enable.extension_enable (cognitive 33) src/specify_cli/extensions/command_enable.py:16 — command_enable.extension_enable has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 3 (7 pts), error handling 2 (3 pts), ternaries 1 (3 pts), boolean chains 2 (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 · IntegrationCatalog.remove_catalog (cognitive 33) · ×1
  • IntegrationCatalog.remove_catalog (cognitive 33) src/specify_cli/integrations/__init__.py:684 — IntegrationCatalog.remove_catalog has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (25 pts), error handling 3 (6 pts), boolean chains 1, 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 · _commands._commit_workflow_file (cognitive 33) · ×1
  • _commands._commit_workflow_file (cognitive 33) src/specify_cli/workflows/_commands.py:496 — _commands._commit_workflow_file has cognitive complexity 33 (threshold 15). Drivers by points: error handling 6 (18 pts), if/else 7 (11 pts), boolean chains 3, ternaries 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 · operations.workflow_overlay_add (cognitive 33) · ×1
  • operations.workflow_overlay_add (cognitive 33) src/specify_cli/workflows/overlay/operations.py:163 — operations.workflow_overlay_add has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 4, loops 2 (4 pts), ternaries 1 (3 pts), error handling 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CommandStep.execute (cognitive 33) · ×1
  • CommandStep.execute (cognitive 33) src/specify_cli/workflows/step/command/__init__.py:46 — CommandStep.execute has cognitive complexity 33 (threshold 15). Drivers by points: if/else 19 (24 pts), boolean chains 7, error handling 1, loops 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · update_agent_context._upsert_section (cognitive 32) · ×1
  • update_agent_context._upsert_section (cognitive 32) extensions/agent-context/scripts/python/update_agent_context.py:259 — update_agent_context._upsert_section has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 6, ternaries 2 (5 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 · ExtensionManifest._validate_provided_artifacts (cognitive 32) · ×1
  • ExtensionManifest._validate_provided_artifacts (cognitive 32) src/specify_cli/extensions/__init__.py:581 — ExtensionManifest._validate_provided_artifacts has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 4, ternaries 1 (3 pts), 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 · ExtensionManager._collect_manifest_command_names (cognitive 32) · ×1
  • ExtensionManager._collect_manifest_command_names (cognitive 32) src/specify_cli/extensions/__init__.py:1091 — ExtensionManager._collect_manifest_command_names has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (29 pts), loops 2 (3 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PresetManager.find_unmet_extension_dependencies (cognitive 32) · ×1
  • PresetManager.find_unmet_extension_dependencies (cognitive 32) src/specify_cli/presets/_manager.py:215 — PresetManager.find_unmet_extension_dependencies has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 3, loops 2, ternaries 1 (2 pts), error handling 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 · validate_community_preset.check_readme (cognitive 31) · ×1
  • validate_community_preset.check_readme (cognitive 31) .github/scripts/validate_community_preset.py:184 — validate_community_preset.check_readme has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 11, ternaries 2 (6 pts), 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 · command_search.extension_search (cognitive 31) · ×1
  • command_search.extension_search (cognitive 31) src/specify_cli/extensions/command_search.py:18 — command_search.extension_search has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (22 pts), ternaries 2 (5 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 · SkillsIntegration.setup (cognitive 31) · ×1
  • SkillsIntegration.setup (cognitive 31) src/specify_cli/integrations/base.py:1831 — SkillsIntegration.setup has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (24 pts), error handling 2 (5 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 · command_list.integration_list (cognitive 31) · ×1
  • command_list.integration_list (cognitive 31) src/specify_cli/integrations/command_list.py:20 — command_list.integration_list has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (16 pts), ternaries 3 (8 pts), loops 2 (3 pts), boolean chains 2, 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 · HermesIntegration.setup (cognitive 31) · ×1
  • HermesIntegration.setup (cognitive 31) src/specify_cli/integrations/hermes/__init__.py:77 — HermesIntegration.setup has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (25 pts), error handling 1 (4 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 · _versions._validated_releases (cognitive 31) · ×1
  • _versions._validated_releases (cognitive 31) src/specify_cli/workflows/catalog/_versions.py:23 — _versions._validated_releases has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 5, error handling 2 (3 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · github_http.resolve_github_release_asset_api_url (cognitive 30) · ×1
  • github_http.resolve_github_release_asset_api_url (cognitive 30) src/specify_cli/authentication/github_http.py:119 — github_http.resolve_github_release_asset_api_url has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 8, ternaries 2 (4 pts), error handling 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExtensionManager._snapshot_generic_refresh_artifacts (cognitive 30) · ×1
  • ExtensionManager._snapshot_generic_refresh_artifacts (cognitive 30) src/specify_cli/extensions/__init__.py:1932 — ExtensionManager._snapshot_generic_refresh_artifacts has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 4 (6 pts), boolean chains 5, error handling 1 (2 pts), 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 · Execution.transition (cognitive 30) · ×1
  • Execution.transition (cognitive 30) src/specify_cli/workflows/_execution.py:468 — Execution.transition has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (14 pts), ternaries 3 (7 pts), boolean chains 6, loops 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 · command_status.workflow_status (cognitive 30) · ×1
  • command_status.workflow_status (cognitive 30) src/specify_cli/workflows/command_status.py:9 — command_status.workflow_status has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 3 (8 pts), error handling 3 (6 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · command_info.workflow_step_info (cognitive 30) · ×1
  • command_info.workflow_step_info (cognitive 30) src/specify_cli/workflows/step/command_info.py:29 — command_info.workflow_step_info has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (19 pts), ternaries 2 (5 pts), error handling 2 (3 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 · ArtifactCatalog._iter_core_candidates (cognitive 29) · ×1
  • ArtifactCatalog._iter_core_candidates (cognitive 29) src/specify_cli/artifacts/catalog.py:971 — ArtifactCatalog._iter_core_candidates has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 7 (10 pts), boolean chains 2, ternaries 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 · BundleManifest.structural_errors (cognitive 29) · ×1
  • BundleManifest.structural_errors (cognitive 29) src/specify_cli/bundles/manifest.py:162 — BundleManifest.structural_errors has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 8, loops 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 · update_agent_context._collect_context_files (cognitive 28) · ×1
  • update_agent_context._collect_context_files (cognitive 28) extensions/agent-context/scripts/python/update_agent_context.py:45 — update_agent_context._collect_context_files has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 3 (9 pts), error handling 2 (5 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArtifactCatalog._find_extension_contribution (cognitive 28) · ×1
  • ArtifactCatalog._find_extension_contribution (cognitive 28) src/specify_cli/artifacts/catalog.py:475 — ArtifactCatalog._find_extension_contribution has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 3 (6 pts), boolean chains 3, error handling 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 · _command_update_discovery.discover_updates (cognitive 28) · ×1
  • _command_update_discovery.discover_updates (cognitive 28) src/specify_cli/extensions/_command_update_discovery.py:42 — _command_update_discovery.discover_updates has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (16 pts), error handling 2 (4 pts), ternaries 1 (4 pts), boolean chains 3, 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 · merge.find_step (cognitive 28) · ×1
  • merge.find_step (cognitive 28) src/specify_cli/workflows/overlay/merge.py:32 — merge.find_step has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (22 pts), 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 · InitStep.execute (cognitive 28) · ×1
  • InitStep.execute (cognitive 28) src/specify_cli/workflows/step/init/__init__.py:78 — InitStep.execute has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 5, error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · update_agent_context._resolve_plan_path (cognitive 27) · ×1
  • update_agent_context._resolve_plan_path (cognitive 27) extensions/agent-context/scripts/python/update_agent_context.py:141 — update_agent_context._resolve_plan_path has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (16 pts), error handling 2 (6 pts), loops 1 (2 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 · events.validate_events (cognitive 27) · ×1
  • events.validate_events (cognitive 27) src/specify_cli/events/__init__.py:1906 — events.validate_events has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (21 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · installer.package_hashes (cognitive 27) · ×1
  • installer.package_hashes (cognitive 27) src/specify_cli/integrations/installer.py:231 — installer.package_hashes has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · kimi._migrate_legacy_kimi_skills_dir (cognitive 27) · ×1
  • kimi._migrate_legacy_kimi_skills_dir (cognitive 27) src/specify_cli/integrations/kimi/__init__.py:257 — kimi._migrate_legacy_kimi_skills_dir has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 4, error handling 1 (2 pts), 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 · PresetCatalog._get_merged_packs (cognitive 27) · ×1
  • PresetCatalog._get_merged_packs (cognitive 27) src/specify_cli/presets/_catalog.py:554 — PresetCatalog._get_merged_packs has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (17 pts), error handling 2 (4 pts), loops 2 (3 pts), boolean chains 2, 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 · _PresetCommandMethods._register_commands (cognitive 27) · ×1
  • _PresetCommandMethods._register_commands (cognitive 27) src/specify_cli/presets/_manager_commands.py:95 — _PresetCommandMethods._register_commands has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 2, error handling 1, 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 · _PresetSkillMethods._delete_agent_preset_skills (cognitive 27) · ×1
  • _PresetSkillMethods._delete_agent_preset_skills (cognitive 27) src/specify_cli/presets/_manager_skills.py:1223 — _PresetSkillMethods._delete_agent_preset_skills has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (7 pts), error handling 1 (2 pts), ternaries 1 (2 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 · merge._remove_sources_recursively (cognitive 27) · ×1
  • merge._remove_sources_recursively (cognitive 27) src/specify_cli/workflows/overlay/merge.py:182 — merge._remove_sources_recursively has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 4 (10 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExtensionManager.scaffold_config (cognitive 26) · ×1
  • ExtensionManager.scaffold_config (cognitive 26) src/specify_cli/extensions/__init__.py:3341 — ExtensionManager.scaffold_config has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 6, error handling 2 (4 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 · integration_status._manifest_file_status (cognitive 26) · ×1
  • integration_status._manifest_file_status (cognitive 26) src/specify_cli/integration_status.py:219 — integration_status._manifest_file_status has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (16 pts), error handling 4 (9 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 · _catalog_cache._cache_directory (cognitive 26) · ×1
  • _catalog_cache._cache_directory (cognitive 26) src/specify_cli/workflows/_catalog_cache.py:76 — _catalog_cache._cache_directory has cognitive complexity 26 (threshold 15). Drivers by points: error handling 4 (12 pts), if/else 5 (10 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WorkflowCatalog.search (cognitive 26) · ×1
  • WorkflowCatalog.search (cognitive 26) src/specify_cli/workflows/catalog/_domain.py:673 — WorkflowCatalog.search has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 4, ternaries 1 (3 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · merge._record_sources_recursively (cognitive 26) · ×1
  • merge._record_sources_recursively (cognitive 26) src/specify_cli/workflows/overlay/merge.py:153 — merge._record_sources_recursively has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 4 (10 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 · PromptStep.execute (cognitive 26) · ×1
  • PromptStep.execute (cognitive 26) src/specify_cli/workflows/step/prompt/__init__.py:49 — PromptStep.execute has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 7 (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 · validate_community_preset.generated (cognitive 25) · ×1
  • validate_community_preset.generated (cognitive 25) .github/scripts/validate_community_preset.py:442 — validate_community_preset.generated has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 4, loops 1, 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.
D2 · Cognitive Complexity · catalog_config.add_source (cognitive 25) · ×1
  • catalog_config.add_source (cognitive 25) src/specify_cli/bundles/catalog_config.py:135 — catalog_config.add_source has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 6, error handling 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 · CatalogStackBase._load_catalog_config (cognitive 25) · ×1
  • CatalogStackBase._load_catalog_config (cognitive 25) src/specify_cli/catalogs.py:98 — CatalogStackBase._load_catalog_config has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (17 pts), error handling 3 (5 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 · events._build_opencode_plugin (cognitive 25) · ×1
  • events._build_opencode_plugin (cognitive 25) src/specify_cli/events/__init__.py:1960 — events._build_opencode_plugin has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (18 pts), error handling 1 (3 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _command_update_artifacts.preflight_update_archive (cognitive 25) · ×1
  • _command_update_artifacts.preflight_update_archive (cognitive 25) src/specify_cli/extensions/_command_update_artifacts.py:43 — _command_update_artifacts.preflight_update_archive has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (22 pts), boolean chains 1, error handling 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 · installer.read_records (cognitive 25) · ×1
  • installer.read_records (cognitive 25) src/specify_cli/integrations/installer.py:271 — installer.read_records has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (5 pts), boolean chains 3, error handling 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 · installer._validate_implementation (cognitive 25) · ×1
  • installer._validate_implementation (cognitive 25) src/specify_cli/integrations/installer.py:691 — installer._validate_implementation has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 4, loops 3 (4 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 · WorkflowCatalog._get_merged_workflows (cognitive 25) · ×1
  • WorkflowCatalog._get_merged_workflows (cognitive 25) src/specify_cli/workflows/catalog/_domain.py:631 — WorkflowCatalog._get_merged_workflows has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 3 (7 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WorkflowEngine._coerce_input (cognitive 25) · ×1
  • WorkflowEngine._coerce_input (cognitive 25) src/specify_cli/workflows/engine.py:1414 — WorkflowEngine._coerce_input has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (18 pts), error handling 2 (5 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 · command_remove._remove_step_locked (cognitive 25) · ×1
  • command_remove._remove_step_locked (cognitive 25) src/specify_cli/workflows/step/command_remove.py:11 — command_remove._remove_step_locked has cognitive complexity 25 (threshold 15). Drivers by points: error handling 5 (12 pts), if/else 6 (10 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · resolution._build_stack (cognitive 24) · ×1
  • resolution._build_stack (cognitive 24) src/specify_cli/artifacts/resolution.py:373 — resolution._build_stack has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 5, ternaries 2 (3 pts), error handling 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · events._resolve_event_command_argv (cognitive 24) · ×1
  • events._resolve_event_command_argv (cognitive 24) src/specify_cli/events/__init__.py:634 — events._resolve_event_command_argv has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 5, error handling 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, 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 · AlquimiaAIIntegration.inject_argument_hint (cognitive 24) · ×1
  • AlquimiaAIIntegration.inject_argument_hint (cognitive 24) src/specify_cli/integrations/alquimia/__init__.py:67 — AlquimiaAIIntegration.inject_argument_hint has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (5 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 · ClaudeIntegration.inject_argument_hint (cognitive 24) · ×1
  • ClaudeIntegration.inject_argument_hint (cognitive 24) src/specify_cli/integrations/claude/__init__.py:114 — ClaudeIntegration.inject_argument_hint has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (5 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 · command_search.integration_search (cognitive 24) · ×1
  • command_search.integration_search (cognitive 24) src/specify_cli/integrations/command_search.py:17 — command_search.integration_search has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 2, error handling 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 · PresetCatalog._load_catalog_config (cognitive 24) · ×1
  • PresetCatalog._load_catalog_config (cognitive 24) src/specify_cli/presets/_catalog.py:242 — PresetCatalog._load_catalog_config has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (17 pts), error handling 2 (3 pts), ternaries 2 (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 · command_resume.workflow_resume (cognitive 24) · ×1
  • command_resume.workflow_resume (cognitive 24) src/specify_cli/workflows/command_resume.py:10 — command_resume.workflow_resume has cognitive complexity 24 (threshold 15). Drivers by points: error handling 11 (13 pts), if/else 7 (10 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 · RunState.load (cognitive 24) · ×1
  • RunState.load (cognitive 24) src/specify_cli/workflows/engine.py:815 — RunState.load has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 3, error handling 1, 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.
D2 · Cognitive Complexity · ProjectOverlaySource.collect (cognitive 24) · ×1
  • ProjectOverlaySource.collect (cognitive 24) src/specify_cli/workflows/overlay/layer_sources.py:127 — ProjectOverlaySource.collect has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (15 pts), error handling 3 (5 pts), boolean chains 3, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · command_add._install_from_url (cognitive 24) · ×1
  • command_add._install_from_url (cognitive 24) src/specify_cli/workflows/step/command_add.py:75 — command_add._install_from_url has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (11 pts), error handling 6, ternaries 4, boolean chains 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 · validate_community_preset.published_manifest (cognitive 23) · ×1
  • validate_community_preset.published_manifest (cognitive 23) .github/scripts/validate_community_preset.py:113 — validate_community_preset.published_manifest has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (13 pts), error handling 5 (6 pts), boolean chains 3, 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 · check_prerequisites.main (cognitive 23) · ×1
  • check_prerequisites.main (cognitive 23) scripts/python/check_prerequisites.py:206 — check_prerequisites.main has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (15 pts), error handling 2 (3 pts), ternaries 2 (3 pts), boolean chains 2 (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 · setup_plan.main (cognitive 23) · ×1
  • setup_plan.main (cognitive 23) scripts/python/setup_plan.py:37 — setup_plan.main has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (15 pts), ternaries 3 (4 pts), error handling 2 (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 · references._validate_pinned_install_metadata (cognitive 23) · ×1
  • references._validate_pinned_install_metadata (cognitive 23) src/specify_cli/bundles/references.py:80 — references._validate_pinned_install_metadata has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 4, 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 · command_init._install_extension_during_init (cognitive 23) · ×1
  • command_init._install_extension_during_init (cognitive 23) src/specify_cli/command_init.py:101 — command_init._install_extension_during_init has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (19 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 · command_list.catalog_list (cognitive 23) · ×1
  • command_list.catalog_list (cognitive 23) src/specify_cli/extensions/catalog/command_list.py:19 — command_list.catalog_list has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 3 (6 pts), boolean chains 2, 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 · command_remove.extension_remove (cognitive 23) · ×1
  • command_remove.extension_remove (cognitive 23) src/specify_cli/extensions/command_remove.py:16 — command_remove.extension_remove has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (16 pts), ternaries 5 (7 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _capture._join (cognitive 23) · ×1
  • _capture._join (cognitive 23) src/specify_cli/integrations/_capture.py:117 — _capture._join has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (11 pts), ternaries 2 (8 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CopilotIntegration.is_skills_mode (cognitive 23) · ×1
  • CopilotIntegration.is_skills_mode (cognitive 23) src/specify_cli/integrations/copilot/__init__.py:189 — CopilotIntegration.is_skills_mode has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 7, error handling 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 · _PresetSkillMethods._build_extension_skill_restore_index (cognitive 23) · ×1
  • _PresetSkillMethods._build_extension_skill_restore_index (cognitive 23) src/specify_cli/presets/_manager_skills.py:567 — _PresetSkillMethods._build_extension_skill_restore_index has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (14 pts), error handling 2 (5 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 · PresetResolver.resolve_extension_command_via_manifest (cognitive 23) · ×1
  • PresetResolver.resolve_extension_command_via_manifest (cognitive 23) src/specify_cli/presets/_resolver.py:399 — PresetResolver.resolve_extension_command_via_manifest has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (15 pts), error handling 2 (5 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PresetResolver._find_bundled_core (cognitive 23) · ×1
  • PresetResolver._find_bundled_core (cognitive 23) src/specify_cli/presets/_resolver.py:685 — PresetResolver._find_bundled_core has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 2 (4 pts), boolean chains 1, 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 · WorkflowRegistry.save (cognitive 23) · ×1
  • WorkflowRegistry.save (cognitive 23) src/specify_cli/workflows/catalog/_domain.py:153 — WorkflowRegistry.save has cognitive complexity 23 (threshold 15). Drivers by points: error handling 5 (10 pts), if/else 6 (9 pts), boolean chains 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · installer._copy_package_tree (cognitive 23) · ×1
  • installer._copy_package_tree (cognitive 23) src/specify_cli/workflows/step/installer.py:554 — installer._copy_package_tree has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (12 pts), error handling 3 (7 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · common._preset_template_layer (cognitive 22) · ×1
  • common._preset_template_layer (cognitive 22) scripts/python/common.py:555 — common._preset_template_layer has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 2 (3 pts), boolean chains 2, 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 · _version._run_installer (cognitive 22) · ×1
  • _version._run_installer (cognitive 22) src/specify_cli/_version.py:767 — _version._run_installer has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (13 pts), error handling 5 (6 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · packager._collect_files (cognitive 22) · ×1
  • packager._collect_files (cognitive 22) src/specify_cli/bundles/packager.py:113 — packager._collect_files has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (16 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 · _capture.run_captured (cognitive 22) · ×1
  • _capture.run_captured (cognitive 22) src/specify_cli/integrations/_capture.py:436 — _capture.run_captured has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 4, error handling 3, loops 2 (3 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 · _helpers._parse_integration_options (cognitive 22) · ×1
  • _helpers._parse_integration_options (cognitive 22) src/specify_cli/integrations/_helpers.py:192 — _helpers._parse_integration_options has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 2, error handling 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 · GenericIntegration._resolve_commands_dir (cognitive 22) · ×1
  • GenericIntegration._resolve_commands_dir (cognitive 22) src/specify_cli/integrations/generic/__init__.py:116 — GenericIntegration._resolve_commands_dir has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 4, 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 · PresetManifest._validate_requires_extensions (cognitive 22) · ×1
  • PresetManifest._validate_requires_extensions (cognitive 22) src/specify_cli/presets/_manifest.py:308 — PresetManifest._validate_requires_extensions has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), error handling 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · command_list.preset_catalog_list (cognitive 22) · ×1
  • command_list.preset_catalog_list (cognitive 22) src/specify_cli/presets/catalog/command_list.py:16 — command_list.preset_catalog_list has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 3 (6 pts), boolean chains 2, 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 · StepRegistry.save (cognitive 22) · ×1
  • StepRegistry.save (cognitive 22) src/specify_cli/workflows/step/catalog/_domain.py:132 — StepRegistry.save has cognitive complexity 22 (threshold 15). Drivers by points: error handling 5 (9 pts), if/else 7 (9 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 · CommandStep.validate (cognitive 22) · ×1
  • CommandStep.validate (cognitive 22) src/specify_cli/workflows/step/command/__init__.py:387 — CommandStep.validate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 7, loops 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 · validate_community_workflow_step.validate_files (cognitive 21) · ×1
  • validate_community_workflow_step.validate_files (cognitive 21) .github/scripts/validate_community_workflow_step.py:137 — validate_community_workflow_step.validate_files has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4, loops 3 (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 · resolve_tasks.main (cognitive 21) · ×1
  • resolve_tasks.main (cognitive 21) extensions/github/scripts/python/resolve_tasks.py:166 — resolve_tasks.main has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (17 pts), loops 2 (3 pts), boolean chains 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 · _download_security.detect_archive_format (cognitive 21) · ×1
  • _download_security.detect_archive_format (cognitive 21) src/specify_cli/_download_security.py:125 — _download_security.detect_archive_format has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 6, error handling 3 (5 pts), ternaries 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 · component_catalog._matching_entry (cognitive 21) · ×1
  • component_catalog._matching_entry (cognitive 21) src/specify_cli/bundles/component_catalog.py:44 — component_catalog._matching_entry has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (17 pts), ternaries 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · yamlio.dump_json (cognitive 21) · ×1
  • yamlio.dump_json (cognitive 21) src/specify_cli/bundles/yamlio.py:136 — yamlio.dump_json has cognitive complexity 21 (threshold 15). Drivers by points: error handling 5 (9 pts), if/else 7 (9 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExtensionManager._unregister_extension_skills (cognitive 21) · ×1
  • ExtensionManager._unregister_extension_skills (cognitive 21) src/specify_cli/extensions/__init__.py:2166 — ExtensionManager._unregister_extension_skills has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 4, error handling 1 (4 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConfigManager._get_env_config (cognitive 21) · ×1
  • ConfigManager._get_env_config (cognitive 21) src/specify_cli/extensions/__init__.py:5382 — ConfigManager._get_env_config has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 3 (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 · _command_upgrade_layout._installed_presets_affecting_agent (cognitive 21) · ×1
  • _command_upgrade_layout._installed_presets_affecting_agent (cognitive 21) src/specify_cli/integrations/_command_upgrade_layout.py:91 — _command_upgrade_layout._installed_presets_affecting_agent has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 5, error handling 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 · AlquimiaAIIntegration._inject_frontmatter_flag (cognitive 21) · ×1
  • AlquimiaAIIntegration._inject_frontmatter_flag (cognitive 21) src/specify_cli/integrations/alquimia/__init__.py:139 — AlquimiaAIIntegration._inject_frontmatter_flag has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 2, 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 · ClaudeIntegration._inject_frontmatter_flag (cognitive 21) · ×1
  • ClaudeIntegration._inject_frontmatter_flag (cognitive 21) src/specify_cli/integrations/claude/__init__.py:205 — ClaudeIntegration._inject_frontmatter_flag has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 2, 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 · VibeIntegration._inject_frontmatter_flag (cognitive 21) · ×1
  • VibeIntegration._inject_frontmatter_flag (cognitive 21) src/specify_cli/integrations/vibe/__init__.py:158 — VibeIntegration._inject_frontmatter_flag has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 2, 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 · PresetCatalog.download_pack_info (cognitive 21) · ×1
  • PresetCatalog.download_pack_info (cognitive 21) src/specify_cli/presets/_catalog.py:846 — PresetCatalog.download_pack_info has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10, boolean chains 4, ternaries 4, error handling 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 · PresetManager.install_from_directory (cognitive 21) · ×1
  • PresetManager.install_from_directory (cognitive 21) src/specify_cli/presets/_manager.py:364 — PresetManager.install_from_directory has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (12 pts), error handling 3 (5 pts), boolean chains 2, ternaries 2 (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 · WorkflowCatalog.add_catalog (cognitive 21) · ×1
  • WorkflowCatalog.add_catalog (cognitive 21) src/specify_cli/workflows/catalog/_domain.py:754 — WorkflowCatalog.add_catalog has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, error handling 2 (3 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 · CommandRegistrar.register_commands_for_non_skill_agents (cognitive 20) · ×1
  • CommandRegistrar.register_commands_for_non_skill_agents (cognitive 20) src/specify_cli/agents.py:1293 — CommandRegistrar.register_commands_for_non_skill_agents has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), error handling 1 (3 pts), boolean chains 1, 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 · command_install.bundle_install (cognitive 20) · ×1
  • command_install.bundle_install (cognitive 20) src/specify_cli/bundles/command_install.py:32 — command_install.bundle_install has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 2, loops 2, ternaries 2, 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 · events._refresh_loaded_integration_events (cognitive 20) · ×1
  • events._refresh_loaded_integration_events (cognitive 20) src/specify_cli/events/__init__.py:1837 — events._refresh_loaded_integration_events has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (9 pts), error handling 2 (4 pts), boolean chains 3, ternaries 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 · ExtensionManager._get_installed_command_name_map (cognitive 20) · ×1
  • ExtensionManager._get_installed_command_name_map (cognitive 20) src/specify_cli/extensions/__init__.py:1172 — ExtensionManager._get_installed_command_name_map has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 3 (6 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 · ExtensionManager._get_skills_dir (cognitive 20) · ×1
  • ExtensionManager._get_skills_dir (cognitive 20) src/specify_cli/extensions/__init__.py:1281 — ExtensionManager._get_skills_dir has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 4, error handling 2 (3 pts), 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 · ExtensionManager.install_from_archive (cognitive 20) · ×1
  • ExtensionManager.install_from_archive (cognitive 20) src/specify_cli/extensions/__init__.py:3211 — ExtensionManager.install_from_archive has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), error handling 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 · HookExecutor._evaluate_condition (cognitive 20) · ×1
  • HookExecutor._evaluate_condition (cognitive 20) src/specify_cli/extensions/__init__.py:5991 — HookExecutor._evaluate_condition has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (17 pts), ternaries 1 (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 · command_list.extension_list (cognitive 20) · ×1
  • command_list.extension_list (cognitive 20) src/specify_cli/extensions/command_list.py:23 — command_list.extension_list has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 4, boolean chains 3, error handling 1 (2 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 · IntegrationCatalog._fetch_single_catalog (cognitive 20) · ×1
  • IntegrationCatalog._fetch_single_catalog (cognitive 20) src/specify_cli/integrations/__init__.py:317 — IntegrationCatalog._fetch_single_catalog has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 6 (9 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 · _command_scaffold_generation.scaffold_integration (cognitive 20) · ×1
  • _command_scaffold_generation.scaffold_integration (cognitive 20) src/specify_cli/integrations/_command_scaffold_generation.py:203 — _command_scaffold_generation.scaffold_integration has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (9 pts), error handling 3 (7 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 · command_list.integration_catalog_list (cognitive 20) · ×1
  • command_list.integration_catalog_list (cognitive 20) src/specify_cli/integrations/catalog/command_list.py:14 — command_list.integration_catalog_list has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 3 (6 pts), boolean chains 1, error handling 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 · installer._read_trust_state (cognitive 20) · ×1
  • installer._read_trust_state (cognitive 20) src/specify_cli/integrations/installer.py:346 — installer._read_trust_state has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 8, error handling 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 · installer._commit_event_recovery_updates (cognitive 20) · ×1
  • installer._commit_event_recovery_updates (cognitive 20) src/specify_cli/integrations/installer.py:524 — installer._commit_event_recovery_updates has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · installer._import_package (cognitive 20) · ×1
  • installer._import_package (cognitive 20) src/specify_cli/integrations/installer.py:744 — installer._import_package has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5, loops 1 (2 pts), 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 · PresetManager.install_from_archive (cognitive 20) · ×1
  • PresetManager.install_from_archive (cognitive 20) src/specify_cli/presets/_manager.py:568 — PresetManager.install_from_archive has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), error handling 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 · expressions._apply_filter (cognitive 20) · ×1
  • expressions._apply_filter (cognitive 20) src/specify_cli/workflows/expressions.py:617 — expressions._apply_filter has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 2, 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 · GateStep._prompt (cognitive 20) · ×1
  • GateStep._prompt (cognitive 20) src/specify_cli/workflows/step/gate/__init__.py:240 — GateStep._prompt has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (10 pts), error handling 2 (4 pts), loops 3, 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 · setup_tasks.main (cognitive 19) · ×1
  • setup_tasks.main (cognitive 19) scripts/python/setup_tasks.py:90 — setup_tasks.main has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 3 (5 pts), error handling 2, boolean chains 1, 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 · catalog._resolve_kind_hint (cognitive 19) · ×1
  • catalog._resolve_kind_hint (cognitive 19) src/specify_cli/artifacts/catalog.py:222 — catalog._resolve_kind_hint has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), error handling 1 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · resolution._derive_source_path (cognitive 19) · ×1
  • resolution._derive_source_path (cognitive 19) src/specify_cli/artifacts/resolution.py:293 — resolution._derive_source_path has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (17 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 · references._resolved_locally (cognitive 19) · ×1
  • references._resolved_locally (cognitive 19) src/specify_cli/bundles/references.py:25 — references._resolved_locally has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 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 · events._cleanup_shared_dispatcher (cognitive 19) · ×1
  • events._cleanup_shared_dispatcher (cognitive 19) src/specify_cli/events/__init__.py:1695 — events._cleanup_shared_dispatcher has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 3 (7 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 · ExtensionCatalog._fetch_single_catalog (cognitive 19) · ×1
  • ExtensionCatalog._fetch_single_catalog (cognitive 19) src/specify_cli/extensions/__init__.py:4640 — ExtensionCatalog._fetch_single_catalog has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (9 pts), error handling 5 (8 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 · CopilotIntegration.dispatch_command (cognitive 19) · ×1
  • CopilotIntegration.dispatch_command (cognitive 19) src/specify_cli/integrations/copilot/__init__.py:361 — CopilotIntegration.dispatch_command has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 2, error handling 1 (2 pts), ternaries 2 (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 · expressions._strip_stray_delimiters (cognitive 19) · ×1
  • expressions._strip_stray_delimiters (cognitive 19) src/specify_cli/workflows/expressions.py:1224 — expressions._strip_stray_delimiters has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (7 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 · StepListComposer._collect_base_step_ids (cognitive 19) · ×1
  • StepListComposer._collect_base_step_ids (cognitive 19) src/specify_cli/workflows/overlay/composer.py:79 — StepListComposer._collect_base_step_ids has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (6 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 · merge._all_base_step_ids (cognitive 19) · ×1
  • merge._all_base_step_ids (cognitive 19) src/specify_cli/workflows/overlay/merge.py:63 — merge._all_base_step_ids has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (6 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: 2 other methods here (merge._init_sources_recursively, merge._build_attribution) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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 · merge._init_sources_recursively (cognitive 19) · ×1
  • merge._init_sources_recursively (cognitive 19) src/specify_cli/workflows/overlay/merge.py:132 — merge._init_sources_recursively has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (6 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: 2 other methods here (merge._all_base_step_ids, merge._build_attribution) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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 · merge._build_attribution (cognitive 19) · ×1
  • merge._build_attribution (cognitive 19) src/specify_cli/workflows/overlay/merge.py:209 — merge._build_attribution has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (6 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: 2 other methods here (merge._all_base_step_ids, merge._init_sources_recursively) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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 · StepCatalog.add_catalog (cognitive 19) · ×1
  • StepCatalog.add_catalog (cognitive 19) src/specify_cli/workflows/step/catalog/_domain.py:692 — StepCatalog.add_catalog has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, error handling 2 (3 pts), loops 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 · validate_community_workflow_step.validate_identity (cognitive 18) · ×1
  • validate_community_workflow_step.validate_identity (cognitive 18) .github/scripts/validate_community_workflow_step.py:72 — validate_community_workflow_step.validate_identity has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), error handling 4 (5 pts), boolean chains 4, loops 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 · common._sorted_extension_ids (cognitive 18) · ×1
  • common._sorted_extension_ids (cognitive 18) scripts/python/common.py:249 — common._sorted_extension_ids has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 2 (3 pts), boolean chains 2, 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 · _operation_info._convert_catalog_result (cognitive 18) · ×1
  • _operation_info._convert_catalog_result (cognitive 18) src/specify_cli/artifacts/_operation_info.py:376 — _operation_info._convert_catalog_result has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 3, error handling 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 · resolution._layer_provenance (cognitive 18) · ×1
  • resolution._layer_provenance (cognitive 18) src/specify_cli/artifacts/resolution.py:79 — resolution._layer_provenance has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), error handling 2 (4 pts), ternaries 1 (3 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 · conflict.detect_conflicts (cognitive 18) · ×1
  • conflict.detect_conflicts (cognitive 18) src/specify_cli/bundles/conflict.py:22 — conflict.detect_conflicts has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 4 (6 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · YamlIntegration.setup (cognitive 18) · ×1
  • YamlIntegration.setup (cognitive 18) src/specify_cli/integrations/base.py:1619 — YamlIntegration.setup has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 3 (7 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 · ForgeIntegration._apply_forge_transformations (cognitive 18) · ×1
  • ForgeIntegration._apply_forge_transformations (cognitive 18) src/specify_cli/integrations/forge/__init__.py:198 — ForgeIntegration._apply_forge_transformations has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, 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 · _PresetSkillMethods._merge_pack_registered_skills (cognitive 18) · ×1
  • _PresetSkillMethods._merge_pack_registered_skills (cognitive 18) src/specify_cli/presets/_manager_skills.py:47 — _PresetSkillMethods._merge_pack_registered_skills has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 2, ternaries 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 · Execution.fan_out (cognitive 18) · ×1
  • Execution.fan_out (cognitive 18) src/specify_cli/workflows/_execution.py:897 — Execution.fan_out has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (4 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 · _execution.check_sequence (cognitive 18) · ×1
  • _execution.check_sequence (cognitive 18) src/specify_cli/workflows/_execution.py:151 — _execution.check_sequence has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, loops 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 · WorkflowCatalog._parse_catalog_config (cognitive 18) · ×1
  • WorkflowCatalog._parse_catalog_config (cognitive 18) src/specify_cli/workflows/catalog/_domain.py:365 — WorkflowCatalog._parse_catalog_config has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), 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 · expressions._filter_map (cognitive 18) · ×1
  • expressions._filter_map (cognitive 18) src/specify_cli/workflows/expressions.py:63 — expressions._filter_map has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · schema.validate_overlay_yaml (cognitive 18) · ×1
  • schema.validate_overlay_yaml (cognitive 18) src/specify_cli/workflows/overlay/schema.py:126 — schema.validate_overlay_yaml has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), 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 · StepCatalog._parse_catalog_config (cognitive 18) · ×1
  • StepCatalog._parse_catalog_config (cognitive 18) src/specify_cli/workflows/step/catalog/_domain.py:327 — StepCatalog._parse_catalog_config has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), 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 · StepCatalog._fetch_single_catalog (cognitive 18) · ×1
  • StepCatalog._fetch_single_catalog (cognitive 18) src/specify_cli/workflows/step/catalog/_domain.py:480 — StepCatalog._fetch_single_catalog has cognitive complexity 18 (threshold 15). Drivers by points: error handling 7 (11 pts), if/else 4 (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 · _utils.merge_json_files (cognitive 17) · ×1
  • _utils.merge_json_files (cognitive 17) src/specify_cli/_utils.py:263 — _utils.merge_json_files has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), error handling 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 · ArtifactCatalog._iter_project_override_candidates (cognitive 17) · ×1
  • ArtifactCatalog._iter_project_override_candidates (cognitive 17) src/specify_cli/artifacts/catalog.py:940 — ArtifactCatalog._iter_project_override_candidates has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 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 · ExtensionCatalog.download_extension_info (cognitive 17) · ×1
  • ExtensionCatalog.download_extension_info (cognitive 17) src/specify_cli/extensions/__init__.py:5101 — ExtensionCatalog.download_extension_info has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, error handling 3, ternaries 3, boolean chains 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 · command_disable.extension_disable (cognitive 17) · ×1
  • command_disable.extension_disable (cognitive 17) src/specify_cli/extensions/command_disable.py:16 — command_disable.extension_disable has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 2 (5 pts), error handling 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 · integration_state.normalize_integration_settings (cognitive 17) · ×1
  • integration_state.normalize_integration_settings (cognitive 17) src/specify_cli/integration_state.py:127 — integration_state.normalize_integration_settings has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, 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 · GenericIntegration._build_skill_content (cognitive 17) · ×1
  • GenericIntegration._build_skill_content (cognitive 17) src/specify_cli/integrations/generic/__init__.py:157 — GenericIntegration._build_skill_content has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 1 (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 · installer._validate_registrar_config (cognitive 17) · ×1
  • installer._validate_registrar_config (cognitive 17) src/specify_cli/integrations/installer.py:667 — installer._validate_registrar_config has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 7 (8 pts), loops 1 (nesting depth added 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 · PresetResolver.resolve_with_source (cognitive 17) · ×1
  • PresetResolver.resolve_with_source (cognitive 17) src/specify_cli/presets/_resolver.py:447 — PresetResolver.resolve_with_source has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), error handling 2 (5 pts), loops 2 (3 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 · shared_infra._ensure_safe_shared_directory (cognitive 17) · ×1
  • shared_infra._ensure_safe_shared_directory (cognitive 17) src/specify_cli/shared_infra.py:185 — shared_infra._ensure_safe_shared_directory has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), error handling 2 (5 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 · _commands._stage_workflow_file (cognitive 17) · ×1
  • _commands._stage_workflow_file (cognitive 17) src/specify_cli/workflows/_commands.py:427 — _commands._stage_workflow_file has cognitive complexity 17 (threshold 15). Drivers by points: error handling 4 (10 pts), if/else 4 (7 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 · merge.validate_edits (cognitive 17) · ×1
  • merge.validate_edits (cognitive 17) src/specify_cli/workflows/overlay/merge.py:433 — merge.validate_edits has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · schema._parse_edit (cognitive 17) · ×1
  • schema._parse_edit (cognitive 17) src/specify_cli/workflows/overlay/schema.py:61 — schema._parse_edit has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 4 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · installer._check_duplicate (cognitive 17) · ×1
  • installer._check_duplicate (cognitive 17) src/specify_cli/workflows/step/installer.py:413 — installer._check_duplicate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 3, error handling 3, loops 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 · create_new_feature._parse_args (cognitive 16) · ×1
  • create_new_feature._parse_args (cognitive 16) scripts/python/create_new_feature.py:114 — create_new_feature._parse_args has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 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 · ArtifactCatalog.get_artifact_info (cognitive 16) · ×1
  • ArtifactCatalog.get_artifact_info (cognitive 16) src/specify_cli/artifacts/catalog.py:335 — ArtifactCatalog.get_artifact_info 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 · ArtifactCatalog._iter_pack_candidates (cognitive 16) · ×1
  • ArtifactCatalog._iter_pack_candidates (cognitive 16) src/specify_cli/artifacts/catalog.py:904 — ArtifactCatalog._iter_pack_candidates has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · resolver.resolve_install_plan (cognitive 16) · ×1
  • resolver.resolve_install_plan (cognitive 16) src/specify_cli/bundles/resolver.py:43 — resolver.resolve_install_plan has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4 (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 · command_init.ensure_constitution_from_template (cognitive 16) · ×1
  • command_init.ensure_constitution_from_template (cognitive 16) src/specify_cli/command_init.py:211 — command_init.ensure_constitution_from_template has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 pts), 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 · ExtensionManager._extension_skill_candidate_dirs (cognitive 16) · ×1
  • ExtensionManager._extension_skill_candidate_dirs (cognitive 16) src/specify_cli/extensions/__init__.py:1847 — ExtensionManager._extension_skill_candidate_dirs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 3, loops 3, 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 · ExtensionManager._retire_legacy_flat_extension_commands (cognitive 16) · ×1
  • ExtensionManager._retire_legacy_flat_extension_commands (cognitive 16) src/specify_cli/extensions/__init__.py:3797 — ExtensionManager._retire_legacy_flat_extension_commands has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 6, 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 · DockerAgentIntegration.build_exec_args (cognitive 16) · ×1
  • DockerAgentIntegration.build_exec_args (cognitive 16) src/specify_cli/integrations/docker_agent/__init__.py:81 — DockerAgentIntegration.build_exec_args has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 5, error handling 1 (2 pts), 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 · DockerAgentIntegration.validate_runtime_config (cognitive 16) · ×1
  • DockerAgentIntegration.validate_runtime_config (cognitive 16) src/specify_cli/integrations/docker_agent/__init__.py:153 — DockerAgentIntegration.validate_runtime_config has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 6, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · DroidIntegration._inject_frontmatter_flag (cognitive 16) · ×1
  • DroidIntegration._inject_frontmatter_flag (cognitive 16) src/specify_cli/integrations/droid/__init__.py:40 — DroidIntegration._inject_frontmatter_flag has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 2, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HermesIntegration.teardown (cognitive 16) · ×1
  • HermesIntegration.teardown (cognitive 16) src/specify_cli/integrations/hermes/__init__.py:231 — HermesIntegration.teardown has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), error handling 1 (4 pts), boolean chains 3, 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 · PresetResolver._extension_manifest_declared_template (cognitive 16) · ×1
  • PresetResolver._extension_manifest_declared_template (cognitive 16) src/specify_cli/presets/_resolver.py:97 — PresetResolver._extension_manifest_declared_template has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 2 (3 pts), ternaries 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 · command_add.preset_catalog_add (cognitive 16) · ×1
  • command_add.preset_catalog_add (cognitive 16) src/specify_cli/presets/catalog/command_add.py:14 — command_add.preset_catalog_add has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 2 (3 pts), boolean chains 1, loops 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 · shared_infra._exclusive_project_lock (cognitive 16) · ×1
  • shared_infra._exclusive_project_lock (cognitive 16) src/specify_cli/shared_infra.py:243 — shared_infra._exclusive_project_lock has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 2 (4 pts), 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 · shared_infra.refresh_shared_templates (cognitive 16) · ×1
  • shared_infra.refresh_shared_templates (cognitive 16) src/specify_cli/shared_infra.py:408 — shared_infra.refresh_shared_templates has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _commands._read_response_within_limit (cognitive 16) · ×1
  • _commands._read_response_within_limit (cognitive 16) src/specify_cli/workflows/_commands.py:231 — _commands._read_response_within_limit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), error handling 2 (5 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 · Execution.workflow (cognitive 16) · ×1
  • Execution.workflow (cognitive 16) src/specify_cli/workflows/_execution.py:827 — Execution.workflow has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (6 pts), ternaries 4 (6 pts), error handling 2 (4 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · expressions._check_json_keys (cognitive 16) · ×1
  • expressions._check_json_keys (cognitive 16) src/specify_cli/workflows/expressions.py:250 — expressions._check_json_keys has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · command_add.workflow_step_add (cognitive 16) · ×1
  • command_add.workflow_step_add (cognitive 16) src/specify_cli/workflows/step/command_add.py:558 — command_add.workflow_step_add has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, boolean chains 6, loops 1 (2 pts), error handling 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 · PromptStep._try_dispatch (cognitive 16) · ×1
  • PromptStep._try_dispatch (cognitive 16) src/specify_cli/workflows/step/prompt/__init__.py:216 — PromptStep._try_dispatch has cognitive complexity 16 (threshold 15). Drivers by points: error handling 5 (6 pts), if/else 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.
D22 · Internal API Consistency · Two methods with nearly identical names and signatures in the same module, likely performing overlapping setup or validation steps for initialization. · ×1
  • Two methods with nearly identical names and signatures in the same module, likely performing overlapping setup or validation steps for initialization. — Merge into a single method (e.g., `prepare_init_root`) or clarify distinct responsibilities if they are sequential steps. (signatures: _file_policy.preflight_init_root(target: Path): Path | _file_policy.prepare_init_root(target: Path): Path)
D22 · Internal API Consistency · Redundant normalization functions. `normalize_zip_member_name` is a specific case of `normalize_archive_member_name` (since ZIP is an archive format), yet both are exposed publicly. · ×1
  • Redundant normalization functions. `normalize_zip_member_name` is a specific case of `normalize_archive_member_name` (since ZIP is an archive format), yet both are exposed publicly. — Remove `normalize_zip_member_name` and use `normalize_archive_member_name` with the appropriate format context, or make the zip-specific one private/internal. (signatures: _download_security.normalize_archive_member_name(name: str, ...): str | _download_security.normalize_zip_member_name(name: str, ...): str)
D22 · Internal API Consistency · Redundant key generation functions. Similar to the normalization issue, `portable_zip_path_key` duplicates the intent of `portable_archive_path_key` for the ZIP format. · ×1
  • Redundant key generation functions. Similar to the normalization issue, `portable_zip_path_key` duplicates the intent of `portable_archive_path_key` for the ZIP format. — Remove `portable_zip_path_key` and use `portable_archive_path_key`. (signatures: _download_security.portable_archive_path_key(name: str): tuple[str, ...] | _download_security.portable_zip_path_key(name: str): tuple[str, ...])
D22 · Internal API Consistency · Inconsistent naming and scope for command registration. `register_commands` is generic, while the other two are specific to agent types, creating confusion about which method to use for general vs. specific registration. · ×1
  • Inconsistent naming and scope for command registration. `register_commands` is generic, while the other two are specific to agent types, creating confusion about which method to use for general vs. specific registration. — Unify under a single `register_commands` method with an optional `agent_filter` parameter, or rename the specific ones to be clearly distinct (e.g., `register_skill_commands`). (signatures: CommandRegistrar.register_commands(...) | CommandRegistrar.register_commands_for_all_agents(...) | CommandRegistrar.register_commands_for_non_skill_agents(...))
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member pair (62 shared lines) · ×1
  • Near-duplicate member pair (62 shared lines) src/specify_cli/workflows/catalog/_domain.py:755 — src/specify_cli/workflows/catalog/_domain.py:755-835 | src/specify_cli/workflows/step/catalog/_domain.py:693-773 — 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 (56 shared lines) · ×1
  • Near-duplicate member pair (56 shared lines) src/specify_cli/workflows/catalog/_domain.py:534 — src/specify_cli/workflows/catalog/_domain.py:534-629 | src/specify_cli/workflows/step/catalog/_domain.py:483-587 — These two members are variants of one another: 56 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 (42 shared lines) · ×1
  • Near-duplicate member pair (42 shared lines) src/specify_cli/integrations/base.py:1838 — src/specify_cli/integrations/base.py:1838-1976 | src/specify_cli/integrations/generic/__init__.py:160-216 — These two members are variants of one another: 42 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 (91 corresponding lines) · ×1
  • Edited copy of a member (91 corresponding lines) src/specify_cli/workflows/step/do_while/__init__.py:73 — src/specify_cli/workflows/step/do_while/__init__.py:73-163 | src/specify_cli/workflows/step/while_loop/__init__.py:82-176 — These two members are one piece of code written twice and then edited apart: 91 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 · Edited copy of a member (21 corresponding lines) · ×1
  • Edited copy of a member (21 corresponding lines) src/specify_cli/extensions/_commands.py:297 — src/specify_cli/extensions/_commands.py:297-347 | src/specify_cli/extensions/_commands.py:355-417 — These two members are one piece of code written twice and then edited apart: 21 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 · Edited copy of a member (20 corresponding lines) · ×1
  • Edited copy of a member (20 corresponding lines) src/specify_cli/workflows/catalog/command_list.py:11 — src/specify_cli/workflows/catalog/command_list.py:11-38 | src/specify_cli/workflows/step/catalog/command_list.py:11-38 — These two members are one piece of code written twice and then edited apart: 20 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 (6 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (6 members, 50+ identical tokens) src/specify_cli/integrations/base.py:1008 — src/specify_cli/integrations/base.py:1008-1045 | src/specify_cli/integrations/base.py:1179-1228 | src/specify_cli/integrations/base.py:1394-1446 | src/specify_cli/integrations/base.py:1626-1689 | src/specify_cli/integrations/forge/__init__.py:143-196 | src/specify_cli/integrations/generic/__init__.py:237-290 — These 6 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 6 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 6 times.
D4 · Code Duplication · Duplicated block (69 lines × 2) · ×1
  • Duplicated block (69 lines × 2) src/specify_cli/integrations/alquimia/__init__.py:68 — src/specify_cli/integrations/alquimia/__init__.py:68-136 | src/specify_cli/integrations/claude/__init__.py:115-183 — `src/specify_cli/integrations/alquimia/__init__.py` and `src/specify_cli/integrations/claude/__init__.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 112 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/specify_cli/integrations/alquimia/__init__.py:68` 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 (62 lines × 3) · ×1
  • Duplicated block (62 lines × 3) src/specify_cli/workflows/step/do_while/__init__.py:78 — src/specify_cli/workflows/step/do_while/__init__.py:78-139 | src/specify_cli/workflows/step/if_then/__init__.py:69-130 | src/specify_cli/workflows/step/while_loop/__init__.py:87-148 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/specify_cli/workflows/step/do_while/__init__.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 (45–48 lines × 2) · ×1
  • Duplicated block (45–48 lines × 2) src/specify_cli/extensions/__init__.py:4576 — src/specify_cli/extensions/__init__.py:4576-4623 | src/specify_cli/integrations/__init__.py:269-313 — 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 (44–46 lines × 2) · ×1
  • Duplicated block (44–46 lines × 2) src/specify_cli/integrations/command_uninstall.py:47 — src/specify_cli/integrations/command_uninstall.py:47-90 | src/specify_cli/integrations/command_uninstall.py:117-162 — 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 (45 lines × 2) · ×1
  • Duplicated block (45 lines × 2) src/specify_cli/workflows/catalog/_domain.py:464 — src/specify_cli/workflows/catalog/_domain.py:464-508 | src/specify_cli/workflows/step/catalog/_domain.py:413-457 — before extracting anything, compare `src/specify_cli/workflows/catalog/_domain.py` and `src/specify_cli/workflows/step/catalog/_domain.py` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 293 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 (41–44 lines × 2) · ×1
  • Duplicated block (41–44 lines × 2) src/specify_cli/integrations/base.py:490 — src/specify_cli/integrations/base.py:490-533 | src/specify_cli/integrations/copilot/__init__.py:426-466 — 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 (38–39 lines × 2) · ×1
  • Duplicated block (38–39 lines × 2) src/specify_cli/workflows/catalog/_domain.py:794 — src/specify_cli/workflows/catalog/_domain.py:794-831 | src/specify_cli/workflows/step/catalog/_domain.py:731-769 — before extracting anything, compare `src/specify_cli/workflows/catalog/_domain.py` and `src/specify_cli/workflows/step/catalog/_domain.py` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 293 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/specify_cli/workflows/catalog/_domain.py:794` 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–38 lines × 2) · ×1
  • Duplicated block (27–38 lines × 2) src/specify_cli/integrations/base.py:1789 — src/specify_cli/integrations/base.py:1789-1815 | src/specify_cli/integrations/cline/__init__.py:109-146 — 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 `src/specify_cli/integrations/base.py:1789` 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–37 lines × 3) · ×1
  • Duplicated block (20–37 lines × 3) src/specify_cli/integrations/base.py:1874 — src/specify_cli/integrations/base.py:1874-1907 | src/specify_cli/integrations/generic/__init__.py:168-187 | src/specify_cli/integrations/hermes/__init__.py:119-155 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/specify_cli/integrations/base.py:1874` 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 (37 lines × 2) · ×1
  • Duplicated block (37 lines × 2) src/specify_cli/workflows/step/command/__init__.py:92 — src/specify_cli/workflows/step/command/__init__.py:92-128 | src/specify_cli/workflows/step/prompt/__init__.py:63-99 — `src/specify_cli/workflows/step/command/__init__.py` and `src/specify_cli/workflows/step/prompt/__init__.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 108 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. 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 (31–36 lines × 2) · ×1
  • Duplicated block (31–36 lines × 2) src/specify_cli/extensions/__init__.py:851 — src/specify_cli/extensions/__init__.py:851-886 | src/specify_cli/presets/_registry.py:97-127 — before extracting anything, compare `src/specify_cli/extensions/__init__.py` and `src/specify_cli/presets/_registry.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 149 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.
D4 · Code Duplication · Duplicated block (27–33 lines × 2) · ×1
  • Duplicated block (27–33 lines × 2) src/specify_cli/events/__init__.py:1551 — src/specify_cli/events/__init__.py:1551-1583 | src/specify_cli/events/__init__.py:1587-1613 — 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 (30–32 lines × 4) · ×1
  • Duplicated block (30–32 lines × 4) src/specify_cli/integrations/alquimia/__init__.py:140 — src/specify_cli/integrations/alquimia/__init__.py:140-169 | src/specify_cli/integrations/claude/__init__.py:206-235 | src/specify_cli/integrations/droid/__init__.py:41-72 | src/specify_cli/integrations/vibe/__init__.py:159-188 — `src/specify_cli/integrations/alquimia/__init__.py` and `src/specify_cli/integrations/claude/__init__.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 112 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. 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–32 lines × 2) · ×1
  • Duplicated block (30–32 lines × 2) src/specify_cli/extensions/__init__.py:994 — src/specify_cli/extensions/__init__.py:994-1025 | src/specify_cli/presets/_registry.py:206-235 — before extracting anything, compare `src/specify_cli/extensions/__init__.py` and `src/specify_cli/presets/_registry.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 149 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.
D4 · Code Duplication · Duplicated block (24–30 lines × 2) · ×1
  • Duplicated block (24–30 lines × 2) src/specify_cli/events/__init__.py:2307 — src/specify_cli/events/__init__.py:2307-2330 | src/specify_cli/events/__init__.py:2560-2589 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/specify_cli/events/__init__.py:2306` calls `isinstance` and `src/specify_cli/events/__init__.py:2559` 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 (28–29 lines × 2) · ×1
  • Duplicated block (28–29 lines × 2) src/specify_cli/extensions/__init__.py:4557 — src/specify_cli/extensions/__init__.py:4557-4585 | src/specify_cli/presets/_catalog.py:343-370 — 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 `src/specify_cli/extensions/__init__.py:4557` 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 `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.
D4 · Code Duplication · Duplicated block (25–29 lines × 2) · ×1
  • Duplicated block (25–29 lines × 2) src/specify_cli/presets/_manager_commands.py:565 — src/specify_cli/presets/_manager_commands.py:565-589 | src/specify_cli/presets/_manager_commands.py:611-639 — 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 `src/specify_cli/presets/_manager_commands.py:565` 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 (26–28 lines × 2) · ×1
  • Duplicated block (26–28 lines × 2) src/specify_cli/_download_security.py:993 — src/specify_cli/_download_security.py:993-1020 | src/specify_cli/_download_security.py:1175-1200 — 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 `src/specify_cli/_download_security.py:993` 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 (27 lines × 2) · ×1
  • Duplicated block (27 lines × 2) src/specify_cli/integrations/cline/__init__.py:176 — src/specify_cli/integrations/cline/__init__.py:176-202 | src/specify_cli/integrations/junie/__init__.py:154-180 — `src/specify_cli/integrations/cline/__init__.py` and `src/specify_cli/integrations/junie/__init__.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 61 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. 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–26 lines × 2) · ×1
  • Duplicated block (19–26 lines × 2) src/specify_cli/bundles/catalog_config.py:47 — src/specify_cli/bundles/catalog_config.py:47-65 | src/specify_cli/bundles/catalogs.py:308-333 — 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. 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–26 lines × 2) · ×1
  • Duplicated block (24–26 lines × 2) src/specify_cli/integrations/base.py:1924 — src/specify_cli/integrations/base.py:1924-1949 | src/specify_cli/integrations/hermes/__init__.py:170-193 — before extracting anything, compare `src/specify_cli/integrations/base.py` and `src/specify_cli/integrations/hermes/__init__.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 102 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/specify_cli/integrations/base.py:1924` 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–25 lines × 3) · ×1
  • Duplicated block (20–25 lines × 3) src/specify_cli/extensions/__init__.py:4864 — src/specify_cli/extensions/__init__.py:4864-4883 | src/specify_cli/presets/_catalog.py:427-451 | src/specify_cli/presets/_catalog.py:622-644 — 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 `src/specify_cli/presets/_catalog.py:622` 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 (11–25 lines × 3) · ×1
  • Duplicated block (11–25 lines × 3) src/specify_cli/integrations/base.py:1911 — src/specify_cli/integrations/base.py:1911-1935 | src/specify_cli/integrations/generic/__init__.py:191-201 | src/specify_cli/integrations/hermes/__init__.py:159-180 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/specify_cli/integrations/base.py:1911` 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–25 lines × 2) · ×1
  • Duplicated block (20–25 lines × 2) src/specify_cli/integrations/base.py:1299 — src/specify_cli/integrations/base.py:1299-1323 | src/specify_cli/integrations/base.py:1509-1528 — 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 (24 lines × 2) · ×1
  • Duplicated block (24 lines × 2) src/specify_cli/workflows/catalog/_domain.py:573 — src/specify_cli/workflows/catalog/_domain.py:573-596 | src/specify_cli/workflows/step/catalog/_domain.py:526-549 — before extracting anything, compare `src/specify_cli/workflows/catalog/_domain.py` and `src/specify_cli/workflows/step/catalog/_domain.py` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 293 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/specify_cli/workflows/catalog/_domain.py:573` 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 (16–23 lines × 3) · ×1
  • Duplicated block (16–23 lines × 3) src/specify_cli/bundles/yamlio.py:159 — src/specify_cli/bundles/yamlio.py:159-174 | src/specify_cli/workflows/catalog/_domain.py:191-213 | src/specify_cli/workflows/step/catalog/_domain.py:157-173 — before extracting anything, compare `src/specify_cli/workflows/catalog/_domain.py` and `src/specify_cli/workflows/step/catalog/_domain.py` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 293 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/specify_cli/workflows/catalog/_domain.py:191` 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 (13–23 lines × 2) · ×1
  • Duplicated block (13–23 lines × 2) src/specify_cli/extensions/__init__.py:2844 — src/specify_cli/extensions/__init__.py:2844-2866 | src/specify_cli/extensions/__init__.py:2878-2890 — 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–22 lines × 2) · ×1
  • Duplicated block (18–22 lines × 2) src/specify_cli/extensions/__init__.py:4716 — src/specify_cli/extensions/__init__.py:4716-4737 | src/specify_cli/presets/_catalog.py:490-507 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (15–22 lines × 2) · ×1
  • Duplicated block (15–22 lines × 2) src/specify_cli/extensions/_catalog_versions.py:116 — src/specify_cli/extensions/_catalog_versions.py:116-137 | src/specify_cli/workflows/catalog/_versions.py:99-113 — before extracting anything, compare `src/specify_cli/extensions/_catalog_versions.py` and `src/specify_cli/workflows/catalog/_versions.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 72 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 (22 lines × 2) · ×1
  • Duplicated block (22 lines × 2) src/specify_cli/workflows/step/command_add.py:222 — src/specify_cli/workflows/step/command_add.py:222-243 | src/specify_cli/workflows/step/command_add.py:517-538 — 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 `src/specify_cli/workflows/step/command_add.py:222` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/specify_cli/workflows/step/command_add.py:515` calls `get` and `src/specify_cli/workflows/step/command_add.py:221` 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 (18–21 lines × 2) · ×1
  • Duplicated block (18–21 lines × 2) src/specify_cli/workflows/step/command/__init__.py:442 — src/specify_cli/workflows/step/command/__init__.py:442-462 | src/specify_cli/workflows/step/prompt/__init__.py:335-352 — `src/specify_cli/workflows/step/command/__init__.py` and `src/specify_cli/workflows/step/prompt/__init__.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 108 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/specify_cli/workflows/step/command/__init__.py:442` 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 × 3) · ×1
  • Duplicated block (20 lines × 3) src/specify_cli/_assets.py:36 — src/specify_cli/_assets.py:36-55 | src/specify_cli/_assets.py:59-78 | src/specify_cli/_assets.py:82-101 — 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 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–20 lines × 3) · ×1
  • Duplicated block (10–20 lines × 3) src/specify_cli/shared_infra.py:606 — src/specify_cli/shared_infra.py:606-625 | src/specify_cli/shared_infra.py:662-681 | src/specify_cli/shared_infra.py:709-718 — 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 (17–20 lines × 2) · ×1
  • Duplicated block (17–20 lines × 2) .github/scripts/check_extension_version_bump.py:126 — .github/scripts/check_extension_version_bump.py:126-145 | .github/scripts/check_extension_version_bump.py:151-167 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `.github/scripts/check_extension_version_bump.py:126` 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 (18–20 lines × 2) · ×1
  • Duplicated block (18–20 lines × 2) src/specify_cli/agents.py:913 — src/specify_cli/agents.py:913-932 | src/specify_cli/agents.py:998-1015 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (19 lines × 5) · ×1
  • Duplicated block (19 lines × 5) src/specify_cli/integrations/base.py:1016 — src/specify_cli/integrations/base.py:1016-1034 | src/specify_cli/integrations/base.py:1179-1197 | src/specify_cli/integrations/base.py:1394-1412 | src/specify_cli/integrations/base.py:1626-1644 | src/specify_cli/integrations/forge/__init__.py:148-166 — there are 5 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 5 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/specify_cli/integrations/forge/__init__.py:167` calls `mkdir`, `get` and `src/specify_cli/integrations/base.py:1036` 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 (13–19 lines × 3) · ×1
  • Duplicated block (13–19 lines × 3) src/specify_cli/workflows/step/do_while/__init__.py:148 — src/specify_cli/workflows/step/do_while/__init__.py:148-162 | src/specify_cli/workflows/step/if_then/__init__.py:127-139 | src/specify_cli/workflows/step/while_loop/__init__.py:157-175 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/specify_cli/workflows/step/do_while/__init__.py:148` 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 (12–19 lines × 2) · ×1
  • Duplicated block (12–19 lines × 2) .github/scripts/check_extension_version_bump.py:124 — .github/scripts/check_extension_version_bump.py:124-142 | .github/scripts/check_extension_version_bump.py:198-209 — 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 (18–19 lines × 2) · ×1
  • Duplicated block (18–19 lines × 2) src/specify_cli/extensions/__init__.py:4759 — src/specify_cli/extensions/__init__.py:4759-4777 | src/specify_cli/integrations/__init__.py:378-395 — 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 `src/specify_cli/integrations/__init__.py:378` 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 (11–19 lines × 2) · ×1
  • Duplicated block (11–19 lines × 2) src/specify_cli/workflows/step/fan_out/__init__.py:84 — src/specify_cli/workflows/step/fan_out/__init__.py:84-94 | src/specify_cli/workflows/step/switch/__init__.py:104-122 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (16–18 lines × 3) · ×1
  • Duplicated block (16–18 lines × 3) src/specify_cli/extensions/_catalog_versions.py:123 — src/specify_cli/extensions/_catalog_versions.py:123-140 | src/specify_cli/workflows/catalog/_versions.py:101-116 | src/specify_cli/workflows/step/catalog/_versions.py:150-165 — before extracting anything, compare `src/specify_cli/extensions/_catalog_versions.py` and `src/specify_cli/workflows/catalog/_versions.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 72 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/specify_cli/extensions/_catalog_versions.py:123` 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 (11–18 lines × 2) · ×1
  • Duplicated block (11–18 lines × 2) src/specify_cli/events/__init__.py:1435 — src/specify_cli/events/__init__.py:1435-1452 | src/specify_cli/events/__init__.py:1524-1534 — 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 `src/specify_cli/events/__init__.py:1435` 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 (13–18 lines × 2) · ×1
  • Duplicated block (13–18 lines × 2) src/specify_cli/presets/_resolver.py:279 — src/specify_cli/presets/_resolver.py:279-296 | src/specify_cli/presets/_resolver.py:307-319 — 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 `src/specify_cli/presets/_resolver.py:279` 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 (11–17 lines × 3) · ×1
  • Duplicated block (11–17 lines × 3) src/specify_cli/events/__init__.py:1433 — src/specify_cli/events/__init__.py:1433-1448 | src/specify_cli/events/__init__.py:1550-1566 | src/specify_cli/events/__init__.py:1586-1596 — 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 (15–17 lines × 3) · ×1
  • Duplicated block (15–17 lines × 3) src/specify_cli/workflows/step/command/__init__.py:388 — src/specify_cli/workflows/step/command/__init__.py:388-403 | src/specify_cli/workflows/step/prompt/__init__.py:319-335 | REDACTED:145-159 — `src/specify_cli/workflows/step/command/__init__.py` and `src/specify_cli/workflows/step/prompt/__init__.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 108 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (13–17 lines × 2) · ×1
  • Duplicated block (13–17 lines × 2) src/specify_cli/events/__init__.py:2276 — src/specify_cli/events/__init__.py:2276-2288 | src/specify_cli/events/__init__.py:2365-2381 — 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 `new_hooks` to `dict[str, list]` in one and `dict` 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 (12–17 lines × 2) · ×1
  • Duplicated block (12–17 lines × 2) src/specify_cli/workflows/step/command/__init__.py:61 — src/specify_cli/workflows/step/command/__init__.py:61-77 | src/specify_cli/workflows/step/command/__init__.py:132-143 — 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 `src/specify_cli/workflows/step/command/__init__.py:61` 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 before the matched lines, `src/specify_cli/workflows/step/command/__init__.py:131` calls `dict`, `get` and `src/specify_cli/workflows/step/command/__init__.py:61` 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 (15–16 lines × 3) · ×1
  • Duplicated block (15–16 lines × 3) src/specify_cli/integrations/base.py:1213 — src/specify_cli/integrations/base.py:1213-1228 | src/specify_cli/integrations/base.py:1432-1446 | src/specify_cli/integrations/base.py:1674-1689 — 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 `src/specify_cli/integrations/base.py:1213` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/specify_cli/integrations/base.py:1430` calls `_split_frontmatter`, `_render_toml`, `command_filename` and `src/specify_cli/integrations/base.py:1213` 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 (12–16 lines × 2) · ×1
  • Duplicated block (12–16 lines × 2) extensions/git/scripts/python/create_new_feature_branch.py:298 — extensions/git/scripts/python/create_new_feature_branch.py:298-313 | scripts/python/create_new_feature.py:192-203 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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 (12–14 lines × 4) · ×1
  • Duplicated block (12–14 lines × 4) src/specify_cli/extensions/_catalog_versions.py:131 — src/specify_cli/extensions/_catalog_versions.py:131-144 | src/specify_cli/integrations/_catalog_versions.py:129-140 | src/specify_cli/workflows/catalog/_versions.py:109-120 | src/specify_cli/workflows/step/catalog/_versions.py:158-169 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. 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–14 lines × 2) · ×1
  • Duplicated block (12–14 lines × 2) src/specify_cli/extensions/__init__.py:3257 — src/specify_cli/extensions/__init__.py:3257-3270 | src/specify_cli/presets/_manager.py:605-616 — 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 `src/specify_cli/extensions/__init__.py:3257` 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 lines × 3) · ×1
  • Duplicated block (13 lines × 3) src/specify_cli/extensions/command_disable.py:27 — src/specify_cli/extensions/command_disable.py:27-39 | src/specify_cli/extensions/command_enable.py:27-39 | src/specify_cli/extensions/command_set_priority.py:32-44 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Note first that the copies are not typed on the same thing: the declarations holding them bind `extension` to `str = typer.Argument(help="Extension ID or name to disable")` in one and `str = typer.Argument(help="Extension ID or name to enable")` 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 (11–13 lines × 2) · ×1
  • Duplicated block (11–13 lines × 2) src/specify_cli/extensions/__init__.py:3639 — src/specify_cli/extensions/__init__.py:3639-3649 | src/specify_cli/extensions/__init__.py:4213-4225 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×1
  • Duplicated block (12–13 lines × 2) src/specify_cli/workflows/catalog/_domain.py:780 — src/specify_cli/workflows/catalog/_domain.py:780-792 | src/specify_cli/workflows/step/catalog/_domain.py:718-729 — before extracting anything, compare `src/specify_cli/workflows/catalog/_domain.py` and `src/specify_cli/workflows/step/catalog/_domain.py` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 293 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/specify_cli/workflows/catalog/_domain.py:780` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `idx` to `"Catalog config 'catalogs' must be a list." ) # Check for duplicate URL (guard against non-dict entries) for` in one and `"Catalog config 'catalogs' must be a list." ) 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.
D4 · Code Duplication · Duplicated block (9–12 lines × 2) · ×1
  • Duplicated block (9–12 lines × 2) src/specify_cli/workflows/command_resume.py:60 — src/specify_cli/workflows/command_resume.py:60-68 | src/specify_cli/workflows/command_status.py:33-44 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×1
  • Duplicated block (11 lines × 3) src/specify_cli/integrations/alquimia/__init__.py:47 — src/specify_cli/integrations/alquimia/__init__.py:47-57 | src/specify_cli/integrations/claude/__init__.py:186-196 | src/specify_cli/integrations/vibe/__init__.py:139-149 — `src/specify_cli/integrations/alquimia/__init__.py` and `src/specify_cli/integrations/claude/__init__.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 112 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. 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 (9 lines × 3) · ×1
  • Duplicated block (9 lines × 3) src/specify_cli/presets/_catalog.py:295 — src/specify_cli/presets/_catalog.py:295-307 | src/specify_cli/workflows/catalog/_domain.py:410-419 | src/specify_cli/workflows/step/catalog/_domain.py:360-368 — before extracting anything, compare `src/specify_cli/workflows/catalog/_domain.py` and `src/specify_cli/workflows/step/catalog/_domain.py` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 293 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/specify_cli/presets/_catalog.py:295` 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 (7–8 lines × 3) · ×1
  • Duplicated block (7–8 lines × 3) src/specify_cli/bundles/catalog_versions.py:99 — src/specify_cli/bundles/catalog_versions.py:99-106 | src/specify_cli/extensions/_catalog_versions.py:96-102 | src/specify_cli/presets/_catalog_versions.py:79-85 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/specify_cli/bundles/catalog_versions.py:99` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/specify_cli/bundles/catalog_versions.py:96` calls `is_https_or_localhost_http`, `BundlerError` and `src/specify_cli/extensions/_catalog_versions.py:96` 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 (5 lines × 4) · ×1
  • Duplicated block (5 lines × 4) src/specify_cli/catalogs.py:165 — src/specify_cli/catalogs.py:165-170 | src/specify_cli/presets/_catalog.py:319-323 | src/specify_cli/workflows/catalog/_domain.py:431-438 | src/specify_cli/workflows/step/catalog/_domain.py:380-387 — before extracting anything, compare `src/specify_cli/workflows/catalog/_domain.py` and `src/specify_cli/workflows/step/catalog/_domain.py` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 293 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/specify_cli/catalogs.py:165` 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 (5 lines × 3) · ×1
  • Duplicated block (5 lines × 3) src/specify_cli/extensions/__init__.py:4672 — src/specify_cli/extensions/__init__.py:4672-4676 | src/specify_cli/integrations/__init__.py:330-334 | src/specify_cli/presets/_catalog.py:425-430 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/specify_cli/presets/_catalog.py:425` 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 (7 lines × 3) · ×1
  • Duplicated block (7 lines × 3) extensions/git/scripts/python/auto_commit.py:22 — extensions/git/scripts/python/auto_commit.py:22-28 | extensions/git/scripts/python/create_new_feature_branch.py:131-137 | extensions/git/scripts/python/initialize_repo.py:20-26 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. 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 lines × 3) · ×1
  • Duplicated block (12 lines × 3) src/specify_cli/artifacts/mcp_info.py:169 — src/specify_cli/artifacts/mcp_info.py:169-181 | src/specify_cli/artifacts/mcp_list.py:171-183 | src/specify_cli/mcp_version.py:85-96 — before extracting anything, compare `src/specify_cli/artifacts/mcp_info.py` and `src/specify_cli/artifacts/mcp_list.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 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.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×1
  • Duplicated block (6 lines × 4) src/specify_cli/extensions/_catalog_versions.py:148 — src/specify_cli/extensions/_catalog_versions.py:148-153 | src/specify_cli/integrations/_catalog_versions.py:144-149 | src/specify_cli/presets/_catalog_versions.py:147-152 | src/specify_cli/workflows/catalog/_versions.py:124-129 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. 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 lines × 4) · ×1
  • Duplicated block (10 lines × 4) src/specify_cli/integrations/codex/__init__.py:71 — src/specify_cli/integrations/codex/__init__.py:71-80 | src/specify_cli/integrations/cursor_agent/__init__.py:122-131 | src/specify_cli/integrations/docker_agent/__init__.py:70-79 | src/specify_cli/integrations/mcode/__init__.py:40-49 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×1
  • Low cohesion: IntegrationBase (LCOM4 4) src/specify_cli/integrations/base.py:113 — IntegrationBase'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.
X17 · Uncapped recursion over a caller-supplied document · Recursive walk over a caller-supplied document has no depth cap · ×1
  • Recursive walk over a caller-supplied document has no depth cap src/specify_cli/_utils.py:323 — `merge_json_files` is public, takes a document from its caller (line 263) and hands it to `deep_merge_polite`, which calls itself at line 323 (`deep_merge_polite`) with a piece of `base` — and nowhere in `deep_merge_polite` 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 `deep_merge_polite` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Minor — 50 finding(s)
X10 · Duplicated predicate · Duplicated predicate · ×25
  • Duplicated predicate src/specify_cli/extensions/__init__.py:394 — `"commands" in provides and not isinstance(commands, list)` appears character-identically in 2 files — src/specify_cli/extensions/__init__.py, src/specify_cli/integrations/__init__.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 src/specify_cli/extensions/__init__.py:398 — `"scripts" in provides and not isinstance(scripts, list)` appears character-identically in 2 files — src/specify_cli/extensions/__init__.py, src/specify_cli/integrations/__init__.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 extensions/git/scripts/python/auto_commit.py:24 — `(current / ".specify").is_dir() or (current / ".git").exists()` appears character-identically in 3 files — extensions/git/scripts/python/auto_commit.py, extensions/git/scripts/python/create_new_feature_branch.py, extensions/git/scripts/python/initialize_repo.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 extensions/git/scripts/python/auto_commit.py:124 — `_find_project_root(script_dir) or Path.cwd()` appears character-identically in 2 files — extensions/git/scripts/python/auto_commit.py, extensions/git/scripts/python/initialize_repo.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 src/specify_cli/integrations/_helpers.py:511 — `abs_path.is_symlink() or not abs_path.is_file()` appears character-identically in 2 files — src/specify_cli/integrations/_helpers.py, src/specify_cli/integrations/manifest.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 src/specify_cli/extensions/__init__.py:1344 — `agent_config and agent_config.get("extension") == "/SKILL.md"` appears character-identically in 2 files — src/specify_cli/extensions/__init__.py, src/specify_cli/presets/_manager_skills.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 src/specify_cli/extensions/__init__.py:1402 — `agent_config and is_ai_skills_enabled(load_init_options(self.project_root)) and agent_config.get("extension") != "/SKILL.md"` appears character-identically in 2 files — src/specify_cli/extensions/__init__.py, src/specify_cli/presets/_manager_commands.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 src/specify_cli/agents.py:1197 — `agent_name == active_skills_agent and agent_config.get("extension") == "/SKILL.md"` appears character-identically in 2 files — src/specify_cli/agents.py, src/specify_cli/extensions/__init__.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 src/specify_cli/bundles/command_info.py:81 — `as_json and isinstance(exc.__cause__, ProjectPolicyError)` appears character-identically in 3 files — src/specify_cli/bundles/command_info.py, src/specify_cli/bundles/command_list.py, src/specify_cli/bundles/command_search.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 src/specify_cli/workflows/step/command/__init__.py:309 — `cli_path is None and fallback_cli_path is None` appears character-identically in 2 files — src/specify_cli/workflows/step/command/__init__.py, src/specify_cli/workflows/step/prompt/__init__.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 src/specify_cli/agents.py:1423 — `cmd_file.exists() or cmd_file.is_symlink()` appears character-identically in 2 files — src/specify_cli/agents.py, src/specify_cli/extensions/_command_update_transaction.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 src/specify_cli/extensions/catalog/command_list.py:66 — `config_path.exists() and catalog._load_catalog_config(config_path) is not None` appears character-identically in 2 files — src/specify_cli/extensions/catalog/command_list.py, src/specify_cli/presets/catalog/command_list.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 src/specify_cli/workflows/overlay/layer_sources.py:85 — `current.exists() and not current.is_dir()` appears character-identically in 2 files — src/specify_cli/workflows/overlay/layer_sources.py, src/specify_cli/workflows/step/installer.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 src/specify_cli/integrations/alquimia/__init__.py:93 — `dash_count == 1 and stripped.startswith("argument-hint:")` appears character-identically in 2 files — src/specify_cli/integrations/alquimia/__init__.py, src/specify_cli/integrations/claude/__init__.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 src/specify_cli/integrations/claude/__init__.py:258 — `dash_count == 1 and stripped.startswith("name:")` appears character-identically in 2 files — src/specify_cli/integrations/claude/__init__.py, src/specify_cli/integrations/vibe/__init__.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 src/specify_cli/integrations/alquimia/__init__.py:152 — `dash_count == 1 and stripped.startswith(f"{key}:")` appears character-identically in 4 files — src/specify_cli/integrations/alquimia/__init__.py, src/specify_cli/integrations/claude/__init__.py, src/specify_cli/integrations/droid/__init__.py, src/specify_cli/integrations/vibe/__init__.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 src/specify_cli/extensions/__init__.py:942 — `entry is None or not isinstance(entry, dict)` appears character-identically in 2 files — src/specify_cli/extensions/__init__.py, src/specify_cli/presets/_registry.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 src/specify_cli/workflows/_commands.py:770 — `expected_id is not None and definition.id != expected_id` appears character-identically in 2 files — src/specify_cli/workflows/_commands.py, src/specify_cli/workflows/command_add.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 src/specify_cli/extensions/__init__.py:3273 — `expected_id is not None or expected_version is not None` appears character-identically in 2 files — src/specify_cli/extensions/__init__.py, src/specify_cli/presets/_manager.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 src/specify_cli/command_init.py:166 — `ext_info.get("bundled") and not ext_info.get("download_url")` appears character-identically in 3 files — src/specify_cli/command_init.py, src/specify_cli/extensions/__init__.py, src/specify_cli/extensions/command_add.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 src/specify_cli/workflows/catalog/_domain.py:665 — `fetch_errors == len(catalogs) and catalogs` appears character-identically in 2 files — src/specify_cli/workflows/catalog/_domain.py, src/specify_cli/workflows/step/catalog/_domain.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 src/specify_cli/bundles/catalog_versions.py:111 — `field in record and not isinstance(record[field], dict)` appears character-identically in 4 files — src/specify_cli/bundles/catalog_versions.py, src/specify_cli/extensions/_catalog_versions.py, src/specify_cli/presets/_catalog_versions.py, src/specify_cli/workflows/step/catalog/_versions.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 extensions/github/scripts/python/resolve_tasks.py:47 — `getattr(sys.stdout, "encoding", None) or "utf-8"` appears character-identically in 3 files — extensions/github/scripts/python/resolve_tasks.py, scripts/python/check_prerequisites.py, scripts/python/setup_tasks.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 extensions/git/scripts/python/create_new_feature_branch.py:165 — `git_marker.is_dir() or git_marker.is_file()` appears character-identically in 2 files — extensions/git/scripts/python/create_new_feature_branch.py, extensions/git/scripts/python/git_common.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 src/specify_cli/integrations/bob/__init__.py:228 — `has_managed_commands and not has_managed_skills` appears character-identically in 2 files — src/specify_cli/integrations/bob/__init__.py, src/specify_cli/integrations/copilot/__init__.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.
X7 · Silent fallback defaults · Silent fallback default on parse failure · ×8
  • Silent fallback default on parse failure extensions/git/scripts/python/create_new_feature_branch.py:347 — `read_git_config_value` returns `''` when `(OSError, 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 extensions/github/scripts/python/resolve_tasks.py:118 — `read_feature_json_feature_directory` returns `''` when `(OSError, UnicodeError, json.JSONDecodeError)` 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 scripts/python/common.py:89 — `read_feature_json_feature_directory` returns `''` when `(OSError, UnicodeError, json.JSONDecodeError)` 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 scripts/python/common.py:208 — `_normalize_priority` returns `10` when `(TypeError, ValueError, OverflowError)` 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 scripts/python/common.py:700 — `get_invoke_separator` returns `'.'` when `(OSError, UnicodeError, json.JSONDecodeError)` 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 src/specify_cli/_init_options.py:36 — `load_init_options` returns `{}` when `(json.JSONDecodeError, OSError, UnicodeError)` 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 src/specify_cli/artifacts/catalog.py:186 — `_describe_artifact_file` returns `''` when `(OSError, 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 src/specify_cli/authentication/config.py:255 — `find_entries_for_url` 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.
M4 · Documentation accuracy · README/code drift · ×7
  • README/code drift CONTRIBUTING.md:189 — CONTRIBUTING.md names `docs/2677-branch-naming-convention`, but no file or folder `docs/2677-branch-naming-convention` 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 docs/local-development.md:82 — docs/local-development.md documents the environment variable `SPEC_KIT_SRC`, but no code, script or configuration file names it. 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 docs/community/workflow-steps.md:48 — docs/community/workflow-steps.md documents the environment variable `TYPESAFE_API_KEY`, but no code, script or configuration file names it. 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 docs/community/workflow-steps.md:134 — docs/community/workflow-steps.md names `docs/deploy.md`, but no file or folder `docs/deploy.md` 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 docs/guides/monorepo.md:51 — docs/guides/monorepo.md changes into `apps/web`, 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 docs/install/uv.md:25 — docs/install/uv.md runs `powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1`, but `https:/astral.sh/uv/install.ps1` does not exist. 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 docs/reference/presets.md:80 — docs/reference/presets.md names `docs/api.md`, but no file or folder `docs/api.md` 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.
D7 · Architectural Integrity · Checkable ADR rule enforced only by prose · ×2
  • Checkable ADR rule enforced only by prose: Specify CLI Command Architecture design/cli.md — ADR 'Specify CLI Command Architecture' declares `enforcement: prose` but states a rule a test or analyzer can check: "Do not rely on filesystem discovery to import arbitrary modules, because command exposure should remain reviewable in one place." Nothing in the build fails when the code breaks it — add an architecture test or analyzer (and `enforcement: test|analyzer` with an `enforcement_link`).
  • Checkable ADR rule enforced only by prose: Extension Architecture design/extension.md — ADR 'Extension Architecture' declares `enforcement: prose` but states a rule a test or analyzer can check: "It does not register Python plugins, replace CLI handlers, or import executable package code." Nothing in the build fails when the code breaks it — add an architecture test or analyzer (and `enforcement: test|analyzer` with an `enforcement_link`).
D16 · Bus Factor · Off-boarding risk · ×1
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 14 significant file(s) lose their only recent owner: src/specify_cli/workflows/command_add.py, src/specify_cli/presets/command_add.py, src/specify_cli/integrations/command_info.py, src/specify_cli/bundles/_commands.py, src/specify_cli/workflows/command_info.py, src/specify_cli/command_version.py, src/specify_cli/extensions/command_enable.py, src/specify_cli/integrations/command_list.py (+6 more). Pair on, review, or document these before any departure.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 1 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 (16 single-owned of 190 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; 190 of the 279 production source files in this repository met that bar). They are anonymized user #2 (2 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: extensions/git/scripts/python/initialize_repo.py, extensions/git/scripts/python/git_common.py.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 1 of 1 project(s) overshoot their size bounds, lowering Project Cohesion to 0.0/10. The most over is `(repository root)` (65784 LoC, 532 module-visible types across 81 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
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · ADRs not easily discoverable · ×1
  • ADRs not easily discoverable — 5 ADR-shaped document(s) detected by content — `design/cli.md`, `design/extension.md`, `design/mcp.md`, `design/shared.md`, `extensions/assess/commands/speckit.assess.decide.md`. They are not under a conventional ADR folder (docs/adr/) and are not named NNNN-title.md, and this check found them by their decision signature rather than by where they live — so a reader who does not already know these paths has no route to them. Detected by content signature only: records kept outside the repository, or written without a Status/Decision/Consequences shape, are not visible to this check and are not counted here.
Minor — 1 finding(s)
D12 · Dependency Hygiene · Dependency hygiene PARTLY measured · ×1
  • Dependency hygiene PARTLY measured — Python dependencies read, no exact pin to grade for currency — This repository's Python dependencies were read: 10 shipped distribution(s) across 1 manifest(s) (3 development or optional declaration(s) excluded, because a consumer does not install them). Whether any of them is behind its current release is the dependency-CURRENCY question, and no declaration here carries an EXACT pin to ask it about — every one is a floor or a range, which installs the newest release it admits and therefore cannot be behind one. That is a healthy declaration style, NOT a defect and NOT a gap in this analyzer; there is simply no currency question to answer. This is NOT a finding that these dependencies are current or healthy. Lockfiles are deliberately not read (poetry.lock, uv.lock, Pipfile.lock, pdm.lock): the four disagree about dev/optional membership, and misreading one would charge a test-only package a consumer never receives. Known CVEs in the same dependency graph are a separate question, reported under D30.

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-2a19c4f665f84055921b3bec85f147e5/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-2a19c4f665f84055921b3bec85f147e5/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/watchdog-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off .16artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesnone (dependency manifest found, not scanned for vulnerabilities here)—none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Python pyproject.toml/requirements.txt (pip/uv/Poetry) — not scanned yet).0—
D31 · IaC & Container Securitytrivy—trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.0—
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.0—
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 Dependenciesnone (dependency manifest found, not scanned for vulnerabilities here)—none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Python pyproject.toml/requirements.txt (pip/uv/Poetry) — not scanned yet).0—

Run 01a166ef-0932-71bb-adc8-6caae8807c9d · 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