Public report — spec-kit, published 5 Aug 2026. Concrete security findings (CVE IDs, secret matches, dependency versions) are hidden in this version; ask the repo owner for the full report.
Watchdog 05-08-2026 @ 06:10 UTC Public
Code Health Audit

Github/spec-Kit

71% Strong
CriticalWeakAdequateStrongExemplary
lower third — near Adequate

Medium · 48,030 LoC · rebuild ~1.2 person-years · weakest lens: Code Health (66%)

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

21/22dimensions tool-verifieddeterministic · confidence 1.0 · 1 LLM-assisted, advisory
438findings with an exact file:lineof 448 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
22/94dimensions across the health lenses48030 LoC — wide & deep

Executive summary

Read through the Production lens — the standard calibration. *Green* means good enough to run in production. The score is absolute and comparable across repos.

github/spec-kit is in good overall health (71%), but at least one category below sits in Adequate-or-worse territory — most items are improvements, and the weakest category contains work to schedule, not shelve.

It is strongest in Architecture (100%) — the structure is clean and changes stay contained. Readiness (83%) is solid too.

The area that most needs attention is Code Health (66%) — changes there are slower and more error-prone.

Leadership focus, highest impact first: 'Architecture' / 'How it works' section to the root README (Documentation (README)); Record significant decisions one document per decision (Architecture documentation); 3 High finding(s) (Static Analysis (SAST)).

For scale: Medium (~48,030 production lines); rebuilding it from scratch would take roughly ~1.2 person-years (~1–3 engineers). Approximate, ±~30%.

It builds on a genuinely strong Architecture foundation (100%); the priorities above are the highest-leverage way to bring the rest up to that level.

How the score is built — each lens's share of the headline Width is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
Code Health 66% · 47% weightSecurity 71% · 26% weightMaturity 76% · 14% weightReadiness 83% · 8% weightArchitecture 100% · 4% weight

Raise Code Health 66 → 70 (the Healthy floor) ⇒ headline 71 → ~73.

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

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

  • D1 · PresetManager.register_enabled_presets_for_agent (cyclomatic 75) src/specify_cli/presets/__init__.py
  • D1 · events.install_integration_events (cyclomatic 35) src/specify_cli/events.py
  • D1 · PresetManager.unregister_agent_artifacts (cyclomatic 31) src/specify_cli/presets/__init__.py
  • D1 · _commands._install_workflow_package (cyclomatic 31) src/specify_cli/workflows/_commands.py
  • D1 · create_new_feature.main (cyclomatic 30) scripts/python/create_new_feature.py
  • D1 · _download_security.safe_extract_tar (cyclomatic 30) src/specify_cli/_download_security.py
  • D1 · PresetManager._unregister_skills_in_dir (cyclomatic 30) src/specify_cli/presets/__init__.py
  • D1 · _download_security._preflight_zip_central_directory (cyclomatic 26) src/specify_cli/_download_security.py
  • D1 · GateStep.execute (cyclomatic 26) src/specify_cli/workflows/steps/gate/__init__.py
  • D1 · _download_security.safe_extract_zip (cyclomatic 25) src/specify_cli/_download_security.py
  • D1 · events._find_command_template (cyclomatic 23) src/specify_cli/events.py
  • D1 · merge._traverse_and_apply (cyclomatic 22) src/specify_cli/workflows/overlays/merge.py
  • D1 · events.resolve_events (cyclomatic 20) src/specify_cli/events.py
  • D1 · events.collect_extension_events (cyclomatic 20) src/specify_cli/events.py
  • D1 · CommandStep.execute (cyclomatic 20) src/specify_cli/workflows/steps/command/__init__.py
  • D1 · _download_security.detect_archive_format (cyclomatic 19) src/specify_cli/_download_security.py
  • D1 · events._resolve_event_command_argv (cyclomatic 19) src/specify_cli/events.py
  • D1 · ExtensionManager._find_extension_skill_dirs (cyclomatic 19) src/specify_cli/extensions/__init__.py
  • D1 · ExtensionManager.scaffold_config (cyclomatic 19) src/specify_cli/extensions/__init__.py
  • D1 · PresetCatalog.download_pack (cyclomatic 19) src/specify_cli/presets/__init__.py
  • D1 · ExtensionCatalog.search (cyclomatic 18) src/specify_cli/extensions/__init__.py
  • D1 · ExtensionCatalog.download_extension (cyclomatic 18) src/specify_cli/extensions/__init__.py
  • D1 · _commands.extension_info (cyclomatic 18) src/specify_cli/extensions/_commands.py
  • D1 · PresetManager._infer_legacy_skill_provenance (cyclomatic 18) src/specify_cli/presets/__init__.py
  • D1 · PromptStep.execute (cyclomatic 18) src/specify_cli/workflows/steps/prompt/__init__.py
  • D1 · init._install_extension_during_init (cyclomatic 17) src/specify_cli/commands/init.py
  • D1 · ExtensionManager._extension_owned_skill_names (cyclomatic 17) src/specify_cli/extensions/__init__.py
  • D1 · _commands.extension_search (cyclomatic 17) src/specify_cli/extensions/_commands.py
  • D1 · ExtensionManager._get_skills_dir (cyclomatic 16) src/specify_cli/extensions/__init__.py
  • D1 · _migrate_commands._installed_presets_affecting_agent (cyclomatic 16) src/specify_cli/integrations/_migrate_commands.py
  • D1 · CopilotIntegration.is_skills_mode (cyclomatic 16) src/specify_cli/integrations/copilot/__init__.py
  • D1 · PresetManager._register_commands (cyclomatic 16) src/specify_cli/presets/__init__.py
  • D1 · _commands.preset_info (cyclomatic 16) src/specify_cli/presets/_commands.py
  • D1 · _commands.workflow_resume (cyclomatic 16) src/specify_cli/workflows/_commands.py
  • D1 · WorkflowEngine._run_fan_out (cyclomatic 16) src/specify_cli/workflows/engine.py
  • D1 · WorkflowEngine._coerce_input (cyclomatic 16) src/specify_cli/workflows/engine.py
  • D1 · ProjectOverlaySource.collect (cyclomatic 16) src/specify_cli/workflows/overlays/layer_sources.py
  • D1 · schema._parse_edit (cyclomatic 16) src/specify_cli/workflows/overlays/schema.py
  • D2 · PresetManager.register_enabled_presets_for_agent (cognitive 148) src/specify_cli/presets/__init__.py
  • D2 · PresetManager.unregister_agent_artifacts (cognitive 70) src/specify_cli/presets/__init__.py
  • D2 · create_new_feature.main (cognitive 65) scripts/python/create_new_feature.py
  • D2 · events.install_integration_events (cognitive 65) src/specify_cli/events.py
  • D2 · PresetManager._unregister_skills_in_dir (cognitive 65) src/specify_cli/presets/__init__.py
  • D2 · _download_security.safe_extract_tar (cognitive 54) src/specify_cli/_download_security.py
  • D2 · merge._traverse_and_apply (cognitive 53) src/specify_cli/workflows/overlays/merge.py
  • D2 · events.resolve_events (cognitive 51) src/specify_cli/events.py
  • D2 · events._find_command_template (cognitive 47) src/specify_cli/events.py
  • D2 · _download_security.safe_extract_zip (cognitive 46) src/specify_cli/_download_security.py
  • D2 · ExtensionCatalog.search (cognitive 44) src/specify_cli/extensions/__init__.py
  • D2 · _commands._install_workflow_package (cognitive 38) src/specify_cli/workflows/_commands.py
  • D2 · GateStep.execute (cognitive 37) src/specify_cli/workflows/steps/gate/__init__.py
  • D2 · events.collect_extension_events (cognitive 36) src/specify_cli/events.py
  • D2 · ExtensionManager._find_extension_skill_dirs (cognitive 36) src/specify_cli/extensions/__init__.py
  • D2 · ExtensionManager._extension_owned_skill_names (cognitive 36) src/specify_cli/extensions/__init__.py
  • D2 · PresetCatalog.search (cognitive 36) src/specify_cli/presets/__init__.py
  • D2 · PresetManager._infer_legacy_skill_provenance (cognitive 34) src/specify_cli/presets/__init__.py
  • D2 · _download_security._preflight_zip_central_directory (cognitive 33) src/specify_cli/_download_security.py
  • D2 · merge.find_step (cognitive 28) src/specify_cli/workflows/overlays/merge.py
  • D2 · events.validate_events (cognitive 27) src/specify_cli/events.py
  • D2 · PresetManager._delete_agent_preset_skills (cognitive 27) src/specify_cli/presets/__init__.py
  • D2 · merge._remove_sources_recursively (cognitive 27) src/specify_cli/workflows/overlays/merge.py
  • D2 · ExtensionManager.scaffold_config (cognitive 26) src/specify_cli/extensions/__init__.py
  • D2 · merge._record_sources_recursively (cognitive 26) src/specify_cli/workflows/overlays/merge.py
  • D2 · init._install_extension_during_init (cognitive 23) src/specify_cli/commands/init.py
  • D2 · CopilotIntegration.is_skills_mode (cognitive 23) src/specify_cli/integrations/copilot/__init__.py
  • D2 · ProjectOverlaySource.collect (cognitive 23) src/specify_cli/workflows/overlays/layer_sources.py
  • D2 · events._build_opencode_plugin (cognitive 22) src/specify_cli/events.py
  • D2 · GenericIntegration._resolve_commands_dir (cognitive 22) src/specify_cli/integrations/generic/__init__.py
  • D2 · common.resolve_template (cognitive 21) scripts/python/common.py
  • D2 · _download_security.detect_archive_format (cognitive 21) src/specify_cli/_download_security.py
  • D2 · _migrate_commands._installed_presets_affecting_agent (cognitive 21) src/specify_cli/integrations/_migrate_commands.py
  • D2 · AlquimiaAIIntegration._inject_frontmatter_flag (cognitive 21) src/specify_cli/integrations/alquimia/__init__.py
  • D2 · CommandStep.execute (cognitive 21) src/specify_cli/workflows/steps/command/__init__.py
  • D2 · events._resolve_event_command_argv (cognitive 20) src/specify_cli/events.py
  • D2 · ExtensionManager._get_skills_dir (cognitive 20) src/specify_cli/extensions/__init__.py
  • D2 · _commands.extension_enable (cognitive 19) src/specify_cli/extensions/_commands.py
  • D2 · AlquimiaAIIntegration.inject_argument_hint (cognitive 19) src/specify_cli/integrations/alquimia/__init__.py
  • D2 · StepListComposer._collect_base_step_ids (cognitive 19) src/specify_cli/workflows/overlays/composer.py
  • D2 · merge._all_base_step_ids (cognitive 19) src/specify_cli/workflows/overlays/merge.py
  • D2 · merge._init_sources_recursively (cognitive 19) src/specify_cli/workflows/overlays/merge.py
  • D2 · merge._build_attribution (cognitive 19) src/specify_cli/workflows/overlays/merge.py
  • D2 · PromptStep.execute (cognitive 19) src/specify_cli/workflows/steps/prompt/__init__.py
  • D2 · setup_plan.main (cognitive 18) scripts/python/setup_plan.py
  • D2 · PresetManager._merge_pack_registered_skills (cognitive 18) src/specify_cli/presets/__init__.py
  • D2 · PresetCatalog.download_pack (cognitive 18) src/specify_cli/presets/__init__.py
  • D2 · schema.validate_overlay_yaml (cognitive 18) src/specify_cli/workflows/overlays/schema.py
  • D2 · ExtensionCatalog.download_extension (cognitive 17) src/specify_cli/extensions/__init__.py
  • D2 · WorkflowCatalog._fetch_single_catalog (cognitive 17) src/specify_cli/workflows/catalog.py
  • D2 · merge.validate_edits (cognitive 17) src/specify_cli/workflows/overlays/merge.py
  • D2 · create_new_feature._parse_args (cognitive 16) scripts/python/create_new_feature.py
  • D2 · setup_tasks.main (cognitive 16) scripts/python/setup_tasks.py
  • D2 · DroidIntegration._inject_frontmatter_flag (cognitive 16) src/specify_cli/integrations/droid/__init__.py
  • D2 · schema._parse_edit (cognitive 16) src/specify_cli/workflows/overlays/schema.py
  • D3 · TooManyMethods: PresetManager src/specify_cli/presets/__init__.py
  • D3 · FileTooLong: integrations/_migrate_commands.py src/specify_cli/integrations/_migrate_commands.py
  • D3 · TooManyMethods: IntegrationBase src/specify_cli/integrations/base.py
  • D3 · TooManyMethods: ExtensionManager src/specify_cli/extensions/__init__.py
  • D4 · Duplicated block (32 lines × 2) src/specify_cli/workflows/catalog.py
  • D4 · Duplicated block (31 lines × 2) src/specify_cli/integrations/base.py
  • D4 · Duplicated block (29 lines × 2) src/specify_cli/extensions/__init__.py

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

Rebuild cost & value ~ Modeled — €60,000–€300,000
Cost to rebuild€60,000–€300,000 (0.6–1.9 person-years (993–3,151 h), ~1–3 engineers)
Domain complexityStandard — harder problems cost more per line
Quality factor1.0× (at 71% quality) — the last 20% of quality is most of the work
Size & shapeMedium · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)

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

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

Top priorities

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

1
Resolve the 3 High finding(s) in Static Analysis (SAST) — start with publish-pypi.yml (2), dependabot.yml.
+1.7 pts · Low effort · Static Analysis (SAST)
2
Resolve the 1 No SBOM finding(s) in Supply-chain Provenance & Signing.
+1.5 pts · Low effort · Supply-chain Provenance & Signing
3
Resolve the 1 No artifact signing finding(s) in Supply-chain Provenance & Signing.
+1.5 pts · Low effort · Supply-chain Provenance & Signing

Diagnosis — what's actually going on

The top fix pays for itself · High · Economics
The top-ranked fix costs roughly 1–3 engineer-days once. Not doing it costs about 82.2–493 engineer-days every year, paid as drag on the ~633,198 lines this team changes annually — a bill that arrives whether or not anyone books it. On those figures the fix breaks even in roughly 1–2 months and is free after that. Method, stated so this is not read as a quotation: debt from the ranked task's effort band; interest = annual changed lines (measured, annualised from the 90-day window) ÷ an ASSUMED 150–400 lines per engineer-day × the 5–12% drag implied by the code-quality signals; breaking point = debt ÷ annual interest. A modelled planning range built from measured inputs and one named assumption — not a quotation, a valuation, or a certified figure.
Evidence: D15 churn: 156,131 line(s) changed over a 90-day window ⇒ ~633,198/year · D1/D2/D4 code quality: averaging 5.9/10 ⇒ a 5–12% drag on each change · top-ranked remediation: Low effort ⇒ about 1–3 engineer-day(s)
→ Do the top-ranked fix now if this code will still be yours in 2 months.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Add an 'Architecture' / 'How it works' section to the root README — the high-level shape. The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 5.9/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 5–12% more than in clean code, and the tax compounds as the codebase grows. (A modelled estimate, not a measured fact.)
Evidence: D1/D2/D4 code quality: averaging 5.9/10 across the code-quality signals actually measured
→ Pay it down where churn is highest — the hotspots — not everywhere; that's where the tax is actually paid.

Architecture — module dependency matrix

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

…te_new_feature_branch…n.check_prerequisitesscripts.python.common…on.create_new_feature…ify_cli._init_options….specify_cli._version…authentication.config…undler.models.catalog…ndler.models.manifest….specify_cli.catalogs…integrations.manifest…fy_cli.workflows.base…verlays.layer_sources…gration_base_markdown…tegration_base_skills…integration_base_toml…ns.git.scripts.pythonscripts.python…i.authentication.base…undler.models.records…er.services.installer…r.services.primitives…cli.integrations.base…_cli.workflows.enginesrc.specify_cli…tication.azure_devops…fy_cli.bundler.models…_cli.bundler.services…_cli.integrations.agy…_cli.integrations.bob…li.integrations.cline….integrations.copilot…li.integrations.forge….integrations.generic…i.integrations.hermes…cli.integrations.kimi….integrations.rovodev…cli.integrations.vibe…specify_cli.workflows…li.workflows.overlays…te_new_feature_branch1…n.check_prerequisites2scripts.python.common3…on.create_new_feature4…ify_cli._init_options5….specify_cli._version6…authentication.config7…undler.models.catalog8…ndler.models.manifest9….specify_cli.catalogs10…integrations.manifest11…fy_cli.workflows.base12…verlays.layer_sources13…gration_base_markdown14…tegration_base_skills15…integration_base_toml16…ns.git.scripts.python17scripts.python18…i.authentication.base19…undler.models.records20…er.services.installer21…r.services.primitives22…cli.integrations.base23…_cli.workflows.engine24src.specify_cli25…tication.azure_devops26…fy_cli.bundler.models27…_cli.bundler.services28…_cli.integrations.agy29…_cli.integrations.bob30…li.integrations.cline31….integrations.copilot32…li.integrations.forge33….integrations.generic34…i.integrations.hermes35…cli.integrations.kimi36….integrations.rovodev37…cli.integrations.vibe38…specify_cli.workflows39…li.workflows.overlays401111111551133112113211512111141113111212121112111+169 more modules (most-connected shown)

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

At a glance — Architecture · 100% · Exemplary

At a glance — Maturity · 76% · Strong

At a glance — Readiness · 83% · Strong

At a glance — Security · 71% · Adequate · gated by 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
A03:2021 — Injection4High / Critical

Roadmap

Begin by enhancing the root README with a clear 'Architecture' or 'How it works' section to improve high-level documentation. Next, establish a structured approach to record significant architectural decisions as dated, context-rich documents in a dedicated directory. Then, address the three high-priority static analysis findings, starting with the publish-pypi and dependabot configurations. Finally, ensure supply chain security by generating an SBOM and implementing artifact signing to verify provenance.

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

Do thisHelpsEffortDimension
Resolve the 3 High finding(s) in Static Analysis (SAST) — start with publish-pypi.yml (2), dependabot.yml.+1.7 ptsLowStatic Analysis (SAST)
Resolve the 1 No SBOM finding(s) in Supply-chain Provenance & Signing.+1.5 ptsLowSupply-chain Provenance & Signing
Resolve the 1 No artifact signing finding(s) in Supply-chain Provenance & Signing.+1.5 ptsLowSupply-chain Provenance & Signing
Resolve the 1 No build provenance finding(s) in Supply-chain Provenance & Signing.+1.5 ptsLowSupply-chain Provenance & Signing
Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.+2.3 ptsMediumDocumentation (README)
Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree with `NNNN-title.md` names is the most discoverable form).+2.3 ptsMediumArchitecture documentation
Resolve the 15 FileTooLong finding(s) in God Classes — start with __init__.py (3), _commands.py (3), catalog.py (2).+1.5 ptsHighGod Classes
Resolve the 1 Low finding(s) in Static Analysis (SAST) — start with __init__.py.+0.7 ptsLowStatic Analysis (SAST)

File quality

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

FileScoreBandWorst signal
.github/workflows/publish-pypi.yml5.8MixedStatic Analysis (SAST): High: run-shell-injection
src/specify_cli/extensions/_commands.py7.0MixedCyclomatic Complexity: _commands.extension_update (cyclomatic 165)
src/specify_cli/presets/__init__.py7.0MixedCyclomatic Complexity: PresetManager.register_enabled_presets_for_agent (cyclomatic 75)
src/specify_cli/extensions/__init__.py7.0MixedCyclomatic Complexity: ExtensionManifest._validate (cyclomatic 67)
src/specify_cli/workflows/_commands.py7.0MixedCyclomatic Complexity: _commands.workflow_step_add (cyclomatic 53)
src/specify_cli/agents.py7.0MixedCyclomatic Complexity: CommandRegistrar.register_commands (cyclomatic 44)
src/specify_cli/integrations/catalog.py7.0MixedCyclomatic Complexity: IntegrationDescriptor._validate (cyclomatic 43)
src/specify_cli/events.py7.0MixedCyclomatic Complexity: events.install_integration_events (cyclomatic 35)
src/specify_cli/workflows/engine.py7.0MixedCyclomatic Complexity: engine.validate_workflow (cyclomatic 35)
src/specify_cli/_version.py7.0MixedCyclomatic Complexity: _version.self_upgrade (cyclomatic 32)
src/specify_cli/_download_security.py7.0MixedCyclomatic Complexity: _download_security.safe_extract_tar (cyclomatic 30)
src/specify_cli/presets/_commands.py7.0MixedCyclomatic Complexity: _commands.preset_add (cyclomatic 24)
src/specify_cli/workflows/overlays/merge.py7.0MixedCyclomatic Complexity: merge._traverse_and_apply (cyclomatic 22)
src/specify_cli/integrations/base.py7.0MixedCyclomatic Complexity: IntegrationBase.process_template (cyclomatic 20)
src/specify_cli/workflows/catalog.py7.0MixedCyclomatic Complexity: WorkflowRegistry.save (cyclomatic 16)
src/specify_cli/integrations/_migrate_commands.py7.0MixedCyclomatic Complexity: _migrate_commands.integration_upgrade (cyclomatic 32)
src/specify_cli/integrations/_install_commands.py7.0MixedCyclomatic Complexity: _install_commands.integration_uninstall (cyclomatic 26)
src/specify_cli/integrations/_query_commands.py7.0MixedCyclomatic Complexity: _query_commands.integration_list (cyclomatic 20)
src/specify_cli/workflows/steps/command/__init__.py7.0MixedCyclomatic Complexity: CommandStep.execute (cyclomatic 20)
src/specify_cli/shared_infra.py7.1MixedCyclomatic Complexity: shared_infra.install_shared_infra (cyclomatic 56)

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. 21 of 22 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 1 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.5 — 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 — 22 dimensions across the health lenses
D1D2D3D4D13D15D16D21D28D29D34D35D36D37M1M2M3M4P1P3P4P6

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, 438 of 448 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
jscpdCode duplication✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.302✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.302✓ 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 019fd08b-863f-7f0c-aa91-853ae374f70e.

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.

  • D19 Documentation Quality — LLM provider failed — The model provider returned an unusable result, so this LLM-assisted dimension fell back to a measurement gap (confidence 0) rather than a penalty. Re-run with a reachable provider to score it.
  • D30 Dependency Vulnerabilities — scanner not present in this environment — The backing tool was not installed where this scan ran, so this dimension was not scored. Install the tool (or run in the hosted environment, where it is always present) for a graded result.

Repo exclusion declarations: 1 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 (jscpd) — 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.
  • 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").
  • 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.
  • 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.
  • 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.
  • 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 (2): D21, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score (documentation, ADR quality, naming, comment value, onboarding) — D25 sets the ADR-conformance fraction over sampled code, D22 judges API accuracy over a sample. These 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 Complexity5.5 / 10Adequate✓ Tool-verified

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

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

Maturity: DocumentedVerifiedPrevented · effective 5.5 / 10 · rule-coverage 100% · ceiling Prevented

106 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was _commands.extension_update at 165.

_commands.extension_update (cyclomatic 165)src/specify_cli/extensions/_commands.py:1508
PresetManager.register_enabled_presets_for_agent (cyclomatic 75)src/specify_cli/presets/__init__.py:961
ExtensionManifest._validate (cyclomatic 67)src/specify_cli/extensions/__init__.py:255
ExtensionManager.install_from_directory (cyclomatic 64)src/specify_cli/extensions/__init__.py:1898
shared_infra.install_shared_infra (cyclomatic 56)src/specify_cli/shared_infra.py:388

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

What to do

  1. Resolve the 1 _commands.extension_update (cyclomatic 165) finding(s) in Cyclomatic Complexity — start with _commands.py. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 PresetManager.register_enabled_presets_for_agent (cyclomatic 75) finding(s) in Cyclomatic Complexity — start with __init__.py. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 ExtensionManifest._validate (cyclomatic 67) finding(s) in Cyclomatic Complexity — start with __init__.py. — One of this dimension's main actionable groups (1 warning-level).
  4. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D2 · Cognitive Complexity3.5 / 10Weak✓ 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: DocumentedVerifiedPrevented · effective 3.5 / 10 · rule-coverage 100% · ceiling Prevented

184 method(s) exceeded the cognitive complexity threshold of 15; the worst was _commands.extension_update at 455.

_commands.extension_update (cognitive 455)src/specify_cli/extensions/_commands.py:1508
PresetManager._reconcile_composed_commands (cognitive 162)src/specify_cli/presets/__init__.py:1626
shared_infra.install_shared_infra (cognitive 159)src/specify_cli/shared_infra.py:388
PresetManager.register_enabled_presets_for_agent (cognitive 148)src/specify_cli/presets/__init__.py:961
PresetResolver.collect_all_layers (cognitive 133)src/specify_cli/presets/__init__.py:5311

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

What to do

  1. Resolve the 1 _commands.extension_update (cognitive 455) finding(s) in Cognitive Complexity — start with _commands.py. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 PresetManager._reconcile_composed_commands (cognitive 162) finding(s) in Cognitive Complexity — start with __init__.py. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 shared_infra.install_shared_infra (cognitive 159) finding(s) in Cognitive Complexity — start with shared_infra.py. — One of this dimension's main actionable groups (1 warning-level).
  4. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D3 · God Classes8.5 / 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: DocumentedVerifiedPrevented · effective 8.5 / 10 · rule-coverage 100% · ceiling Prevented

18 god class(es) detected.

FileTooLong: presets/__init__.py · ×15src/specify_cli/presets/__init__.py:0
TooManyMethods: PresetManager · ×3src/specify_cli/presets/__init__.py:752

What to do

  1. Resolve the 15 FileTooLong finding(s) in God Classes — start with __init__.py (3), _commands.py (3), catalog.py (2). — One of this dimension's main actionable groups (15 warning-level).
  2. Resolve the 3 TooManyMethods finding(s) in God Classes — start with __init__.py (2), base.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: DocumentedVerifiedPrevented · effective 8.8 / 10 · rule-coverage 100% · ceiling Verified

116 duplicated block group(s) detected.

Duplicated block (10 lines × 2) · ×12src/specify_cli/bundler/services/primitives.py:200
Duplicated block (13 lines × 2) · ×11src/specify_cli/_version.py:534
Duplicated block (12 lines × 2) · ×9src/specify_cli/_download_security.py:675
Duplicated block (8 lines × 2) · ×9scripts/python/check_prerequisites.py:95
Duplicated block (11 lines × 2) · ×8src/specify_cli/bundler/commands_impl/catalog_config.py:56

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

What to do

  1. Resolve the 12 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with __init__.py (3), _commands.py (3), catalog.py (3). — One of this dimension's main actionable groups (12 warning-level).
  2. Resolve the 11 Duplicated block (13 lines × 2) finding(s) in Code Duplication — start with __init__.py (3), events.py (2), _commands.py (2). — One of this dimension's main actionable groups (11 warning-level).
  3. Resolve the 9 Duplicated block (12 lines × 2) finding(s) in Code Duplication — start with __init__.py (4), base.py (2), catalog.py (2). — One of this dimension's main actionable groups (9 warning-level).
  4. Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

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: DocumentedVerifiedPrevented · 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.

D15 · Churn × Complexity Hotspots9.2 / 10Exemplary✓ 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: DocumentedVerifiedPrevented · effective 9.2 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: src/specify_cli/extensions/_commands.py (16×165=2640); src/specify_cli/extensions/__init__.py (37×67=2479); src/specify_cli/presets/__init__.py (32×75=2400)

Hotspot: src/specify_cli/extensions/_commands.py · ×10src/specify_cli/extensions/_commands.py

✓ On the Gold path — maintain.

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

D16 · Bus Factor9.5 / 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: DocumentedVerifiedPrevented · effective 9.5 / 10 · rule-coverage 100% · ceiling Documented

5 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is src/specify_cli/integration_status.py.

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.

D21 · Naming Consistency / 10Exemplary◐ 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: DocumentedVerifiedPrevented · 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.

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: Git-history secret scan via gitleaks detect over full history in an isolated checkout; each match flagged High. Exhaustive; degrades cleanly when tool absent.

Maturity: DocumentedVerifiedPrevented · 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)5.9 / 10Adequate✓ 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: DocumentedVerifiedPrevented · effective 5.9 / 10 · rule-coverage 100% · ceiling Documented

4 finding(s): 0 critical, 3 high, 0 medium, 1 low.

High: dependabot-missing-cooldown · ×3.github/dependabot.yml:2detected by semgrep finding
Low: subprocess-shell-truesrc/specify_cli/workflows/steps/shell/__init__.py:58detected by semgrep finding

What to do

  1. Resolve the 3 High finding(s) in Static Analysis (SAST) — start with publish-pypi.yml (2), dependabot.yml. — One of this dimension's main actionable groups (3 issue-level).
  2. Resolve the 1 Low finding(s) in Static Analysis (SAST) — start with __init__.py. — One of this dimension's main actionable groups (1 recommendation-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: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

Every significant source file has living knowledge — recently and meaningfully worked.

✓ On the Gold path — maintain.

Detailed fixes: d34_recommendation.md.

D35 · Change Coupling10.0 / 10Exemplary✓ 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; coupling through a build step, config, or non-source file isn't seen.

Maturity: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No strong hidden change-coupling between production files.

✓ On the Gold path — maintain.

Detailed fixes: d35_recommendation.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: DocumentedVerifiedPrevented · effective 2.5 / 10 · rule-coverage 100% · ceiling Documented

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

No build provenance
No artifact signing
No SBOM

What to do

  1. Resolve the 1 No build provenance finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
  2. Resolve the 1 No artifact signing finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
  3. Resolve the 1 No SBOM 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: DocumentedVerifiedPrevented · 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.

Frontend & cross-cutting dimensions

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

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

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

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

What to do

  • Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
M2 · Architecture documentation5.0 / 10Adequate✓ Tool-verified

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

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

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

What to do

  • Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree with `NNNN-title.md` names is the most discoverable form).
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

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

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

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

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.

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 Health66%Adequate — gated by D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture100%ExemplaryStrongest area.
Maturity76%StrongSolid.
Readiness83%StrongSolid.
Security71%Adequate — gated by D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Not included — 72 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 — no DI registrations detected
  • AX10 Code composition — not assessed — code composition is computed by ROLE over a document set that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX2 Stateful singletons — no singleton implementations detected
  • AX3 Project dependency cycles — not assessed — project cycles and dependency direction are computed over a project-reference graph 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
  • AX4 Dependency direction — not assessed — project cycles and dependency direction are computed over a project-reference graph that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — not assessed — test isolation is computed from a project graph (which projects are test projects, and what they reference) 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
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • D10 Test Quality — ~84381 lines of test source are present (.py) but the test-quality collector reads C# only, 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 hygiene not measured — dependency manifest found but not parsed for hygiene
  • D14 License Compliance — Not scored — this repository's package manifest is not parsed for licence data yet. A gap in the analyzer's language coverage, NOT a finding that the repository's licenses are compliant (a Python pyproject.toml/requirements.txt (pip/uv/Poetry)), which this pass does not parse yet — so this dimension asserts nothing about this repository's licensing in either direction.
  • D17 Explicit Debt — explicit-debt markers are read through a C# workspace today, so they were not read for this repository's language — this asserts nothing about how many markers the code carries. Not scored — this is a gap in the analyzer, not a finding about this repository
  • 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.
  • D19 Documentation Quality — LLM evaluation failed
  • D20 ADR Quality — N/A — ADRs are expected on deployable products with a user-facing host, not consumed libraries; no ADR log is required here.
  • D22 Internal API Consistency — No exposed public API
  • D23 Boundary Type-Coupling — Production source is present (.py) but bounded contexts are resolved over the C#/VB project set, which exposed none, so context scope could not be assessed. Not scored — this is a gap in the analyzer, not a verdict about this repository. Declaring the codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed — see the recommendation on this dimension for where. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — No inline comments to assess — comment value is not applicable here.
  • D25 ADR Conformance — no ADRs to check
  • D26 Project Cohesion — Project cohesion is assessed over the .NET project set; this target exposed no projects, so project size and spread could not be assessed. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
  • D27 Navigability — No calls could be sampled, so navigability was not assessed — tracing effort is measured over resolved call sites and this target exposed none. Not scored — this is a gap in the analyzer's reach, 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) — where an OSV-supported manifest exists, dependency vulnerabilities for this repository are reported under D38 instead.
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Terraform, Kubernetes/Helm, CloudFormation); nothing to scan.
  • D32 Data Compliance (PII/GDPR) — No PII/GDPR-handling patterns detected (p/gdpr ruleset) — no data-compliance surface to assess.
  • D33 JS/npm Dependency Vulnerabilities — No JS/npm manifest or lockfile found outside build output (package.json, package-lock.json, yarn.lock, pnpm-lock.yaml, bun.lockb); no JS dependencies to scan.
  • D38 OSV Dependency Vulnerabilities — No supported non-.NET dependency lockfile found outside build output (npm package-lock/yarn/pnpm/bun, Go go.mod, Rust Cargo.lock, Maven pom.xml, Gradle lockfiles, Python requirements.txt/poetry.lock/Pipfile.lock/pdm.lock, PHP composer.lock, Ruby Gemfile.lock, Elixir mix.lock, Dart pubspec.lock, Swift Package.resolved); nothing for OSV to scan. A NuGet-only repo stays NotApplicable — .NET CVEs are D30's domain.
  • 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.
  • D5 Coupling — Inter-project coupling could not be assessed — no analyzable project graph was found for this repository. Not scored: a gap in the analyzer's reach, not a verdict about this repository. (Coupling here is Martin afferent/efferent/instability plus reference cycles across a project-reference graph, read today from .NET project files; other ecosystems' module graphs are not read yet.)
  • D6 Cohesion (LCOM4) — Cohesion (LCOM4) is measured over a C#/VB class graph, and this repository's production source is .py, which this pass does not read — so no class could be assessed. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage not included — suite not readable by the collector
  • D9 Test Distribution — Test source is present (.py) but the test-pyramid classifier reads C# only, so its unit/integration/BDD/E2E split couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this check looks for (39 value object(s))
  • ED1 Event-Driven — not scored — this repository shows none of the 3 signals this check 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 check looks for
  • GD1 Unfinished & placeholder code — no source files
  • 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, 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'.
  • P2 Observability — Observability was not assessed: this check reads a source model that does not carry this repository's product — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of a logging idiom this check recognises is NOT evidence that this repo lacks structured logging (it may log through its own ecosystem's logger). This is a gap in the analyzer, not a finding about this repository.
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
  • P7 Outbound HTTP resilience — not measured — the application kind could not be determined for this repo
  • P8 Schema migrations — not assessed — schema-migration practice is read from 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
  • 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`) into the repo working tree before the scan — a CI step is the usual place, since the artefact is commonly gitignored, or wire coverage collection into CI, to enable this cross-layer check
  • PF1 Benchmark discipline — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
  • PF2 Allocation hygiene — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
  • PF3 Async & latency hygiene — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • X1 Async correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X2 Cancellation propagation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X3 Exception handling — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository

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.

Issue — 3 finding(s)
D29 · Static Analysis (SAST) · High · ×3
  • High: dependabot-missing-cooldown .github/dependabot.yml:2 — This Dependabot configuration does not set a cooldown period. Newly published packages can be malicious or unstable. Add a `cooldown` block with `default-days: 7` to each `package-ecosystem` entry under `updates` to wait 7 days before proposing updates to newly published package versions. Reference: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#cooldown. This is a semgrep security-AUDIT rule reporting a POLICY that is absent or weaker than its recommendation, not an exploitable defect. Confirm whether the current setting is a deliberate decision for this repository — and apply the change where it is not; where it is (a policy your release process already enforces elsewhere, or one this repository has consciously opted out of), record the decision and leave the configuration as it is. This configuration file has 2 such entries; one cooldown decision clears them all — reported once.
  • High: run-shell-injection .github/workflows/publish-pypi.yml:22 — Using variable interpolation `${{...}}` with a workflow input in a `run:` step could allow an attacker to inject their own code into the runner. This would allow them to steal secrets and code. A workflow input is not bounded by this step and should be treated as untrusted. Instead, use an intermediate environment variable with `env:` to store the data and use the environment variable in the `run:` script. Reference it as a shell VARIABLE rather than a `${{ }}` interpolation, using your shell's own syntax (`"$ENVVAR"` in bash, `$env:ENVVAR` in PowerShell), so the value is passed as data and never re-expanded as code.
  • High: run-shell-injection .github/workflows/publish-pypi.yml:43 — Using variable interpolation `${{...}}` with a workflow input in a `run:` step could allow an attacker to inject their own code into the runner. This would allow them to steal secrets and code. A workflow input is not bounded by this step and should be treated as untrusted. Instead, use an intermediate environment variable with `env:` to store the data and use the environment variable in the `run:` script. Reference it as a shell VARIABLE rather than a `${{ }}` interpolation, using your shell's own syntax (`"$ENVVAR"` in bash, `$env:ENVVAR` in PowerShell), so the value is passed as data and never re-expanded as code.
Warning — 435 finding(s)
D3 · God Classes · FileTooLong · ×15
  • FileTooLong: presets/__init__.py src/specify_cli/presets/__init__.py:0 — FileTooLong — 3397 significant lines (blank, comment-only and punctuation-only lines excluded). 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/__init__.py src/specify_cli/extensions/__init__.py:0 — FileTooLong — 2784 significant lines (blank, comment-only and punctuation-only lines excluded). 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:0 — FileTooLong — 2711 significant lines (blank, comment-only and punctuation-only lines excluded). 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/_commands.py src/specify_cli/extensions/_commands.py:0 — FileTooLong — 1842 significant lines (blank, comment-only and punctuation-only lines excluded). 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/catalog.py src/specify_cli/workflows/catalog.py:0 — FileTooLong — 1006 significant lines (blank, comment-only and punctuation-only lines excluded). 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:0 — FileTooLong — 985 significant lines (blank, comment-only and punctuation-only lines excluded). 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:0 — FileTooLong — 974 significant lines (blank, comment-only and punctuation-only lines excluded). 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:0 — FileTooLong — 929 significant lines (blank, comment-only and punctuation-only lines excluded). 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:0 — FileTooLong — 805 significant lines (blank, comment-only and punctuation-only lines excluded). 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: commands/init.py src/specify_cli/commands/init.py:0 — FileTooLong — 759 significant lines (blank, comment-only and punctuation-only lines excluded). 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: bundle/__init__.py src/specify_cli/commands/bundle/__init__.py:0 — FileTooLong — 709 significant lines (blank, comment-only and punctuation-only lines excluded). 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/_migrate_commands.py src/specify_cli/integrations/_migrate_commands.py:0 — FileTooLong — 627 significant lines (blank, comment-only and punctuation-only lines excluded). 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/_commands.py src/specify_cli/presets/_commands.py:0 — FileTooLong — 610 significant lines (blank, comment-only and punctuation-only lines excluded). 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/catalog.py src/specify_cli/integrations/catalog.py:0 — FileTooLong — 542 significant lines (blank, comment-only and punctuation-only lines excluded). 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:0 — FileTooLong — 518 significant lines (blank, comment-only and punctuation-only lines excluded). 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.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×12
  • Duplicated block (10 lines × 2) src/specify_cli/bundler/services/primitives.py:200 — src/specify_cli/bundler/services/primitives.py:200-209 | src/specify_cli/bundler/services/primitives.py:283-294 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) src/specify_cli/events.py:2027 — src/specify_cli/events.py:2027-2036 | src/specify_cli/events.py:2115-2127 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) src/specify_cli/extensions/__init__.py:2274 — src/specify_cli/extensions/__init__.py:2274-2287 | src/specify_cli/extensions/__init__.py:2308-2317 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) src/specify_cli/extensions/_commands.py:285 — src/specify_cli/extensions/_commands.py:285-294 | src/specify_cli/extensions/_commands.py:353-362 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/specify_cli/extensions/_commands.py:285` 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/extensions/_commands.py:444 — src/specify_cli/extensions/_commands.py:444-453 | src/specify_cli/presets/_commands.py:683-692 — 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/_migrate_commands.py:78 — src/specify_cli/integrations/_migrate_commands.py:78-87 | src/specify_cli/integrations/_migrate_commands.py:106-115 — both copies are in the same file, so extract the 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/integrations/_migrate_commands.py:78` 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 (10 lines × 2) src/specify_cli/presets/__init__.py:1591 — src/specify_cli/presets/__init__.py:1591-1600 | src/specify_cli/presets/__init__.py:2082-2091 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) src/specify_cli/workflows/_commands.py:2189 — src/specify_cli/workflows/_commands.py:2189-2198 | src/specify_cli/workflows/_commands.py:3166-3177 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) src/specify_cli/workflows/catalog.py:491 — src/specify_cli/workflows/catalog.py:491-500 | src/specify_cli/workflows/catalog.py:1186-1195 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) src/specify_cli/workflows/catalog.py:628 — src/specify_cli/workflows/catalog.py:628-637 | src/specify_cli/workflows/catalog.py:1319-1328 — both copies are in the same file, so extract the 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 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 (10 lines × 2) src/specify_cli/workflows/catalog.py:805 — src/specify_cli/workflows/catalog.py:805-814 | src/specify_cli/workflows/catalog.py:1484-1495 — both copies are in the same file, so extract the 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/catalog.py:805` 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/steps/command/__init__.py:46 — src/specify_cli/workflows/steps/command/__init__.py:46-60 | src/specify_cli/workflows/steps/command/__init__.py:117-126 — both copies are in the same file, so extract the 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/steps/command/__init__.py:46` 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 (13 lines × 2) · ×11
  • Duplicated block (13 lines × 2) src/specify_cli/_version.py:534 — src/specify_cli/_version.py:534-546 | src/specify_cli/_version.py:554-566 — both copies are in the same file, so extract the 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/_version.py:534` 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.
  • Duplicated block (13 lines × 2) src/specify_cli/bundler/lib/yamlio.py:153 — src/specify_cli/bundler/lib/yamlio.py:153-165 | src/specify_cli/workflows/catalog.py:184-196 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/specify_cli/workflows/catalog.py:184` 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 (13 lines × 2) src/specify_cli/events.py:1399 — src/specify_cli/events.py:1399-1412 | src/specify_cli/events.py:1430-1442 — both copies are in the same file, so extract the 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/events.py:2062 — src/specify_cli/events.py:2062-2074 | src/specify_cli/events.py:2307-2323 — both copies are in the same file, so extract the 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 (13 lines × 2) src/specify_cli/extensions/__init__.py:3920 — src/specify_cli/extensions/__init__.py:3920-3932 | src/specify_cli/presets/__init__.py:4602-4614 — 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:3920` 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 (13 lines × 2) src/specify_cli/integrations/_install_commands.py:227 — src/specify_cli/integrations/_install_commands.py:227-239 | src/specify_cli/integrations/_migrate_commands.py:599-611 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (13 lines × 2) src/specify_cli/integrations/base.py:1796 — src/specify_cli/integrations/base.py:1796-1808 | src/specify_cli/integrations/hermes/__init__.py:164-176 — 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:1796` 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 (13 lines × 2) src/specify_cli/presets/__init__.py:2892 — src/specify_cli/presets/__init__.py:2892-2904 | src/specify_cli/presets/__init__.py:3228-3240 — both copies are in the same file, so extract the 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 (13 lines × 2) src/specify_cli/presets/__init__.py:3406 — src/specify_cli/presets/__init__.py:3406-3418 | src/specify_cli/presets/__init__.py:3454-3466 — both copies are in the same file, so extract the 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/workflows/_commands.py:1897 — src/specify_cli/workflows/_commands.py:1897-1909 | src/specify_cli/workflows/_commands.py:2134-2146 — both copies are in the same file, so extract the 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/workflows/overlays/_commands.py:81 — src/specify_cli/workflows/overlays/_commands.py:81-93 | src/specify_cli/workflows/overlays/_commands.py:138-150 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D15 · Churn × Complexity Hotspots · Hotspot · ×10
  • Hotspot: src/specify_cli/extensions/_commands.py src/specify_cli/extensions/_commands.py — src/specify_cli/extensions/_commands.py changed 16 times in last 90 days, max complexity 165. 9 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
  • Hotspot: src/specify_cli/extensions/__init__.py src/specify_cli/extensions/__init__.py — src/specify_cli/extensions/__init__.py changed 37 times in last 90 days, max complexity 67. 29 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
  • Hotspot: src/specify_cli/presets/__init__.py src/specify_cli/presets/__init__.py — src/specify_cli/presets/__init__.py changed 32 times in last 90 days, max complexity 75. 27 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
  • Hotspot: src/specify_cli/agents.py src/specify_cli/agents.py — src/specify_cli/agents.py changed 27 times in last 90 days, max complexity 44. 19 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
  • Hotspot: src/specify_cli/__init__.py src/specify_cli/__init__.py — src/specify_cli/__init__.py changed 53 times in last 90 days, max complexity 21. 21 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
  • Hotspot: src/specify_cli/workflows/_commands.py src/specify_cli/workflows/_commands.py — src/specify_cli/workflows/_commands.py changed 20 times in last 90 days, max complexity 53. 13 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
  • Hotspot: src/specify_cli/workflows/engine.py src/specify_cli/workflows/engine.py — src/specify_cli/workflows/engine.py changed 25 times in last 90 days, max complexity 35. 14 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
  • Hotspot: src/specify_cli/shared_infra.py src/specify_cli/shared_infra.py — src/specify_cli/shared_infra.py changed 12 times in last 90 days, max complexity 56. 9 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
  • Hotspot: src/specify_cli/integrations/base.py src/specify_cli/integrations/base.py — src/specify_cli/integrations/base.py changed 25 times in last 90 days, max complexity 20. 12 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
  • Hotspot: src/specify_cli/workflows/expressions.py src/specify_cli/workflows/expressions.py — src/specify_cli/workflows/expressions.py changed 15 times in last 90 days, max complexity 29. 12 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×9
  • Duplicated block (12 lines × 2) src/specify_cli/_download_security.py:675 — src/specify_cli/_download_security.py:675-686 | src/specify_cli/_download_security.py:792-803 — both copies are in the same file, so extract the 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:675` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) src/specify_cli/extensions/__init__.py:2560 — src/specify_cli/extensions/__init__.py:2560-2573 | src/specify_cli/presets/__init__.py:3689-3700 — 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:2560` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) src/specify_cli/extensions/__init__.py:4021 — src/specify_cli/extensions/__init__.py:4021-4032 | src/specify_cli/presets/__init__.py:4701-4712 — 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:4021` 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.
  • Duplicated block (12 lines × 2) src/specify_cli/integrations/base.py:1162 — src/specify_cli/integrations/base.py:1162-1173 | src/specify_cli/integrations/base.py:1366-1377 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) src/specify_cli/integrations/base.py:1716 — src/specify_cli/integrations/base.py:1716-1734 | src/specify_cli/integrations/hermes/__init__.py:115-126 — 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:1716` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) src/specify_cli/integrations/catalog.py:403 — src/specify_cli/integrations/catalog.py:403-414 | src/specify_cli/integrations/catalog.py:516-528 — both copies are in the same file, so extract the 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 (12 lines × 2) src/specify_cli/presets/__init__.py:2780 — src/specify_cli/presets/__init__.py:2780-2791 | src/specify_cli/presets/__init__.py:3451-3462 — both copies are in the same file, so extract the 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/__init__.py:2780` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) src/specify_cli/presets/__init__.py:3236 — src/specify_cli/presets/__init__.py:3236-3247 | src/specify_cli/presets/__init__.py:3328-3339 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) src/specify_cli/workflows/catalog.py:406 — src/specify_cli/workflows/catalog.py:406-417 | src/specify_cli/workflows/catalog.py:1101-1112 — both copies are in the same file, so extract the 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/catalog.py:406` 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 (8 lines × 2) · ×9
  • Duplicated block (8 lines × 2) scripts/python/check_prerequisites.py:95 — scripts/python/check_prerequisites.py:95-102 | scripts/python/setup_tasks.py:46-53 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (8 lines × 2) src/specify_cli/agents.py:969 — src/specify_cli/agents.py:969-979 | src/specify_cli/extensions/__init__.py:1568-1575 — 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/catalogs.py:166 — src/specify_cli/catalogs.py:166-175 | src/specify_cli/presets/__init__.py:4263-4270 — 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 (8 lines × 2) src/specify_cli/extensions/_commands.py:560 — src/specify_cli/extensions/_commands.py:560-567 | src/specify_cli/presets/_commands.py:814-821 — 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/extensions/_commands.py:1079 — src/specify_cli/extensions/_commands.py:1079-1086 | src/specify_cli/extensions/_commands.py:2589-2596 — both copies are in the same file, so extract the 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:1079` 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 (8 lines × 2) src/specify_cli/integrations/_install_commands.py:52 — src/specify_cli/integrations/_install_commands.py:52-59 | src/specify_cli/integrations/_migrate_commands.py:245-252 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (8 lines × 2) src/specify_cli/presets/_commands.py:512 — src/specify_cli/presets/_commands.py:512-520 | src/specify_cli/workflows/_commands.py:3675-3682 — 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/_commands.py:3675` 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.
  • Duplicated block (8 lines × 2) src/specify_cli/workflows/catalog.py:420 — src/specify_cli/workflows/catalog.py:420-427 | src/specify_cli/workflows/catalog.py:1115-1122 — both copies are in the same file, so extract the 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/catalog.py:420` 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 (8 lines × 2) src/specify_cli/workflows/overlays/merge.py:72 — src/specify_cli/workflows/overlays/merge.py:72-79 | src/specify_cli/workflows/overlays/merge.py:87-94 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×8
  • Duplicated block (11 lines × 2) src/specify_cli/bundler/commands_impl/catalog_config.py:56 — src/specify_cli/bundler/commands_impl/catalog_config.py:56-66 | src/specify_cli/bundler/models/catalog.py:291-301 — 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/bundler/commands_impl/catalog_config.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. 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 lines × 2) src/specify_cli/bundler/services/adapters.py:77 — src/specify_cli/bundler/services/adapters.py:77-87 | src/specify_cli/commands/bundle/__init__.py:872-882 — 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/extensions/__init__.py:1660 — src/specify_cli/extensions/__init__.py:1660-1671 | src/specify_cli/extensions/__init__.py:1834-1844 — both copies are in the same file, so extract the 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/__init__.py:1660` 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/alquimia/__init__.py:47 — src/specify_cli/integrations/alquimia/__init__.py:47-57 | src/specify_cli/integrations/claude/__init__.py:117-127 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) src/specify_cli/workflows/_commands.py:3290 — src/specify_cli/workflows/_commands.py:3290-3300 | src/specify_cli/workflows/_commands.py:3503-3514 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) src/specify_cli/workflows/catalog.py:382 — src/specify_cli/workflows/catalog.py:382-393 | src/specify_cli/workflows/catalog.py:1078-1088 — both copies are in the same file, so extract the 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/catalog.py:382` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) src/specify_cli/workflows/catalog.py:1396 — src/specify_cli/workflows/catalog.py:1396-1406 | src/specify_cli/workflows/catalog.py:1465-1475 — both copies are in the same file, so extract the 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 (11 lines × 2) src/specify_cli/workflows/engine.py:996 — src/specify_cli/workflows/engine.py:996-1006 | src/specify_cli/workflows/engine.py:1076-1086 — both copies are in the same file, so extract the 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) · ×6
  • Duplicated block (15 lines × 2) src/specify_cli/agents.py:845 — src/specify_cli/agents.py:845-861 | src/specify_cli/agents.py:925-939 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) src/specify_cli/extensions/__init__.py:4155 — src/specify_cli/extensions/__init__.py:4155-4169 | src/specify_cli/presets/__init__.py:4847-4861 — 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:4155` 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 (15 lines × 2) src/specify_cli/extensions/_commands.py:515 — src/specify_cli/extensions/_commands.py:515-529 | src/specify_cli/presets/_commands.py:761-775 — 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 (15 lines × 2) src/specify_cli/workflows/_commands.py:1844 — src/specify_cli/workflows/_commands.py:1844-1858 | src/specify_cli/workflows/_commands.py:2486-2500 — both copies are in the same file, so extract the 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/_commands.py:1844` 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 (15 lines × 2) src/specify_cli/workflows/steps/command/__init__.py:135 — src/specify_cli/workflows/steps/command/__init__.py:135-151 | src/specify_cli/workflows/steps/prompt/__init__.py:105-119 — 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/steps/command/__init__.py:135` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 2) src/specify_cli/workflows/steps/command/__init__.py:259 — src/specify_cli/workflows/steps/command/__init__.py:259-273 | src/specify_cli/workflows/steps/prompt/__init__.py:278-292 — 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/steps/command/__init__.py:259` 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 (14 lines × 2) · ×6
  • Duplicated block (14 lines × 2) src/specify_cli/_download_security.py:979 — src/specify_cli/_download_security.py:979-996 | src/specify_cli/_download_security.py:1163-1176 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) src/specify_cli/extensions/__init__.py:4136 — src/specify_cli/extensions/__init__.py:4136-4149 | src/specify_cli/presets/__init__.py:4830-4843 — 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:4136` 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 (14 lines × 2) src/specify_cli/extensions/_commands.py:2535 — src/specify_cli/extensions/_commands.py:2535-2548 | src/specify_cli/extensions/_commands.py:2605-2618 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) src/specify_cli/presets/_commands.py:583 — src/specify_cli/presets/_commands.py:583-596 | src/specify_cli/presets/_commands.py:620-633 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) src/specify_cli/workflows/_commands.py:1431 — src/specify_cli/workflows/_commands.py:1431-1444 | src/specify_cli/workflows/_commands.py:1546-1559 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) src/specify_cli/workflows/catalog.py:658 — src/specify_cli/workflows/catalog.py:658-671 | src/specify_cli/workflows/catalog.py:1349-1362 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×6
  • Duplicated block (9 lines × 2) extensions/git/scripts/python/auto_commit.py:179 — extensions/git/scripts/python/auto_commit.py:179-187 | extensions/git/scripts/python/initialize_repo.py:72-81 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (9 lines × 2) src/specify_cli/extensions/__init__.py:510 — src/specify_cli/extensions/__init__.py:510-518 | src/specify_cli/extensions/__init__.py:537-545 — both copies are in the same file, so extract the 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/__init__.py:510` 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 (9 lines × 2) src/specify_cli/extensions/_commands.py:1415 — src/specify_cli/extensions/_commands.py:1415-1423 | src/specify_cli/extensions/_commands.py:1429-1437 — both copies are in the same file, so extract the 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/extensions/_commands.py:1565 — src/specify_cli/extensions/_commands.py:1565-1574 | src/specify_cli/workflows/_commands.py:2689-2697 — 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) src/specify_cli/presets/__init__.py:5161 — src/specify_cli/presets/__init__.py:5161-5170 | src/specify_cli/presets/__init__.py:5530-5538 — both copies are in the same file, so extract the 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/overlays/_commands.py:215 — src/specify_cli/workflows/overlays/_commands.py:215-225 | src/specify_cli/workflows/overlays/_commands.py:268-276 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×6
  • Duplicated block (7 lines × 2) src/specify_cli/extensions/_commands.py:1436 — src/specify_cli/extensions/_commands.py:1436-1442 | src/specify_cli/extensions/_commands.py:1479-1485 — both copies are in the same file, so extract the 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 (7 lines × 2) src/specify_cli/integrations/_query_commands.py:333 — src/specify_cli/integrations/_query_commands.py:333-339 | src/specify_cli/integrations/_query_commands.py:411-417 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) src/specify_cli/integrations/catalog.py:790 — src/specify_cli/integrations/catalog.py:790-796 | src/specify_cli/integrations/catalog.py:799-805 — both copies are in the same file, so extract the 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/integrations/catalog.py:790` 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/workflows/_commands.py:1501 — src/specify_cli/workflows/_commands.py:1501-1507 | src/specify_cli/workflows/_commands.py:1590-1596 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) src/specify_cli/workflows/_commands.py:3641 — src/specify_cli/workflows/_commands.py:3641-3647 | src/specify_cli/workflows/_commands.py:3667-3673 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) src/specify_cli/workflows/catalog.py:600 — src/specify_cli/workflows/catalog.py:600-606 | src/specify_cli/workflows/catalog.py:1294-1300 — both copies are in the same file, so extract the 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 lines × 2) · ×5
  • Duplicated block (18 lines × 2) src/specify_cli/extensions/__init__.py:3711 — src/specify_cli/extensions/__init__.py:3711-3732 | src/specify_cli/presets/__init__.py:4423-4440 — 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 (18 lines × 2) src/specify_cli/extensions/__init__.py:3843 — src/specify_cli/extensions/__init__.py:3843-3860 | src/specify_cli/presets/__init__.py:4520-4539 — 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 (18 lines × 2) src/specify_cli/integrations/_install_commands.py:144 — src/specify_cli/integrations/_install_commands.py:144-162 | src/specify_cli/integrations/_migrate_commands.py:471-488 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/specify_cli/integrations/_install_commands.py:144` 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/workflows/_commands.py:1335 — src/specify_cli/workflows/_commands.py:1335-1353 | src/specify_cli/workflows/_commands.py:1473-1490 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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 (18 lines × 2) src/specify_cli/workflows/steps/command/__init__.py:81 — src/specify_cli/workflows/steps/command/__init__.py:81-98 | src/specify_cli/workflows/steps/prompt/__init__.py:58-75 — 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 (21 lines × 2) · ×4
  • Duplicated block (21 lines × 2) src/specify_cli/integrations/agy/__init__.py:48 — src/specify_cli/integrations/agy/__init__.py:48-68 | src/specify_cli/integrations/cline/__init__.py:100-120 — 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/agy/__init__.py:48` 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 (21 lines × 2) src/specify_cli/presets/__init__.py:1293 — src/specify_cli/presets/__init__.py:1293-1313 | src/specify_cli/presets/__init__.py:1339-1363 — both copies are in the same file, so extract the 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/__init__.py:1293` 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 (21 lines × 2) src/specify_cli/workflows/catalog.py:548 — src/specify_cli/workflows/catalog.py:548-568 | src/specify_cli/workflows/catalog.py:1243-1263 — both copies are in the same file, so extract the 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/catalog.py:548` 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 (21 lines × 2) src/specify_cli/workflows/steps/do_while/__init__.py:67 — src/specify_cli/workflows/steps/do_while/__init__.py:67-87 | src/specify_cli/workflows/steps/while_loop/__init__.py:76-96 — 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/steps/do_while/__init__.py:67` 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 (16 lines × 2) · ×4
  • Duplicated block (16 lines × 2) src/specify_cli/events.py:1282 — src/specify_cli/events.py:1282-1297 | src/specify_cli/events.py:1376-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.
  • Duplicated block (16 lines × 2) src/specify_cli/events.py:1947 — src/specify_cli/events.py:1947-1962 | src/specify_cli/events.py:1979-1997 — both copies are in the same file, so extract the 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/extensions/__init__.py:4170 — src/specify_cli/extensions/__init__.py:4170-4185 | src/specify_cli/presets/__init__.py:4862-4877 — 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:4170` 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/_commands.py:1880 — src/specify_cli/workflows/_commands.py:1880-1895 | src/specify_cli/workflows/_commands.py:2117-2132 — both copies are in the same file, so extract the 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.
D3 · God Classes · TooManyMethods · ×3
  • TooManyMethods: PresetManager src/specify_cli/presets/__init__.py:752 — TooManyMethods — 39 methods. 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:102 — TooManyMethods — 34 methods. 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: ExtensionManager src/specify_cli/extensions/__init__.py:864 — TooManyMethods — 33 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×3
  • Duplicated block (22 lines × 2) src/specify_cli/extensions/__init__.py:687 — src/specify_cli/extensions/__init__.py:687-713 | src/specify_cli/presets/__init__.py:597-618 — 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 (22 lines × 2) src/specify_cli/extensions/__init__.py:830 — src/specify_cli/extensions/__init__.py:830-851 | src/specify_cli/presets/__init__.py:706-727 — 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 (22 lines × 2) src/specify_cli/extensions/__init__.py:3738 — src/specify_cli/extensions/__init__.py:3738-3759 | src/specify_cli/presets/__init__.py:4446-4467 — 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:3738` 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 (19 lines × 2) · ×3
  • Duplicated block (19 lines × 2) src/specify_cli/extensions/__init__.py:725 — src/specify_cli/extensions/__init__.py:725-745 | src/specify_cli/presets/__init__.py:630-648 — 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/integrations/_install_commands.py:251 — src/specify_cli/integrations/_install_commands.py:251-269 | src/specify_cli/integrations/_install_commands.py:299-318 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (19 lines × 2) src/specify_cli/workflows/catalog.py:516 — src/specify_cli/workflows/catalog.py:516-535 | src/specify_cli/workflows/catalog.py:1212-1230 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×3
  • Duplicated block (17 lines × 2) src/specify_cli/extensions/__init__.py:3814 — src/specify_cli/extensions/__init__.py:3814-3838 | src/specify_cli/integrations/catalog.py:268-284 — 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:3814` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (17 lines × 2) src/specify_cli/extensions/_commands.py:1234 — src/specify_cli/extensions/_commands.py:1234-1250 | src/specify_cli/extensions/_commands.py:1451-1467 — both copies are in the same file, so extract the 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 (17 lines × 2) src/specify_cli/integrations/base.py:881 — src/specify_cli/integrations/base.py:881-900 | src/specify_cli/integrations/forge/__init__.py:113-129 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×2
  • Duplicated block (20 lines × 2) src/specify_cli/integrations/alquimia/__init__.py:68 — src/specify_cli/integrations/alquimia/__init__.py:68-87 | src/specify_cli/integrations/claude/__init__.py:70-89 — 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 (20 lines × 2) src/specify_cli/shared_infra.py:525 — src/specify_cli/shared_infra.py:525-544 | src/specify_cli/shared_infra.py:581-600 — both copies are in the same file, so extract the 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/shared_infra.py:525` 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 (6 lines × 2) · ×2
  • Duplicated block (6 lines × 2) src/specify_cli/extensions/__init__.py:3666 — src/specify_cli/extensions/__init__.py:3666-3671 | src/specify_cli/integrations/catalog.py:168-173 — 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/extensions/_commands.py:1401 — src/specify_cli/extensions/_commands.py:1401-1406 | src/specify_cli/presets/_commands.py:497-504 — 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/presets/_commands.py:497` 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 (5 lines × 3) · ×2
  • Duplicated block (5 lines × 3) src/specify_cli/extensions/_commands.py:1478 — src/specify_cli/extensions/_commands.py:1478-1482 | src/specify_cli/presets/_commands.py:511-519 | src/specify_cli/workflows/_commands.py:3674-3680 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (5 lines × 3) src/specify_cli/presets/_commands.py:69 — src/specify_cli/presets/_commands.py:69-73 | src/specify_cli/presets/_commands.py:504-510 | src/specify_cli/workflows/_commands.py:2954-2958 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×2
  • Duplicated block (5 lines × 2) src/specify_cli/presets/_commands.py:339 — src/specify_cli/presets/_commands.py:339-344 | src/specify_cli/workflows/_commands.py:2856-2860 — 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/presets/_commands.py:339` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) src/specify_cli/workflows/_commands.py:1697 — src/specify_cli/workflows/_commands.py:1697-1701 | src/specify_cli/workflows/_commands.py:3607-3613 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D1 · Cyclomatic Complexity · _commands.extension_update (cyclomatic 165) · ×1
  • _commands.extension_update (cyclomatic 165) src/specify_cli/extensions/_commands.py:1508 — _commands.extension_update has cyclomatic complexity 165 (threshold 15). To reduce it, separate the cases: extract each independent branch into its 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.register_enabled_presets_for_agent (cyclomatic 75) · ×1
  • PresetManager.register_enabled_presets_for_agent (cyclomatic 75) src/specify_cli/presets/__init__.py:961 — PresetManager.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 67) · ×1
  • ExtensionManifest._validate (cyclomatic 67) src/specify_cli/extensions/__init__.py:255 — ExtensionManifest._validate has cyclomatic complexity 67 (threshold 15). To reduce it, separate the cases: extract each independent branch into its 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 64) · ×1
  • ExtensionManager.install_from_directory (cyclomatic 64) src/specify_cli/extensions/__init__.py:1898 — ExtensionManager.install_from_directory has cyclomatic complexity 64 (threshold 15). To reduce it, separate the cases: extract each independent branch into its 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 56) · ×1
  • shared_infra.install_shared_infra (cyclomatic 56) src/specify_cli/shared_infra.py:388 — shared_infra.install_shared_infra has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its 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.workflow_step_add (cyclomatic 53) · ×1
  • _commands.workflow_step_add (cyclomatic 53) src/specify_cli/workflows/_commands.py:3153 — _commands.workflow_step_add has cyclomatic complexity 53 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PresetManager._reconcile_composed_commands (cyclomatic 50) · ×1
  • PresetManager._reconcile_composed_commands (cyclomatic 50) src/specify_cli/presets/__init__.py:1626 — PresetManager._reconcile_composed_commands has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its 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/__init__.py:3722 — 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 · ExtensionManager.register_enabled_extensions_for_agent (cyclomatic 47) · ×1
  • ExtensionManager.register_enabled_extensions_for_agent (cyclomatic 47) src/specify_cli/extensions/__init__.py:2954 — ExtensionManager.register_enabled_extensions_for_agent has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PresetResolver.collect_all_layers (cyclomatic 47) · ×1
  • PresetResolver.collect_all_layers (cyclomatic 47) src/specify_cli/presets/__init__.py:5311 — PresetResolver.collect_all_layers has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _commands.workflow_add (cyclomatic 46) · ×1
  • _commands.workflow_add (cyclomatic 46) src/specify_cli/workflows/_commands.py:1706 — _commands.workflow_add has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CommandRegistrar.register_commands (cyclomatic 44) · ×1
  • CommandRegistrar.register_commands (cyclomatic 44) src/specify_cli/agents.py:606 — CommandRegistrar.register_commands has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _commands.extension_add (cyclomatic 43) · ×1
  • _commands.extension_add (cyclomatic 43) src/specify_cli/extensions/_commands.py:848 — _commands.extension_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 · IntegrationDescriptor._validate (cyclomatic 43) · ×1
  • IntegrationDescriptor._validate (cyclomatic 43) src/specify_cli/integrations/catalog.py:681 — IntegrationDescriptor._validate 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 · create_new_feature_branch.main (cyclomatic 42) · ×1
  • create_new_feature_branch.main (cyclomatic 42) extensions/git/scripts/python/create_new_feature_branch.py:420 — 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 · PresetResolver.resolve (cyclomatic 41) · ×1
  • PresetResolver.resolve (cyclomatic 41) src/specify_cli/presets/__init__.py:5037 — PresetResolver.resolve 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 · _commands._install_workflow_from_catalog (cyclomatic 41) · ×1
  • _commands._install_workflow_from_catalog (cyclomatic 41) src/specify_cli/workflows/_commands.py:2153 — _commands._install_workflow_from_catalog has cyclomatic complexity 41 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · config.load_auth_config (cyclomatic 36) · ×1
  • config.load_auth_config (cyclomatic 36) src/specify_cli/authentication/config.py:70 — config.load_auth_config 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 · PresetManager._register_skills (cyclomatic 36) · ×1
  • PresetManager._register_skills (cyclomatic 36) src/specify_cli/presets/__init__.py:2614 — PresetManager._register_skills 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 · events.install_integration_events (cyclomatic 35) · ×1
  • events.install_integration_events (cyclomatic 35) src/specify_cli/events.py:1198 — events.install_integration_events 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:143 — 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 · engine._validate_steps (cyclomatic 35) · ×1
  • engine._validate_steps (cyclomatic 35) src/specify_cli/workflows/engine.py:325 — engine._validate_steps 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 · integration_status.build_integration_status_report (cyclomatic 34) · ×1
  • integration_status.build_integration_status_report (cyclomatic 34) src/specify_cli/integration_status.py:352 — integration_status.build_integration_status_report has cyclomatic complexity 34 (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 · PresetManifest._validate (cyclomatic 34) · ×1
  • PresetManifest._validate (cyclomatic 34) src/specify_cli/presets/__init__.py:288 — PresetManifest._validate 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 · _version.self_upgrade (cyclomatic 32) · ×1
  • _version.self_upgrade (cyclomatic 32) src/specify_cli/_version.py:1224 — _version.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 · CommandRegistrar.register_commands_for_all_agents (cyclomatic 32) · ×1
  • CommandRegistrar.register_commands_for_all_agents (cyclomatic 32) src/specify_cli/agents.py:1048 — 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 · _migrate_commands.integration_upgrade (cyclomatic 32) · ×1
  • _migrate_commands.integration_upgrade (cyclomatic 32) src/specify_cli/integrations/_migrate_commands.py:584 — _migrate_commands.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 · PresetManager.unregister_agent_artifacts (cyclomatic 31) · ×1
  • PresetManager.unregister_agent_artifacts (cyclomatic 31) src/specify_cli/presets/__init__.py:1401 — PresetManager.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 · _commands._install_workflow_package (cyclomatic 31) · ×1
  • _commands._install_workflow_package (cyclomatic 31) src/specify_cli/workflows/_commands.py:963 — _commands._install_workflow_package has cyclomatic complexity 31 (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 · create_new_feature.main (cyclomatic 30) · ×1
  • create_new_feature.main (cyclomatic 30) scripts/python/create_new_feature.py:244 — create_new_feature.main has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _download_security.safe_extract_tar (cyclomatic 30) · ×1
  • _download_security.safe_extract_tar (cyclomatic 30) src/specify_cli/_download_security.py:1052 — _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._register_extension_skills (cyclomatic 30) · ×1
  • ExtensionManager._register_extension_skills (cyclomatic 30) src/specify_cli/extensions/__init__.py:1381 — ExtensionManager._register_extension_skills 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 · PresetManager._unregister_skills_in_dir (cyclomatic 30) · ×1
  • PresetManager._unregister_skills_in_dir (cyclomatic 30) src/specify_cli/presets/__init__.py:3254 — PresetManager._unregister_skills_in_dir 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 · WorkflowEngine._execute_steps (cyclomatic 30) · ×1
  • WorkflowEngine._execute_steps (cyclomatic 30) src/specify_cli/workflows/engine.py:1107 — WorkflowEngine._execute_steps 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 · expressions._evaluate_simple_expression (cyclomatic 29) · ×1
  • expressions._evaluate_simple_expression (cyclomatic 29) src/specify_cli/workflows/expressions.py:437 — expressions._evaluate_simple_expression 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 · _migrate_commands.integration_switch (cyclomatic 28) · ×1
  • _migrate_commands.integration_switch (cyclomatic 28) src/specify_cli/integrations/_migrate_commands.py:232 — _migrate_commands.integration_switch 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 · _commands._print_extension_info (cyclomatic 27) · ×1
  • _commands._print_extension_info (cyclomatic 27) src/specify_cli/extensions/_commands.py:1386 — _commands._print_extension_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 · PresetManager._reconcile_skills (cyclomatic 27) · ×1
  • PresetManager._reconcile_skills (cyclomatic 27) src/specify_cli/presets/__init__.py:2093 — PresetManager._reconcile_skills 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 · PresetResolver.resolve_content (cyclomatic 27) · ×1
  • PresetResolver.resolve_content (cyclomatic 27) src/specify_cli/presets/__init__.py:5552 — PresetResolver.resolve_content 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:705 — _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:4745 — 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 · _install_commands.integration_uninstall (cyclomatic 26) · ×1
  • _install_commands.integration_uninstall (cyclomatic 26) src/specify_cli/integrations/_install_commands.py:218 — _install_commands.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 · GateStep.execute (cyclomatic 26) · ×1
  • GateStep.execute (cyclomatic 26) src/specify_cli/workflows/steps/gate/__init__.py:39 — GateStep.execute 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:887 — _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:481 — _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:1015 — _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 · workflows.load_custom_steps (cyclomatic 25) · ×1
  • workflows.load_custom_steps (cyclomatic 25) src/specify_cli/workflows/__init__.py:75 — 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 · _commands.preset_add (cyclomatic 24) · ×1
  • _commands.preset_add (cyclomatic 24) src/specify_cli/presets/_commands.py:79 — _commands.preset_add 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/steps/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 · events._find_command_template (cyclomatic 23) · ×1
  • events._find_command_template (cyclomatic 23) src/specify_cli/events.py:458 — 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 · _commands.workflow_run (cyclomatic 23) · ×1
  • _commands.workflow_run (cyclomatic 23) src/specify_cli/workflows/_commands.py:1309 — _commands.workflow_run 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 · _install_commands.integration_install (cyclomatic 22) · ×1
  • _install_commands.integration_install (cyclomatic 22) src/specify_cli/integrations/_install_commands.py:40 — _install_commands.integration_install has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _commands.workflow_update (cyclomatic 22) · ×1
  • _commands.workflow_update (cyclomatic 22) src/specify_cli/workflows/_commands.py:2636 — _commands.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/overlays/merge.py:233 — 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 · 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:217 — 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 · _github_http.resolve_github_release_asset_api_url (cyclomatic 21) · ×1
  • _github_http.resolve_github_release_asset_api_url (cyclomatic 21) src/specify_cli/_github_http.py:67 — _github_http.resolve_github_release_asset_api_url 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 · IntegrationCatalog.remove_catalog (cyclomatic 21) · ×1
  • IntegrationCatalog.remove_catalog (cyclomatic 21) src/specify_cli/integrations/catalog.py:497 — 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 · IntegrationManifest.uninstall (cyclomatic 21) · ×1
  • IntegrationManifest.uninstall (cyclomatic 21) src/specify_cli/integrations/manifest.py:325 — IntegrationManifest.uninstall 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 · PresetManager._unregister_skills (cyclomatic 21) · ×1
  • PresetManager._unregister_skills (cyclomatic 21) src/specify_cli/presets/__init__.py:3057 — PresetManager._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 · _version._run_installer (cyclomatic 20) · ×1
  • _version._run_installer (cyclomatic 20) src/specify_cli/_version.py:768 — _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 · BundleManifest.structural_errors (cyclomatic 20) · ×1
  • BundleManifest.structural_errors (cyclomatic 20) src/specify_cli/bundler/models/manifest.py:162 — BundleManifest.structural_errors 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 · installer.install_bundle (cyclomatic 20) · ×1
  • installer.install_bundle (cyclomatic 20) src/specify_cli/bundler/services/installer.py:59 — installer.install_bundle 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.py:803 — 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.py:944 — 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 · _query_commands.integration_list (cyclomatic 20) · ×1
  • _query_commands.integration_list (cyclomatic 20) src/specify_cli/integrations/_query_commands.py:28 — _query_commands.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 · IntegrationBase.process_template (cyclomatic 20) · ×1
  • IntegrationBase.process_template (cyclomatic 20) src/specify_cli/integrations/base.py:759 — 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 · CommandStep.execute (cyclomatic 20) · ×1
  • CommandStep.execute (cyclomatic 20) src/specify_cli/workflows/steps/command/__init__.py:31 — CommandStep.execute 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 · update_agent_context._upsert_section (cyclomatic 19) · ×1
  • update_agent_context._upsert_section (cyclomatic 19) extensions/agent-context/scripts/python/update_agent_context.py:244 — 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 · _download_security.detect_archive_format (cyclomatic 19) · ×1
  • _download_security.detect_archive_format (cyclomatic 19) src/specify_cli/_download_security.py:111 — _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:1278 — 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 · bundle.bundle_info (cyclomatic 19) · ×1
  • bundle.bundle_info (cyclomatic 19) src/specify_cli/commands/bundle/__init__.py:204 — bundle.bundle_info 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 · events._resolve_event_command_argv (cyclomatic 19) · ×1
  • events._resolve_event_command_argv (cyclomatic 19) src/specify_cli/events.py:536 — events._resolve_event_command_argv 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 · ExtensionManager._find_extension_skill_dirs (cyclomatic 19) · ×1
  • ExtensionManager._find_extension_skill_dirs (cyclomatic 19) src/specify_cli/extensions/__init__.py:1595 — 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:2620 — 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 · _query_commands.integration_info (cyclomatic 19) · ×1
  • _query_commands.integration_info (cyclomatic 19) src/specify_cli/integrations/_query_commands.py:366 — _query_commands.integration_info 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 · PresetCatalog.download_pack (cyclomatic 19) · ×1
  • PresetCatalog.download_pack (cyclomatic 19) src/specify_cli/presets/__init__.py:4744 — PresetCatalog.download_pack 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 · _commands.workflow_info (cyclomatic 19) · ×1
  • _commands.workflow_info (cyclomatic 19) src/specify_cli/workflows/_commands.py:2864 — _commands.workflow_info 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 · ExtensionCatalog.search (cyclomatic 18) · ×1
  • ExtensionCatalog.search (cyclomatic 18) src/specify_cli/extensions/__init__.py:3974 — 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 (cyclomatic 18) · ×1
  • ExtensionCatalog.download_extension (cyclomatic 18) src/specify_cli/extensions/__init__.py:4060 — ExtensionCatalog.download_extension 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 · _commands.extension_info (cyclomatic 18) · ×1
  • _commands.extension_info (cyclomatic 18) src/specify_cli/extensions/_commands.py:1277 — _commands.extension_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 · kimi._migrate_legacy_kimi_skills_dir (cyclomatic 18) · ×1
  • kimi._migrate_legacy_kimi_skills_dir (cyclomatic 18) src/specify_cli/integrations/kimi/__init__.py:217 — kimi._migrate_legacy_kimi_skills_dir 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 · PresetManager._infer_legacy_skill_provenance (cyclomatic 18) · ×1
  • PresetManager._infer_legacy_skill_provenance (cyclomatic 18) src/specify_cli/presets/__init__.py:2806 — PresetManager._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:723 — _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 · PromptStep.execute (cyclomatic 18) · ×1
  • PromptStep.execute (cyclomatic 18) src/specify_cli/workflows/steps/prompt/__init__.py:40 — PromptStep.execute 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 · 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 · init._install_extension_during_init (cyclomatic 17) · ×1
  • init._install_extension_during_init (cyclomatic 17) src/specify_cli/commands/init.py:85 — 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:1762 — 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 · ExtensionManager.remove (cyclomatic 17) · ×1
  • ExtensionManager.remove (cyclomatic 17) src/specify_cli/extensions/__init__.py:2746 — ExtensionManager.remove 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 · _commands.extension_search (cyclomatic 17) · ×1
  • _commands.extension_search (cyclomatic 17) src/specify_cli/extensions/_commands.py:1182 — _commands.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/catalog.py:292 — 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 · IntegrationCatalog.add_catalog (cyclomatic 17) · ×1
  • IntegrationCatalog.add_catalog (cyclomatic 17) src/specify_cli/integrations/catalog.py:384 — IntegrationCatalog.add_catalog has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · yamlio.dump_json (cyclomatic 16) · ×1
  • yamlio.dump_json (cyclomatic 16) src/specify_cli/bundler/lib/yamlio.py:126 — 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:1143 — 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 · _migrate_commands._installed_presets_affecting_agent (cyclomatic 16) · ×1
  • _migrate_commands._installed_presets_affecting_agent (cyclomatic 16) src/specify_cli/integrations/_migrate_commands.py:131 — _migrate_commands._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 · _query_commands.integration_search (cyclomatic 16) · ×1
  • _query_commands.integration_search (cyclomatic 16) src/specify_cli/integrations/_query_commands.py:270 — _query_commands.integration_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 · CopilotIntegration.is_skills_mode (cyclomatic 16) · ×1
  • CopilotIntegration.is_skills_mode (cyclomatic 16) src/specify_cli/integrations/copilot/__init__.py:175 — 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 · PresetManager._register_commands (cyclomatic 16) · ×1
  • PresetManager._register_commands (cyclomatic 16) src/specify_cli/presets/__init__.py:828 — PresetManager._register_commands 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 · _commands.preset_info (cyclomatic 16) · ×1
  • _commands.preset_info (cyclomatic 16) src/specify_cli/presets/_commands.py:434 — _commands.preset_info 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 · _commands.workflow_resume (cyclomatic 16) · ×1
  • _commands.workflow_resume (cyclomatic 16) src/specify_cli/workflows/_commands.py:1458 — _commands.workflow_resume 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 · _commands.workflow_step_remove (cyclomatic 16) · ×1
  • _commands.workflow_step_remove (cyclomatic 16) src/specify_cli/workflows/_commands.py:3490 — _commands.workflow_step_remove 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 · WorkflowRegistry.save (cyclomatic 16) · ×1
  • WorkflowRegistry.save (cyclomatic 16) src/specify_cli/workflows/catalog.py:140 — 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 · WorkflowEngine._run_fan_out (cyclomatic 16) · ×1
  • WorkflowEngine._run_fan_out (cyclomatic 16) src/specify_cli/workflows/engine.py:1345 — WorkflowEngine._run_fan_out 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 · WorkflowEngine._coerce_input (cyclomatic 16) · ×1
  • WorkflowEngine._coerce_input (cyclomatic 16) src/specify_cli/workflows/engine.py:1628 — WorkflowEngine._coerce_input 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/overlays/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 · schema._parse_edit (cyclomatic 16) · ×1
  • schema._parse_edit (cyclomatic 16) src/specify_cli/workflows/overlays/schema.py:61 — schema._parse_edit 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.
D19 · Documentation Quality · LLM evaluation failed · ×1
  • LLM evaluation failed — JSON parse error: Expected end of string, but instead reached end of data. Path: $.findings[1].suggestion | LineNumber: 0 | BytePositionInLine: 1215.
D2 · Cognitive Complexity · _commands.extension_update (cognitive 455) · ×1
  • _commands.extension_update (cognitive 455) src/specify_cli/extensions/_commands.py:1508 — _commands.extension_update has cognitive complexity 455 (threshold 15). Drivers by points: if/else 296, loops 78, error handling 49, boolean chains 26, ternaries 6 (nesting depth added 288). To reduce it, split the body into named stages: move each independent step or branch 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._reconcile_composed_commands (cognitive 162) · ×1
  • PresetManager._reconcile_composed_commands (cognitive 162) src/specify_cli/presets/__init__.py:1626 — PresetManager._reconcile_composed_commands has cognitive complexity 162 (threshold 15). Drivers by points: if/else 110, loops 35, boolean chains 10, error handling 7 (nesting depth added 111). To reduce it, split the body into named stages: move each independent step or branch 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.install_shared_infra (cognitive 159) · ×1
  • shared_infra.install_shared_infra (cognitive 159) src/specify_cli/shared_infra.py:388 — shared_infra.install_shared_infra has cognitive complexity 159 (threshold 15). Drivers by points: if/else 105, loops 23, error handling 21, boolean chains 7, ternaries 3 (nesting depth added 101). To reduce it, split the body into named stages: move each independent step or branch 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.register_enabled_presets_for_agent (cognitive 148) · ×1
  • PresetManager.register_enabled_presets_for_agent (cognitive 148) src/specify_cli/presets/__init__.py:961 — PresetManager.register_enabled_presets_for_agent has cognitive complexity 148 (threshold 15). Drivers by points: if/else 102, loops 22, boolean chains 19, error handling 5 (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 · PresetResolver.collect_all_layers (cognitive 133) · ×1
  • PresetResolver.collect_all_layers (cognitive 133) src/specify_cli/presets/__init__.py:5311 — PresetResolver.collect_all_layers has cognitive complexity 133 (threshold 15). Drivers by points: if/else 103, loops 13, error handling 9, boolean chains 4, ternaries 4 (nesting depth added 87). To reduce it, split the body into named stages: move each independent step or branch 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 130) · ×1
  • ExtensionManifest._validate (cognitive 130) src/specify_cli/extensions/__init__.py:255 — ExtensionManifest._validate has cognitive complexity 130 (threshold 15). Drivers by points: if/else 100, loops 15, boolean chains 11, ternaries 3, 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 · ExtensionManager.register_enabled_extensions_for_agent (cognitive 129) · ×1
  • ExtensionManager.register_enabled_extensions_for_agent (cognitive 129) src/specify_cli/extensions/__init__.py:2954 — ExtensionManager.register_enabled_extensions_for_agent has cognitive complexity 129 (threshold 15). Drivers by points: if/else 99, loops 14, boolean chains 11, error handling 5 (nesting depth added 81). To reduce it, split the body into named stages: move each independent step or branch 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_directory (cognitive 103) · ×1
  • ExtensionManager.install_from_directory (cognitive 103) src/specify_cli/extensions/__init__.py:1898 — ExtensionManager.install_from_directory has cognitive complexity 103 (threshold 15). Drivers by points: if/else 52, error handling 20, loops 18, boolean chains 13 (nesting depth added 48). To reduce it, split the body into named stages: move each independent step or branch 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_branch.main (cognitive 99) · ×1
  • create_new_feature_branch.main (cognitive 99) extensions/git/scripts/python/create_new_feature_branch.py:420 — create_new_feature_branch.main has cognitive complexity 99 (threshold 15). Drivers by points: if/else 84, boolean chains 7, ternaries 4, error handling 2, loops 2 (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 · PresetManager.remove (cognitive 98) · ×1
  • PresetManager.remove (cognitive 98) src/specify_cli/presets/__init__.py:3722 — PresetManager.remove has cognitive complexity 98 (threshold 15). Drivers by points: if/else 58, ternaries 14, loops 10, error handling 9, 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 · _commands.workflow_add (cognitive 90) · ×1
  • _commands.workflow_add (cognitive 90) src/specify_cli/workflows/_commands.py:1706 — _commands.workflow_add has cognitive complexity 90 (threshold 15). Drivers by points: if/else 49, error handling 21, ternaries 14, boolean chains 6 (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch 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 (cognitive 84) · ×1
  • CommandRegistrar.register_commands (cognitive 84) src/specify_cli/agents.py:606 — CommandRegistrar.register_commands has cognitive complexity 84 (threshold 15). Drivers by points: if/else 57, loops 10, ternaries 7, boolean chains 5, error handling 5 (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch 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 78) · ×1
  • PresetResolver.resolve (cognitive 78) src/specify_cli/presets/__init__.py:5037 — PresetResolver.resolve has cognitive complexity 78 (threshold 15). Drivers by points: if/else 69, loops 8, boolean chains 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 · engine._validate_steps (cognitive 75) · ×1
  • engine._validate_steps (cognitive 75) src/specify_cli/workflows/engine.py:325 — engine._validate_steps has cognitive complexity 75 (threshold 15). Drivers by points: if/else 56, loops 10, ternaries 5, boolean chains 4 (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch 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._execute_steps (cognitive 74) · ×1
  • WorkflowEngine._execute_steps (cognitive 74) src/specify_cli/workflows/engine.py:1107 — WorkflowEngine._execute_steps has cognitive complexity 74 (threshold 15). Drivers by points: if/else 55, loops 10, boolean chains 9 (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch 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.extension_add (cognitive 72) · ×1
  • _commands.extension_add (cognitive 72) src/specify_cli/extensions/_commands.py:848 — _commands.extension_add has cognitive complexity 72 (threshold 15). Drivers by points: if/else 58, error handling 5, boolean chains 4, loops 4, ternaries 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PresetManager.unregister_agent_artifacts (cognitive 70) · ×1
  • PresetManager.unregister_agent_artifacts (cognitive 70) src/specify_cli/presets/__init__.py:1401 — PresetManager.unregister_agent_artifacts has cognitive complexity 70 (threshold 15). Drivers by points: if/else 57, boolean chains 7, loops 5, error handling 1 (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 · CommandRegistrar.register_commands_for_all_agents (cognitive 67) · ×1
  • CommandRegistrar.register_commands_for_all_agents (cognitive 67) src/specify_cli/agents.py:1048 — CommandRegistrar.register_commands_for_all_agents has cognitive complexity 67 (threshold 15). Drivers by points: if/else 41, error handling 14, 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 · create_new_feature.main (cognitive 65) · ×1
  • create_new_feature.main (cognitive 65) scripts/python/create_new_feature.py:244 — create_new_feature.main has cognitive complexity 65 (threshold 15). Drivers by points: if/else 53, boolean chains 4, loops 4, ternaries 4 (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 · events.install_integration_events (cognitive 65) · ×1
  • events.install_integration_events (cognitive 65) src/specify_cli/events.py:1198 — events.install_integration_events has cognitive complexity 65 (threshold 15). Drivers by points: if/else 39, loops 26 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PresetManager._unregister_skills_in_dir (cognitive 65) · ×1
  • PresetManager._unregister_skills_in_dir (cognitive 65) src/specify_cli/presets/__init__.py:3254 — PresetManager._unregister_skills_in_dir has cognitive complexity 65 (threshold 15). Drivers by points: if/else 47, ternaries 10, boolean chains 4, error handling 3, loops 1 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _commands.workflow_step_add (cognitive 62) · ×1
  • _commands.workflow_step_add (cognitive 62) src/specify_cli/workflows/_commands.py:3153 — _commands.workflow_step_add has cognitive complexity 62 (threshold 15). Drivers by points: if/else 32, boolean chains 15, error handling 14, loops 1 (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 · config.load_auth_config (cognitive 58) · ×1
  • config.load_auth_config (cognitive 58) src/specify_cli/authentication/config.py:70 — config.load_auth_config has cognitive complexity 58 (threshold 15). Drivers by points: if/else 39, boolean chains 11, loops 6, error handling 2 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _migrate_commands.integration_switch (cognitive 58) · ×1
  • _migrate_commands.integration_switch (cognitive 58) src/specify_cli/integrations/_migrate_commands.py:232 — _migrate_commands.integration_switch has cognitive complexity 58 (threshold 15). Drivers by points: if/else 42, error handling 13, boolean chains 3 (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 · IntegrationDescriptor._validate (cognitive 58) · ×1
  • IntegrationDescriptor._validate (cognitive 58) src/specify_cli/integrations/catalog.py:681 — IntegrationDescriptor._validate has cognitive complexity 58 (threshold 15). Drivers by points: if/else 40, boolean chains 11, loops 6, error handling 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 · PresetManager._register_skills (cognitive 57) · ×1
  • PresetManager._register_skills (cognitive 57) src/specify_cli/presets/__init__.py:2614 — PresetManager._register_skills has cognitive complexity 57 (threshold 15). Drivers by points: if/else 39, boolean chains 9, loops 6, ternaries 3 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _download_security.safe_extract_tar (cognitive 54) · ×1
  • _download_security.safe_extract_tar (cognitive 54) src/specify_cli/_download_security.py:1052 — _download_security.safe_extract_tar has cognitive complexity 54 (threshold 15). Drivers by points: if/else 36, error handling 10, loops 5, 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:481 — _version._detect_install_method has cognitive complexity 54 (threshold 15). Drivers by points: if/else 34, ternaries 7, error handling 6, boolean chains 4, loops 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 · CommandRegistrar.unregister_commands (cognitive 54) · ×1
  • CommandRegistrar.unregister_commands (cognitive 54) src/specify_cli/agents.py:1278 — CommandRegistrar.unregister_commands has cognitive complexity 54 (threshold 15). Drivers by points: if/else 28, error handling 12, loops 10, 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 · ExtensionManager._register_extension_skills (cognitive 53) · ×1
  • ExtensionManager._register_extension_skills (cognitive 53) src/specify_cli/extensions/__init__.py:1381 — ExtensionManager._register_extension_skills has cognitive complexity 53 (threshold 15). Drivers by points: if/else 32, error handling 11, boolean chains 9, 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 · merge._traverse_and_apply (cognitive 53) · ×1
  • merge._traverse_and_apply (cognitive 53) src/specify_cli/workflows/overlays/merge.py:233 — merge._traverse_and_apply has cognitive complexity 53 (threshold 15). Drivers by points: if/else 29, loops 17, ternaries 4, 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:143 — engine.validate_workflow has cognitive complexity 52 (threshold 15). Drivers by points: if/else 34, boolean chains 9, error handling 4, loops 4, 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.py:803 — events.resolve_events has cognitive complexity 51 (threshold 15). Drivers by points: if/else 30, error handling 8, loops 8, boolean chains 3, ternaries 2 (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 · PresetManifest._validate (cognitive 50) · ×1
  • PresetManifest._validate (cognitive 50) src/specify_cli/presets/__init__.py:288 — PresetManifest._validate has cognitive complexity 50 (threshold 15). Drivers by points: if/else 39, loops 6, boolean chains 4, error handling 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 · HookExecutor.register_hooks (cognitive 49) · ×1
  • HookExecutor.register_hooks (cognitive 49) src/specify_cli/extensions/__init__.py:4745 — HookExecutor.register_hooks has cognitive complexity 49 (threshold 15). Drivers by points: if/else 39, loops 6, 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 · expressions._evaluate_simple_expression (cognitive 48) · ×1
  • expressions._evaluate_simple_expression (cognitive 48) src/specify_cli/workflows/expressions.py:437 — expressions._evaluate_simple_expression has cognitive complexity 48 (threshold 15). Drivers by points: if/else 40, boolean chains 4, loops 3, error handling 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 · specify_cli.ensure_executable_scripts (cognitive 47) · ×1
  • specify_cli.ensure_executable_scripts (cognitive 47) src/specify_cli/__init__.py:217 — specify_cli.ensure_executable_scripts has cognitive complexity 47 (threshold 15). Drivers by points: if/else 30, error handling 6, loops 6, ternaries 4, 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.py:458 — events._find_command_template has cognitive complexity 47 (threshold 15). Drivers by points: if/else 33, loops 10, 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:887 — _download_security.safe_extract_zip has cognitive complexity 46 (threshold 15). Drivers by points: if/else 28, error handling 11, loops 5, 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 · _commands._install_workflow_from_catalog (cognitive 46) · ×1
  • _commands._install_workflow_from_catalog (cognitive 46) src/specify_cli/workflows/_commands.py:2153 — _commands._install_workflow_from_catalog has cognitive complexity 46 (threshold 15). Drivers by points: if/else 21, error handling 14, boolean chains 8, loops 2, ternaries 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PresetManager._reconcile_skills (cognitive 45) · ×1
  • PresetManager._reconcile_skills (cognitive 45) src/specify_cli/presets/__init__.py:2093 — PresetManager._reconcile_skills has cognitive complexity 45 (threshold 15). Drivers by points: if/else 32, loops 6, ternaries 4, 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 · ExtensionCatalog.search (cognitive 44) · ×1
  • ExtensionCatalog.search (cognitive 44) src/specify_cli/extensions/__init__.py:3974 — ExtensionCatalog.search has cognitive complexity 44 (threshold 15). Drivers by points: if/else 26, ternaries 16, 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 · integration_status.build_integration_status_report (cognitive 44) · ×1
  • integration_status.build_integration_status_report (cognitive 44) src/specify_cli/integration_status.py:352 — integration_status.build_integration_status_report has cognitive complexity 44 (threshold 15). Drivers by points: if/else 27, boolean chains 7, loops 5, error handling 4, ternaries 1 (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 · workflows.load_custom_steps (cognitive 44) · ×1
  • workflows.load_custom_steps (cognitive 44) src/specify_cli/workflows/__init__.py:75 — workflows.load_custom_steps has cognitive complexity 44 (threshold 15). Drivers by points: if/else 27, loops 7, boolean chains 5, error handling 5 (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 · _commands.extension_info (cognitive 42) · ×1
  • _commands.extension_info (cognitive 42) src/specify_cli/extensions/_commands.py:1277 — _commands.extension_info has cognitive complexity 42 (threshold 15). Drivers by points: if/else 33, ternaries 5, loops 4 (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 · _migrate_commands.integration_upgrade (cognitive 42) · ×1
  • _migrate_commands.integration_upgrade (cognitive 42) src/specify_cli/integrations/_migrate_commands.py:584 — _migrate_commands.integration_upgrade has cognitive complexity 42 (threshold 15). Drivers by points: if/else 27, error handling 8, boolean chains 5, loops 2 (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 · PresetResolver.resolve_content (cognitive 42) · ×1
  • PresetResolver.resolve_content (cognitive 42) src/specify_cli/presets/__init__.py:5552 — PresetResolver.resolve_content has cognitive complexity 42 (threshold 15). Drivers by points: if/else 34, loops 5, boolean chains 3 (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 · IntegrationBase.process_template (cognitive 41) · ×1
  • IntegrationBase.process_template (cognitive 41) src/specify_cli/integrations/base.py:759 — IntegrationBase.process_template has cognitive complexity 41 (threshold 15). Drivers by points: if/else 37, 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 · _commands.preset_add (cognitive 41) · ×1
  • _commands.preset_add (cognitive 41) src/specify_cli/presets/_commands.py:79 — _commands.preset_add has cognitive complexity 41 (threshold 15). Drivers by points: if/else 26, error handling 7, ternaries 6, 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 · _version.self_upgrade (cognitive 40) · ×1
  • _version.self_upgrade (cognitive 40) src/specify_cli/_version.py:1224 — _version.self_upgrade has cognitive complexity 40 (threshold 15). Drivers by points: if/else 27, boolean chains 5, ternaries 4, error handling 2, loops 2 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · _install_commands.integration_uninstall (cognitive 40) · ×1
  • _install_commands.integration_uninstall (cognitive 40) src/specify_cli/integrations/_install_commands.py:218 — _install_commands.integration_uninstall has cognitive complexity 40 (threshold 15). Drivers by points: if/else 27, ternaries 7, boolean chains 3, loops 2, 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 · IntegrationCatalog.search (cognitive 40) · ×1
  • IntegrationCatalog.search (cognitive 40) src/specify_cli/integrations/catalog.py:292 — IntegrationCatalog.search has cognitive complexity 40 (threshold 15). Drivers by points: if/else 20, ternaries 18, 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 · 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 33, 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 · _commands._print_extension_info (cognitive 38) · ×1
  • _commands._print_extension_info (cognitive 38) src/specify_cli/extensions/_commands.py:1386 — _commands._print_extension_info has cognitive complexity 38 (threshold 15). Drivers by points: if/else 23, ternaries 11, loops 3, boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _commands._install_workflow_package (cognitive 38) · ×1
  • _commands._install_workflow_package (cognitive 38) src/specify_cli/workflows/_commands.py:963 — _commands._install_workflow_package has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16, error handling 13, boolean chains 7, 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 · _commands.workflow_info (cognitive 38) · ×1
  • _commands.workflow_info (cognitive 38) src/specify_cli/workflows/_commands.py:2864 — _commands.workflow_info has cognitive complexity 38 (threshold 15). Drivers by points: if/else 23, loops 6, ternaries 5, error handling 3, boolean chains 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 · IntegrationManifest.uninstall (cognitive 37) · ×1
  • IntegrationManifest.uninstall (cognitive 37) src/specify_cli/integrations/manifest.py:325 — IntegrationManifest.uninstall has cognitive complexity 37 (threshold 15). Drivers by points: error handling 15, if/else 13, loops 5, boolean chains 4 (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 · PresetManager._unregister_skills (cognitive 37) · ×1
  • PresetManager._unregister_skills (cognitive 37) src/specify_cli/presets/__init__.py:3057 — PresetManager._unregister_skills has cognitive complexity 37 (threshold 15). Drivers by points: if/else 20, ternaries 8, loops 7, 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 · GateStep.execute (cognitive 37) · ×1
  • GateStep.execute (cognitive 37) src/specify_cli/workflows/steps/gate/__init__.py:39 — GateStep.execute has cognitive complexity 37 (threshold 15). Drivers by points: if/else 30, boolean chains 7 (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 · events.collect_extension_events (cognitive 36) · ×1
  • events.collect_extension_events (cognitive 36) src/specify_cli/events.py:944 — events.collect_extension_events has cognitive complexity 36 (threshold 15). Drivers by points: if/else 22, error handling 7, boolean chains 4, loops 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExtensionManager._find_extension_skill_dirs (cognitive 36) · ×1
  • ExtensionManager._find_extension_skill_dirs (cognitive 36) src/specify_cli/extensions/__init__.py:1595 — ExtensionManager._find_extension_skill_dirs has cognitive complexity 36 (threshold 15). Drivers by points: if/else 18, error handling 8, ternaries 5, loops 3, 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:1762 — ExtensionManager._extension_owned_skill_names has cognitive complexity 36 (threshold 15). Drivers by points: if/else 21, error handling 8, loops 3, ternaries 3, 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 · PresetManager._register_command_from_path (cognitive 36) · ×1
  • PresetManager._register_command_from_path (cognitive 36) src/specify_cli/presets/__init__.py:1916 — PresetManager._register_command_from_path has cognitive complexity 36 (threshold 15). Drivers by points: if/else 25, loops 7, boolean chains 2, error handling 2 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PresetCatalog.search (cognitive 36) · ×1
  • PresetCatalog.search (cognitive 36) src/specify_cli/presets/__init__.py:4658 — PresetCatalog.search has cognitive complexity 36 (threshold 15). Drivers by points: if/else 18, ternaries 16, error handling 1, 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 · _commands.workflow_update (cognitive 36) · ×1
  • _commands.workflow_update (cognitive 36) src/specify_cli/workflows/_commands.py:2636 — _commands.workflow_update has cognitive complexity 36 (threshold 15). Drivers by points: if/else 25, error handling 8, 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 · _version._emit_failure (cognitive 34) · ×1
  • _version._emit_failure (cognitive 34) src/specify_cli/_version.py:1015 — _version._emit_failure has cognitive complexity 34 (threshold 15). Drivers by points: if/else 21, boolean chains 9, ternaries 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 · _install_commands.integration_install (cognitive 34) · ×1
  • _install_commands.integration_install (cognitive 34) src/specify_cli/integrations/_install_commands.py:40 — _install_commands.integration_install has cognitive complexity 34 (threshold 15). Drivers by points: if/else 24, boolean chains 5, error handling 3, 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 · PresetManager._infer_legacy_skill_provenance (cognitive 34) · ×1
  • PresetManager._infer_legacy_skill_provenance (cognitive 34) src/specify_cli/presets/__init__.py:2806 — PresetManager._infer_legacy_skill_provenance has cognitive complexity 34 (threshold 15). Drivers by points: if/else 19, loops 6, ternaries 5, error handling 3, 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 · _commands.preset_resolve (cognitive 34) · ×1
  • _commands.preset_resolve (cognitive 34) src/specify_cli/presets/_commands.py:348 — _commands.preset_resolve has cognitive complexity 34 (threshold 15). Drivers by points: if/else 23, loops 6, error handling 3, 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 · _download_security._preflight_zip_central_directory (cognitive 33) · ×1
  • _download_security._preflight_zip_central_directory (cognitive 33) src/specify_cli/_download_security.py:705 — _download_security._preflight_zip_central_directory has cognitive complexity 33 (threshold 15). Drivers by points: if/else 25, 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 · installer.install_bundle (cognitive 33) · ×1
  • installer.install_bundle (cognitive 33) src/specify_cli/bundler/services/installer.py:59 — installer.install_bundle has cognitive complexity 33 (threshold 15). Drivers by points: if/else 23, boolean chains 3, loops 3, error handling 2, ternaries 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 · ExtensionManager.remove (cognitive 33) · ×1
  • ExtensionManager.remove (cognitive 33) src/specify_cli/extensions/__init__.py:2746 — ExtensionManager.remove has cognitive complexity 33 (threshold 15). Drivers by points: if/else 23, loops 6, boolean chains 2, ternaries 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/catalog.py:497 — IntegrationCatalog.remove_catalog has cognitive complexity 33 (threshold 15). Drivers by points: if/else 25, error handling 6, 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:723 — _commands._commit_workflow_file has cognitive complexity 33 (threshold 15). Drivers by points: error handling 18, if/else 11, 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 · update_agent_context._upsert_section (cognitive 32) · ×1
  • update_agent_context._upsert_section (cognitive 32) extensions/agent-context/scripts/python/update_agent_context.py:244 — update_agent_context._upsert_section has cognitive complexity 32 (threshold 15). Drivers by points: if/else 21, boolean chains 6, ternaries 5 (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 · ExtensionManager._collect_manifest_command_names (cognitive 32) · ×1
  • ExtensionManager._collect_manifest_command_names (cognitive 32) src/specify_cli/extensions/__init__.py:927 — ExtensionManager._collect_manifest_command_names has cognitive complexity 32 (threshold 15). Drivers by points: if/else 29, loops 3 (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 · bundle.bundle_info (cognitive 31) · ×1
  • bundle.bundle_info (cognitive 31) src/specify_cli/commands/bundle/__init__.py:204 — bundle.bundle_info has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16, loops 9, boolean chains 3, ternaries 2, 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 · _commands.extension_search (cognitive 31) · ×1
  • _commands.extension_search (cognitive 31) src/specify_cli/extensions/_commands.py:1182 — _commands.extension_search has cognitive complexity 31 (threshold 15). Drivers by points: if/else 22, ternaries 5, 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 · _query_commands.integration_list (cognitive 31) · ×1
  • _query_commands.integration_list (cognitive 31) src/specify_cli/integrations/_query_commands.py:28 — _query_commands.integration_list has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16, ternaries 8, loops 3, boolean chains 2, 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 · SkillsIntegration.setup (cognitive 31) · ×1
  • SkillsIntegration.setup (cognitive 31) src/specify_cli/integrations/base.py:1677 — SkillsIntegration.setup has cognitive complexity 31 (threshold 15). Drivers by points: if/else 24, error handling 5, 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 · _query_commands.integration_info (cognitive 29) · ×1
  • _query_commands.integration_info (cognitive 29) src/specify_cli/integrations/_query_commands.py:366 — _query_commands.integration_info has cognitive complexity 29 (threshold 15). Drivers by points: if/else 23, ternaries 3, boolean chains 2, error handling 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 · IntegrationCatalog.add_catalog (cognitive 29) · ×1
  • IntegrationCatalog.add_catalog (cognitive 29) src/specify_cli/integrations/catalog.py:384 — IntegrationCatalog.add_catalog has cognitive complexity 29 (threshold 15). Drivers by points: if/else 19, error handling 7, boolean chains 1, loops 1, ternaries 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 · PresetManager._register_commands (cognitive 29) · ×1
  • PresetManager._register_commands (cognitive 29) src/specify_cli/presets/__init__.py:828 — PresetManager._register_commands has cognitive complexity 29 (threshold 15). Drivers by points: if/else 25, 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 · StepCatalog._get_merged_steps (cognitive 29) · ×1
  • StepCatalog._get_merged_steps (cognitive 29) src/specify_cli/workflows/catalog.py:1302 — StepCatalog._get_merged_steps has cognitive complexity 29 (threshold 15). Drivers by points: if/else 19, loops 7, error handling 2, boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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 10, ternaries 9, error handling 5, boolean chains 2, loops 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 · kimi._migrate_legacy_kimi_skills_dir (cognitive 28) · ×1
  • kimi._migrate_legacy_kimi_skills_dir (cognitive 28) src/specify_cli/integrations/kimi/__init__.py:217 — kimi._migrate_legacy_kimi_skills_dir has cognitive complexity 28 (threshold 15). Drivers by points: if/else 20, boolean chains 4, error handling 3, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _commands.workflow_run (cognitive 28) · ×1
  • _commands.workflow_run (cognitive 28) src/specify_cli/workflows/_commands.py:1309 — _commands.workflow_run has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15, error handling 4, ternaries 4, boolean chains 3, loops 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · merge.find_step (cognitive 28) · ×1
  • merge.find_step (cognitive 28) src/specify_cli/workflows/overlays/merge.py:32 — merge.find_step has cognitive complexity 28 (threshold 15). Drivers by points: if/else 22, loops 6 (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/steps/init/__init__.py:78 — InitStep.execute has cognitive complexity 28 (threshold 15). Drivers by points: if/else 19, boolean chains 5, error handling 2, loops 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 · events.validate_events (cognitive 27) · ×1
  • events.validate_events (cognitive 27) src/specify_cli/events.py:1674 — events.validate_events has cognitive complexity 27 (threshold 15). Drivers by points: if/else 21, boolean chains 4, loops 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 · PresetManager._delete_agent_preset_skills (cognitive 27) · ×1
  • PresetManager._delete_agent_preset_skills (cognitive 27) src/specify_cli/presets/__init__.py:3196 — PresetManager._delete_agent_preset_skills has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15, loops 7, error handling 2, ternaries 2, 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 · WorkflowEngine._run_fan_out (cognitive 27) · ×1
  • WorkflowEngine._run_fan_out (cognitive 27) src/specify_cli/workflows/engine.py:1345 — WorkflowEngine._run_fan_out has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12, loops 11, error handling 3, boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · merge._remove_sources_recursively (cognitive 27) · ×1
  • merge._remove_sources_recursively (cognitive 27) src/specify_cli/workflows/overlays/merge.py:182 — merge._remove_sources_recursively has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16, loops 10, 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:2620 — ExtensionManager.scaffold_config has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13, boolean chains 6, error handling 4, ternaries 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 · integration_status._manifest_file_status (cognitive 26) · ×1
  • integration_status._manifest_file_status (cognitive 26) src/specify_cli/integration_status.py:234 — integration_status._manifest_file_status has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16, error handling 9, 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 · WorkflowCatalog.search (cognitive 26) · ×1
  • WorkflowCatalog.search (cognitive 26) src/specify_cli/workflows/catalog.py:650 — WorkflowCatalog.search has cognitive complexity 26 (threshold 15). Drivers by points: if/else 18, boolean chains 4, ternaries 3, 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/overlays/merge.py:153 — merge._record_sources_recursively has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16, loops 10 (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 · update_agent_context._resolve_plan_path (cognitive 25) · ×1
  • update_agent_context._resolve_plan_path (cognitive 25) extensions/agent-context/scripts/python/update_agent_context.py:141 — update_agent_context._resolve_plan_path has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13, error handling 9, ternaries 2, 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 · BundleManifest.structural_errors (cognitive 25) · ×1
  • BundleManifest.structural_errors (cognitive 25) src/specify_cli/bundler/models/manifest.py:162 — BundleManifest.structural_errors has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15, boolean chains 7, loops 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 17, error handling 5, ternaries 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 · _commands.workflow_step_remove (cognitive 25) · ×1
  • _commands.workflow_step_remove (cognitive 25) src/specify_cli/workflows/_commands.py:3490 — _commands.workflow_step_remove has cognitive complexity 25 (threshold 15). Drivers by points: error handling 12, if/else 10, 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 · WorkflowCatalog._get_merged_workflows (cognitive 25) · ×1
  • WorkflowCatalog._get_merged_workflows (cognitive 25) src/specify_cli/workflows/catalog.py:608 — WorkflowCatalog._get_merged_workflows has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15, loops 7, error handling 2, 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 · ExtensionManager.unregister_agent_artifacts (cognitive 24) · ×1
  • ExtensionManager.unregister_agent_artifacts (cognitive 24) src/specify_cli/extensions/__init__.py:2837 — ExtensionManager.unregister_agent_artifacts has cognitive complexity 24 (threshold 15). Drivers by points: if/else 20, boolean chains 3, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _query_commands.integration_search (cognitive 24) · ×1
  • _query_commands.integration_search (cognitive 24) src/specify_cli/integrations/_query_commands.py:270 — _query_commands.integration_search has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19, 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 · HermesIntegration.setup (cognitive 24) · ×1
  • HermesIntegration.setup (cognitive 24) src/specify_cli/integrations/hermes/__init__.py:76 — HermesIntegration.setup has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18, error handling 4, 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 · _github_http.resolve_github_release_asset_api_url (cognitive 23) · ×1
  • _github_http.resolve_github_release_asset_api_url (cognitive 23) src/specify_cli/_github_http.py:67 — _github_http.resolve_github_release_asset_api_url has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10, boolean chains 6, error handling 4, ternaries 2, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · init._install_extension_during_init (cognitive 23) · ×1
  • init._install_extension_during_init (cognitive 23) src/specify_cli/commands/init.py:85 — init._install_extension_during_init has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19, boolean chains 2, error handling 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 · _commands.extension_remove (cognitive 23) · ×1
  • _commands.extension_remove (cognitive 23) src/specify_cli/extensions/_commands.py:1110 — _commands.extension_remove has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16, ternaries 7 (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 · CopilotIntegration.is_skills_mode (cognitive 23) · ×1
  • CopilotIntegration.is_skills_mode (cognitive 23) src/specify_cli/integrations/copilot/__init__.py:175 — CopilotIntegration.is_skills_mode has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13, boolean chains 7, error handling 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PresetManager._build_extension_skill_restore_index (cognitive 23) · ×1
  • PresetManager._build_extension_skill_restore_index (cognitive 23) src/specify_cli/presets/__init__.py:2561 — PresetManager._build_extension_skill_restore_index has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14, error handling 5, loops 3, 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/__init__.py:5201 — PresetResolver.resolve_extension_command_via_manifest has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15, error handling 5, 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 · PresetResolver._find_bundled_core (cognitive 23) · ×1
  • PresetResolver._find_bundled_core (cognitive 23) src/specify_cli/presets/__init__.py:5502 — PresetResolver._find_bundled_core has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17, loops 4, 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 · _commands.workflow_status (cognitive 23) · ×1
  • _commands.workflow_status (cognitive 23) src/specify_cli/workflows/_commands.py:1569 — _commands.workflow_status has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14, loops 5, error handling 4 (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 · WorkflowRegistry.save (cognitive 23) · ×1
  • WorkflowRegistry.save (cognitive 23) src/specify_cli/workflows/catalog.py:140 — WorkflowRegistry.save has cognitive complexity 23 (threshold 15). Drivers by points: error handling 10, if/else 9, 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 · ProjectOverlaySource.collect (cognitive 23) · ×1
  • ProjectOverlaySource.collect (cognitive 23) src/specify_cli/workflows/overlays/layer_sources.py:127 — ProjectOverlaySource.collect has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13, error handling 5, 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 · _version._run_installer (cognitive 22) · ×1
  • _version._run_installer (cognitive 22) src/specify_cli/_version.py:768 — _version._run_installer has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13, error handling 6, 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/bundler/services/packager.py:113 — packager._collect_files has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16, boolean chains 3, loops 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 · events._build_opencode_plugin (cognitive 22) · ×1
  • events._build_opencode_plugin (cognitive 22) src/specify_cli/events.py:1728 — events._build_opencode_plugin has cognitive complexity 22 (threshold 15). Drivers by points: if/else 18, loops 3, boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _commands.catalog_list (cognitive 22) · ×1
  • _commands.catalog_list (cognitive 22) src/specify_cli/extensions/_commands.py:420 — _commands.catalog_list has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11, error handling 6, boolean chains 2, ternaries 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 · _helpers._parse_integration_options (cognitive 22) · ×1
  • _helpers._parse_integration_options (cognitive 22) src/specify_cli/integrations/_helpers.py:187 — _helpers._parse_integration_options has cognitive complexity 22 (threshold 15). Drivers by points: if/else 18, 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:46 — GenericIntegration._resolve_commands_dir has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16, boolean chains 4, loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _commands.preset_catalog_list (cognitive 22) · ×1
  • _commands.preset_catalog_list (cognitive 22) src/specify_cli/presets/_commands.py:658 — _commands.preset_catalog_list has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11, error handling 6, boolean chains 2, ternaries 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 · common.resolve_template (cognitive 21) · ×1
  • common.resolve_template (cognitive 21) scripts/python/common.py:216 — common.resolve_template has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15, loops 4, 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 · _download_security.detect_archive_format (cognitive 21) · ×1
  • _download_security.detect_archive_format (cognitive 21) src/specify_cli/_download_security.py:111 — _download_security.detect_archive_format has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9, boolean chains 6, error handling 5, 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 · yamlio.dump_json (cognitive 21) · ×1
  • yamlio.dump_json (cognitive 21) src/specify_cli/bundler/lib/yamlio.py:126 — yamlio.dump_json has cognitive complexity 21 (threshold 15). Drivers by points: error handling 9, if/else 9, 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 · ConfigManager._get_env_config (cognitive 21) · ×1
  • ConfigManager._get_env_config (cognitive 21) src/specify_cli/extensions/__init__.py:4329 — ConfigManager._get_env_config has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, loops 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 · _migrate_commands._installed_presets_affecting_agent (cognitive 21) · ×1
  • _migrate_commands._installed_presets_affecting_agent (cognitive 21) src/specify_cli/integrations/_migrate_commands.py:131 — _migrate_commands._installed_presets_affecting_agent has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, 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:115 — AlquimiaAIIntegration._inject_frontmatter_flag has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, 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:136 — ClaudeIntegration._inject_frontmatter_flag has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, 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:44 — VibeIntegration._inject_frontmatter_flag has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, 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 · _commands.preset_info (cognitive 21) · ×1
  • _commands.preset_info (cognitive 21) src/specify_cli/presets/_commands.py:434 — _commands.preset_info has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, boolean chains 2, loops 2, ternaries 2, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CommandStep.execute (cognitive 21) · ×1
  • CommandStep.execute (cognitive 21) src/specify_cli/workflows/steps/command/__init__.py:31 — CommandStep.execute has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13, boolean chains 7, 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 · CommandRegistrar.register_commands_for_non_skill_agents (cognitive 20) · ×1
  • CommandRegistrar.register_commands_for_non_skill_agents (cognitive 20) src/specify_cli/agents.py:1199 — CommandRegistrar.register_commands_for_non_skill_agents has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, error handling 3, 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 · events._resolve_event_command_argv (cognitive 20) · ×1
  • events._resolve_event_command_argv (cognitive 20) src/specify_cli/events.py:536 — events._resolve_event_command_argv has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13, boolean chains 4, error handling 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ExtensionManager._get_installed_command_name_map (cognitive 20) · ×1
  • ExtensionManager._get_installed_command_name_map (cognitive 20) src/specify_cli/extensions/__init__.py:1008 — ExtensionManager._get_installed_command_name_map has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, loops 6 (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:1143 — ExtensionManager._get_skills_dir has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11, boolean chains 4, error handling 3, ternaries 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HookExecutor._evaluate_condition (cognitive 20) · ×1
  • HookExecutor._evaluate_condition (cognitive 20) src/specify_cli/extensions/__init__.py:4930 — HookExecutor._evaluate_condition has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, ternaries 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 · integration_scaffold.scaffold_integration (cognitive 20) · ×1
  • integration_scaffold.scaffold_integration (cognitive 20) src/specify_cli/integration_scaffold.py:203 — integration_scaffold.scaffold_integration has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9, error handling 7, loops 3, 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 · _query_commands.integration_catalog_list (cognitive 20) · ×1
  • _query_commands.integration_catalog_list (cognitive 20) src/specify_cli/integrations/_query_commands.py:467 — _query_commands.integration_catalog_list has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11, ternaries 6, 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 · PresetResolver.resolve_with_source (cognitive 20) · ×1
  • PresetResolver.resolve_with_source (cognitive 20) src/specify_cli/presets/__init__.py:5249 — PresetResolver.resolve_with_source has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8, error handling 5, loops 3, ternaries 3, 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 · WorkflowCatalog._load_catalog_config (cognitive 20) · ×1
  • WorkflowCatalog._load_catalog_config (cognitive 20) src/specify_cli/workflows/catalog.py:331 — WorkflowCatalog._load_catalog_config has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, error handling 3, 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._load_catalog_config (cognitive 20) · ×1
  • StepCatalog._load_catalog_config (cognitive 20) src/specify_cli/workflows/catalog.py:1039 — StepCatalog._load_catalog_config has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, error handling 3, 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 20) · ×1
  • StepCatalog._fetch_single_catalog (cognitive 20) src/specify_cli/workflows/catalog.py:1200 — StepCatalog._fetch_single_catalog has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10, error handling 8, 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._interpolate_expressions (cognitive 20) · ×1
  • expressions._interpolate_expressions (cognitive 20) src/specify_cli/workflows/expressions.py:227 — expressions._interpolate_expressions has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, loops 3, ternaries 2, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExtensionCatalog._fetch_single_catalog (cognitive 19) · ×1
  • ExtensionCatalog._fetch_single_catalog (cognitive 19) src/specify_cli/extensions/__init__.py:3635 — ExtensionCatalog._fetch_single_catalog has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9, error handling 8, 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 · _commands.extension_enable (cognitive 19) · ×1
  • _commands.extension_enable (cognitive 19) src/specify_cli/extensions/_commands.py:2532 — _commands.extension_enable has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10, loops 7, boolean chains 1, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AlquimiaAIIntegration.inject_argument_hint (cognitive 19) · ×1
  • AlquimiaAIIntegration.inject_argument_hint (cognitive 19) src/specify_cli/integrations/alquimia/__init__.py:67 — AlquimiaAIIntegration.inject_argument_hint has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, boolean chains 2, 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 · IntegrationCatalog._fetch_single_catalog (cognitive 19) · ×1
  • IntegrationCatalog._fetch_single_catalog (cognitive 19) src/specify_cli/integrations/catalog.py:156 — IntegrationCatalog._fetch_single_catalog has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10, error handling 8, 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 · ClaudeIntegration.inject_argument_hint (cognitive 19) · ×1
  • ClaudeIntegration.inject_argument_hint (cognitive 19) src/specify_cli/integrations/claude/__init__.py:69 — ClaudeIntegration.inject_argument_hint has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, boolean chains 2, 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 · PresetManager.install_from_directory (cognitive 19) · ×1
  • PresetManager.install_from_directory (cognitive 19) src/specify_cli/presets/__init__.py:3474 — PresetManager.install_from_directory has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, error handling 5, 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 · PresetCatalog._load_catalog_config (cognitive 19) · ×1
  • PresetCatalog._load_catalog_config (cognitive 19) src/specify_cli/presets/__init__.py:4200 — PresetCatalog._load_catalog_config has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, error handling 3, 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 · WorkflowEngine._coerce_input (cognitive 19) · ×1
  • WorkflowEngine._coerce_input (cognitive 19) src/specify_cli/workflows/engine.py:1628 — WorkflowEngine._coerce_input has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, boolean chains 2, error handling 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 · StepListComposer._collect_base_step_ids (cognitive 19) · ×1
  • StepListComposer._collect_base_step_ids (cognitive 19) src/specify_cli/workflows/overlays/composer.py:79 — StepListComposer._collect_base_step_ids has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, loops 6 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · merge._all_base_step_ids (cognitive 19) · ×1
  • merge._all_base_step_ids (cognitive 19) src/specify_cli/workflows/overlays/merge.py:63 — merge._all_base_step_ids has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, loops 6 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · merge._init_sources_recursively (cognitive 19) · ×1
  • merge._init_sources_recursively (cognitive 19) src/specify_cli/workflows/overlays/merge.py:132 — merge._init_sources_recursively has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, loops 6 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · merge._build_attribution (cognitive 19) · ×1
  • merge._build_attribution (cognitive 19) src/specify_cli/workflows/overlays/merge.py:209 — merge._build_attribution has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, loops 6 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PromptStep.execute (cognitive 19) · ×1
  • PromptStep.execute (cognitive 19) src/specify_cli/workflows/steps/prompt/__init__.py:40 — PromptStep.execute has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, boolean chains 7 (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 · setup_plan.main (cognitive 18) · ×1
  • setup_plan.main (cognitive 18) scripts/python/setup_plan.py:29 — setup_plan.main has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, ternaries 4, boolean chains 1, error handling 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 · YamlIntegration.setup (cognitive 18) · ×1
  • YamlIntegration.setup (cognitive 18) src/specify_cli/integrations/base.py:1470 — YamlIntegration.setup has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8, ternaries 7, 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:168 — ForgeIntegration._apply_forge_transformations has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, 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 · PresetManager._merge_pack_registered_skills (cognitive 18) · ×1
  • PresetManager._merge_pack_registered_skills (cognitive 18) src/specify_cli/presets/__init__.py:2040 — PresetManager._merge_pack_registered_skills has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, boolean chains 2, ternaries 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 · PresetCatalog.download_pack (cognitive 18) · ×1
  • PresetCatalog.download_pack (cognitive 18) src/specify_cli/presets/__init__.py:4744 — PresetCatalog.download_pack has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, 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 · expressions._filter_map (cognitive 18) · ×1
  • expressions._filter_map (cognitive 18) src/specify_cli/workflows/expressions.py:56 — expressions._filter_map has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, loops 6 (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/overlays/schema.py:115 — schema.validate_overlay_yaml has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, 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 · _utils.merge_json_files (cognitive 17) · ×1
  • _utils.merge_json_files (cognitive 17) src/specify_cli/_utils.py:222 — _utils.merge_json_files has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, error handling 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · catalog_config.add_source (cognitive 17) · ×1
  • catalog_config.add_source (cognitive 17) src/specify_cli/bundler/commands_impl/catalog_config.py:135 — catalog_config.add_source has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, boolean chains 5, error handling 1, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExtensionCatalog.download_extension (cognitive 17) · ×1
  • ExtensionCatalog.download_extension (cognitive 17) src/specify_cli/extensions/__init__.py:4060 — ExtensionCatalog.download_extension 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 · _commands.extension_list (cognitive 17) · ×1
  • _commands.extension_list (cognitive 17) src/specify_cli/extensions/_commands.py:384 — _commands.extension_list has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 9, boolean chains 3, if/else 3, 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 · 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 13, 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 · shared_infra._ensure_safe_shared_directory (cognitive 17) · ×1
  • shared_infra._ensure_safe_shared_directory (cognitive 17) src/specify_cli/shared_infra.py:163 — shared_infra._ensure_safe_shared_directory has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, error handling 5, 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:615 — _commands._stage_workflow_file has cognitive complexity 17 (threshold 15). Drivers by points: error handling 10, if/else 7 (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.workflow_resume (cognitive 17) · ×1
  • _commands.workflow_resume (cognitive 17) src/specify_cli/workflows/_commands.py:1458 — _commands.workflow_resume has cognitive complexity 17 (threshold 15). Drivers by points: error handling 10, if/else 6, boolean chains 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WorkflowCatalog._fetch_single_catalog (cognitive 17) · ×1
  • WorkflowCatalog._fetch_single_catalog (cognitive 17) src/specify_cli/workflows/catalog.py:505 — WorkflowCatalog._fetch_single_catalog has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, error handling 7, 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 · merge.validate_edits (cognitive 17) · ×1
  • merge.validate_edits (cognitive 17) src/specify_cli/workflows/overlays/merge.py:374 — merge.validate_edits has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, 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 · create_new_feature._parse_args (cognitive 16) · ×1
  • create_new_feature._parse_args (cognitive 16) scripts/python/create_new_feature.py:101 — create_new_feature._parse_args has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, 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 · setup_tasks.main (cognitive 16) · ×1
  • setup_tasks.main (cognitive 16) scripts/python/setup_tasks.py:68 — setup_tasks.main has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, ternaries 3, boolean chains 1, error handling 1, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · DroidIntegration._inject_frontmatter_flag (cognitive 16) · ×1
  • DroidIntegration._inject_frontmatter_flag (cognitive 16) src/specify_cli/integrations/droid/__init__.py:36 — DroidIntegration._inject_frontmatter_flag has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, 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:192 — HermesIntegration.teardown has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, error handling 4, boolean chains 3, 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 · KimiIntegration.teardown (cognitive 16) · ×1
  • KimiIntegration.teardown (cognitive 16) src/specify_cli/integrations/kimi/__init__.py:129 — KimiIntegration.teardown has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, error handling 6, loops 2, 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 · shared_infra.refresh_shared_templates (cognitive 16) · ×1
  • shared_infra.refresh_shared_templates (cognitive 16) src/specify_cli/shared_infra.py:329 — shared_infra.refresh_shared_templates has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, loops 4, 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:419 — _commands._read_response_within_limit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, error handling 5, 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 · _commands._workflow_install_transaction (cognitive 16) · ×1
  • _commands._workflow_install_transaction (cognitive 16) src/specify_cli/workflows/_commands.py:674 — _commands._workflow_install_transaction has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, error handling 4, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · expressions._apply_filter (cognitive 16) · ×1
  • expressions._apply_filter (cognitive 16) src/specify_cli/workflows/expressions.py:369 — expressions._apply_filter has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · schema._parse_edit (cognitive 16) · ×1
  • schema._parse_edit (cognitive 16) src/specify_cli/workflows/overlays/schema.py:61 — schema._parse_edit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D4 · Code Duplication · Duplicated block (32 lines × 2) · ×1
  • Duplicated block (32 lines × 2) src/specify_cli/workflows/catalog.py:448 — src/specify_cli/workflows/catalog.py:448-479 | src/specify_cli/workflows/catalog.py:1143-1174 — both copies are in the same file, so extract the 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/catalog.py:448` 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 (31 lines × 2) · ×1
  • Duplicated block (31 lines × 2) src/specify_cli/integrations/base.py:388 — src/specify_cli/integrations/base.py:388-421 | src/specify_cli/integrations/copilot/__init__.py:398-428 — 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 (29 lines × 2) · ×1
  • Duplicated block (29 lines × 2) src/specify_cli/extensions/__init__.py:3934 — src/specify_cli/extensions/__init__.py:3934-3962 | src/specify_cli/presets/__init__.py:4616-4644 — 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:3934` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (28 lines × 2) · ×1
  • Duplicated block (28 lines × 2) src/specify_cli/extensions/__init__.py:3552 — src/specify_cli/extensions/__init__.py:3552-3579 | src/specify_cli/presets/__init__.py:4281-4308 — 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 (25 lines × 2) · ×1
  • Duplicated block (25 lines × 2) src/specify_cli/workflows/catalog.py:745 — src/specify_cli/workflows/catalog.py:745-769 | src/specify_cli/workflows/catalog.py:1422-1446 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (17 lines × 3) · ×1
  • Duplicated block (17 lines × 3) src/specify_cli/_assets.py:36 — src/specify_cli/_assets.py:36-52 | src/specify_cli/_assets.py:59-75 | src/specify_cli/_assets.py:82-98 — 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 (14 lines × 4) · ×1
  • Duplicated block (14 lines × 4) src/specify_cli/integrations/alquimia/__init__.py:116 — src/specify_cli/integrations/alquimia/__init__.py:116-129 | src/specify_cli/integrations/claude/__init__.py:137-150 | src/specify_cli/integrations/droid/__init__.py:37-55 | src/specify_cli/integrations/vibe/__init__.py:45-61 — 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 (13 lines × 4) · ×1
  • Duplicated block (13 lines × 4) src/specify_cli/integrations/base.py:1045 — src/specify_cli/integrations/base.py:1045-1057 | src/specify_cli/integrations/base.py:1255-1267 | src/specify_cli/integrations/base.py:1486-1498 | src/specify_cli/integrations/forge/__init__.py:127-139 — there are 4 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 4 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/integrations/base.py:1045` 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/workflows/steps/command/__init__.py:232 — src/specify_cli/workflows/steps/command/__init__.py:232-245 | src/specify_cli/workflows/steps/prompt/__init__.py:262-276 | src/specify_cli/workflows/steps/shell/__init__.py:145-157 — 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/steps/command/__init__.py:232` 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 (11 lines × 3) · ×1
  • Duplicated block (11 lines × 3) src/specify_cli/presets/_commands.py:539 — src/specify_cli/presets/_commands.py:539-549 | src/specify_cli/presets/_commands.py:588-598 | src/specify_cli/presets/_commands.py:625-635 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×1
  • Duplicated block (10 lines × 3) src/specify_cli/presets/__init__.py:4238 — src/specify_cli/presets/__init__.py:4238-4251 | src/specify_cli/workflows/catalog.py:384-394 | src/specify_cli/workflows/catalog.py:1080-1089 — 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/__init__.py:4238` 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 (8 lines × 3) · ×1
  • Duplicated block (8 lines × 3) src/specify_cli/integrations/base.py:1019 — src/specify_cli/integrations/base.py:1019-1026 | src/specify_cli/integrations/base.py:1110-1117 | src/specify_cli/integrations/base.py:1579-1586 — 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 (7 lines × 3) · ×1
  • Duplicated block (7 lines × 3) src/specify_cli/presets/__init__.py:4271 — src/specify_cli/presets/__init__.py:4271-4277 | src/specify_cli/workflows/catalog.py:419-426 | src/specify_cli/workflows/catalog.py:1114-1121 — 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/__init__.py:4271` 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.
Recommendation — 8 finding(s)
D11 · Test Reliability · Test reliability not included · ×1
  • Test reliability not included — Test source is present (.py) but the built-in reliability runner does not support this repository's ecosystem, so flakiness couldn't be assessed. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
D16 · Bus Factor · Off-boarding risk · ×1
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 1 significant file(s) lose their only recent owner: src/specify_cli/integration_status.py. Pair on, review, or document these before any departure.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 3 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (5 single-owned of 96 analysed files in total, counted over production source files of roughly 100 lines or more, excluding tests, vendored, generated and example/demo trees, largest first). They are anonymized user #2 (1 file(s)), anonymized user #3 (1 file(s)), anonymized user #4 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above.
D29 · Static Analysis (SAST) · Low · ×1
  • Low: subprocess-shell-true src/specify_cli/workflows/steps/shell/__init__.py:58 — Found 'subprocess' function 'run' with 'shell=True'. This is dangerous because this call will spawn the command using a shell process. Doing so propagates current shell settings and variables, which makes it much easier for a malicious actor to execute commands. Use 'shell=False' instead. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is.
D36 · Supply-chain Provenance & Signing · No build provenance · ×1
  • No build provenance — No SLSA provenance generation or build attestation found in CI — nothing binds a released artifact to the build that produced it, so a consumer cannot tell your artifact from a substituted one. On GitHub Actions, `actions/attest-build-provenance` (or slsa-github-generator) emits one from the job's own OIDC identity; elsewhere, run `cosign attest` over the released artifact from the release pipeline and publish the attestation beside it.
D36 · Supply-chain Provenance & Signing · No artifact signing · ×1
  • No artifact signing — No artifact signing found in CI — sign your released artifacts with whatever your ecosystem ships (a GPG/minisign detached signature — or `cosign sign-blob` — over the release archives, or over a checksum file published alongside them, PEP 740 attestations via `pypa/gh-action-pypi-publish` under PyPI Trusted Publishing (OIDC) for wheels/sdists) so consumers can verify what you built.
D36 · Supply-chain Provenance & Signing · No SBOM · ×1
  • No SBOM — No SBOM generation or committed SBOM found — produce one with what your ecosystem ships (`cyclonedx-py` over the resolved Python environment/lockfile, `syft` (or `anchore/sbom-action` in CI) over the source tree or released image). Publish it as a release asset (`*.spdx.json` / `*.cdx.json`) so consumers can see what they are installing.
D8 · Code Coverage · Coverage not included · ×1
  • Coverage not included — suite not readable by the collector — 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`) into the repo working tree before the scan — a CI step is the usual place, since the artefact is commonly gitignored.
Info — 2 finding(s)
D12 · Dependency Hygiene · Dependency hygiene not measured · ×1
  • Dependency hygiene not measured — dependency manifest found but not parsed for hygiene — This repository's dependency manifest (a Python pyproject.toml/requirements.txt (pip/uv/Poetry)) was found, but this pass cannot parse it for hygiene, so no package was assessed. Zero packages read is NOT a clean dependency tree, so this is NOT SCORED — a gap in the analyzer, not a verdict about this repository. This row is about dependency HYGIENE — outdated, deprecated or unmaintained direct dependencies; known CVEs in the same dependency graph are a separate question, reported under D38 wherever the manifest is OSV-readable.
D22 · Internal API Consistency · No exposed public API · ×1
  • No exposed public API — No intentionally-exposed types (IsPackable or .Contracts) to evaluate.

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)gitleaksgitleaks detect --no-banner --report-format json --report-path /dev/stdout --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D29 · Static Analysis (SAST)semgrepsemgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --json --quiet --timeout 0 --metrics off .4artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesnone (no readable dependency manifest)none (no readable dependency manifest): not present in this environment0
D31 · IaC & Container Securitytrivytrivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Terraform, Kubernetes/Helm, CloudFormation); nothing to scan.0
D32 · Data Compliance (PII/GDPR)semgrepsemgrep: not applicable — No PII/GDPR-handling patterns detected (p/gdpr ruleset) — no data-compliance surface to assess.0
D33 · JS/npm Dependency Vulnerabilitiestrivytrivy: not applicable — No JS/npm manifest or lockfile found outside build output (package.json, package-lock.json, yarn.lock, pnpm-lock.yaml, bun.lockb); no JS dependencies to scan.0
D38 · OSV Dependency Vulnerabilitiesosv-scannerosv-scanner: not applicable — No supported non-.NET dependency lockfile found outside build output (npm package-lock/yarn/pnpm/bun, Go go.mod, Rust Cargo.lock, Maven pom.xml, Gradle lockfiles, Python requirements.txt/poetry.lock/Pipfile.lock/pdm.lock, PHP composer.lock, Ruby Gemfile.lock, Elixir mix.lock, Dart pubspec.lock, Swift Package.resolved); nothing for OSV to scan. A NuGet-only repo stays NotApplicable — .NET CVEs are D30's domain.0
D40 · Network Egress Confinementruntime-hardeningruntime-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-hardeningruntime-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-hardeningruntime-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

Run 019fd08b-863f-7f0c-aa91-853ae374f70e · 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