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

T8y2/dbx

Measured 28 September 2026, 21:35 UTC

55% At Risk

Very large · 1,167,990 LoC · 117 projects · rebuild ~10.8 person-years · weakest lens: Accessibility (44%)

Findings by grade

568 critical 5338 serious 69 minor 44 could not be resolved — could be critical — see Limitations

This survey was produced by

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
28 September 2026, 21:35 UTC

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

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

63/68dimensions tool-verifieddeterministic · confidence 1.0 · 5 LLM-assisted, advisory
5914findings with an exact file:lineof 5975 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
68/136dimensions across the health lenses1167990 LoC · 117 projects — wide & deep
Chapters

Executive summary

⚠ A critical security finding caps this grade — resolve it before relying on the score below; see the Security lens.

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

The platform is a massive, high-value asset carrying significant risk. With a health score of 55%, the system is stable but fragile, facing a critical accessibility gap that threatens compliance and user trust. The sheer scale—nearly one million lines of production code—means that even small inefficiencies compound into substantial costs, while the weak accessibility foundation exposes the business to legal and reputational damage.

The most urgent issue is the severe accessibility deficit. At 44%, this is the weakest lens, creating a barrier for users and violating modern standards. This is not just a technical debt; it is a direct business risk. Remediation here offers the highest protection for the brand and ensures the platform serves all customers effectively. Ignoring this gap invites regulatory scrutiny and alienates a significant portion of the user base.

Secondly, the codebase imposes a hidden velocity tax. Complexity and duplication average a low 4.4 out of 10, meaning every change requires more effort than it should. This inefficiency slows delivery and increases costs across the entire organization. The cost of inaction is high, with annual drag estimated in thousands of engineer-days. Fixing the core accessibility issues pays for itself within months, turning a liability into a net positive by streamlining future development.

Despite these risks, the system shows strength in its architectural maturity and event-driven design, which are fully scored. The code is well-structured for scalability, and the team has built a robust foundation for handling complex workflows. This stability provides a solid base for remediation efforts, ensuring that fixes do not destabilize the core business logic.

Focus first on making custom controls keyboard-operable and enforcing accessibility in the toolchain. This single action has the highest leverage, breaking even quickly and reducing long-term drag. By addressing accessibility immediately, the business mitigates its greatest risk while unlocking faster, cheaper development. The picture is partial, as some areas were not measured, but the current data clearly points to accessibility as the priority.

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.
Accessibility 44% · 45% weightPerformance 60% · 25% weightReadiness 61% · 14% weightCode Health 65% · 8% weightSecurity 67% · 4% weightArchitecture 69% · 2% weightMaturity 71% · 1% weightEvent-Driven 100% · 1% weightEvent Sourcing 100% · 0% weight

Raise Accessibility 44 → 70 (the Healthy floor) ⇒ headline 55 → ~63.

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

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

  • D1 · useQueryEditorCompletion.useQueryEditorCompletion (cyclomatic 531) apps/desktop/src/components/editor/useQueryEditorCompletion.ts
  • D1 · server.createMockHost (cyclomatic 264) plugins/sdk/dev-host/server.mjs
  • D1 · useQueryEditorCompletionMetadata.useQueryEditorCompletionMetadata (cyclomatic 151) apps/desktop/src/components/editor/useQueryEditorCompletionMetadata.ts
  • D1 · dbx_sql_schema::schema_diff::generate_schema_sync_sql_inner (cyclomatic 150) crates/dbx-sql-schema/src/schema_diff.rs
  • D1 · useQueryEditorDiagnostics.useQueryEditorDiagnostics (cyclomatic 146) apps/desktop/src/components/editor/useQueryEditorDiagnostics.ts
  • D1 · useQueryEditorBatchSelection.useQueryEditorBatchSelection (cyclomatic 130) apps/desktop/src/components/editor/useQueryEditorBatchSelection.ts
  • D1 · dbx_driver_mongodb::mongo_shell::parse (cyclomatic 128) crates/dbx-driver-mongodb/src/mongo_shell.rs
  • D1 · dbx_core::data::table_import::import_table_file_core (cyclomatic 118) REDACTED
  • D1 · useQueryEditorObjectNavigation.useQueryEditorObjectNavigation (cyclomatic 107) apps/desktop/src/components/editor/useQueryEditorObjectNavigation.ts
  • D1 · dbx_core::data::database_export::export_database_sql_core_inner (cyclomatic 104) REDACTED
  • D1 · dataGenerate.buildDefaultGeneratorParams (cyclomatic 102) apps/desktop/src/lib/dataGrid/dataGenerate.ts
  • D1 · queryEditorSqlExtensions.configureQueryEditorSqlExtensions (cyclomatic 101) apps/desktop/src/components/editor/queryEditorSqlExtensions.ts
  • D1 · PluginHostBridge.dispatch (cyclomatic 101) REDACTED
  • D1 · AppState::get_or_create_pool_for_session_inner (cyclomatic 95) REDACTED
  • D1 · ConnectionConfig::connection_url_with_host (cyclomatic 95) crates/dbx-types/src/models/connection.rs
  • D1 · dbx_core::data::transfer::map_column_type (cyclomatic 86) REDACTED
  • D1 · dbx_sql_schema::table_structure_sql::columns::build_column_sql (cyclomatic 85) crates/dbx-sql-schema/src/table_structure_sql/columns.rs
  • D1 · useQueryEditorHover.useQueryEditorHover (cyclomatic 85) apps/desktop/src/components/editor/useQueryEditorHover.ts
  • D1 · dbx_core::data::transfer::transfer_table_inner (cyclomatic 84) REDACTED
  • D1 · ConnectionConfig::redacted_connection_url_with_host (cyclomatic 84) crates/dbx-types/src/models/connection.rs
  • D1 · dbx_core::schema::list_tables_once (cyclomatic 81) crates/dbx-core/src/schema/mod.rs
  • D1 · dbx_core::query::do_execute_typed (cyclomatic 73) REDACTED
  • D1 · dbx_core::data::table_export::export_table_data_core_inner (cyclomatic 72) REDACTED
  • D1 · dbx_sql_schema::table_structure_sql::create_table::build_create_table_sql_with_partition_clause (cyclomatic 70) crates/dbx-sql-schema/src/table_structure_sql/create_table.rs
  • D1 · dbx_sql_dialect::sql_dialect::type_rewrite::rewrite_cross_dialect_to_sqlserver (cyclomatic 68) crates/dbx-sql-dialect/src/sql_dialect/type_rewrite.rs
  • D1 · MysqlDumpBinaryLiteralNormalizer::normalize (cyclomatic 67) REDACTED
  • D1 · SqlStatementSplitter::push_chunk_with_control (cyclomatic 66) crates/dbx-sql-core/src/sql.rs
  • D1 · dbx_plugin_runtime::plugins::manifest::validate_contributions (cyclomatic 65) crates/dbx-plugin-runtime/src/plugins/manifest.rs
  • D1 · dbx_core::data::query_result_export::export_query_result_core_inner (cyclomatic 64) REDACTED
  • D1 · AppState::refresh_connections (cyclomatic 60) REDACTED
  • D1 · useComponentUpdates.useComponentUpdates (cyclomatic 58) apps/desktop/src/composables/useComponentUpdates.ts
  • D1 · AppState::remove_stale_connection_pool (cyclomatic 57) REDACTED
  • D1 · dbx_sql_schema::schema_diff::generate_create_table_sql (cyclomatic 57) crates/dbx-sql-schema/src/schema_diff.rs
  • D1 · dbx_core::ai::agent_loop::run_agent_loop_inner (cyclomatic 56) crates/dbx-core/src/ai/agent_loop.rs
  • D1 · dbx_sql_core::sql::split_sql_statement_ranges_with_options (cyclomatic 56) crates/dbx-sql-core/src/sql.rs
  • D1 · dbx_core::schema::render_postgres_table_ddl_with_constraints_and_partition_info (cyclomatic 55) crates/dbx-core/src/schema/mod.rs
  • D1 · mongoShellCommand.diagnoseMongoCommand (cyclomatic 55) apps/desktop/src/lib/mongo/mongoShellCommand.ts
  • D1 · useQueryEditorCompletionKeys.useQueryEditorCompletionKeys (cyclomatic 54) apps/desktop/src/components/editor/useQueryEditorCompletionKeys.ts
  • D1 · dbx_core::schema::get_columns_core_for_session_inner_with_pool (cyclomatic 53) crates/dbx-core/src/schema/mod.rs
  • D1 · useQueryEditorTextActions.useQueryEditorTextActions (cyclomatic 53) apps/desktop/src/components/editor/useQueryEditorTextActions.ts
  • D1 · createMockHost::bridge (cyclomatic 53) plugins/sdk/dev-host/server.mjs
  • D1 · useQueryEditorDocumentState.useQueryEditorDocumentState (cyclomatic 52) apps/desktop/src/components/editor/useQueryEditorDocumentState.ts
  • D1 · installBridge (cyclomatic 50) REDACTED
  • D1 · dbx_sql_data::data_grid_sql::format_grid_sql_literal_with_identifier_quote (cyclomatic 49) REDACTED
  • D1 · useQueryEditorPointer.useQueryEditorPointer (cyclomatic 49) apps/desktop/src/components/editor/useQueryEditorPointer.ts
  • D1 · dbx_core::persistence::cloud_sync::apply_sync_snapshot_with_selection (cyclomatic 47) crates/dbx-core/src/persistence/cloud_sync.rs
  • D1 · DbxMcpServer::execute_batch_request (cyclomatic 47) crates/dbx-mcp/src/server.rs
  • D1 · dbx_core::schema::list_objects_once (cyclomatic 46) crates/dbx-core/src/schema/mod.rs
  • D1 · sqlStatementRanges.topLevelWordsInRange (cyclomatic 43) apps/desktop/src/lib/sql/sqlStatementRanges.ts
  • D1 · frontendPlugin.buildPluginConnectionConfig (cyclomatic 43) apps/desktop/src/lib/plugins/frontendPlugin.ts
  • D1 · TableRestoreFilter::classify (cyclomatic 42) REDACTED
  • D1 · usePluginShortcutSort.usePluginShortcutSort (cyclomatic 42) apps/desktop/src/composables/usePluginShortcutSort.ts
  • D1 · PluginDetailClient.PluginDetailClient (cyclomatic 42) docs/app/[lang]/plugins/[id]/PluginDetailClient.tsx
  • D1 · BackupService::export_job (cyclomatic 40) crates/dbx-core/src/scheduled_backup/engine.rs
  • D1 · dbx_core::data::query_result_export::try_export_mysql_query_result_stream (cyclomatic 40) REDACTED
  • D1 · dbx_core::data::transfer::escape_value_typed (cyclomatic 40) REDACTED
  • D1 · dbx_sql_schema::table_structure_sql::column_alter::build_single_column_alter_sql (cyclomatic 40) crates/dbx-sql-schema/src/table_structure_sql/column_alter.rs
  • D1 · Storage::inspect_data_migration (cyclomatic 39) REDACTED
  • D1 · dbx_core::data::table_import::parse_xlsx_preview_file_with_options (cyclomatic 39) REDACTED
  • D1 · ddlDisplay.collectDdlStatementNameTargets (cyclomatic 39) apps/desktop/src/lib/sql/ddlDisplay.ts
  • D1 · dbx_sql_schema::table_structure_sql::indexes::build_create_index_statements (cyclomatic 38) crates/dbx-sql-schema/src/table_structure_sql/indexes.rs
  • D1 · startDevelopment (cyclomatic 38) plugins/sdk/dev-host/runtime.mjs
  • D1 · dbx_ai_provider::ai::stream_claude_with_tools (cyclomatic 37) crates/dbx-ai-provider/src/ai.rs
  • D1 · dbx_driver_agent::agent_service::download_with_progress (cyclomatic 37) crates/dbx-driver-agent/src/agent_service.rs
  • D1 · dbx_driver_agent::agent_service::import_offline_zip (cyclomatic 37) crates/dbx-driver-agent/src/agent_service.rs
  • D1 · dbx_sql_dialect::sql_dialect::table_select::build_table_data_select_sql_with_database (cyclomatic 36) crates/dbx-sql-dialect/src/sql_dialect/table_select.rs
  • D1 · dbx_sql_schema::schema_diff::consume_postgres_cast_type (cyclomatic 36) crates/dbx-sql-schema/src/schema_diff.rs
  • D1 · dbx_web::routes::mongodb_dump::receive_source (cyclomatic 36) crates/dbx-web/src/routes/mongodb_dump.rs
  • D1 · dbx_drivers::db::ssh_tunnel::connect_and_authenticate (cyclomatic 35) crates/dbx-drivers/src/db/ssh_tunnel.rs
  • D1 · dbx_driver_mysql::mysql::mysql_column_type_name (cyclomatic 34) crates/dbx-driver-mysql/src/mysql.rs
  • D1 · MqttClient::spawn_v4_event_loop (cyclomatic 33) crates/dbx-core/src/admin/mqtt/client.rs
  • D1 · MqttClient::spawn_v5_event_loop (cyclomatic 33) crates/dbx-core/src/admin/mqtt/client.rs
  • D1 · dbx_core::schema::get_table_ddl_once (cyclomatic 33) crates/dbx-core/src/schema/mod.rs
  • D1 · dbx_core::data::sql_file_import::execute_sql_file_paths_inner (cyclomatic 33) REDACTED
  • D1 · dbx_core::schema::table_structure_sql::sqlite_rebuild::find_column_constraint_start (cyclomatic 33) crates/dbx-core/src/schema/table_structure_sql/sqlite_rebuild.rs
  • D1 · dbx_sql_core::sql::mysql_routine_tokens (cyclomatic 33) crates/dbx-sql-core/src/sql.rs
  • D1 · DialectYaml::build_capability_flags (cyclomatic 33) REDACTED
  • D1 · connectionDeepLink.parseConnectionDeepLinkUpdate (cyclomatic 33) apps/desktop/src/lib/connection/connectionDeepLink.ts
  • D1 · registerDbxMcpBridge (cyclomatic 33) crates/dbx-ai-provider/assets/pi-mcp-bridge.mjs
  • D1 · dbx_core::data::transfer::transfer_postgres_schema_objects (cyclomatic 32) REDACTED
  • D1 · DependencyGraph::build_with_functions_and_options (cyclomatic 32) crates/dbx-sql-schema/src/schema_diff.rs
  • D1 · dbx_sql_schema::schema_diff::create_index_sql (cyclomatic 32) crates/dbx-sql-schema/src/schema_diff.rs
  • D1 · verify-schema-objects.main (cyclomatic 32) REDACTED
  • D1 · usePluginShortcutHeight.usePluginShortcutHeight (cyclomatic 32) apps/desktop/src/composables/usePluginShortcutHeight.ts
  • D1 · jdbcProperties.parseJdbcProperties (cyclomatic 32) apps/desktop/src/lib/connection/jdbcProperties.ts
  • D1 · seo.auditPages (cyclomatic 32) docs/scripts/seo.mjs
  • D1 · validateRecord (cyclomatic 32) plugins/sdk/dev-host/connections.mjs
  • D1 · dbx_core::data::query_result_export::try_export_clickhouse_query_result_stream (cyclomatic 31) REDACTED
  • D1 · dbx_core::data::table_import::stream_xlsx_rows_to_channel_with_control (cyclomatic 31) REDACTED
  • D1 · dbx_core::data::table_export::try_export_native_table_stream (cyclomatic 31) REDACTED
  • D1 · dbx_core::query::mongo_ops::execute_mongo_command_core (cyclomatic 31) crates/dbx-core/src/query/mongo_ops.rs
  • D1 · dbx_ai_provider::ai::stream_openai_with_tools (cyclomatic 30) crates/dbx-ai-provider/src/ai.rs
  • D1 · dbx_core::admin::nacos::access_control::plan_operation (cyclomatic 30) crates/dbx-core/src/admin/nacos/access_control.rs
  • D1 · dbx_core::schema::table_structure_sql::sqlite_rebuild::build_change_plan (cyclomatic 30) crates/dbx-core/src/schema/table_structure_sql/sqlite_rebuild.rs
  • D1 · dbx_core::schema::table_structure_sql::sqlite_rebuild::find_sql_keyword_end (cyclomatic 30) crates/dbx-core/src/schema/table_structure_sql/sqlite_rebuild.rs
  • D1 · dbx_driver_postgres::postgres::pg_ndim_array_element_json (cyclomatic 30) REDACTED
  • D1 · dbx_driver_postgres::postgres::completion_assistant_search_inner (cyclomatic 30) REDACTED
  • D1 · dbx_sql_core::sql_diagnostics::redact_literals (cyclomatic 30) crates/dbx-sql-core/src/sql_diagnostics.rs
  • D1 · dbx_sql_core::sql_analysis::spark_datasource_clause_removals (cyclomatic 30) crates/dbx-sql-core/src/sql_analysis.rs
  • D1 · dbx_sql_schema::schema_diff::diff_columns_with_identifier_options (cyclomatic 30) crates/dbx-sql-schema/src/schema_diff.rs

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

Rebuild cost & value ~ Modeled — €520,000–€2,600,000
Cost to rebuild€520,000–€2,600,000 (5.2–16.4 person-years (8,694–27,581 h), ~6–21 engineers)
Domain complexityStandard — harder problems cost more per line
Quality factor0.8× (at 55% quality) — the last 20% of quality is most of the work
Size & shapeVery large · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)

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

How we model this: boilerplate at a scaffolding rate + logic × domain Standard (×1.3) — event-driven integration × a 0.8× 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
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
+8.5 pts · Medium effort · Keyboard semantics
2
Enforce accessibility in the toolchain: add eslint-plugin-vuejs-accessibility, then assert with vitest-axe in tests, then gate axe/pa11y/Lighthouse in CI.
+8.5 pts · Medium effort · A11y enforcement
3
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
+8.5 pts · Medium effort · Forms & labels

Diagnosis — what's actually going on

Value concentrated against a weak lens · High · Value at risk
This is a Very large asset (~10.8 person-years to rebuild), and its weakest lens is Accessibility at 44%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
Evidence: valuation: Very large, ~10.8 person-years rebuild (1,167,990 LoC) · weakest lens: Accessibility 44%
→ Direct remediation budget at Accessibility first — highest risk-reduction per euro on an asset this size.
The top fix pays for itself · High · Economics
The top-ranked fix costs roughly 3–10 engineer-days once. Not doing it costs about 1314.4–7886.4 engineer-days every year, paid as drag on the ~5,811,879 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 9–20% 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: 1,433,066 line(s) changed over a 90-day window ⇒ ~5,811,879/year · D1/D2/D4 code quality: averaging 4.4/10 ⇒ a 9–20% drag on each change · top-ranked remediation: Medium effort ⇒ about 3–10 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: Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href. The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 4.4/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 9–20% 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 4.4/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 graph

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

arch @dbx-app/cli cli @dbx-app/mcp-server mcp-server @dbx-app/plugin-cli plugin-cli dbx dbx dbx-core dbx-core dbx->dbx-core dbx-mcp dbx-mcp dbx->dbx-mcp dbx-drivers dbx-drivers dbx-core->dbx-drivers dbx-platform dbx-platform dbx-core->dbx-platform dbx-sql dbx-sql dbx-core->dbx-sql dbx-types dbx-types dbx-core->dbx-types dbx-driver-agent dbx-driver-agent dbx-driver-agent->dbx-platform dbx-sql-core dbx-sql-core dbx-driver-agent->dbx-sql-core dbx-driver-agent->dbx-types dbx-driver-mysql dbx-driver-mysql dbx-driver-support dbx-driver-support dbx-driver-mysql->dbx-driver-support dbx-driver-mysql->dbx-sql-core dbx-sql-dialect dbx-sql-dialect dbx-driver-mysql->dbx-sql-dialect dbx-driver-mysql->dbx-types dbx-driver-postgres dbx-driver-postgres dbx-driver-postgres->dbx-driver-support dbx-driver-postgres->dbx-sql-core dbx-driver-postgres->dbx-types dbx-driver-sqlserver dbx-driver-sqlserver dbx-driver-sqlserver->dbx-driver-support dbx-driver-sqlserver->dbx-sql-core dbx-sql-data dbx-sql-data dbx-driver-sqlserver->dbx-sql-data dbx-driver-sqlserver->dbx-types dbx-driver-support->dbx-platform dbx-driver-support->dbx-types dbx-drivers->dbx-driver-agent dbx-drivers->dbx-driver-mysql dbx-drivers->dbx-driver-postgres dbx-drivers->dbx-driver-sqlserver dbx-drivers->dbx-driver-support dbx-drivers->dbx-platform dbx-drivers->dbx-sql-core dbx-drivers->dbx-sql-data dbx-drivers->dbx-sql-dialect dbx-drivers->dbx-types dbx-mcp->dbx-core dbx-sql->dbx-sql-core dbx-sql->dbx-sql-data dbx-sql->dbx-sql-dialect dbx-sql-schema dbx-sql-schema dbx-sql->dbx-sql-schema dbx-sql->dbx-types dbx-sql-core->dbx-types dbx-sql-data->dbx-sql-core dbx-sql-data->dbx-sql-dialect dbx-sql-data->dbx-types dbx-sql-dialect->dbx-types dbx-sql-schema->dbx-sql-core dbx-sql-schema->dbx-sql-dialect dbx-sql-schema->dbx-types github.com/beltran/gosasl gosasl __more__ +97 more projects

Architecture — module dependency matrix

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

1635 modules, 2290 dependencies. 6 dependency cycles across 46 modules, marked above the diagonal.

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

Module dependency matrix. The row depends on the column; the number is how many type pairs create the dependency. A cell above the diagonal is part of a dependency cycle.
depends on →1 apps.desktop.src.components.editor2 apps.desktop.src.types.generated.databaseTypes3 com.dbx.agent4 dbx_duckdb_driver.wire5 dbx_plugin_runtime.plugins6 pageant.error7 apps.desktop.src.components.editor.queryEditorTypes8 apps.desktop.src.types.database9 dbx_sql_schema.table_structure_sql.types10 dbx_tdengine_driver.model11 rumqttc.mqttbytes12 apps.desktop.src.lib.backend.tauri13 apps.desktop.src.lib.dataGrid14 apps.desktop.src.lib.diagram15 dbx_driver_agent.agent_driver16 dbx_types.models.connection17 dbx_types.types18 rumqttc19 apps.desktop.src.composables20 apps.desktop.src.lib.ai21 apps.desktop.src.lib.app22 apps.desktop.src.lib.backend23 apps.desktop.src.lib.connection24 apps.desktop.src.lib.database25 apps.desktop.src.lib.sidebar26 apps.desktop.src.lib.sql27 apps.desktop.src.stores.settingsStore28 rumqttc.client29 apps.desktop.src.lib.editor30 apps.desktop.src.lib.table31 dbx_ai_provider.ai32 tiberius.query33 dbx_core.persistence.storage34 dbx_driver_mysql.mysql35 dbx_core.connection36 dbx_core.ai.agent_kv37 dbx_core.query38 dbx_web.state39 dbx_tauri_consul.commands40 dbx_web.routes.consul
1 apps.desktop.src.components.editor
2 apps.desktop.src.types.generated.databaseTypes
3 com.dbx.agent
4 dbx_duckdb_driver.wire
5 dbx_plugin_runtime.plugins
6 pageant.error
7 apps.desktop.src.components.editor.queryEditorTypes1
8 apps.desktop.src.types.database24
9 dbx_sql_schema.table_structure_sql.types11
10 dbx_tdengine_driver.model1
11 rumqttc.mqttbytes1
12 apps.desktop.src.lib.backend.tauri41
13 apps.desktop.src.lib.dataGrid136
14 apps.desktop.src.lib.diagram31
15 dbx_driver_agent.agent_driver11
16 dbx_types.models.connection25
17 dbx_types.types61
18 rumqttc1
19 apps.desktop.src.composables144
20 apps.desktop.src.lib.ai152
21 apps.desktop.src.lib.app121
22 apps.desktop.src.lib.backend257214
23 apps.desktop.src.lib.connection5243
24 apps.desktop.src.lib.database14201
25 apps.desktop.src.lib.sidebar5451
26 apps.desktop.src.lib.sql2072
27 apps.desktop.src.stores.settingsStore11
28 rumqttc.client23
29 apps.desktop.src.lib.editor62
30 apps.desktop.src.lib.table112221
31 dbx_ai_provider.ai11
32 tiberius.query1
33 dbx_core.persistence.storage11618
34 dbx_driver_mysql.mysql822131
35 dbx_core.connection1114311
36 dbx_core.ai.agent_kv211
37 dbx_core.query2114121174
38 dbx_web.state1
39 dbx_tauri_consul.commands14
40 dbx_web.routes.consul14
Dependency, pointing down the layeringAbove the diagonal — part of a cycleThe module itself
…src.components.editor…nerated.databaseTypescom.dbx.agentdbx_duckdb_driver.wire…lugin_runtime.pluginspageant.error…itor.queryEditorTypes…op.src.types.database…e_structure_sql.types…tdengine_driver.modelrumqttc.mqttbytes…src.lib.backend.tauri…ktop.src.lib.dataGrid…sktop.src.lib.diagram…er_agent.agent_driver…pes.models.connectiondbx_types.typesrumqttc…sktop.src.composables…ps.desktop.src.lib.ai…s.desktop.src.lib.app…sktop.src.lib.backend…op.src.lib.connection…ktop.src.lib.database…sktop.src.lib.sidebar…s.desktop.src.lib.sql….stores.settingsStorerumqttc.client…esktop.src.lib.editor…desktop.src.lib.tabledbx_ai_provider.aitiberius.query…e.persistence.storagedbx_driver_mysql.mysqldbx_core.connectiondbx_core.ai.agent_kvdbx_core.querydbx_web.state…tauri_consul.commandsdbx_web.routes.consul…src.components.editor1…nerated.databaseTypes2com.dbx.agent3dbx_duckdb_driver.wire4…lugin_runtime.plugins5pageant.error6…itor.queryEditorTypes7…op.src.types.database8…e_structure_sql.types9…tdengine_driver.model10rumqttc.mqttbytes11…src.lib.backend.tauri12…ktop.src.lib.dataGrid13…sktop.src.lib.diagram14…er_agent.agent_driver15…pes.models.connection16dbx_types.types17rumqttc18…sktop.src.composables19…ps.desktop.src.lib.ai20…s.desktop.src.lib.app21…sktop.src.lib.backend22…op.src.lib.connection23…ktop.src.lib.database24…sktop.src.lib.sidebar25…s.desktop.src.lib.sql26….stores.settingsStore27rumqttc.client28…esktop.src.lib.editor29…desktop.src.lib.table30dbx_ai_provider.ai31tiberius.query32…e.persistence.storage33dbx_driver_mysql.mysql34dbx_core.connection35dbx_core.ai.agent_kv36dbx_core.query37dbx_web.state38…tauri_consul.commands39dbx_web.routes.consul4012411114113631112561114415212125721452431420154512072112362112221111116188221311114311211211412117411414+1595 more modules (most-connected shown)

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

At a glance — Architecture · 69% · Adequate · gated by R9 ·

At a glance — Maturity · 71% · Adequate · gated by D15 ·

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

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

At a glance — Event-Driven · 100% · Exemplary ·

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

At a glance — Accessibility · 44% · Adequate · gated by AC4 ·

At a glance — Performance · 60% · Adequate ·

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 — Injection483High / Critical
A06:2021 — Vulnerable & Outdated Components68High / Critical
A05:2021 — Security Misconfiguration31High / Critical
A02:2021 — Cryptographic Failures18High / Critical

Roadmap

First, ensure all custom controls are fully keyboard-operable and anchors have valid hrefs to support users who cannot use a mouse. Next, implement comprehensive accessibility enforcement in the development toolchain and CI pipeline to catch issues early, while simultaneously adding programmatic labels to every form control and button. Finally, provide meaningful text alternatives for all media elements and correct page structure landmarks to ensure a consistent and accessible experience for all users.

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

Do thisHelpsEffortDimension
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.+8.5 ptsMediumKeyboard semantics
Enforce accessibility in the toolchain: add eslint-plugin-vuejs-accessibility, then assert with vitest-axe in tests, then gate axe/pa11y/Lighthouse in CI.+8.5 ptsMediumA11y enforcement
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.+8.5 ptsMediumForms & labels
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.+8.4 ptsMediumText alternatives
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.+8.1 ptsMediumPage structure
Use valid, non-abstract roles, supply the ARIA state each role requires, and never put aria-hidden on a focusable element.+7.9 ptsMediumARIA correctness
Resolve the 9 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (2), REDACTED, REDACTED.+1.1 ptsLowREDACTED Scanning
Resolve the 3 Dependency pinned to a stale untagged commit finding(s) in Dependency Hygiene.+0.8 ptsLowDependency Hygiene

File quality

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

FileScoreBandWorst signal
REDACTED0.0SlopREDACTED Scanning: Leaked secret: REDACTED
REDACTED0.0SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED0.9SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED1.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED1.8SlopStatic Analysis (SAST): High: REDACTED
REDACTED1.8SlopREDACTED Scanning: Leaked secret: REDACTED
REDACTED2.3SlopREDACTED Scanning: Leaked secret: REDACTED
REDACTED2.3SlopREDACTED Scanning: Leaked secret: REDACTED
REDACTED2.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.4SlopIaC & Container Security: High IaC: REDACTED
REDACTED2.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.7SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED2.8SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.8SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.9SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.5MixedStatic Analysis (SAST): High: REDACTED
REDACTED3.6MixedStatic Analysis (SAST): High: REDACTED
REDACTED3.7MixedDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED3.9MixedStatic Analysis (SAST): High: REDACTED

How the grades work

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

Critical — 568

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

Serious — 5338

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

Minor — 69

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

Could not be resolved — 44

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

Methodology & how to trust this report

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

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

What we checked — 68 dimensions across the health lenses
D1D2D3D4D5D9D10D12D13D14D15D16D17D19D20D21D22D26D28D29D30D31D34D35D36D37D43D44AC1AC2AC3AC4AC5AC6AC7AX10AX3AX4AX9ED1ED3ED4ES1ES2M1M2M3M4P1P2P3P4P5P6P7PF3R1R10R11R2R3R4R5R6R7R8R9S1

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, 5914 of 5975 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
  2. Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

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

Tools & methods

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

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

Every finding is locatable in findings.md. Run 01a0e9f1-77b3-7e98-800a-394a0b964beb.

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.

  • D6 Cohesion (LCOM4) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
  • D10 Test Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 15,190 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 286 test source file(s) (.java, .go, .rs, .rb) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
  • D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability not included — the JavaScript/TypeScript suite (vitest via `pnpm install --frozen-lockfile --ignore-scripts` in the repository root (17976 tests); vitest via `pnpm install --frozen-lockfile --ignore-scripts` in packages/mcp-server/ (2 tests)) did not finish re-running within its budget: too large to re-run within its budget.
  • D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares package.json, but the licence verdict published here was taken over its crate dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a Gradle build (build.gradle/build.gradle.kts), but the licence verdict published here was taken over its crate dependencies. Nothing was read about its Gradle dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D31 IaC & Container Security — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Deploy/Dockerfile.dockerignore carries no `FROM` instruction, so it declares no build stage and every REDACTED rule this engine owns — the runtime-hardening, key-material, mutable-clone, no-op-shim, build-context, trust-anchor, install-guard, setuid and world-writable-path rules — is outside its own premise there and returned nothing. That silence is deliberate and correct: with no base image there is no image to reason about. It is reported here because it is NOT the same fact as a clean file, and coverage is stated as 32 of 33 Infrastructure-as-Code manifest(s) fully judged rather than as 100%. The vendor scanners (trivy, checkov) do read these files and their findings above stand; only this engine's own stage-keyed rules are absent. No owner action: a build file with no FROM is a legitimate include fragment.
  • D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `.github/scripts/suggest-similar-issues.mjs`, `apps/desktop/src/components/editor/queryEditorCodeMirrorRuntime.ts`, `apps/desktop/src/components/editor/queryEditorSqlExtensions.ts`, `apps/desktop/src/components/editor/useQueryEditorBatchSelection.ts`, `apps/desktop/src/components/editor/useQueryEditorCompletion.ts`, … (+48 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • AC2 Forms & labels — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 893 further occurrence(s) are not listed individually; the score already reflects all 933.
  • AC4 Keyboard semantics — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 49 further occurrence(s) are not listed individually; the score already reflects all 89.
  • AX1 Captive dependencies — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • AX2 Stateful singletons — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • AX6 Interface segregation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
  • C2 Access Controls — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
  • C3 Audit Trail — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
  • C4 Data Retention — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
  • C5 Data-Subject Rights — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
  • ED5 Idempotency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check finds retry-prone mutations by walking the repository's declared types, and NONE was loaded on this run, so it had nothing to look at. That is a limit of the analyzer's reach — it reads .NET projects — not a finding that this repository has no command handlers or message consumers.
  • GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • P10 Library API & versioning — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads NuGet packaging and C# public API only, and no .NET project was loaded for this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • PF1 Benchmark discipline — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • PF2 Allocation hygiene — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • R10 Code Duplication — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 1335 further occurrence(s) are not listed individually; the score already reflects all 1375.
  • R4 Test Coverage — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 22 further occurrence(s) are not listed individually; the score already reflects all 62.
  • R7 Dead Code — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 81 further occurrence(s) are not listed individually; the score already reflects all 121.
  • X1 Async correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X10 Duplicated predicate — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X12 Unreachable branch — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X13 Undrained process stream — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X14 Bypassable address classification — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X15 Unvalidated length from an untrusted reader — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X16 Unfloored truncation loop — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X17 Uncapped recursion over a caller-supplied document — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X18 Disposal-pattern correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X19 Unrestored process-global state — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X2 Cancellation propagation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X20 Mistyped argument guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X21 Side-effecting pattern guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X22 Contradicted release guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X23 Unguarded diagnostic materialisation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X24 Document value interpolated into markup unescaped — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X25 Inert configuration knob — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X26 Unsynchronised callback handoff — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X27 Collection changed while being enumerated — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X28 Index access outside its own emptiness guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X29 Per-element action decided by a fixed element — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X3 Exception handling — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X30 Support guard that admits what it rejects — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X32 Type resolved by simple name across every loaded assembly — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X4 Structured logging — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X5 Nullable reference types — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X6 Hand-rolled structured-format parsing — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X7 Silent fallback defaults — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.

Repo exclusion declarations: 9 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
  • D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
  • D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
  • D22 Internal API Consistency: API-surface coherence is an LLM judgement over a sample of the public surface — consistency of intent across the whole API is approximated, not exhaustively verified.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (REDACTED, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
  • AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
  • AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
  • AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
  • AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
  • AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
  • AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
  • 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".
  • P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
  • 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 (5): D19, D21, D22, D26, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.

Dimensions

D1 · Cyclomatic Complexity2.0 / 10Critical✓ Tool-verified

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

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

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

934 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was connectionStore.useConnectionStore at 2238. A further 77 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being PickleUnpickler.dispatch at 62 — they are counted neither in the figure above nor in this dimension's score. 35 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: apps/desktop/src/lib/redis/codec/pickle.ts (PickleUnpickler.dispatch at 62), apps/desktop/src/lib/connection/connectionPresentation.ts (connectionPresentation.connectionUrlPlaceholder at 50), REDACTED (server.dispatch at 42), agents/drivers/etcd-go/main.go (etcdSession.handle at 36), agents/drivers/gbase8s/src/main/java/com/dbx/agent/gbase8s/Gbase8sAgent.java (Gbase8sAgent.mapColType at 35), and 30 more not listed here. They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.

dbx_core::data::table_import::import_table_file_core (cyclomatic 118) · ×98REDACTED:7051
dbx_sql_schema::schema_diff::generate_schema_sync_sql_inner (cyclomatic 150) · ×26crates/dbx-sql-schema/src/schema_diff.rs:6118
dbx_sql_core::sql::split_sql_statement_ranges_with_options (cyclomatic 56) · ×20crates/dbx-sql-core/src/sql.rs:991
dbx_drivers::db::ssh_tunnel::connect_and_authenticate (cyclomatic 35) · ×19crates/dbx-drivers/src/db/ssh_tunnel.rs:380
dbx_sql_data::data_grid_sql::format_grid_sql_literal_with_identifier_quote (cyclomatic 49) · ×12REDACTED:2484

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

What to do

  1. Resolve the 98 dbx_core finding(s) in Cyclomatic Complexity — start with REDACTED (20), REDACTED (15), REDACTED (10). — One of this dimension's main actionable groups (98 warning-level).
  2. Resolve the 26 dbx_sql_schema finding(s) in Cyclomatic Complexity — start with schema_diff.rs (14), column_format.rs (3), column_alter.rs (2). — One of this dimension's main actionable groups (26 warning-level).
  3. Resolve the 20 dbx_sql_core finding(s) in Cyclomatic Complexity — start with sql.rs (7), sql_analysis.rs (3), object_source_sql.rs (3). — One of this dimension's main actionable groups (20 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 Complexity2.0 / 10Critical✓ Tool-verified

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

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

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

1436 method(s) exceeded the cognitive complexity threshold of 15; the worst was connectionStore.useConnectionStore at 2555.

dbx_core::data::database_export::export_database_sql_core_inner (cognitive 247) · ×180REDACTED:3380
dbx_sql_schema::schema_diff::generate_schema_sync_sql_inner (cognitive 514) · ×46crates/dbx-sql-schema/src/schema_diff.rs:6118
dbx_sql_core::sql::split_sql_statement_ranges_with_options (cognitive 126) · ×35crates/dbx-sql-core/src/sql.rs:991
dbx_drivers::db::sqlite::normalize_sqlite_sql (cognitive 64) · ×34crates/dbx-drivers/src/db/sqlite.rs:2767
dbx_sql_data::data_grid_sql::format_grid_sql_literal_with_identifier_quote (cognitive 75) · ×21REDACTED:2484

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

What to do

  1. Resolve the 180 dbx_core finding(s) in Cognitive Complexity — start with REDACTED (34), REDACTED (26), REDACTED (13). — One of this dimension's main actionable groups (180 warning-level).
  2. Resolve the 46 dbx_sql_schema finding(s) in Cognitive Complexity — start with schema_diff.rs (25), triggers.rs (4), column_alter.rs (4). — One of this dimension's main actionable groups (46 warning-level).
  3. Resolve the 35 dbx_sql_core finding(s) in Cognitive Complexity — start with sql.rs (14), sql_editability.rs (6), sql_analysis.rs (3). — One of this dimension's main actionable groups (35 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.4 / 10Strong✓ Tool-verified

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

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

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

545 god class(es) detected.

FileTooLong: REDACTED · ×203REDACTED
FunctionTooLong: connectionStore.useConnectionStore · ×193apps/desktop/src/stores/connectionStore.ts:441
ClassTooLong: Storage · ×53REDACTED:194
TooManyMethods: DbxJdbcPlugin · ×43REDACTED:63
MethodTooLong: AppState.get_or_create_pool_for_session_inner · ×32REDACTED:2500

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

What to do

  1. Resolve the 203 FileTooLong finding(s) in God Classes — start with REDACTED (4), lib.rs (4), REDACTED (3). — One of this dimension's main actionable groups (203 warning-level).
  2. Resolve the 193 FunctionTooLong finding(s) in God Classes — start with REDACTED (15), REDACTED (9), schema_diff.rs (5). — One of this dimension's main actionable groups (193 warning-level).
  3. Resolve the 53 ClassTooLong finding(s) in God Classes — start with REDACTED (3), backend.rs (2), REDACTED. — One of this dimension's main actionable groups (53 warning-level).
  4. Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D4 · Code Duplication9.1 / 10Stronggated by 1720 serious findings✓ Tool-verified

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

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

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

1625 duplicated block group(s) detected. A further 95 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 40 of the 1720 are in trees this repository does not ship — vendored, example/demo, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population. Measured on part of this repository only: .ts (36% of production source) was not exposed to THIS dimension's token comparison and is not in this count; duplication there is measured by R10 Code Duplication, the frontend lens's card running the same clone algorithm over the JS/TS token stream.

Duplicated block (5 lines × 2) · ×136crates/dbx-ai-provider/src/ai.rs:2826
Duplicated block (7 lines × 2) · ×128agents/drivers/duckdb/src/schema.rs:407
Duplicated block (9 lines × 2) · ×99crates/dbx-ai-provider/src/ai.rs:1527
Duplicated block (6 lines × 2) · ×98agents/drivers/duckdb/src/schema.rs:536
Duplicated block (8 lines × 2) · ×91crates/dbx-ai-provider/src/ai.rs:4008

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

What to do

  1. Resolve the 136 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with mongodb_import_export.rs (8), REDACTED (7), lib.rs (7). — One of this dimension's main actionable groups (136 warning-level).
  2. Resolve the 128 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with REDACTED (7), REDACTED (6), mongo_driver.rs (5). — One of this dimension's main actionable groups (128 warning-level).
  3. Resolve the 99 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with REDACTED (14), REDACTED (8), REDACTED (5). — One of this dimension's main actionable groups (99 warning-level).
  4. Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

D5 · Coupling9.1 / 10Stronggated by 14 serious findings✓ Tool-verified

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

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

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

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

117 production modules (Gradle+Cargo+npm+Go), 0 dependency cycle(s), 2 unstable depended-on module(s). Read from the build's own module declarations; edges a convention plugin adds from buildSrc or build-logic are not visible there; 12 module(s) off the main sequence, with abstractness counted on 92 of the 117 (the rest declare no modelled class or interface, export only macros, or are not Gradle/Maven modules or Cargo crates).

Off the main sequence: dbx-formats · ×12
Unstable project dbx-drivers
Unstable project dbx-sql

What to do

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

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

D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified

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

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

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

26300 test methods: 25815 unit, 476 integration, 0 BDD, 9 e2e. The JavaScript/TypeScript suite contributes 15223 `it`/`test` case(s) across 1566 test file(s) declaring at least one beside 1032 .NET test method(s); its tier split is read from package names and paths only. The Rust suite contributes 8886 `#[test]` function(s) across 458 file(s) declaring at least one; its unit/integration split is Cargo's own — 94 of those file(s) are integration-test targets under a crate's tests/ directory, and the rest are #[test] functions compiled into the crate they test. The Python suite contributes 26 test function(s) across 3 file(s) declaring at least one — every `def test…` in a file pytest or unittest would collect, which is those frameworks' own definition of a case; a parametrize table counts once, so this is a floor. Its tier split is read from file names and paths only. The Go suite contributes 1133 test case(s) across 97 `_test.go` file(s) declaring at least one — every `func Test…(t *testing.T)` that `go test` would collect, plus the suite methods a testify-style runner reaches; a table-driven case list counts once, so this is a floor. Its tier split is INFERRED from file names, paths and build constraints, not declared: 0 of those file(s) use Go's external test package (`package x_test`), which is a visibility boundary rather than a pyramid tier and was not read as one.

✓ On the Gold path — maintain.

Detailed fixes: d9_recommendation.md.

D10 · Test Quality10.0 / 10Stronggated by 1 serious finding✓ Tool-verified

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

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

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

4 skipped (4 with a documented reason), 1 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 15190 tests. Measured on the JavaScript/TypeScript suite only — at least 286 test source file(s) (.java, .go, .rs, .rb) went unread, so its test quality is unmeasured and is not in these counts.

No assertions: keeps structure and table-info scrollbars visible without OKLab color mixingapps/desktop/src/styles/__tests__/legacyWebviewFallback.spec.ts:398
Skipped (documented): (unnamed test) · ×4apps/desktop/src/lib/backend/__tests__/elasticsearchIndexTransportContract.spec.ts:28

What to do

  1. Resolve the 1 No assertions finding(s) in Test Quality — start with legacyWebviewFallback.spec.ts. — One of this dimension's main actionable groups (1 warning-level).
  2. Enforce Test Quality in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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

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

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

Maturity: Documented → Verified → Prevented · effective 7.1 / 10 · rule-coverage 88% · ceiling Verified

18 outdated, 0 author-deprecated direct Go module(s), 4 pinning or checksum defect(s). 40 of 40 direct requirement(s) were graded against proxy.golang.org (0 not served there, 5 publishing no tagged release to be behind). Whether any of these modules is UNMAINTAINED is not graded — proxy.golang.org publishes no maintenance status, and release age does not stand in for one. Whether any is UNUSED is not graded either: that is a source question, not a registry one. Known CVEs in this module graph are D30's question, read from REDACTED and REDACTED there.

Dependency pinned to a stale untagged commit: github.com/jcmturner/krb5test · ×3
No REDACTED committed (plugins/sdk/cli/templates/go/backend/go.mod)
Outdated: gitee.com/XuguDB/go-xugu-driver · ×18

What to do

  1. Resolve the 3 Dependency pinned to a stale untagged commit finding(s) in Dependency Hygiene. — One of this dimension's main actionable groups (3 warning-level).
  2. Resolve the 1 No REDACTED committed (plugins/sdk/cli/templates/go/backend/go.mod) finding(s) in Dependency Hygiene. — One of this dimension's main actionable groups (1 warning-level).
  3. Enforce Dependency Hygiene in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

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

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

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

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

9 secret(s) detected.

REDACTED

What to do

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

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

D14 · License Compliance10.0 / 10Exemplary○ Nothing flagged

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

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

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

0 of 1043 shipped crate(s) use a banned license. Licences were resolved from crates.io over the crates a consumer compiles — this repository's REDACTED closed over its manifests' `[dependencies]` and `[build-dependencies]`. Crates it asks for ONLY under `[dev-dependencies]` are excluded: they are not compiled by anything that depends on this repository. A further 7 crate(s) in the closure resolve from git, a path or a private registry and publish no licence this pass can read; they are outside this verdict. ★ COVERAGE OF THIS VERDICT: it grades this repository's crate dependencies and nothing else. The repository also declares package.json and a Gradle build (build.gradle/build.gradle.kts), and the licences of those dependency graphs were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots0.0 / 10Critical✓ Tool-verified

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

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

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

Top hotspots: apps/desktop/src/stores/queryStore.ts (328×2109=691752); apps/desktop/src/stores/connectionStore.ts (262×2238=586356); apps/desktop/src/stores/settingsStore.ts (195×337=65715) Repeated repair below the complexity floor: src-tauri/src/commands/mcp.rs (15 of 22 changes were fixes); agents/common/src/main/java/com/dbx/agent/AgentProtocol.java (14 of 26 changes were fixes); apps/desktop/src/components/layout/SqlFilePanel.vue (14 of 20 changes were fixes)

Hotspot: apps/desktop/src/stores/queryStore.ts · ×285apps/desktop/src/stores/queryStore.ts:1025
Repeated repair: src-tauri/src/commands/mcp.rs · ×78src-tauri/src/commands/mcp.rs:1251

What to do

  1. Resolve the 285 Hotspot finding(s) in Churn × Complexity Hotspots — start with REDACTED (6), REDACTED (5), REDACTED (3). — One of this dimension's main actionable groups (285 warning-level).
  2. Resolve the 78 Repeated repair finding(s) in Churn × Complexity Hotspots — start with mcp.rs, AgentProtocol.java, SqlFilePanel.vue. — One of this dimension's main actionable groups (78 warning-level).

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

D16 · Bus Factor9.4 / 10Exemplary✓ Tool-verified

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

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

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

71 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is src-tauri/src/webview2_recovery.rs. Counted over 1311 of the 1995 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Off-boarding risk: anonymized user #1 · ×4
Further sole-owners (lower concentration)

✓ On the Gold path — maintain.

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

D17 · Explicit Debt10.0 / 10Stronggated by 3 serious findings✓ Tool-verified

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

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

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

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

TodoComment · ×3agents/go-common/go-gssapi/krb5/krb5_test.go:7

What to do

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

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

D19 · Documentation QualityExemplary◐ Sampled · advisory

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

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

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

The repository's root README and the deploy directories all present a strong overview (DBX is 'a lightweight, self-hosted database client for the browser', supports '100+ databases'), installation, usage, and contribution guidance. The architecture/design docs are also well written and cover dependency rules, compatibility exports, feature selection, and validation commands. Each document's scope is clear: the root README documents the repository as a whole; each deploy directory (database/test-environments, demo) documents its own tier (self-hosting, public demo). The repository's READMEs and architecture/Docs markdown files are clear, complete, and well-structured. Each directory's README documents itself (deploy/fnos/, plugin-stats-worker/, packages/cli/, etc.) rather than the root repo, as required; they all cover installation/build, usage examples, and cross-directory links to companion docs. The main architecture doc is a standalone markdown file that is fully referenced by its outline sections, so no section is considered missing despite being clipped.

Documentation: no project overview · ×2README.md

✓ On the Gold path — maintain.

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

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

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

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

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

No architecture decision records were found.

No ADRs found

What to do

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

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

D21 · Naming ConsistencyExemplary◐ Sampled · advisory

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

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

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

0 naming inconsistencies across 0 sampled symbols.

✓ On the Gold path — maintain.

Detailed fixes: d21_recommendation.md.

D22 · Internal API ConsistencyStronggated by 1 serious finding◐ Sampled · advisory

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

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

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

1 API inconsistencies across a 400-member sample of 1092 exposed types.

Redundant pagination/listing operations. `list_prefix` appears to be a standard paginated lister (using `continuation` token), while `list_recursive` takes `max_entries` and `max_value_bytes` but lacks a continuation token in the signature, suggesting it might be a one-shot fetch or an incomplete pagination implementation. They likely serve the same domain (KV listing) but with confusingly different signatures and capabilities.

What to do

  1. Resolve the 1 Redundant pagination/listing operations. `list_prefix` appears to be a… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).

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

D26 · Project Cohesion7.6 / 10Strong✓ Tool-verified

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

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

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

4 of 34 build units (Cargo, npm) flagged as possibly oversized/incoherent.

Split crates/dbx-core
Split crates/dbx-web

What to do

  1. Resolve the 1 Split crates/dbx-core finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
  2. Resolve the 1 Split crates/dbx-web finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).

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

D28 · Secrets (history)2.0 / 10Critical✓ Tool-verified

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

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

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

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

REDACTED
REDACTED
REDACTED

What to do

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

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

D29 · Static Analysis (SAST)0.0 / 10Critical✓ Tool-verified

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

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

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

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

483 finding(s): 0 critical, 418 high, 54 medium, 11 low. 318 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 91 file(s) — `.github/ISSUE_TEMPLATE/database_compatibility.yml`, `.github/scripts/suggest-similar-issues.mjs` (line 115), `REDACTED`, `agents/go-common/iotdb-client-go/common/common.go`, `agents/gradlew` (line 74, line 178), … (+86 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 15 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 37 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (6), REDACTED (5), REDACTED (3). — One of this dimension's main actionable groups (37 issue-level).
  2. Resolve the 21 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (10), REDACTED (6), REDACTED (3). — One of this dimension's main actionable groups (21 issue-level).
  3. No action in Static Analysis (SAST) — all 318 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (318 issue-level, 0 of them charged here).

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

D30 · Dependency Vulnerabilities0.0 / 10Critical✓ Tool-verified

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

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

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

68 finding(s): 4 critical, 21 high, 40 medium, 3 low.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 21 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (12), REDACTED (5), REDACTED (3). — One of this dimension's main actionable groups (21 issue-level).
  2. Resolve the 20 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (12), REDACTED (6), REDACTED (2). — One of this dimension's main actionable groups (20 warning-level).
  3. Resolve the 4 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (4). — One of this dimension's main actionable groups (4 issue-level).

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

D31 · IaC & Container Security6.3 6.1 / 10Adequate✓ Tool-verified

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

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

Maturity: Documented → Verified → Prevented · effective 6.1 / 10 · rule-coverage 97% · ceiling Documented

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

REDACTED
REDACTED
REDACTED

What to do

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

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d34_recommendation.md.

D35 · Change Coupling9.5 / 10Adequategated by 12 critical findings✓ Tool-verified

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

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

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

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

Strongest change-coupling: AgentProtocol.java↔agent_driver.rs 100%; http.ts↔mongo_cmd.rs 96%; redis.rs↔redis_cmd.rs 93%

Boundary-crossing change coupling: AgentProtocol.java ↔ agent_driver.rs · ×12agents/common/src/main/java/com/dbx/agent/AgentProtocol.java
Change coupling: column_format.rs ↔ tests.rs · ×24crates/dbx-sql-schema/src/table_structure_sql/column_format.rs
Change-coupling hub: http.ts → useAppUpdater.ts, redis_ops.rs, mongo_cmd.rs, redis_cmd.rs · ×6apps/desktop/src/lib/backend/http.ts

What to do

  1. Resolve the 12 Boundary-crossing change coupling finding(s) in Change Coupling — start with AgentProtocol.java (2), redis.rs (2), mongo.rs (2). — One of this dimension's main actionable groups (12 issue-level).
  2. Resolve the 24 Change coupling finding(s) in Change Coupling — start with tauri.ts (2), es.ts (2), ContentArea.vue (2). — One of this dimension's main actionable groups (24 warning-level).
  3. Resolve the 6 Change-coupling hub finding(s) in Change Coupling — start with http.ts, api.ts, ConnectionDialog.vue. — One of this dimension's main actionable groups (6 warning-level).

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

D36 · Supply-chain Provenance & Signing7.5 / 10Adequategated by 1 critical finding✓ Tool-verified

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

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

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

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

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

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

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.md.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

D44 · Platform End-of-Life10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

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

AC1 · Text alternatives5.4 / 10Adequate✓ Tool-verified

Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.

Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.

  • An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative. — apps/desktop/src/components/editor/AiAttachmentCard.vue:49
  • A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content. (×3) — apps/desktop/src/components/grid/DataGridCellDetailDialog.vue:198, apps/desktop/src/components/grid/DataGridCellDetailPanel.vue:175, docs/components/landing/Starfield.tsx:192
  • An svg presented as an image needs a name — add a <title> child or an aria-label/aria-labelledby. — docs/components/DocsSidebarFooter.tsx:19

What to do

  • Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
AC2 · Forms & labels4.7 / 10Adequate✓ Tool-verified

Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.

Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id. (×16) — apps/desktop/src/App.vue:4735, apps/desktop/src/App.vue:4739, apps/desktop/src/components/admin/DamengUserAdmin.vue:681, …
  • This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. (×11) — apps/desktop/src/App.vue:4736, apps/desktop/src/components/admin/AuthorizationScopeEditor.vue:302, apps/desktop/src/components/admin/AuthorizationScopeEditor.vue:306, …
  • This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label. (×12) — apps/desktop/src/components/admin/AuthorizationScopeEditor.vue:291, apps/desktop/src/components/admin/AuthorizationScopeEditor.vue:344, apps/desktop/src/components/admin/DamengJobAdmin.vue:300, …
  • This <td> carries a click handler, which makes it a control, and its only name is a title attribute. A plain element maps to role="generic", which does not support a name from the author, so the title is announced as nothing at all — it is a mouse-only tooltip, unreachable on touch. Give it role="button" (which it needs anyway to be operable) so the title becomes a real name, or add an aria-label. — apps/desktop/src/components/admin/ProcessListPanel.vue:601

What to do

  • Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
AC3 · Page structure7.3 / 10Strong✓ Tool-verified

Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.

Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. (×3) — apps/desktop/index.html:2, dbx-er-diagram-architecture.html:3, docs/app/(root)/layout.tsx:34
  • A <table> with data cells but no <th> gives assistive technology no way to associate cells with their headers. Mark the header row/column cells as <th> (with a scope). (×3) — apps/desktop/src/components/admin/MySqlDashboard.vue:247, apps/desktop/src/components/redis/RedisDashboard.vue:510, apps/desktop/src/components/solr/SolrAdmin.vue:718
  • An empty heading appears in the document outline announced with no text. Give the heading text, or remove it if it's decorative. — apps/desktop/src/components/diagram/DiagramInspector.vue:420
  • Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one. — dbx-er-diagram-architecture.html:699
  • A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>. — plugins/sdk/cli/templates/svelte/index.html:2

What to do

  • Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
AC4 · Keyboard semantics1.5 / 10Critical✓ Tool-verified

Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no element the repo's own CSS styles `cursor: pointer` without giving it any of the three, no unfocusable element whose only binding is a mouse enter/leave pair or a double-click, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.

Coverage: Population: interactive elements plus elements the markup gives a click/key handler or the repo's own CSS styles `cursor: pointer`, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".

  • A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler. (×22) — apps/desktop/src/components/admin/ProcessListPanel.vue:579, apps/desktop/src/components/admin/ProcessListPanel.vue:601, apps/desktop/src/components/admin/SqlServerActivityTracePanel.vue:318, …
  • The repo's own CSS styles .cursor-pointer with `cursor: pointer`, so this <div> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler. (×4) — apps/desktop/src/components/diagram/LayerPanel.vue:407, apps/desktop/src/components/diagram/LayerPanel.vue:429, apps/desktop/src/components/diagram/SchemaDiagramDialog.vue:2260, …
  • This <div> carries tabindex="0", so it is in the tab order and a keyboard user will land on it — but its behaviour is bound to the pointer only, with no key handler. A tabindex makes an element focusable, not operable: Enter and Space fire a click on a native <button> or <a href> and nowhere else, so this can be focused and never activated. Use a <button>, or handle Enter/Space in a key handler. — apps/desktop/src/components/diff/SchemaDiffRoutineList.vue:71
  • This <span> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabindex="0", so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabindex="0"="0" so the element can receive that focus. (×5) — apps/desktop/src/components/editor/EditorSettingsDialog.vue:7472, apps/desktop/src/components/editor/EditorSettingsDialog.vue:7489, apps/desktop/src/components/editor/EditorSettingsDialog.vue:7506, …
  • The repo's own CSS styles .cursor-pointer with `cursor: pointer`, so this <td> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler. (×3) — apps/desktop/src/components/editor/TableStructurePeekDialog.vue:314, apps/desktop/src/components/editor/TableStructurePeekDialog.vue:320, apps/desktop/src/components/editor/TableStructurePeekDialog.vue:323
  • The repo's own CSS styles .cursor-pointer with `cursor: pointer`, so this <pre> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler. — apps/desktop/src/components/grid/DataGridCellDetailPanel.vue:204
  • This <tr> carries tabindex="0", so it is in the tab order and a keyboard user will land on it — but its behaviour is bound to the pointer only, with no key handler. A tabindex makes an element focusable, not operable: Enter and Space fire a click on a native <button> or <a href> and nowhere else, so this can be focused and never activated. Use a <button>, or handle Enter/Space in a key handler. — apps/desktop/src/components/grid/DataGridTableInfoPanels.vue:107
  • This <img> binds pointerdown, pointerup, pointermove and double-click — pointer gestures with no keyboard form, a double-click among them. No click, no key handler, and no tabindex="0", so it cannot even take focus. Nothing synthesises a double-click from the keyboard: Enter and Space fire a single click, and only on a native <button> or <a href>. So this behaviour has no keyboard path at all. Expose the same action on a real control, or add role + tabindex="0" + a key handler alongside the double-click. — apps/desktop/src/components/grid/ImagePreviewDialog.vue:223
  • This <div> binds double-click and nothing else. No click, no key handler, and no tabindex="0", so it cannot even take focus. Nothing synthesises a double-click from the keyboard: Enter and Space fire a single click, and only on a native <button> or <a href>. So this behaviour has no keyboard path at all. Expose the same action on a real control, or add role + tabindex="0" + a key handler alongside the double-click. — apps/desktop/src/components/layout/AppToolbar.vue:548
  • The repo's own CSS styles .app-tab-scrollbar with `cursor: pointer`, so this <div> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler. — apps/desktop/src/components/layout/EditorGroupTabBar.vue:1522

What to do

  • Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
AC5 · ARIA correctness7.9 / 10Strong✓ Tool-verified

Other · Accessibility — Whether ARIA is used correctly — valid non-abstract roles, the ARIA state a role requires, valid (non-misspelled) aria-* attribute names, in-enum values for token-typed aria-* attributes, and no aria-hidden on (or wrapping) a focusable element. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: role values checked against the WAI-ARIA role set (abstract/invalid flagged), required ARIA state for a role, and aria-hidden on a focusable element. Deterministic, role/attribute level.

Coverage: Population: elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) that carry a role or an aria-* attribute; roles and token values are checked against the ARIA enums exhaustively within that set. An expression-valued (dynamic) role or aria-* value is skipped rather than guessed, and markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • aria-hidden="true" here hides the subtree from assistive tech, but a focusable descendant stays in the tab order — a keyboard user can land on a control screen readers can't see. Add inert, take the descendants out of the tab order (tabindex="-1"), or drop aria-hidden. (×3) — apps/desktop/src/components/explain/ExplainPlanNodeTree.vue:63, apps/desktop/src/components/layout/StartupLoading.vue:16, apps/desktop/src/components/plugins/PluginShortcutBar.vue:147

What to do

  • Use valid, non-abstract roles, supply the ARIA state each role requires, and never put aria-hidden on a focusable element.
AC6 · Visual & motion safety10.0 / 10Exemplary○ Nothing flagged

Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.

Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.

Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

AC7 · A11y enforcement4.0 / 10Weak✓ Tool-verified

Other · Accessibility — Whether accessibility is ENFORCED in the toolchain — an accessibility checker configured over the markup (an a11y lint rule set, e.g. eslint-plugin-jsx-a11y or vuejs-accessibility where the project lints JavaScript) and an automated accessibility assertion wired into tests or CI (axe/pa11y/Lighthouse or an equivalent) — on the Documented→Verified→Prevented ladder.

Method: Repo config/CI scan: an accessibility checker configured over the markup (an a11y lint rule set such as eslint-plugin-jsx-a11y / vuejs-accessibility where JavaScript is linted) and an automated accessibility assertion in tests or CI (axe/pa11y/Lighthouse or equivalent), graded on the Documented→Verified→Prevented rungs. Deterministic, presence/rung detection.

Coverage: Population: the repository's own tooling configuration — lint config, test and CI files — NOT the markup. It is read for a configured accessibility checker and an automated accessibility assertion (axe/pa11y/Lighthouse, or a native-toolkit equivalent), and it credits an INVOCATION, never a mention: a licence filename, an import comment or a doc reference earns no rung. Enforcement configured entirely outside the repository leaves no evidence here and cannot be credited.

  • No accessibility enforcement found — no a11y linter (eslint-plugin-vuejs-accessibility) and no axe/pa11y/Lighthouse in tests or CI. Start with the linter to catch issues at author time. What was searched, so you can tell an absence from a miss: the 563 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.

What to do

  • Enforce accessibility in the toolchain: add eslint-plugin-vuejs-accessibility, then assert with vitest-axe in tests, then gate axe/pa11y/Lighthouse in CI.
AX10 · Code composition8.8 / 10Exemplary✓ Tool-verified

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

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

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

What to do

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

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

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

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

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

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

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

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

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

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

  • `InnerWebView.load_extensions` is a read-named query yet it performs a durable write on the read path (a persist to a store/repository). A query must stay side-effect-free so reads are safe to retry, cache, and route to a read replica; move the write into a command. — vendor/wry/src/webview2/mod.rs:1416

What to do

  • Keep query handlers read-only — move the writes/event-publishes into a command handler so reads stay safe to retry, cache, and route to a read replica.
ED1 · Handler temporal coupling10.0 / 10Exemplary✓ Tool-verified

Other · Event-Driven — Whether event handlers stay asynchronous (no blocking remote HTTP/gRPC calls awaited inside a handler).

Method: Roslyn semantic scan (event-driven gated): event-handler bodies scanned for HTTP/gRPC invocations by resolved symbol type, not substring. Deterministic, semantic-resolved.

ED3 · Event naming7.0 / 10Strong✓ Tool-verified

Other · Event-Driven — Whether events are named in the past tense (a clarity nudge — low weight).

Method: Roslyn scan (event-driven gated): domain and integration events checked for past-tense naming (-ed/-en suffix or irregular set). Naming nudge, low-weight advisory.

  • `benchmarkMetadata` reads as an instruction, not a fact that happened. Events describe something that already occurred — name them in the past tense (e.g. `OrderPlaced`, `PaymentCaptured`) so the ubiquitous language stays clear. — REDACTED:59
  • `rpcError` reads as an instruction, not a fact that happened. Events describe something that already occurred — name them in the past tense (e.g. `OrderPlaced`, `PaymentCaptured`) so the ubiquitous language stays clear. — REDACTED:51
  • `AgentEvent` reads as an instruction, not a fact that happened. Events describe something that already occurred — name them in the past tense (e.g. `OrderPlaced`, `PaymentCaptured`) so the ubiquitous language stays clear. — crates/dbx-ai-provider/src/agent_events.rs:8
  • `ReloadEvent` reads as an instruction, not a fact that happened. Events describe something that already occurred — name them in the past tense (e.g. `OrderPlaced`, `PaymentCaptured`) so the ubiquitous language stays clear. — crates/dbx-sql-dialect/src/sql_dialect/hot_reload.rs:28
  • `DownloadEvent` reads as an instruction, not a fact that happened. Events describe something that already occurred — name them in the past tense (e.g. `OrderPlaced`, `PaymentCaptured`) so the ubiquitous language stays clear. — vendor/tauri-plugin-updater/src/commands.rs:16
  • `PageLoadEvent` reads as an instruction, not a fact that happened. Events describe something that already occurred — name them in the past tense (e.g. `OrderPlaced`, `PaymentCaptured`) so the ubiquitous language stays clear. — vendor/wry/src/lib.rs:2562
  • `SidebarLayoutMonitorEvent` reads as an instruction, not a fact that happened. Events describe something that already occurred — name them in the past tense (e.g. `OrderPlaced`, `PaymentCaptured`) so the ubiquitous language stays clear. — apps/desktop/src/lib/sidebar/sidebarLayoutMonitor.ts:128

What to do

  • Name events in the past tense — they record facts that already happened.
ED4 · Outbox / dual-write10.0 / 10Exemplary○ Nothing flagged

Other · Event-Driven — Whether state changes and message publishes are atomic (a transactional outbox) rather than a crash-unsafe dual write.

Method: Roslyn semantic scan (event-driven gated): event-handler methods scanned for DB-save plus bus-publish without a transactional outbox reference. Deterministic, semantic-resolved.

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

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

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

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

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

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

M1 · Documentation (README)7.8 / 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.
  • Add a README to the 96 of 125 project(s) that lack one — worth up to 1.5 pts.
M2 · Architecture documentation5.0 / 10Adequate✓ Tool-verified

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

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

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

What to do

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

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

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

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

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

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

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

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

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

P2 · Observability7.9 / 10Strong✓ Tool-verified

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

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

  • Only 24/83 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `agents/drivers/access`, `agents/drivers/bigquery`, `agents/drivers/cache`, `agents/drivers/cassandra-go`, `agents/drivers/databend` and 54 more.

What to do

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

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

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

What to do

  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback10.0 / 10Exemplary✓ 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.

P5 · DR & Backup7.0 / 10Strong✓ Tool-verified

Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.

Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.

What to do

  • Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
P6 · Release Hygiene10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

  • `.openConnection(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. 4 of the 26 files that make outbound calls are unbounded; the first 4 are listed. — agents/drivers/gbase8s/src/main/java/com/dbx/agent/gbase8s/Gbase8sAgent.java:156
  • `.openConnection(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — agents/drivers/sqlserver-legacy/src/main/java/com/dbx/agent/sqlserverlegacy/SqlServerLegacyAgent.java:93
  • `Client::builder()` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — crates/dbx-core/src/persistence/cloud_sync.rs:1784
  • `reqwest::get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — crates/dbx-driver-agent/src/agent_manager.rs:1290

What to do

  • Set connect and read timeouts on every client (`RestTemplateBuilder.connectTimeout/readTimeout`, WebClient `responseTimeout`, `HttpRequest.Builder.timeout`, `HttpURLConnection.setReadTimeout`, Feign `connectTimeout`/`readTimeout` in configuration), and wrap calls to dependencies in resilience4j `@Retry`/`@CircuitBreaker`/`@TimeLimiter` (or Spring Retry).
  • Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.
PF3 · Async & latency hygiene6.0 / 10Adequate✓ Tool-verified

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

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

  • `enable_wal_mode` is async and calls thread::sleep — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs. — REDACTED:1370
  • `main` is async and calls mkdirSync, writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — agents/drivers/oceanbase-oracle/scripts/verify-partition-ddl.ts:10, REDACTED:10
  • `validateAndCopyBundle` is async and calls existsSync, statSync, mkdirSync, copyFileSync, writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — agents/scripts/build_offline_jdbc_payload.mjs:82
  • `main` is async and calls existsSync, rmSync, mkdirSync, copyFileSync, mkdtempSync, writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — agents/scripts/build_offline_jdbc_payload.mjs:140
  • `validatePayload` is async and calls readFileSync, statSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — agents/scripts/verify_offline_jdbc_release.mjs:41
  • `main` is async and calls existsSync, mkdtempSync, spawnSync, rmSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — agents/scripts/verify_offline_jdbc_release.mjs:64
  • `verifyTemplate` is async and calls readdirSync, existsSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — scripts/verify-plugin-cli-package.mjs:107
  • `verifyDev` is async and calls existsSync, readFileSync, spawnSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — scripts/verify-plugin-cli-package.mjs:132

What to do

  • Rust: `.await` the future instead of `block_on` (on a Tokio runtime thread it panics outright) and use `tokio::time::sleep(..).await` instead of `std::thread::sleep`; where synchronous code must run, move it to `tokio::task::spawn_blocking` or `block_in_place`.
  • TypeScript/JavaScript: use the promise APIs (fs/promises, a promisified child_process.execFile, the async zlib/crypto functions) and await them instead of the *Sync variants.
R1 · Type Safety9.7 / 10Exemplary✓ Tool-verified

React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.

Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.

What to do

  • Migrate the remaining .js/.jsx files to TypeScript.
R10 · Code Duplication8.7 / 10Strong✓ Tool-verified

React / JS · Code Health — Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm over JS/TS tokens, D-386): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.

Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Deterministic.

  • 291 duplicated blocks under apps/desktop/src/components/ have copies in at least two of the sibling directories admin, ai, backup, chart, codeSnapshot, common (+39 more sibling(s) not listed) — 169 of them are reported below, and 122 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 291 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 291 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 291 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — apps/desktop/src/components/layout/SqlLibraryPanel.vue:1088
  • 203 duplicated blocks under apps/desktop/src/ have copies in at least two of the sibling directories components, composables, lib, stores, types — 132 of them are reported below, and 71 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 203 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 203 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 203 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — apps/desktop/src/components/generate/params/IdNumberParams.vue:37
  • 122 duplicated blocks under apps/desktop/src/lib/ have copies in at least two of the sibling directories ai, app, backend, codeSnapshot, common, connection (+33 more sibling(s) not listed) — 84 of them are reported below, and 38 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 122 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 122 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 122 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — apps/desktop/src/lib/app/documentJsonValues.ts:306
  • 7 duplicated blocks under apps/desktop/src/components/ui/ have copies in at least two of the sibling directories context-menu, dialog, dropdown-menu, popover, tabs — 4 of them are reported below, and 3 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 7 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 7 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 7 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — apps/desktop/src/components/ui/context-menu/ContextMenuItem.vue:9
  • 6 duplicated blocks under the repository root have copies in at least two of the sibling directories agents, apps, packages, plugins, scripts — 5 of them are reported below, and 1 is counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 6 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 6 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 6 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — packages/mcp-server/bin/dbx-mcp-server.js:55
  • apps/desktop/src/components/admin/DamengRoleAdmin.vue:58 · apps/desktop/src/components/admin/DamengUserAdmin.vue:81 — the two spans are one implementation copied and then locally edited — 1628 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — apps/desktop/src/components/admin/DamengRoleAdmin.vue:58
  • apps/desktop/src/components/layout/SqlLibraryPanel.vue:1088 · apps/desktop/src/components/transfer/TransferTaskTree.vue:333 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — apps/desktop/src/components/layout/SqlLibraryPanel.vue:1088
  • apps/desktop/src/lib/metadata/objectDdlCache.ts:39 · apps/desktop/src/lib/metadata/objectMetadataCache.ts:24 — the two spans are one implementation copied and then locally edited — 1255 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — apps/desktop/src/lib/metadata/objectDdlCache.ts:39
  • apps/desktop/src/components/admin/MySqlDashboard.vue:32 · apps/desktop/src/components/admin/PostgresDashboard.vue:29 — the two spans are one implementation copied and then locally edited — 1079 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — apps/desktop/src/components/admin/MySqlDashboard.vue:32
  • apps/desktop/src/components/mq/rabbitmq/RabbitMqPermissionsPanel.vue:84 · apps/desktop/src/components/mq/rabbitmq/RabbitMqPoliciesPanel.vue:58 — the two spans are one implementation copied and then locally edited — 589 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — apps/desktop/src/components/mq/rabbitmq/RabbitMqPermissionsPanel.vue:84
  • apps/desktop/src/lib/app/documentJsonValues.ts:306 · apps/desktop/src/lib/common/safeJsonFormat.ts:462 — the two spans are one implementation copied and then locally edited — 596 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — apps/desktop/src/lib/app/documentJsonValues.ts:306
  • apps/desktop/src/lib/sql/sqlStatementRanges.ts:1096 · apps/desktop/src/lib/sql/sqlStatementRanges.ts:1327 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — apps/desktop/src/lib/sql/sqlStatementRanges.ts:1096
  • apps/desktop/src/components/mq/SubscriptionsPanel.vue:19 · apps/desktop/src/components/mq/TopicsPanel.vue:32 — the two spans are one implementation copied and then locally edited — 437 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — apps/desktop/src/components/mq/SubscriptionsPanel.vue:19
  • apps/desktop/src/lib/backend/http.ts:3783 · apps/desktop/src/lib/backend/tauri.ts:3867 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — apps/desktop/src/lib/backend/http.ts:3783
  • apps/desktop/src/lib/sql/identifierSearch.ts:7 · REDACTED:5691 — the two spans are one implementation copied and then locally edited — 523 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — apps/desktop/src/lib/sql/identifierSearch.ts:7
  • apps/desktop/src/components/codeSnapshot/CodeSnapshotDialog.vue:65 · apps/desktop/src/components/grid/GridSnapshotDialog.vue:29 — the two spans are one implementation copied and then locally edited — 436 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — apps/desktop/src/components/codeSnapshot/CodeSnapshotDialog.vue:65
  • apps/desktop/src/components/sidebar/ConnectionTree.vue:1238 · apps/desktop/src/components/sidebar/ConnectionTree.vue:1311 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — apps/desktop/src/components/sidebar/ConnectionTree.vue:1238
  • apps/desktop/src/lib/sql/sqlFormatter.ts:460 · apps/desktop/src/lib/sql/sqlFormatter.ts:747 — the two spans are one implementation copied and then locally edited — 491 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — apps/desktop/src/lib/sql/sqlFormatter.ts:460
  • apps/desktop/src/components/mq/ProducerConsumerPanel.vue:12 · apps/desktop/src/components/mq/SendMessagePanel.vue:12 — the two spans are one implementation copied and then locally edited — 375 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — apps/desktop/src/components/mq/ProducerConsumerPanel.vue:12
  • apps/desktop/src/composables/useDataGridCanvasRuntime.ts:68 · apps/desktop/src/composables/useDataGridScrollbars.ts:44 — the two spans are one implementation copied and then locally edited — 260 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — apps/desktop/src/composables/useDataGridCanvasRuntime.ts:68
  • apps/desktop/src/components/diff/SchemaDiffConfigStep.vue:95 · apps/desktop/src/components/diff/SchemaDiffConfigStep.vue:261 — the two spans are one implementation copied and then locally edited — 498 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — apps/desktop/src/components/diff/SchemaDiffConfigStep.vue:95
  • apps/desktop/src/components/generate/params/IdNumberParams.vue:37 · apps/desktop/src/lib/dataGrid/dataGenerate.ts:702 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — apps/desktop/src/components/generate/params/IdNumberParams.vue:37
  • apps/desktop/src/components/mq/ExchangesPanel.vue:107 · apps/desktop/src/components/mq/TopicsPanel.vue:282 — the two spans are one implementation copied and then locally edited — 292 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — apps/desktop/src/components/mq/ExchangesPanel.vue:107
  • apps/desktop/src/components/plugins/PluginFileManager.vue:190 · apps/desktop/src/composables/usePluginShortcutHeight.ts:61 — the two spans are one implementation copied and then locally edited — 344 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — apps/desktop/src/components/plugins/PluginFileManager.vue:190
  • apps/desktop/src/stores/savedSqlStore.ts:810 · apps/desktop/src/stores/transferTaskStore.ts:352 — the two spans are one implementation copied and then locally edited — 599 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — apps/desktop/src/stores/savedSqlStore.ts:810
  • apps/desktop/src/components/diff/SchemaDiffDeployStep.vue:249 · apps/desktop/src/components/diff/SchemaDiffObjectTree.vue:43 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — apps/desktop/src/components/diff/SchemaDiffDeployStep.vue:249
  • apps/desktop/src/components/sidebar/VisibleNacosNamespacesDialog.vue:20 · apps/desktop/src/components/sidebar/VisibleSchemasDialog.vue:33 — the two spans are one implementation copied and then locally edited — 334 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — apps/desktop/src/components/sidebar/VisibleNacosNamespacesDialog.vue:20
  • apps/desktop/src/lib/backend/tauri.ts:314 · apps/desktop/src/stores/settingsStore.ts:67 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — apps/desktop/src/lib/backend/tauri.ts:314
  • apps/desktop/src/lib/backend/http.ts:2449 · apps/desktop/src/lib/backend/tauri.ts:441 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — apps/desktop/src/lib/backend/http.ts:2449
  • apps/desktop/src/lib/backend/http.ts:3274 · apps/desktop/src/lib/backend/http.ts:3331 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — apps/desktop/src/lib/backend/http.ts:3274
  • apps/desktop/src/components/diagram/SchemaDiagramDialog.vue:811 · apps/desktop/src/components/diagram/SchemaDiagramDialog.vue:857 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — apps/desktop/src/components/diagram/SchemaDiagramDialog.vue:811
  • apps/desktop/src/components/transfer/DataTransferDialog.vue:505 · apps/desktop/src/components/transfer/DataTransferDialog.vue:572 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — apps/desktop/src/components/transfer/DataTransferDialog.vue:505
  • apps/desktop/src/lib/sql/sqlParameters.ts:1702 · apps/desktop/src/lib/sql/sqlVariables.ts:317 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — apps/desktop/src/lib/sql/sqlParameters.ts:1702
  • apps/desktop/src/components/admin/ProcessListPanel.vue:347 · apps/desktop/src/components/admin/ProcessListPanel.vue:403 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — apps/desktop/src/components/admin/ProcessListPanel.vue:347
  • apps/desktop/src/components/sidebar/SidebarTreeItemDialogs.vue:90 · REDACTED:5358 — the 2 copies are spread across 2 files, and what repeats is a LIST OF ENTRIES rather than behaviour — the same entries written out more than once. Extract them into one shared, exported constant and spread that constant into each site, rather than into a function the sites call: a list like this often lives in declarative metadata (a decorator's options object, a static configuration table) that a build step must be able to read statically, where a function call is not allowed. Adding an entry to one copy and not the other is the failure this prevents. — apps/desktop/src/components/sidebar/SidebarTreeItemDialogs.vue:90
  • apps/desktop/src/components/generate/params/IdNumberParams.vue:149 · apps/desktop/src/components/generate/params/SkuParams.vue:22 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — apps/desktop/src/components/generate/params/IdNumberParams.vue:149
  • apps/desktop/src/components/connection/ConnectionDialog.vue:833 · apps/desktop/src/components/grid/DataGridBulkEditDialog.vue:23 — the two spans are one implementation copied and then locally edited — 336 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — apps/desktop/src/components/connection/ConnectionDialog.vue:833
  • apps/desktop/src/lib/backend/tauri.ts:5956 · apps/desktop/src/lib/backend/tauri.ts:6001 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — apps/desktop/src/lib/backend/tauri.ts:5956
  • apps/desktop/src/stores/queryStore.ts:2169 · apps/desktop/src/stores/queryStore.ts:2276 — all 2 copies are in the same file, and what repeats is a LIST OF ENTRIES rather than behaviour — the same entries written out more than once. Extract them into one shared, exported constant and spread that constant into each site, rather than into a function the sites call: a list like this often lives in declarative metadata (a decorator's options object, a static configuration table) that a build step must be able to read statically, where a function call is not allowed. Adding an entry to one copy and not the other is the failure this prevents. — apps/desktop/src/stores/queryStore.ts:2169
  • apps/desktop/src/components/consul/ConsulAcl.vue:14 · apps/desktop/src/components/consul/ConsulScope.vue:13 — the two spans are one implementation copied and then locally edited — 389 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — apps/desktop/src/components/consul/ConsulAcl.vue:14

What to do

  • Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
R11 · Import Boundaries9.6 / 10Exemplary✓ Tool-verified

React / JS · Architecture — Conformance to the detected frontend architecture layout (feature-sliced / layered src) plus cross-package deep-import rules (D-386).

Method: Conformance to the detected frontend layout (feature-sliced / layered src) plus cross-package deep-import rules, over the module graph. Deterministic.

  • apps/desktop/src/lib/diagram/elk-layout.ts:1 imports elkjs/lib/elk.bundled.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — apps/desktop/src/lib/diagram/elk-layout.ts:1
  • apps/desktop/src/lib/sql/layout/internals.ts:60 imports sql-formatter/dist/esm/parser/createParser.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — apps/desktop/src/lib/sql/layout/internals.ts:60
  • apps/desktop/src/lib/sql/layout/internals.ts:61 imports sql-formatter/dist/esm/dialect.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — apps/desktop/src/lib/sql/layout/internals.ts:61
  • apps/desktop/src/lib/sql/layout/internals.ts:62 imports sql-formatter/dist/esm/allDialects.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — apps/desktop/src/lib/sql/layout/internals.ts:62
  • apps/desktop/src/lib/sql/layout/internals.ts:63 imports sql-formatter/dist/esm/formatter/ExpressionFormatter.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — apps/desktop/src/lib/sql/layout/internals.ts:63
  • apps/desktop/src/lib/sql/layout/internals.ts:64 imports sql-formatter/dist/esm/formatter/InlineLayout.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — apps/desktop/src/lib/sql/layout/internals.ts:64
  • apps/desktop/src/lib/sql/layout/internals.ts:65 imports sql-formatter/dist/esm/formatter/Params.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — apps/desktop/src/lib/sql/layout/internals.ts:65
  • apps/desktop/src/lib/sql/layout/internals.ts:66 imports sql-formatter/dist/esm/formatter/Layout.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — apps/desktop/src/lib/sql/layout/internals.ts:66
  • apps/desktop/src/lib/sql/layout/internals.ts:67 imports sql-formatter/dist/esm/formatter/Indentation.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — apps/desktop/src/lib/sql/layout/internals.ts:67
  • packages/app-tests/mongoShellCommand.test.ts:42 reaches past another workspace package's public entry into its internals with a relative path (../mongo-shell/src/json.ts) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/app-tests/mongoShellCommand.test.ts:42

What to do

  • Fix the listed violations: import through public entries (package exports / slice index), never reach into another layer or package's internals.
R2 · Cyclomatic Complexity7.0 / 10Strong✓ Tool-verified

React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.

Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.

  • executeTabSql has cyclomatic complexity 496 and cognitive complexity 696; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — apps/desktop/src/stores/queryStore.ts:6640
  • connectionConfigForSubmit has cyclomatic complexity 243 and cognitive complexity 312; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — apps/desktop/src/components/connection/ConnectionDialog.vue:4576
  • send has cyclomatic complexity 225 and cognitive complexity 324; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — apps/desktop/src/components/editor/AiAssistant.vue:3230
  • applyEditorSettingsPatch has cyclomatic complexity 205 and cognitive complexity 215; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — apps/desktop/src/stores/settingsStore.ts:2511
  • toggle has cyclomatic complexity 200 and cognitive complexity 208; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:814
  • normalizeEditorSettings has cyclomatic complexity 125 and cognitive complexity 118; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — apps/desktop/src/stores/settingsStore.ts:1636
  • performAsyncCompletionWithResult has cyclomatic complexity 117 and cognitive complexity 149; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — apps/desktop/src/components/editor/useQueryEditorCompletion.ts:1373
  • buildDefaultGeneratorParams has cyclomatic complexity 108 and cognitive complexity 121; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — apps/desktop/src/lib/dataGrid/dataGenerate.ts:1257
  • loadTreeNodeChildren has cyclomatic complexity 106 and cognitive complexity 83; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — apps/desktop/src/stores/connectionStore.ts:7521
  • dispatch has cyclomatic complexity 105 and cognitive complexity 161; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:537
  • getIconInfo has cyclomatic complexity 101 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — apps/desktop/src/components/sidebar/TreeItem.vue:245
  • (anonymous) has cyclomatic complexity 97 and cognitive complexity 135; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — apps/desktop/src/components/connection/ConnectionDialog.vue:3049
  • buildObjectSidebarMenu has cyclomatic complexity 95 and cognitive complexity 141; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:6221
  • onGridKeydown has cyclomatic complexity 92 and cognitive complexity 104; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — apps/desktop/src/components/grid/DataGrid.vue:9429
  • splitSqlStatementRanges has cyclomatic complexity 89 and cognitive complexity 184; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — apps/desktop/src/lib/sql/sqlStatementRanges.ts:333
  • getTreeNodeIconInfo has cyclomatic complexity 89 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — apps/desktop/src/lib/sidebar/treeNodeIcon.ts:10
  • provideSqlCompletions has cyclomatic complexity 88 and cognitive complexity 112; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — apps/desktop/src/components/editor/useQueryEditorCompletion.ts:654
  • handleQuickOpenSelect has cyclomatic complexity 86 and cognitive complexity 88; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — apps/desktop/src/App.vue:3299
  • explainTabSql has cyclomatic complexity 84 and cognitive complexity 165; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — apps/desktop/src/stores/queryStore.ts:8231
  • saveChanges has cyclomatic complexity 83 and cognitive complexity 111; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — apps/desktop/src/composables/useDataGridEditor.ts:1881

What to do

  • Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
R3 · Large Files4.3 / 10Weak✓ Tool-verified

React / JS · Code Health — How many source files exceed the large-file threshold.

Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.

  • 239 file(s) over 400 lines (counted as significant lines — blank lines excluded — over production source only, tests excluded), largest first: apps/desktop/src/components/grid/DataGrid.vue (14331), apps/desktop/src/i18n/locales/ru.ts (11882), apps/desktop/src/i18n/locales/en.ts (11382), REDACTED (11343), apps/desktop/src/components/editor/EditorSettingsDialog.vue (11040), apps/desktop/src/i18n/locales/es.ts (10974) (+233 more).

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
R4 · Test Coverage9.6 / 10Exemplary✓ Tool-verified

React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.

Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.

  • No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×40) — plugins/sdk/dev-host/ui/App.vue, deploy/plugin-stats-worker/worker.ts, scripts/sync-connection-types.mjs, …

What to do

  • Add tests that import the unreached modules (directly or through their public entry).
R5 · Dependency Freshness10.0 / 10Exemplary✓ Tool-verified

React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).

Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.

R6 · Tooling10.0 / 10Exemplary✓ Tool-verified

React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.

Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.

R7 · Dead Code7.9 / 10Strong✓ Tool-verified

React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).

Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.

  • Unreachable from the 261 application, 19 tooling and 1647 test entry point(s) detected in this repo. Gate removals on `pnpm run typecheck` — an undetected custom entry would make these reachable.
  • no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make (×20) — deploy/plugin-stats-worker/worker.ts, REDACTED, apps/desktop/src/components/config/TagManagementPanel.vue, …
  • no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (apps/desktop/src/components/ui/context-menu/index.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it (×14) — apps/desktop/src/components/ui/context-menu/ContextMenuItem.vue, apps/desktop/src/components/ui/context-menu/ContextMenuCheckboxItem.vue, apps/desktop/src/components/ui/context-menu/ContextMenuRadioItem.vue, …
  • no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (apps/desktop/src/components/ui/sheet/index.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it (×4) — apps/desktop/src/components/ui/sheet/SheetContent.vue, apps/desktop/src/components/ui/sheet/SheetDescription.vue, apps/desktop/src/components/ui/sheet/SheetTitle.vue, …
  • no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (apps/desktop/src/components/ui/sheet/SheetContent.vue) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — apps/desktop/src/components/ui/sheet/SheetOverlay.vue

What to do

  • Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
R8 · Dependency Hygiene8.0 / 10Strong✓ Tool-verified

React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.

Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.

  • Declared in the root package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it. (×3)

What to do

  • Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
R9 · Circular Imports1.6 / 10Critical✓ Tool-verified

React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.

Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.

  • apps/desktop/src/components/ui/badge/Badge.vue → apps/desktop/src/components/ui/badge/index.ts → apps/desktop/src/components/ui/badge/Badge.vue — apps/desktop/src/components/ui/badge/Badge.vue
  • apps/desktop/src/components/ui/button/Button.vue → apps/desktop/src/components/ui/button/index.ts → apps/desktop/src/components/ui/button/Button.vue — apps/desktop/src/components/ui/button/Button.vue
  • apps/desktop/src/components/ui/select/SelectContent.vue → apps/desktop/src/components/ui/select/index.ts → apps/desktop/src/components/ui/select/SelectContent.vue — apps/desktop/src/components/ui/select/SelectContent.vue
  • apps/desktop/src/components/ui/tabs/TabsList.vue → apps/desktop/src/components/ui/tabs/index.ts → apps/desktop/src/components/ui/tabs/TabsList.vue — apps/desktop/src/components/ui/tabs/TabsList.vue
  • apps/desktop/src/types/database.ts → apps/desktop/src/types/database.ts — apps/desktop/src/types/database.ts

What to do

  • Break each cycle by extracting the shared piece into a module both sides can import.
S1 · Web-Security Posture8.0 / 10Strong✓ Tool-verified

Other · Security — Only what this repository's own non-C# files could be read for was assessed — markup this repository SHIPS is scored for third-party script integrity whether or not the repository serves it itself, since a page handed to a consumer runs in that consumer’s origin. Nothing else in this dimension was assessed: the transport, cookie, input-validation and crypto controls are read from a source model that was not loaded for this repository’s language, so their absence here is not a finding about this repository.

Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. Deterministic.

  • `https://analytics.unihub.top/script.js` is executed by this page with no Subresource Integrity. Whoever can answer that request — the CDN, anyone who compromises it, anyone on the network path — runs arbitrary script in this page's origin, with its session. The URL also names no version, so it resolves to whatever that origin serves at fetch time — the executed bytes can change with nobody touching this repository. — docs/app/[lang]/layout.tsx:66

What to do

  • Pin third-party scripts and verify them: name an exact version in the URL and add an `integrity="sha384-…"` hash alongside `crossorigin="anonymous"` (both are required — an integrity hash on a cross-origin script without `crossorigin` is not evaluated, it blocks the script). Where the vendor ships a continuously-updated loader and publishes no stable hash (tag managers, analytics, chat widgets), Subresource Integrity is not available: constrain it instead with a `Content-Security-Policy` that names the exact origins allowed to execute, and drop the script from the pages that do not need it. Where the page is shipped inside a package that others host, prefer vendoring the asset and serving it from the app’s own origin, so no consumer inherits a third-party dependency they did not choose.

WCAG coverage — what static analysis assessed

Statically assessed 15 of 55 WCAG 2.2 Level A/AA success criteria (27%; ≈30% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 40 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).

DimensionWCAG 2.2 A/AA criteriaCoverage
AC1 · Text alternatives1.1.1, 1.2.2, 1.2.5Partial signal
AC2 · Forms & labels1.3.1, 3.3.2, 4.1.2Partial signal
AC3 · Page structure1.4.4, 2.2.1, 2.4.1, 2.4.2, 3.1.1, 4.1.2Partial signal
AC4 · Keyboard semantics2.1.1, 2.4.3Partial signal
AC5 · ARIA correctness4.1.2Partial signal
AC6 · Visual & motion safety1.4.3, 2.4.7Partial — literal CSS only
AC7 · A11y enforcementenforcement — no page criterionEnforcement posture (process)

Not statically assessed — these 40 Level A/AA criteria need runtime or manual evaluation (WCAG-EM): 1.2.1, 1.2.3, 1.2.4, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.4.1, 1.4.2, 1.4.5, 1.4.10, 1.4.11, 1.4.12, 1.4.13, 2.1.2, 2.1.4, 2.2.2, 2.3.1, 2.4.4, 2.4.5, 2.4.6, 2.4.11, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.5.7, 2.5.8, 3.1.2, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.6, 3.3.1, 3.3.3, 3.3.4, 3.3.7, 3.3.8, 4.1.3.

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 Health65%Adequate — gated by D1, D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture69%Adequate — gated by R9Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity71%Adequate — gated by D15Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness61%Adequate — gated by D13, P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security67%Adequate — gated by D28, D29, D30Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Event-Driven100%ExemplaryStrongest area.
Event Sourcing100%ExemplarySolid.
Accessibility44%Adequate — gated by AC4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance60%AdequateAcceptable, with room to improve.
Unscored — 1 check(s) recorded observations but carry no score

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

  • X9 Subsumed condition operand — 11 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 3 control(s) we could not find positive evidence for

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

  • C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
Not included — 64 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.

  • AX1 Captive dependencies — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX2 Stateful singletons — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — compose up failed (exit 17 — an image could not be built) — failed to solve: failed to resolve source metadata for docker.io/docker/dockerfile:1: failed to do request: Head "https://registry-1.docker.io/v2/docker/dockerfile/manifests/1": Forbidden; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
  • C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • D11 Test Reliability — Test reliability not included
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout nor 2+ sibling source directories each declaring an aggregate root. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — No inline comments to assess — comment value is not applicable here.
  • D25 ADR Conformance — no ADRs to check
  • D27 Navigability — symbol resolution incomplete — too few calls resolved to assess navigability
  • D32 Data Compliance (PII/GDPR) — 53 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • 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.
  • D6 Cohesion (LCOM4) — D6 reads a CS/VB/GO/SCALA/SWIFT/DART/JAVA/PY/KT/TS/TSX/MTS/CTS/JS/JSX/MJS/CJS/PHP class graph only — this repository's production source is .c, .rb, .rs, which was left unread. Not scored: this is a gap in the analyzer, not a verdict 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 MEASURED: the JavaScript/TypeScript half could not be measured — the vitest suite in the repository root ran and passed but wrote no lcov report. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
  • DM1 Domain Modelling — applicable but not scored (2 signals for this style, 2 needed — the count is met but a required primary signal is absent): 205 value object(s); 5 domain event(s); its domain events are published by services or handlers — no domain entity raises one
  • ED2 Event/command shape — no command-shaped messages detected — single-handler-per-command check not applicable
  • ED5 Idempotency — This check finds retry-prone mutations (command handlers and message/event consumers) by walking the repository's declared types, and none was loaded here, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C# syntax, and none was loaded for this repository. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P10 Library API & versioning — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
  • PF1 Benchmark discipline — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • PF2 Allocation hygiene — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X1 Async correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X10 Duplicated predicate — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X12 Unreachable branch — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X13 Undrained process stream — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X14 Bypassable address classification — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X15 Unvalidated length from an untrusted reader — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X16 Unfloored truncation loop — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X17 Uncapped recursion over a caller-supplied document — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X18 Disposal-pattern correctness — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X19 Unrestored process-global state — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X2 Cancellation propagation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X20 Mistyped argument guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X21 Side-effecting pattern guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X22 Contradicted release guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X23 Unguarded diagnostic materialisation — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X24 Document value interpolated into markup unescaped — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X25 Inert configuration knob — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X26 Unsynchronised callback handoff — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X27 Collection changed while being enumerated — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X28 Index access outside its own emptiness guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X29 Per-element action decided by a fixed element — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X3 Exception handling — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X30 Support guard that admits what it rejects — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X32 Type resolved by simple name across every loaded assembly — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X6 Hand-rolled structured-format parsing — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X7 Silent fallback defaults — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository

Appendix A — Findings (grouped)

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

Critical — 568 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 293 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 12 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · High CVE · ×21
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC2 · Forms & labels · <input> without a programmatic label · ×18
  • <input> without a programmatic label apps/desktop/src/App.vue:4736 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label apps/desktop/src/components/admin/AuthorizationScopeEditor.vue:291 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label apps/desktop/src/components/admin/AuthorizationScopeEditor.vue:302 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label apps/desktop/src/components/admin/AuthorizationScopeEditor.vue:344 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label apps/desktop/src/components/admin/DamengJobAdmin.vue:300 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label apps/desktop/src/components/admin/DamengRoleAdmin.vue:334 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label apps/desktop/src/components/admin/DamengUserAdmin.vue:497 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label apps/desktop/src/components/admin/DatabaseUserAdmin.vue:785 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label apps/desktop/src/components/admin/DatabaseUserAdmin.vue:970 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label apps/desktop/src/components/admin/DatabaseUserAdmin.vue:1016 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label apps/desktop/src/components/admin/MySqlDashboard.vue:244 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label apps/desktop/src/components/admin/ProcessListPanel.vue:541 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label apps/desktop/src/components/admin/ProcessListPanel.vue:548 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label apps/desktop/src/components/admin/SqlServerActivityTracePanel.vue:288 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label apps/desktop/src/components/admin/SqlServerActivityTracePanel.vue:289 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label apps/desktop/src/components/admin/SqlServerActivityTracePanel.vue:290 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label apps/desktop/src/components/backup/DatabaseBackupConfigFields.vue:163 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label apps/desktop/src/components/backup/DatabaseBackupConfigFields.vue:181 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC4 · Keyboard semantics · Click handler on a non-interactive <div> · ×18
  • Click handler on a non-interactive <div> apps/desktop/src/components/diagram/DiagramSchemaSelect.vue:128 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> apps/desktop/src/components/diagram/LayerPanel.vue:334 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> apps/desktop/src/components/diff/SchemaDiffDeployStep.vue:350 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> apps/desktop/src/components/diff/SchemaDiffObjectTree.vue:168 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> apps/desktop/src/components/diff/SchemaDiffObjectTree.vue:209 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> apps/desktop/src/components/dolt/DoltDiffTable.vue:245 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> apps/desktop/src/components/editor/AiAssistant.vue:5485 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> apps/desktop/src/components/editor/QueryEditorIntentionPopup.vue:30 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> apps/desktop/src/components/editor/ThemeCustomizerDialog.vue:454 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> apps/desktop/src/components/export/DatabaseExportDialog.vue:930 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> apps/desktop/src/components/export/DatabaseExportDialog.vue:935 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> apps/desktop/src/components/export/DatabaseExportDialog.vue:940 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> apps/desktop/src/components/export/DatabaseExportDialog.vue:945 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> apps/desktop/src/components/export/DatabaseExportDialog.vue:950 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> apps/desktop/src/components/export/DatabaseExportDialog.vue:965 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> apps/desktop/src/components/generate/GeneratorSelect.vue:50 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> apps/desktop/src/components/generate/GeneratorSelect.vue:59 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> apps/desktop/src/components/grid/DataGridColumnHeader.vue:64 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
AC2 · Forms & labels · <label> that labels no control · ×16
  • <label> that labels no control apps/desktop/src/App.vue:4735 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control apps/desktop/src/App.vue:4739 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control apps/desktop/src/components/admin/DamengUserAdmin.vue:681 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control apps/desktop/src/components/admin/DamengUserAdmin.vue:714 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control apps/desktop/src/components/admin/DamengUserAdmin.vue:719 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control apps/desktop/src/components/admin/DatabaseUserAdmin.vue:969 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control apps/desktop/src/components/admin/DatabaseUserAdmin.vue:979 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control apps/desktop/src/components/admin/SqlServerActivityTracePanel.vue:279 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control apps/desktop/src/components/backup/DatabaseBackupConfigFields.vue:106 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control apps/desktop/src/components/backup/DatabaseBackupConfigFields.vue:138 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control apps/desktop/src/components/backup/DatabaseBackupConfigFields.vue:148 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control apps/desktop/src/components/backup/DatabaseBackupConfigFields.vue:152 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control apps/desktop/src/components/backup/DatabaseBackupConfigFields.vue:170 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control apps/desktop/src/components/backup/DatabaseBackupConfigFields.vue:193 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control apps/desktop/src/components/backup/DatabaseBackupConfigFields.vue:202 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control apps/desktop/src/components/backup/DatabaseBackupConfigFields.vue:230 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
D35 · Change Coupling · Boundary-crossing change coupling · ×12
  • Boundary-crossing change coupling: AgentProtocol.java ↔ agent_driver.rs agents/common/src/main/java/com/dbx/agent/AgentProtocol.java — `agents/common/src/main/java/com/dbx/agent/AgentProtocol.java` (context agents) and `crates/dbx-driver-agent/src/agent_driver.rs` (context crates) sit in DIFFERENT parts of the tree yet change together 100% of the time (20 of the 20 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 20 shared commits counted here, the most recent 3 are `2db28fc2` feat(mongodb): support db.collection.renameCollection() (at that commit the file was still `crates/dbx-drivers/src/db/agent_driver.rs`); `f78dc1ba` feat(mongodb): support bulkWrite (at that commit the file was still `crates/dbx-core/src/db/agent_driver.rs`); `9eafac70` feat(mongodb): support replaceOne (at that commit the file was still `crates/dbx-core/src/db/agent_driver.rs`) — run `git show` on any of them.
  • Boundary-crossing change coupling: redis.rs ↔ redis_cmd.rs crates/dbx-web/src/routes/redis.rs — `crates/dbx-web/src/routes/redis.rs` (context crates) and `src-tauri/src/commands/redis_cmd.rs` (context src-tauri) sit in DIFFERENT parts of the tree yet change together 93% of the time (13 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 13 shared commits counted here, the most recent 3 are `59187f2e` feat(redis): view and edit Hash field expiry (HEXPIRE/HTTL/HPERSIST); `c697d0c7` feat(redis): improve key detail auto-refresh and TTL polling; `fc9f97b6` fix(redis): speed up large key scans — run `git show` on any of them.
  • Boundary-crossing change coupling: mongo.rs ↔ mongo_cmd.rs crates/dbx-web/src/routes/mongo.rs — `crates/dbx-web/src/routes/mongo.rs` (context crates) and `src-tauri/src/commands/mongo_cmd.rs` (context src-tauri) sit in DIFFERENT parts of the tree yet change together 92% of the time (23 of the 25 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 23 shared commits counted here, the most recent 3 are `f78dc1ba` feat(mongodb): support bulkWrite; `9eafac70` feat(mongodb): support replaceOne; `52c89267` feat(vector): support renaming Milvus collections — run `git show` on any of them.
  • Boundary-crossing change coupling: AgentProtocol.java ↔ mongo_ops.rs agents/common/src/main/java/com/dbx/agent/AgentProtocol.java — `agents/common/src/main/java/com/dbx/agent/AgentProtocol.java` (context agents) and `crates/dbx-core/src/query/mongo_ops.rs` (context crates) sit in DIFFERENT parts of the tree yet change together 80% of the time (16 of the 20 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 16 shared commits counted here, the most recent 3 are `2db28fc2` feat(mongodb): support db.collection.renameCollection(); `f78dc1ba` feat(mongodb): support bulkWrite (at that commit the file was still `crates/dbx-core/src/mongo_ops.rs`); `9eafac70` feat(mongodb): support replaceOne (at that commit the file was still `crates/dbx-core/src/mongo_ops.rs`) — run `git show` on any of them.
  • Boundary-crossing change coupling: mongo.rs ↔ lib.rs crates/dbx-web/src/routes/mongo.rs — `crates/dbx-web/src/routes/mongo.rs` (context crates) and `src-tauri/src/lib.rs` (context src-tauri) sit in DIFFERENT parts of the tree yet change together 68% of the time (17 of the 25 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 17 shared commits counted here, the most recent 3 are `f78dc1ba` feat(mongodb): support bulkWrite; `9eafac70` feat(mongodb): support replaceOne; `52c89267` feat(vector): support renaming Milvus collections — run `git show` on any of them.
  • Boundary-crossing change coupling: redis.rs ↔ lib.rs crates/dbx-web/src/routes/redis.rs — `crates/dbx-web/src/routes/redis.rs` (context crates) and `src-tauri/src/lib.rs` (context src-tauri) sit in DIFFERENT parts of the tree yet change together 64% of the time (9 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `59187f2e` feat(redis): view and edit Hash field expiry (HEXPIRE/HTTL/HPERSIST); `c697d0c7` feat(redis): improve key detail auto-refresh and TTL polling; `f71406c1` feat(redis): add slowlog panel and integrate with backend APIs — run `git show` on any of them.
  • Boundary-crossing change coupling: MongoAgent.java ↔ mongo_ops.rs agents/drivers/mongodb/src/main/java/com/dbx/agent/mongodb/MongoAgent.java — `agents/drivers/mongodb/src/main/java/com/dbx/agent/mongodb/MongoAgent.java` (context agents) and `crates/dbx-core/src/query/mongo_ops.rs` (context crates) sit in DIFFERENT parts of the tree yet change together 62% of the time (18 of the 29 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 18 shared commits counted here, the most recent 3 are `2db28fc2` feat(mongodb): support db.collection.renameCollection(); `f78dc1ba` feat(mongodb): support bulkWrite (at that commit the file was still `crates/dbx-core/src/mongo_ops.rs`); `9eafac70` feat(mongodb): support replaceOne (at that commit the file was still `crates/dbx-core/src/mongo_ops.rs`) — run `git show` on any of them.
  • Boundary-crossing change coupling: main.rs ↔ mongo_cmd.rs crates/dbx-web/src/main.rs — `crates/dbx-web/src/main.rs` (context crates) and `src-tauri/src/commands/mongo_cmd.rs` (context src-tauri) sit in DIFFERENT parts of the tree yet change together 61% of the time (17 of the 28 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 17 shared commits counted here, the most recent 3 are `f78dc1ba` feat(mongodb): support bulkWrite; `9eafac70` feat(mongodb): support replaceOne; `52c89267` feat(vector): support renaming Milvus collections — run `git show` on any of them.
  • Boundary-crossing change coupling: JsonRpcServer.java ↔ agent_driver.rs agents/common/src/main/java/com/dbx/agent/JsonRpcServer.java — `agents/common/src/main/java/com/dbx/agent/JsonRpcServer.java` (context agents) and `crates/dbx-driver-agent/src/agent_driver.rs` (context crates) sit in DIFFERENT parts of the tree yet change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `0e414e63` fix(agent): recover JDBC connections after query timeouts (at that commit the file was still `crates/dbx-core/src/db/agent_driver.rs`); `73120883` fix(dameng): separate materialized view metadata (at that commit the file was still `crates/dbx-core/src/db/agent_driver.rs`); `2f06ca5f` fix(data-compare): batch sync execution (at that commit the file was still `crates/dbx-core/src/db/agent_driver.rs`) — run `git show` on any of them.
  • Boundary-crossing change coupling: MongoAgent.java ↔ agent_driver.rs agents/drivers/mongodb/src/main/java/com/dbx/agent/mongodb/MongoAgent.java — `agents/drivers/mongodb/src/main/java/com/dbx/agent/mongodb/MongoAgent.java` (context agents) and `crates/dbx-driver-agent/src/agent_driver.rs` (context crates) sit in DIFFERENT parts of the tree yet change together 55% of the time (16 of the 29 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 16 shared commits counted here, the most recent 3 are `2db28fc2` feat(mongodb): support db.collection.renameCollection() (at that commit the file was still `crates/dbx-drivers/src/db/agent_driver.rs`); `f78dc1ba` feat(mongodb): support bulkWrite (at that commit the file was still `crates/dbx-core/src/db/agent_driver.rs`); `9eafac70` feat(mongodb): support replaceOne (at that commit the file was still `crates/dbx-core/src/db/agent_driver.rs`) — run `git show` on any of them.
  • Boundary-crossing change coupling: main.rs ↔ redis_cmd.rs crates/dbx-web/src/main.rs — `crates/dbx-web/src/main.rs` (context crates) and `src-tauri/src/commands/redis_cmd.rs` (context src-tauri) sit in DIFFERENT parts of the tree yet change together 50% of the time (9 of the 18 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `59187f2e` feat(redis): view and edit Hash field expiry (HEXPIRE/HTTL/HPERSIST); `c697d0c7` feat(redis): improve key detail auto-refresh and TTL polling; `f71406c1` feat(redis): add slowlog panel and integrate with backend APIs — run `git show` on any of them.
  • Boundary-crossing change coupling: JsonRpcServer.java ↔ REDACTED agents/common/src/main/java/com/dbx/agent/JsonRpcServer.java — `agents/common/src/main/java/com/dbx/agent/JsonRpcServer.java` (context agents) and `crates/dbx-core/src/schema/mod.rs` (context crates) sit in DIFFERENT parts of the tree yet change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `afe3b3f3` feat(sqlserver): add sql server 2000 legacy support (at that commit the file was still `crates/dbx-core/src/schema.rs`); `0e414e63` fix(agent): recover JDBC connections after query timeouts (at that commit the file was still `crates/dbx-core/src/schema.rs`); `73120883` fix(dameng): separate materialized view metadata (at that commit the file was still `crates/dbx-core/src/schema.rs`) — run `git show` on any of them.
AC4 · Keyboard semantics · Clickable element isn't keyboard-operable · ×9
  • Clickable element isn't keyboard-operable apps/desktop/src/components/diagram/LayerPanel.vue:407 — The repo's own CSS styles .cursor-pointer with `cursor: pointer`, so this <div> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
  • Clickable element isn't keyboard-operable apps/desktop/src/components/diagram/LayerPanel.vue:429 — The repo's own CSS styles .cursor-pointer with `cursor: pointer`, so this <div> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
  • Clickable element isn't keyboard-operable apps/desktop/src/components/diagram/SchemaDiagramDialog.vue:2260 — The repo's own CSS styles .cursor-pointer with `cursor: pointer`, so this <div> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
  • Clickable element isn't keyboard-operable apps/desktop/src/components/editor/TableStructurePeekDialog.vue:314 — The repo's own CSS styles .cursor-pointer with `cursor: pointer`, so this <td> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
  • Clickable element isn't keyboard-operable apps/desktop/src/components/editor/TableStructurePeekDialog.vue:320 — The repo's own CSS styles .cursor-pointer with `cursor: pointer`, so this <td> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
  • Clickable element isn't keyboard-operable apps/desktop/src/components/editor/TableStructurePeekDialog.vue:323 — The repo's own CSS styles .cursor-pointer with `cursor: pointer`, so this <td> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
  • Clickable element isn't keyboard-operable apps/desktop/src/components/grid/DataGridCellDetailPanel.vue:204 — The repo's own CSS styles .cursor-pointer with `cursor: pointer`, so this <pre> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
  • Clickable element isn't keyboard-operable apps/desktop/src/components/grid/DataGridSearchBar.vue:111 — The repo's own CSS styles .cursor-pointer with `cursor: pointer`, so this <div> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
  • Clickable element isn't keyboard-operable apps/desktop/src/components/layout/EditorGroupTabBar.vue:1522 — The repo's own CSS styles .app-tab-scrollbar with `cursor: pointer`, so this <div> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
D13 · REDACTED Scanning · Leaked secret · ×9
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D28 · Secrets (history) · REDACTED · ×7
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC2 · Forms & labels · <select> without a programmatic label · ×5
  • <select> without a programmatic label apps/desktop/src/components/admin/AuthorizationScopeEditor.vue:306 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <select> without a programmatic label apps/desktop/src/components/admin/MySqlDashboard.vue:192 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <select> without a programmatic label apps/desktop/src/components/admin/PostgresDashboard.vue:213 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <select> without a programmatic label apps/desktop/src/components/admin/XuguServerDashboard.vue:299 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <select> without a programmatic label apps/desktop/src/components/backup/DatabaseBackupConfigFields.vue:231 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC4 · Keyboard semantics · Hover-only interaction on <span> · ×5
  • Hover-only interaction on <span> apps/desktop/src/components/editor/EditorSettingsDialog.vue:7472 — This <span> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabindex="0", so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabindex="0"="0" so the element can receive that focus.
  • Hover-only interaction on <span> apps/desktop/src/components/editor/EditorSettingsDialog.vue:7489 — This <span> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabindex="0", so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabindex="0"="0" so the element can receive that focus.
  • Hover-only interaction on <span> apps/desktop/src/components/editor/EditorSettingsDialog.vue:7506 — This <span> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabindex="0", so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabindex="0"="0" so the element can receive that focus.
  • Hover-only interaction on <span> apps/desktop/src/components/editor/EditorSettingsDialog.vue:7539 — This <span> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabindex="0", so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabindex="0"="0" so the element can receive that focus.
  • Hover-only interaction on <span> apps/desktop/src/components/editor/EditorSettingsDialog.vue:7558 — This <span> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabindex="0", so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabindex="0"="0" so the element can receive that focus.
D29 · Static Analysis (SAST) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Critical CVE · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
R9 · Circular Imports · Import cycle (2 files) · ×4
  • Import cycle (2 files) apps/desktop/src/components/ui/badge/Badge.vue — apps/desktop/src/components/ui/badge/Badge.vue → apps/desktop/src/components/ui/badge/index.ts → apps/desktop/src/components/ui/badge/Badge.vue
  • Import cycle (2 files) apps/desktop/src/components/ui/button/Button.vue — apps/desktop/src/components/ui/button/Button.vue → apps/desktop/src/components/ui/button/index.ts → apps/desktop/src/components/ui/button/Button.vue
  • Import cycle (2 files) apps/desktop/src/components/ui/select/SelectContent.vue — apps/desktop/src/components/ui/select/SelectContent.vue → apps/desktop/src/components/ui/select/index.ts → apps/desktop/src/components/ui/select/SelectContent.vue
  • Import cycle (2 files) apps/desktop/src/components/ui/tabs/TabsList.vue — apps/desktop/src/components/ui/tabs/TabsList.vue → apps/desktop/src/components/ui/tabs/index.ts → apps/desktop/src/components/ui/tabs/TabsList.vue
AC5 · ARIA correctness · aria-hidden hides a focusable element · ×3
  • aria-hidden hides a focusable element apps/desktop/src/components/explain/ExplainPlanNodeTree.vue:63 — aria-hidden="true" here hides the subtree from assistive tech, but a focusable descendant stays in the tab order — a keyboard user can land on a control screen readers can't see. Add inert, take the descendants out of the tab order (tabindex="-1"), or drop aria-hidden.
  • aria-hidden hides a focusable element apps/desktop/src/components/layout/StartupLoading.vue:16 — aria-hidden="true" here hides the subtree from assistive tech, but a focusable descendant stays in the tab order — a keyboard user can land on a control screen readers can't see. Add inert, take the descendants out of the tab order (tabindex="-1"), or drop aria-hidden.
  • aria-hidden hides a focusable element apps/desktop/src/components/plugins/PluginShortcutBar.vue:147 — aria-hidden="true" here hides the subtree from assistive tech, but a focusable descendant stays in the tab order — a keyboard user can land on a control screen readers can't see. Add inert, take the descendants out of the tab order (tabindex="-1"), or drop aria-hidden.
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · High IaC · ×3
  • REDACTED
  • REDACTED
  • REDACTED
AC4 · Keyboard semantics · Click handler on a non-interactive <tr> · ×2
  • Click handler on a non-interactive <tr> apps/desktop/src/components/admin/SqlServerActivityTracePanel.vue:318 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <tr> apps/desktop/src/components/document/MongoGridFsBrowser.vue:338 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
AC1 · Text alternatives · <img> without a text alternative · ×1
  • <img> without a text alternative apps/desktop/src/components/editor/AiAttachmentCard.vue:49 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
AC1 · Text alternatives · <svg role="img"> without an accessible name · ×1
  • <svg role="img"> without an accessible name docs/components/DocsSidebarFooter.tsx:19 — An svg presented as an image needs a name — add a <title> child or an aria-label/aria-labelledby.
AC2 · Forms & labels · Custom control named only by title on <td> · ×1
  • Custom control named only by title on <td> apps/desktop/src/components/admin/ProcessListPanel.vue:601 — This <td> carries a click handler, which makes it a control, and its only name is a title attribute. A plain element maps to role="generic", which does not support a name from the author, so the title is announced as nothing at all — it is a mouse-only tooltip, unreachable on touch. Give it role="button" (which it needs anyway to be operable) so the title becomes a real name, or add an aria-label.
AC3 · Page structure · Document without a <title> · ×1
  • Document without a <title> plugins/sdk/cli/templates/svelte/index.html:2 — A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>.
AC4 · Keyboard semantics · Click handler on a non-interactive <th> · ×1
  • Click handler on a non-interactive <th> apps/desktop/src/components/admin/ProcessListPanel.vue:579 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
AC4 · Keyboard semantics · Click handler on a non-interactive <td> · ×1
  • Click handler on a non-interactive <td> apps/desktop/src/components/admin/ProcessListPanel.vue:601 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
AC4 · Keyboard semantics · Focusable <div> isn't keyboard-operable · ×1
  • Focusable <div> isn't keyboard-operable apps/desktop/src/components/diff/SchemaDiffRoutineList.vue:71 — This <div> carries tabindex="0", so it is in the tab order and a keyboard user will land on it — but its behaviour is bound to the pointer only, with no key handler. A tabindex makes an element focusable, not operable: Enter and Space fire a click on a native <button> or <a href> and nowhere else, so this can be focused and never activated. Use a <button>, or handle Enter/Space in a key handler.
AC4 · Keyboard semantics · Focusable <tr> isn't keyboard-operable · ×1
  • Focusable <tr> isn't keyboard-operable apps/desktop/src/components/grid/DataGridTableInfoPanels.vue:107 — This <tr> carries tabindex="0", so it is in the tab order and a keyboard user will land on it — but its behaviour is bound to the pointer only, with no key handler. A tabindex makes an element focusable, not operable: Enter and Space fire a click on a native <button> or <a href> and nowhere else, so this can be focused and never activated. Use a <button>, or handle Enter/Space in a key handler.
AC4 · Keyboard semantics · Double-click handler on a non-interactive <img> · ×1
  • Double-click handler on a non-interactive <img> apps/desktop/src/components/grid/ImagePreviewDialog.vue:223 — This <img> binds pointerdown, pointerup, pointermove and double-click — pointer gestures with no keyboard form, a double-click among them. No click, no key handler, and no tabindex="0", so it cannot even take focus. Nothing synthesises a double-click from the keyboard: Enter and Space fire a single click, and only on a native <button> or <a href>. So this behaviour has no keyboard path at all. Expose the same action on a real control, or add role + tabindex="0" + a key handler alongside the double-click.
AC4 · Keyboard semantics · Double-click handler on a non-interactive <div> · ×1
  • Double-click handler on a non-interactive <div> apps/desktop/src/components/layout/AppToolbar.vue:548 — This <div> binds double-click and nothing else. No click, no key handler, and no tabindex="0", so it cannot even take focus. Nothing synthesises a double-click from the keyboard: Enter and Space fire a single click, and only on a native <button> or <a href>. So this behaviour has no keyboard path at all. Expose the same action on a real control, or add role + tabindex="0" + a key handler alongside the double-click.
AX9 · CQS / query purity · Query writes persistent state on the read path · ×1
  • Query writes persistent state on the read path: InnerWebView.load_extensions vendor/wry/src/webview2/mod.rs:1416 — `InnerWebView.load_extensions` is a read-named query yet it performs a durable write on the read path (a persist to a store/repository). A query must stay side-effect-free so reads are safe to retry, cache, and route to a read replica; move the write into a command.
D28 · Secrets (history) · High secret · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
R9 · Circular Imports · Import cycle (1 files) · ×1
  • Import cycle (1 files) apps/desktop/src/types/database.ts — apps/desktop/src/types/database.ts → apps/desktop/src/types/database.ts
Serious — 5338 finding(s)
D15 · Churn × Complexity Hotspots · Hotspot · ×285
  • Hotspot: apps/desktop/src/stores/queryStore.ts apps/desktop/src/stores/queryStore.ts:1025 — apps/desktop/src/stores/queryStore.ts changed 328 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 2109 in queryStore.useQueryStore at line 1025. 193 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- apps/desktop/src/stores/queryStore.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: apps/desktop/src/stores/connectionStore.ts apps/desktop/src/stores/connectionStore.ts:441 — apps/desktop/src/stores/connectionStore.ts changed 262 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 2238 in connectionStore.useConnectionStore at line 441. 120 of those changes were fix/bug commits, and the other 142 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- apps/desktop/src/stores/connectionStore.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: apps/desktop/src/stores/settingsStore.ts apps/desktop/src/stores/settingsStore.ts:2000 — apps/desktop/src/stores/settingsStore.ts changed 195 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 337 in settingsStore.useSettingsStore at line 2000. 37 of those changes were fix/bug commits, and the other 158 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- apps/desktop/src/stores/settingsStore.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: apps/desktop/src/components/connection/ConnectionDialog.vue apps/desktop/src/components/connection/ConnectionDialog.vue:4576 — apps/desktop/src/components/connection/ConnectionDialog.vue changed 196 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 243 in connectionConfigForSubmit at line 4576. 88 of those changes were fix/bug commits, and the other 108 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- apps/desktop/src/components/connection/ConnectionDialog.vue`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:814 — REDACTED changed 190 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 200 in toggle at line 814. 76 of those changes were fix/bug commits, and the other 114 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: apps/desktop/src/components/grid/DataGrid.vue apps/desktop/src/components/grid/DataGrid.vue:9429 — apps/desktop/src/components/grid/DataGrid.vue changed 405 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 92 in onGridKeydown at line 9429. 214 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- apps/desktop/src/components/grid/DataGrid.vue`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: apps/desktop/src/composables/useDataGridEditor.ts apps/desktop/src/composables/useDataGridEditor.ts:248 — apps/desktop/src/composables/useDataGridEditor.ts changed 54 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 531 in useDataGridEditor.useDataGridEditor at line 248. 31 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- apps/desktop/src/composables/useDataGridEditor.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: apps/desktop/src/composables/useDataGridExport.ts apps/desktop/src/composables/useDataGridExport.ts:175 — apps/desktop/src/composables/useDataGridExport.ts changed 68 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 375 in useDataGridExport.useDataGridExport at line 175. 35 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- apps/desktop/src/composables/useDataGridExport.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: apps/desktop/src/components/editor/AiAssistant.vue apps/desktop/src/components/editor/AiAssistant.vue:3230 — apps/desktop/src/components/editor/AiAssistant.vue changed 93 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 225 in send at line 3230. 41 of those changes were fix/bug commits, and the other 52 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- apps/desktop/src/components/editor/AiAssistant.vue`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: apps/desktop/src/App.vue apps/desktop/src/App.vue:3299 — apps/desktop/src/App.vue changed 229 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 86 in handleQuickOpenSelect at line 3299. 104 of those changes were fix/bug commits, and the other 125 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- apps/desktop/src/App.vue`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: apps/desktop/src/components/sidebar/TreeItem.vue apps/desktop/src/components/sidebar/TreeItem.vue:245 — apps/desktop/src/components/sidebar/TreeItem.vue changed 168 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 101 in getIconInfo at line 245. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- apps/desktop/src/components/sidebar/TreeItem.vue`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/dbx-core/src/schema/mod.rs crates/dbx-core/src/schema/mod.rs:2222 — crates/dbx-core/src/schema/mod.rs changed 197 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 81 in dbx_core::schema::list_tables_once at line 2222. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- crates/dbx-core/src/schema/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:2500 — REDACTED changed 164 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 95 in AppState::get_or_create_pool_for_session_inner at line 2500. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:3425 — REDACTED changed 146 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 86 in dbx_core::data::transfer::map_column_type at line 3425. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:1698 — REDACTED changed 154 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 73 in dbx_core::query::do_execute_typed at line 1698. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src-tauri/src/lib.rs src-tauri/src/lib.rs:1464 — src-tauri/src/lib.rs changed 211 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 51 in dbx::run at line 1464. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- src-tauri/src/lib.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: apps/desktop/src/composables/useSqlExecution.ts apps/desktop/src/composables/useSqlExecution.ts:153 — apps/desktop/src/composables/useSqlExecution.ts changed 49 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 198 in useSqlExecution.useSqlExecution at line 153. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- apps/desktop/src/composables/useSqlExecution.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: apps/desktop/src/components/sidebar/ConnectionTree.vue apps/desktop/src/components/sidebar/ConnectionTree.vue:1729 — apps/desktop/src/components/sidebar/ConnectionTree.vue changed 117 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 81 in ensureTreeLoadedForTarget at line 1729. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- apps/desktop/src/components/sidebar/ConnectionTree.vue`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:3380 — REDACTED changed 91 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 104 in dbx_core::data::database_export::export_database_sql_core_inner at line 3380. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: apps/desktop/src/components/editor/QueryEditor.vue apps/desktop/src/components/editor/QueryEditor.vue:818 — apps/desktop/src/components/editor/QueryEditor.vue changed 250 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in selectStarExpansionTargetForView at line 818. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- apps/desktop/src/components/editor/QueryEditor.vue`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:1673 — REDACTED changed 103 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 76 in SqlCompletionProvider.build at line 1673. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: apps/desktop/src/composables/useDataGridActions.ts apps/desktop/src/composables/useDataGridActions.ts:45 — apps/desktop/src/composables/useDataGridActions.ts changed 41 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 185 in useDataGridActions.useDataGridActions at line 45. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- apps/desktop/src/composables/useDataGridActions.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/dbx-types/src/models/connection.rs crates/dbx-types/src/models/connection.rs:1228 — crates/dbx-types/src/models/connection.rs changed 74 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 95 in ConnectionConfig::connection_url_with_host at line 1228. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- crates/dbx-types/src/models/connection.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:7051 — REDACTED changed 58 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 118 in dbx_core::data::table_import::import_table_file_core at line 7051. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: apps/desktop/src/lib/sql/sqlStatementRanges.ts apps/desktop/src/lib/sql/sqlStatementRanges.ts:333 — apps/desktop/src/lib/sql/sqlStatementRanges.ts changed 64 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 101 in sqlStatementRanges.splitSqlStatementRanges at line 333. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- apps/desktop/src/lib/sql/sqlStatementRanges.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • + 260 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×203
  • FileTooLong: REDACTED REDACTED — FileTooLong — 7985 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 334 free functions. The bar is 500 significant lines; this is 7485 over it, 15.97× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: stores/connectionStore.ts apps/desktop/src/stores/connectionStore.ts — FileTooLong — 7583 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: useConnectionStore (441-10355). The bar is 500 significant lines; this is 7083 over it, 15.17× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 7297 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 396 free functions. The bar is 500 significant lines; this is 6797 over it, 14.59× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: stores/queryStore.ts apps/desktop/src/stores/queryStore.ts — FileTooLong — 7040 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: useQueryStore (1025-9499). The bar is 500 significant lines; this is 6540 over it, 14.08× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: schema/mod.rs crates/dbx-core/src/schema/mod.rs — FileTooLong — 7012 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 349 free functions. The bar is 500 significant lines; this is 6512 over it, 14.02× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 6468 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 140 free functions. The bar is 500 significant lines; this is 5968 over it, 12.94× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 6262 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 220 free functions. The bar is 500 significant lines; this is 5762 over it, 12.52× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/mysql.rs crates/dbx-driver-mysql/src/mysql.rs — FileTooLong — 5004 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 289 free functions. The bar is 500 significant lines; this is 4504 over it, 10.01× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 4865 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 194 free functions. The bar is 500 significant lines; this is 4365 over it, 9.73× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 4807 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 68% of them inside a single declaration: AppState (2 blocks, 391-5877), declaring 85 free functions. The bar is 500 significant lines; this is 4307 over it, 9.61× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: src/schema_diff.rs crates/dbx-sql-schema/src/schema_diff.rs — FileTooLong — 4642 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 135 free functions. The bar is 500 significant lines; this is 4142 over it, 9.28× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: backend/tauri.ts apps/desktop/src/lib/backend/tauri.ts — FileTooLong — 4098 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3598 over it, 8.20× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 4029 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3529 over it, 8.06× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 3796 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3296 over it, 7.59× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 3674 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3174 over it, 7.35× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: backend/http.ts apps/desktop/src/lib/backend/http.ts — FileTooLong — 3458 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2958 over it, 6.92× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/ai.rs crates/dbx-ai-provider/src/ai.rs — FileTooLong — 3440 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 148 free functions. The bar is 500 significant lines; this is 2940 over it, 6.88× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 3429 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: DbxJdbcPlugin (63-4775). The bar is 500 significant lines; this is 2929 over it, 6.86× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: src/server.rs crates/dbx-mcp/src/server.rs — FileTooLong — 3398 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 61% of them inside a single declaration: DbxMcpServer (5 blocks, 690-3765), declaring 65 free functions. The bar is 500 significant lines; this is 2898 over it, 6.80× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: nacos/http.rs crates/dbx-core/src/admin/nacos/http.rs — FileTooLong — 3294 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 68% of them inside a single declaration: NacosOpenApiAdmin (3 blocks, 167-3358), declaring 69 free functions. The bar is 500 significant lines; this is 2794 over it, 6.59× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: src/lib.rs crates/dbx-driver-redis/src/lib.rs — FileTooLong — 3128 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 187 free functions. The bar is 500 significant lines; this is 2628 over it, 6.26× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 3087 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 130 free functions. The bar is 500 significant lines; this is 2587 over it, 6.17× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/sqlserver.rs crates/dbx-driver-sqlserver/src/sqlserver.rs — FileTooLong — 2876 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 178 free functions. The bar is 500 significant lines; this is 2376 over it, 5.75× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/agent_service.rs crates/dbx-driver-agent/src/agent_service.rs — FileTooLong — 2806 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 158 free functions. The bar is 500 significant lines; this is 2306 over it, 5.61× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 2805 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 157 free functions. The bar is 500 significant lines; this is 2305 over it, 5.61× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • + 178 more in this group — see findings.md.
D3 · God Classes · FunctionTooLong · ×193
  • FunctionTooLong: connectionStore.useConnectionStore apps/desktop/src/stores/connectionStore.ts:441 — FunctionTooLong — useConnectionStore runs 7232 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 7132 over it, 72.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: queryStore.useQueryStore apps/desktop/src/stores/queryStore.ts:1025 — FunctionTooLong — useQueryStore runs 6304 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 6204 over it, 63.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: useDataGridEditor.useDataGridEditor apps/desktop/src/composables/useDataGridEditor.ts:248 — FunctionTooLong — useDataGridEditor runs 1591 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1491 over it, 15.91× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: useDataGridExport.useDataGridExport apps/desktop/src/composables/useDataGridExport.ts:175 — FunctionTooLong — useDataGridExport runs 1202 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1102 over it, 12.02× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: dbx::run src-tauri/src/lib.rs:1464 — FunctionTooLong — dbx::run runs 1154 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 1054 over it, 11.54× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: useQueryEditorCompletion.useQueryEditorCompletion apps/desktop/src/components/editor/useQueryEditorCompletion.ts:78 — FunctionTooLong — useQueryEditorCompletion runs 1118 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1018 over it, 11.18× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: dbx_core::data::table_import::import_table_file_core REDACTED:7051 — FunctionTooLong — dbx_core::data::table_import::import_table_file_core runs 1102 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 1002 over it, 11.02× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: dbx_web::serve crates/dbx-web/src/main.rs:389 — FunctionTooLong — dbx_web::serve runs 908 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 808 over it, 9.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: useSidebarDatabaseSpecificMutationRuntime.useSidebarDatabaseSpecificMutationRuntime apps/desktop/src/composables/useSidebarDatabaseSpecificMutationRuntime.ts:113 — FunctionTooLong — useSidebarDatabaseSpecificMutationRuntime runs 875 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 775 over it, 8.75× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: dbx_core::data::database_export::export_database_sql_core_inner REDACTED:3380 — FunctionTooLong — dbx_core::data::database_export::export_database_sql_core_inner runs 759 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 659 over it, 7.59× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: settingsStore.useSettingsStore apps/desktop/src/stores/settingsStore.ts:2000 — FunctionTooLong — useSettingsStore runs 752 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 652 over it, 7.52× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: useSqlExecution.useSqlExecution apps/desktop/src/composables/useSqlExecution.ts:153 — FunctionTooLong — useSqlExecution runs 630 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 530 over it, 6.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: savedSqlStore.useSavedSqlStore apps/desktop/src/stores/savedSqlStore.ts:175 — FunctionTooLong — useSavedSqlStore runs 600 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 500 over it, 6.00× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: dbx_core::data::table_export::export_table_data_core_inner REDACTED:1580 — FunctionTooLong — dbx_core::data::table_export::export_table_data_core_inner runs 584 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 484 over it, 5.84× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: useQuickOpen.useQuickOpen apps/desktop/src/composables/useQuickOpen.ts:285 — FunctionTooLong — useQuickOpen runs 563 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 463 over it, 5.63× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: dbx_core::data::transfer::transfer_table_inner REDACTED:9482 — FunctionTooLong — dbx_core::data::transfer::transfer_table_inner runs 559 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 459 over it, 5.59× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: useDataGridActions.useDataGridActions apps/desktop/src/composables/useDataGridActions.ts:45 — FunctionTooLong — useDataGridActions runs 537 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 437 over it, 5.37× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: useDataGridSelection.useDataGridSelection apps/desktop/src/composables/useDataGridSelection.ts:52 — FunctionTooLong — useDataGridSelection runs 532 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 432 over it, 5.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: server.createMockHost plugins/sdk/dev-host/server.mjs:77 — FunctionTooLong — createMockHost runs 516 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 416 over it, 5.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: dbx_core::query::do_execute_typed REDACTED:1698 — FunctionTooLong — dbx_core::query::do_execute_typed runs 464 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 364 over it, 4.64× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: dbx_sql_schema::schema_diff::generate_schema_sync_sql_inner crates/dbx-sql-schema/src/schema_diff.rs:6118 — FunctionTooLong — dbx_sql_schema::schema_diff::generate_schema_sync_sql_inner runs 456 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 356 over it, 4.56× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: useQueryEditorBatchSelection.useQueryEditorBatchSelection apps/desktop/src/components/editor/useQueryEditorBatchSelection.ts:52 — FunctionTooLong — useQueryEditorBatchSelection runs 453 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 353 over it, 4.53× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: useQueryEditorCompletionMetadata.useQueryEditorCompletionMetadata apps/desktop/src/components/editor/useQueryEditorCompletionMetadata.ts:43 — FunctionTooLong — useQueryEditorCompletionMetadata runs 451 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 351 over it, 4.51× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: dbx::commands::connection::test_connection_with_info_inner src-tauri/src/commands/connection.rs:1180 — FunctionTooLong — dbx::commands::connection::test_connection_with_info_inner runs 444 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 344 over it, 4.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: useDataGridColumnFormatter.useDataGridColumnFormatter apps/desktop/src/composables/useDataGridColumnFormatter.ts:76 — FunctionTooLong — useDataGridColumnFormatter runs 433 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 333 over it, 4.33× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • + 168 more in this group — see findings.md.
D2 · Cognitive Complexity · dbx_core · ×180
  • dbx_core::data::database_export::export_database_sql_core_inner (cognitive 247) REDACTED:3380 — dbx_core::data::database_export::export_database_sql_core_inner has cognitive complexity 247 (threshold 15). Drivers by points: if/else 68 (161 pts), match/switch 16 (43 pts), loops 14 (29 pts), boolean chains 14 (nesting depth added 135). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • dbx_core::data::table_import::import_table_file_core (cognitive 197) REDACTED:7051 — dbx_core::data::table_import::import_table_file_core has cognitive complexity 197 (threshold 15). Drivers by points: if/else 58 (108 pts), match/switch 31 (64 pts), boolean chains 16, loops 5 (9 pts) (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.
  • dbx_core::data::table_export::export_table_data_core_inner (cognitive 184) REDACTED:1580 — dbx_core::data::table_export::export_table_data_core_inner has cognitive complexity 184 (threshold 15). Drivers by points: if/else 65 (157 pts), loops 8 (18 pts), match/switch 3 (6 pts), boolean chains 3 (nesting depth added 105). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_core::data::transfer::transfer_table_inner (cognitive 134) REDACTED:9482 — dbx_core::data::transfer::transfer_table_inner has cognitive complexity 134 (threshold 15). Drivers by points: if/else 58 (85 pts), boolean chains 20, match/switch 9 (19 pts), loops 5 (10 pts) (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_core::data::query_result_export::export_query_result_core_inner (cognitive 123) REDACTED:891 — dbx_core::data::query_result_export::export_query_result_core_inner has cognitive complexity 123 (threshold 15). Drivers by points: if/else 58 (102 pts), boolean chains 11, loops 3 (8 pts), match/switch 1 (2 pts) (nesting depth added 50). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_core::schema::list_tables_once (cognitive 118) crates/dbx-core/src/schema/mod.rs:2222 — dbx_core::schema::list_tables_once has cognitive complexity 118 (threshold 15). Drivers by points: if/else 56 (98 pts), boolean chains 13, match/switch 3 (7 pts) (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_core::ai::agent_loop::run_agent_loop_inner (cognitive 103) crates/dbx-core/src/ai/agent_loop.rs:167 — dbx_core::ai::agent_loop::run_agent_loop_inner has cognitive complexity 103 (threshold 15). Drivers by points: if/else 35 (59 pts), match/switch 9 (23 pts), loops 9 (19 pts), boolean chains 2 (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.
  • dbx_core::data::transfer::transfer_mongodb_table (cognitive 96) REDACTED:8528 — dbx_core::data::transfer::transfer_mongodb_table has cognitive complexity 96 (threshold 15). Drivers by points: if/else 30 (74 pts), loops 3 (11 pts), match/switch 2 (9 pts), boolean chains 2 (nesting depth added 59). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • dbx_core::schema::render_postgres_table_ddl_with_constraints_and_partition_info (cognitive 92) crates/dbx-core/src/schema/mod.rs:14537 — dbx_core::schema::render_postgres_table_ddl_with_constraints_and_partition_info has cognitive complexity 92 (threshold 15). Drivers by points: if/else 39 (67 pts), loops 9 (13 pts), boolean chains 10, match/switch 1 (2 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_core::query::do_execute_typed (cognitive 89) REDACTED:1698 — dbx_core::query::do_execute_typed has cognitive complexity 89 (threshold 15). Drivers by points: if/else 37 (68 pts), match/switch 9 (19 pts), boolean chains 2 (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_core::schema::list_objects_once (cognitive 76) crates/dbx-core/src/schema/mod.rs:7041 — dbx_core::schema::list_objects_once has cognitive complexity 76 (threshold 15). Drivers by points: if/else 37 (62 pts), boolean chains 7, match/switch 3 (7 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_core::persistence::cloud_sync::apply_sync_snapshot_with_selection (cognitive 72) crates/dbx-core/src/persistence/cloud_sync.rs:1186 — dbx_core::persistence::cloud_sync::apply_sync_snapshot_with_selection has cognitive complexity 72 (threshold 15). Drivers by points: if/else 34 (52 pts), boolean chains 12, loops 4 (6 pts), match/switch 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_core::data::transfer::escape_value_typed (cognitive 66) REDACTED:2883 — dbx_core::data::transfer::escape_value_typed has cognitive complexity 66 (threshold 15). Drivers by points: if/else 29 (52 pts), match/switch 5 (9 pts), boolean chains 5 (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.
  • dbx_core::schema::get_columns_core_for_session_inner_with_pool (cognitive 65) crates/dbx-core/src/schema/mod.rs:7785 — dbx_core::schema::get_columns_core_for_session_inner_with_pool has cognitive complexity 65 (threshold 15). Drivers by points: if/else 23 (40 pts), match/switch 7 (21 pts), boolean chains 4 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_core::schema::completion_assistant_fallback_core (cognitive 64) crates/dbx-core/src/schema/mod.rs:6686 — dbx_core::schema::completion_assistant_fallback_core has cognitive complexity 64 (threshold 15). Drivers by points: if/else 23 (53 pts), loops 3 (7 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 36). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • dbx_core::data::transfer::map_column_type (cognitive 64) REDACTED:3425 — dbx_core::data::transfer::map_column_type has cognitive complexity 64 (threshold 15). Drivers by points: match/switch 22 (44 pts), if/else 13 (20 pts) (nesting depth added 29). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • dbx_core::data::transfer::rename_tables_to_backup (cognitive 64) REDACTED:9036 — dbx_core::data::transfer::rename_tables_to_backup has cognitive complexity 64 (threshold 15). Drivers by points: if/else 20 (46 pts), loops 7 (14 pts), match/switch 1 (4 pts) (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.
  • dbx_core::data::sql_file_import::execute_sql_file_paths_inner (cognitive 63) REDACTED:774 — dbx_core::data::sql_file_import::execute_sql_file_paths_inner has cognitive complexity 63 (threshold 15). Drivers by points: if/else 22 (47 pts), match/switch 5 (10 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_core::data::query_result_export::try_export_mysql_query_result_stream (cognitive 55) REDACTED:1440 — dbx_core::data::query_result_export::try_export_mysql_query_result_stream has cognitive complexity 55 (threshold 15). Drivers by points: if/else 35 (45 pts), match/switch 4 (6 pts), boolean chains 3, loops 1 (nesting depth added 12). 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.
  • dbx_core::schema::table_structure_sql::sqlite_rebuild::find_column_constraint_start (cognitive 52) crates/dbx-core/src/schema/table_structure_sql/sqlite_rebuild.rs:1034 — dbx_core::schema::table_structure_sql::sqlite_rebuild::find_column_constraint_start has cognitive complexity 52 (threshold 15). Drivers by points: if/else 13 (37 pts), boolean chains 5, loops 2 (5 pts), match/switch 2 (5 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_core::schema::table_structure_sql::sqlite_rebuild::find_sql_keyword_end (cognitive 51) crates/dbx-core/src/schema/table_structure_sql/sqlite_rebuild.rs:1358 — dbx_core::schema::table_structure_sql::sqlite_rebuild::find_sql_keyword_end has cognitive complexity 51 (threshold 15). Drivers by points: if/else 13 (37 pts), loops 2 (5 pts), match/switch 2 (5 pts), boolean chains 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.
  • dbx_core::data::transfer::generate_create_table_ddl_with_column_quoting (cognitive 50) REDACTED:3653 — dbx_core::data::transfer::generate_create_table_ddl_with_column_quoting has cognitive complexity 50 (threshold 15). Drivers by points: if/else 18 (43 pts), loops 2 (3 pts), boolean chains 2, match/switch 2 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • dbx_core::data::transfer::break_backup_foreign_key_graph (cognitive 49) REDACTED:10357 — dbx_core::data::transfer::break_backup_foreign_key_graph has cognitive complexity 49 (threshold 15). Drivers by points: if/else 8 (23 pts), match/switch 5 (14 pts), loops 4 (12 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_core::persistence::cloud_sync::build_sync_snapshot_with_selection (cognitive 48) crates/dbx-core/src/persistence/cloud_sync.rs:810 — dbx_core::persistence::cloud_sync::build_sync_snapshot_with_selection has cognitive complexity 48 (threshold 15). Drivers by points: if/else 20 (38 pts), loops 4 (6 pts), boolean chains 3, match/switch 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.
  • dbx_core::data::transfer::transfer_postgres_schema_objects (cognitive 48) REDACTED:10790 — dbx_core::data::transfer::transfer_postgres_schema_objects has cognitive complexity 48 (threshold 15). Drivers by points: if/else 19 (31 pts), loops 8 (10 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • + 155 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×136
  • Duplicated block (5 lines × 2) crates/dbx-ai-provider/src/ai.rs:2826 — crates/dbx-ai-provider/src/ai.rs:2826-2830 | crates/dbx-ai-provider/src/ai.rs:2992-2997 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) crates/dbx-ai-provider/src/ai.rs:5118 — crates/dbx-ai-provider/src/ai.rs:5118-5122 | crates/dbx-core/src/persistence/history.rs:120-124 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) crates/dbx-ai-provider/src/ai_claude_code_cli.rs:457 — crates/dbx-ai-provider/src/ai_claude_code_cli.rs:457-461 | crates/dbx-ai-provider/src/ai_codex_cli.rs:991-995 — before extracting anything, compare `crates/dbx-ai-provider/src/ai_claude_code_cli.rs` and `crates/dbx-ai-provider/src/ai_codex_cli.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) crates/dbx-ai-provider/src/ai_cli_agent.rs:450 — crates/dbx-ai-provider/src/ai_cli_agent.rs:450-454 | crates/dbx-ai-provider/src/ai_cli_agent.rs:628-632 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) crates/dbx-ai-provider/src/ai_cli_agent.rs:553 — crates/dbx-ai-provider/src/ai_cli_agent.rs:553-557 | crates/dbx-ai-provider/src/ai_cli_agent.rs:592-596 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) crates/dbx-core/src/admin/consul/blocking.rs:383 — crates/dbx-core/src/admin/consul/blocking.rs:383-387 | crates/dbx-core/src/admin/consul/txn.rs:376-380 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) crates/dbx-core/src/admin/consul/client.rs:153 — crates/dbx-core/src/admin/consul/client.rs:153-157 | crates/dbx-core/src/admin/consul/client.rs:185-189 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) crates/dbx-core/src/admin/mq/adapters/kafka.rs:123 — crates/dbx-core/src/admin/mq/adapters/kafka.rs:123-127 | crates/dbx-core/src/admin/mq/adapters/rocketmq.rs:79-83 — before extracting anything, compare `crates/dbx-core/src/admin/mq/adapters/kafka.rs` and `crates/dbx-core/src/admin/mq/adapters/rocketmq.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 186 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) crates/dbx-core/src/admin/mq/adapters/rabbitmq.rs:1138 — crates/dbx-core/src/admin/mq/adapters/rabbitmq.rs:1138-1142 | crates/dbx-core/src/admin/mq/adapters/rocketmq.rs:1195-1199 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) crates/dbx-core/src/admin/nacos/http.rs:550 — crates/dbx-core/src/admin/nacos/http.rs:550-554 | crates/dbx-core/src/admin/nacos/http.rs:576-580 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) crates/dbx-core/src/admin/nacos/http.rs:3955 — crates/dbx-core/src/admin/nacos/http.rs:3955-3959 | crates/dbx-core/src/admin/nacos/http.rs:4019-4023 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) crates/dbx-core/src/connection/jdbc.rs:833 — crates/dbx-core/src/connection/jdbc.rs:833-837 | crates/dbx-core/src/connection/jdbc.rs:870-874 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) crates/dbx-core/src/connection/jdbc.rs:993 — crates/dbx-core/src/connection/jdbc.rs:993-997 | crates/dbx-core/src/connection/jdbc.rs:1065-1069 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) crates/dbx-core/src/connection/jdbc.rs:1046 — crates/dbx-core/src/connection/jdbc.rs:1046-1050 | crates/dbx-core/src/connection/jdbc.rs:1103-1107 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) REDACTED:2566 — REDACTED:2566-2570 | src-tauri/src/commands/connection.rs:1787-1791 — before extracting anything, compare `REDACTED` and `src-tauri/src/commands/connection.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 247 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) REDACTED:2948 — REDACTED:2948-2952 | src-tauri/src/commands/connection.rs:2101-2105 — before extracting anything, compare `REDACTED` and `src-tauri/src/commands/connection.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 247 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) REDACTED:1087 — REDACTED:1087-1091 | REDACTED:1523-1527 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) REDACTED:920 — REDACTED:920-924 | REDACTED:2820-2824 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) crates/dbx-core/src/data/mongodb_import_export.rs:1210 — crates/dbx-core/src/data/mongodb_import_export.rs:1210-1214 | crates/dbx-core/src/data/mongodb_import_export.rs:1250-1254 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) REDACTED:1273 — REDACTED:1273-1277 | REDACTED:1974-1978 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) REDACTED:1170 — REDACTED:1170-1174 | REDACTED:1274-1278 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) REDACTED:1358 — REDACTED:1358-1362 | REDACTED:1377-1381 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) crates/dbx-core/src/persistence/cloud_sync.rs:1619 — crates/dbx-core/src/persistence/cloud_sync.rs:1619-1623 | crates/dbx-core/src/persistence/cloud_sync.rs:1736-1740 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) crates/dbx-core/src/persistence/cloud_sync.rs:2908 — crates/dbx-core/src/persistence/cloud_sync.rs:2908-2912 | crates/dbx-core/src/persistence/cloud_sync.rs:2932-2936 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) crates/dbx-core/src/persistence/config/governance.rs:233 — crates/dbx-core/src/persistence/config/governance.rs:233-237 | crates/dbx-core/src/persistence/config/governance.rs:247-251 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 111 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×128
  • Duplicated block (7 lines × 2) agents/drivers/duckdb/src/schema.rs:407 — agents/drivers/duckdb/src/schema.rs:407-413 | crates/dbx-core/src/schema/mod.rs:6690-6696 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) agents/drivers/duckdb/src/sql.rs:119 — agents/drivers/duckdb/src/sql.rs:119-125 | crates/dbx-drivers/src/db/duckdb_sql.rs:138-144 — before extracting anything, compare `agents/drivers/duckdb/src/sql.rs` and `crates/dbx-drivers/src/db/duckdb_sql.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 147 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) crates/dbx-ai-provider/src/ai.rs:3767 — crates/dbx-ai-provider/src/ai.rs:3767-3773 | crates/dbx-ai-provider/src/ai.rs:4343-4349 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) crates/dbx-core/src/admin/consul/blocking.rs:161 — crates/dbx-core/src/admin/consul/blocking.rs:161-167 | crates/dbx-core/src/admin/consul/blocking.rs:214-220 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) crates/dbx-core/src/admin/mqtt/client.rs:924 — crates/dbx-core/src/admin/mqtt/client.rs:924-930 | crates/dbx-core/src/admin/mqtt/client.rs:954-960 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) crates/dbx-core/src/admin/nacos/http.rs:915 — crates/dbx-core/src/admin/nacos/http.rs:915-921 | crates/dbx-core/src/admin/nacos/http.rs:977-983 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) crates/dbx-core/src/admin/nacos/http.rs:1593 — crates/dbx-core/src/admin/nacos/http.rs:1593-1599 | crates/dbx-core/src/admin/nacos/http.rs:1620-1626 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) crates/dbx-core/src/admin/nacos/http.rs:2945 — crates/dbx-core/src/admin/nacos/http.rs:2945-2951 | crates/dbx-core/src/admin/nacos/http.rs:2984-2990 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) crates/dbx-core/src/connection/jdbc.rs:802 — crates/dbx-core/src/connection/jdbc.rs:802-808 | crates/dbx-core/src/connection/jdbc.rs:954-960 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) crates/dbx-core/src/data/sqlite_backup.rs:97 — crates/dbx-core/src/data/sqlite_backup.rs:97-103 | crates/dbx-driver-agent/src/agent_service.rs:2612-2618 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) REDACTED:2572 — REDACTED:2572-2578 | REDACTED:10335-10341 — both copies are in the same file, so extract the 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) REDACTED:2462 — REDACTED:2462-2468 | REDACTED:2477-2483 — both copies are in the same file, so extract the 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) REDACTED:5324 — REDACTED:5324-5330 | REDACTED:5535-5541 — both copies are in the same file, so extract the 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) REDACTED:2059 — REDACTED:2059-2065 | REDACTED:2105-2111 — both copies are in the same file, so extract the 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) REDACTED:3022 — REDACTED:3022-3028 | REDACTED:3298-3304 — both copies are in the same file, so extract the 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) REDACTED:5863 — REDACTED:5863-5869 | REDACTED:5909-5915 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) crates/dbx-core/src/schema/mod.rs:2197 — crates/dbx-core/src/schema/mod.rs:2197-2204 | crates/dbx-core/src/schema/mod.rs:11297-11303 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) crates/dbx-core/src/schema/mod.rs:2712 — crates/dbx-core/src/schema/mod.rs:2712-2718 | crates/dbx-core/src/schema/mod.rs:2733-2739 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) crates/dbx-driver-agent/src/agent_service.rs:1183 — crates/dbx-driver-agent/src/agent_service.rs:1183-1189 | crates/dbx-driver-agent/src/agent_service.rs:1462-1468 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) crates/dbx-driver-agent/src/backend_error.rs:957 — crates/dbx-driver-agent/src/backend_error.rs:957-963 | crates/dbx-driver-agent/src/backend_error.rs:977-983 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) crates/dbx-driver-elasticsearch/src/lib.rs:361 — crates/dbx-driver-elasticsearch/src/lib.rs:361-367 | crates/dbx-driver-elasticsearch/src/lib.rs:601-607 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) crates/dbx-driver-mongodb/src/mongo_driver.rs:136 — crates/dbx-driver-mongodb/src/mongo_driver.rs:136-142 | crates/dbx-types/src/models/connection.rs:2094-2100 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) crates/dbx-driver-mongodb/src/mongo_driver.rs:2198 — crates/dbx-driver-mongodb/src/mongo_driver.rs:2198-2204 | crates/dbx-driver-mongodb/src/mongo_driver.rs:2285-2291 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) crates/dbx-driver-mongodb/src/mongo_driver.rs:2608 — crates/dbx-driver-mongodb/src/mongo_driver.rs:2608-2614 | crates/dbx-driver-mongodb/src/mongo_driver.rs:2628-2634 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) crates/dbx-driver-mongodb/src/mongo_shell.rs:1064 — crates/dbx-driver-mongodb/src/mongo_shell.rs:1064-1070 | crates/dbx-driver-mongodb/src/mongo_shell.rs:1084-1090 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 103 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×99
  • Duplicated block (9 lines × 2) crates/dbx-ai-provider/src/ai.rs:1527 — crates/dbx-ai-provider/src/ai.rs:1527-1535 | crates/dbx-ai-provider/src/ai.rs:1557-1565 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) crates/dbx-ai-provider/src/ai_codebuddy_cli.rs:361 — crates/dbx-ai-provider/src/ai_codebuddy_cli.rs:361-369 | crates/dbx-ai-provider/src/ai_codebuddy_cli.rs:766-774 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) crates/dbx-ai-provider/src/ai_codebuddy_cli.rs:674 — crates/dbx-ai-provider/src/ai_codebuddy_cli.rs:674-682 | crates/dbx-ai-provider/src/ai_grok_cli.rs:600-608 — before extracting anything, compare `crates/dbx-ai-provider/src/ai_codebuddy_cli.rs` and `crates/dbx-ai-provider/src/ai_grok_cli.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) crates/dbx-ai-provider/src/ai_cursor_cli.rs:338 — crates/dbx-ai-provider/src/ai_cursor_cli.rs:338-346 | crates/dbx-ai-provider/src/ai_opencode_cli.rs:384-392 — before extracting anything, compare `crates/dbx-ai-provider/src/ai_cursor_cli.rs` and `crates/dbx-ai-provider/src/ai_opencode_cli.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) crates/dbx-core/src/admin/nacos/http.rs:940 — crates/dbx-core/src/admin/nacos/http.rs:940-948 | crates/dbx-core/src/admin/nacos/http.rs:962-970 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) crates/dbx-core/src/admin/nacos/http.rs:2360 — crates/dbx-core/src/admin/nacos/http.rs:2360-2368 | crates/dbx-core/src/admin/nacos/http.rs:2400-2408 — both copies are in the same file, so extract the 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) REDACTED:1822 — REDACTED:1822-1830 | REDACTED:1866-1874 — both copies are in the same file, so extract the 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) REDACTED:2701 — REDACTED:2701-2709 | src-tauri/src/commands/connection.rs:1822-1830 — before extracting anything, compare `REDACTED` and `src-tauri/src/commands/connection.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 247 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) REDACTED:950 — REDACTED:950-958 | REDACTED:2844-2852 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) REDACTED:982 — REDACTED:982-990 | REDACTED:3092-3100 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) crates/dbx-core/src/data/mongodb_import_export.rs:908 — crates/dbx-core/src/data/mongodb_import_export.rs:908-916 | crates/dbx-core/src/data/mongodb_import_export.rs:1543-1551 — both copies are in the same file, so extract the 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) REDACTED:1648 — REDACTED:1648-1656 | REDACTED:1697-1705 — both copies are in the same file, so extract the 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) REDACTED:1176 — REDACTED:1176-1184 | REDACTED:1280-1288 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) crates/dbx-core/src/data/cloudflare_d1/import.rs:18 — crates/dbx-core/src/data/cloudflare_d1/import.rs:18-26 | REDACTED:4657-4665 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) REDACTED:4198 — REDACTED:4198-4206 | REDACTED:4325-4333 — both copies are in the same file, so extract the 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) REDACTED:5087 — REDACTED:5087-5095 | REDACTED:5110-5118 — both copies are in the same file, so extract the 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) REDACTED:6869 — REDACTED:6869-6877 | REDACTED:7694-7702 — both copies are in the same file, so extract the 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) REDACTED:2535 — REDACTED:2535-2543 | REDACTED:2566-2574 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) REDACTED:4735 — REDACTED:4735-4743 | REDACTED:5140-5148 — both copies are in the same file, so extract the 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) REDACTED:6114 — REDACTED:6114-6122 | REDACTED:6280-6288 — both copies are in the same file, so extract the 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) REDACTED:6886 — REDACTED:6886-6894 | REDACTED:6917-6925 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) crates/dbx-core/src/schema/agent_pg_sequences.rs:53 — crates/dbx-core/src/schema/agent_pg_sequences.rs:53-61 | crates/dbx-core/src/schema/kingbase.rs:80-88 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (9 lines × 2) crates/dbx-core/src/schema/mod.rs:13851 — crates/dbx-core/src/schema/mod.rs:13851-13859 | crates/dbx-core/src/schema/mod.rs:14363-14371 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) crates/dbx-core/src/schema/providers/native.rs:101 — crates/dbx-core/src/schema/providers/native.rs:101-109 | crates/dbx-core/src/schema/providers/native.rs:125-133 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) crates/dbx-driver-elasticsearch/src/lib.rs:1018 — crates/dbx-driver-elasticsearch/src/lib.rs:1018-1026 | crates/dbx-driver-elasticsearch/src/lib.rs:1032-1040 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 74 more in this group — see findings.md.
D1 · Cyclomatic Complexity · dbx_core · ×98
  • dbx_core::data::table_import::import_table_file_core (cyclomatic 118) REDACTED:7051 — dbx_core::data::table_import::import_table_file_core has cyclomatic complexity 118 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • dbx_core::data::database_export::export_database_sql_core_inner (cyclomatic 104) REDACTED:3380 — dbx_core::data::database_export::export_database_sql_core_inner has cyclomatic complexity 104 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • dbx_core::data::transfer::map_column_type (cyclomatic 86) REDACTED:3425 — dbx_core::data::transfer::map_column_type has cyclomatic complexity 86 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • dbx_core::data::transfer::transfer_table_inner (cyclomatic 84) REDACTED:9482 — dbx_core::data::transfer::transfer_table_inner has cyclomatic complexity 84 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • dbx_core::schema::list_tables_once (cyclomatic 81) crates/dbx-core/src/schema/mod.rs:2222 — dbx_core::schema::list_tables_once has cyclomatic complexity 81 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • dbx_core::query::do_execute_typed (cyclomatic 73) REDACTED:1698 — dbx_core::query::do_execute_typed has cyclomatic complexity 73 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • dbx_core::data::table_export::export_table_data_core_inner (cyclomatic 72) REDACTED:1580 — dbx_core::data::table_export::export_table_data_core_inner has cyclomatic complexity 72 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • dbx_core::data::query_result_export::export_query_result_core_inner (cyclomatic 64) REDACTED:891 — dbx_core::data::query_result_export::export_query_result_core_inner 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.
  • dbx_core::ai::agent_loop::run_agent_loop_inner (cyclomatic 56) crates/dbx-core/src/ai/agent_loop.rs:167 — dbx_core::ai::agent_loop::run_agent_loop_inner 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.
  • dbx_core::schema::render_postgres_table_ddl_with_constraints_and_partition_info (cyclomatic 55) crates/dbx-core/src/schema/mod.rs:14537 — dbx_core::schema::render_postgres_table_ddl_with_constraints_and_partition_info has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • dbx_core::schema::get_columns_core_for_session_inner_with_pool (cyclomatic 53) crates/dbx-core/src/schema/mod.rs:7785 — dbx_core::schema::get_columns_core_for_session_inner_with_pool has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • dbx_core::persistence::cloud_sync::apply_sync_snapshot_with_selection (cyclomatic 47) crates/dbx-core/src/persistence/cloud_sync.rs:1186 — dbx_core::persistence::cloud_sync::apply_sync_snapshot_with_selection 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.
  • dbx_core::schema::list_objects_once (cyclomatic 46) crates/dbx-core/src/schema/mod.rs:7041 — dbx_core::schema::list_objects_once 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.
  • dbx_core::data::query_result_export::try_export_mysql_query_result_stream (cyclomatic 40) REDACTED:1440 — dbx_core::data::query_result_export::try_export_mysql_query_result_stream has cyclomatic complexity 40 (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.
  • dbx_core::data::transfer::escape_value_typed (cyclomatic 40) REDACTED:2883 — dbx_core::data::transfer::escape_value_typed has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • dbx_core::data::table_import::parse_xlsx_preview_file_with_options (cyclomatic 39) REDACTED:3405 — dbx_core::data::table_import::parse_xlsx_preview_file_with_options has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • dbx_core::schema::get_table_ddl_once (cyclomatic 33) crates/dbx-core/src/schema/mod.rs:9332 — dbx_core::schema::get_table_ddl_once has cyclomatic complexity 33 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • dbx_core::data::sql_file_import::execute_sql_file_paths_inner (cyclomatic 33) REDACTED:774 — dbx_core::data::sql_file_import::execute_sql_file_paths_inner has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • dbx_core::schema::table_structure_sql::sqlite_rebuild::find_column_constraint_start (cyclomatic 33) crates/dbx-core/src/schema/table_structure_sql/sqlite_rebuild.rs:1034 — dbx_core::schema::table_structure_sql::sqlite_rebuild::find_column_constraint_start has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • dbx_core::data::transfer::transfer_postgres_schema_objects (cyclomatic 32) REDACTED:10790 — dbx_core::data::transfer::transfer_postgres_schema_objects 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.
  • dbx_core::data::query_result_export::try_export_clickhouse_query_result_stream (cyclomatic 31) REDACTED:1724 — dbx_core::data::query_result_export::try_export_clickhouse_query_result_stream has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • dbx_core::data::table_import::stream_xlsx_rows_to_channel_with_control (cyclomatic 31) REDACTED:4068 — dbx_core::data::table_import::stream_xlsx_rows_to_channel_with_control has cyclomatic complexity 31 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • dbx_core::data::table_export::try_export_native_table_stream (cyclomatic 31) REDACTED:1139 — dbx_core::data::table_export::try_export_native_table_stream 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.
  • dbx_core::query::mongo_ops::execute_mongo_command_core (cyclomatic 31) crates/dbx-core/src/query/mongo_ops.rs:1132 — dbx_core::query::mongo_ops::execute_mongo_command_core has cyclomatic complexity 31 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • dbx_core::admin::nacos::access_control::plan_operation (cyclomatic 30) crates/dbx-core/src/admin/nacos/access_control.rs:534 — dbx_core::admin::nacos::access_control::plan_operation 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.
  • + 73 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×98
  • Duplicated block (6 lines × 2) agents/drivers/duckdb/src/schema.rs:536 — agents/drivers/duckdb/src/schema.rs:536-541 | crates/dbx-drivers/src/db/sqlite.rs:1787-1792 — 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) agents/drivers/duckdb/src/sql.rs:361 — agents/drivers/duckdb/src/sql.rs:361-366 | crates/dbx-drivers/src/db/cloudflare_d1/sql_lexer.rs:23-28 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) crates/dbx-ai-provider/src/ai_codex_cli.rs:107 — crates/dbx-ai-provider/src/ai_codex_cli.rs:107-113 | crates/dbx-ai-provider/src/ai_pi_agent_cli.rs:248-253 — before extracting anything, compare `crates/dbx-ai-provider/src/ai_codex_cli.rs` and `crates/dbx-ai-provider/src/ai_pi_agent_cli.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) crates/dbx-ai-provider/src/ai_cursor_cli.rs:235 — crates/dbx-ai-provider/src/ai_cursor_cli.rs:235-240 | crates/dbx-ai-provider/src/ai_cursor_cli.rs:285-290 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/dbx-ai-provider/src/ai_pi_agent_cli.rs:173 — crates/dbx-ai-provider/src/ai_pi_agent_cli.rs:173-178 | crates/dbx-ai-provider/src/ai_pi_agent_cli.rs:184-189 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/dbx-cli/src/main.rs:496 — crates/dbx-cli/src/main.rs:496-501 | crates/dbx-cli/src/main.rs:548-553 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/dbx-core/src/admin/mq/adapters/rocketmq.rs:1034 — crates/dbx-core/src/admin/mq/adapters/rocketmq.rs:1034-1039 | crates/dbx-core/src/admin/mq/adapters/rocketmq.rs:1112-1119 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/dbx-core/src/admin/nacos/access_control.rs:90 — crates/dbx-core/src/admin/nacos/access_control.rs:90-95 | crates/dbx-core/src/ai/agent_tools.rs:76-81 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) crates/dbx-core/src/ai/plugin_tools.rs:837 — crates/dbx-core/src/ai/plugin_tools.rs:837-842 | crates/dbx-mcp/src/plugin_tools.rs:109-114 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) crates/dbx-core/src/connection/connection_secrets.rs:584 — crates/dbx-core/src/connection/connection_secrets.rs:584-589 | crates/dbx-core/src/persistence/cloud_sync.rs:2535-2540 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) crates/dbx-core/src/data/mongodb_import_export.rs:1283 — crates/dbx-core/src/data/mongodb_import_export.rs:1283-1288 | crates/dbx-core/src/data/mongodb_import_export.rs:1304-1310 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) REDACTED:1642 — REDACTED:1642-1647 | REDACTED:1690-1696 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) REDACTED:2932 — REDACTED:2932-2937 | REDACTED:3030-3035 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) REDACTED:3921 — REDACTED:3921-3927 | REDACTED:4116-4121 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) REDACTED:5354 — REDACTED:5354-5359 | REDACTED:5464-5469 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) REDACTED:4707 — REDACTED:4707-4712 | REDACTED:7261-7266 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) REDACTED:5075 — REDACTED:5075-5080 | REDACTED:5098-5103 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/dbx-core/src/schema/agent_pg_sequences.rs:72 — crates/dbx-core/src/schema/agent_pg_sequences.rs:72-77 | crates/dbx-core/src/schema/kingbase.rs:99-104 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) crates/dbx-core/src/schema/mod.rs:11022 — crates/dbx-core/src/schema/mod.rs:11022-11027 | crates/dbx-core/src/schema/mod.rs:11068-11073 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/dbx-core/src/query/redis_ops.rs:231 — crates/dbx-core/src/query/redis_ops.rs:231-236 | crates/dbx-core/src/query/redis_ops.rs:263-268 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/dbx-driver-agent/src/backend_error.rs:1016 — crates/dbx-driver-agent/src/backend_error.rs:1016-1021 | crates/dbx-driver-agent/src/backend_error.rs:1040-1045 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/dbx-driver-elasticsearch/src/lib.rs:432 — crates/dbx-driver-elasticsearch/src/lib.rs:432-437 | crates/dbx-drivers/src/db/solr_driver.rs:144-149 — before extracting anything, compare `crates/dbx-driver-elasticsearch/src/lib.rs` and `crates/dbx-drivers/src/db/solr_driver.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) crates/dbx-driver-mongodb/src/mongo_driver.rs:2103 — crates/dbx-driver-mongodb/src/mongo_driver.rs:2103-2108 | crates/dbx-driver-mongodb/src/mongo_driver.rs:2125-2130 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/dbx-driver-mongodb/src/mongo_oidc.rs:139 — crates/dbx-driver-mongodb/src/mongo_oidc.rs:139-144 | crates/dbx-drivers/src/salesforce_oauth.rs:212-217 — before extracting anything, compare `crates/dbx-driver-mongodb/src/mongo_oidc.rs` and `crates/dbx-drivers/src/salesforce_oauth.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 87 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) REDACTED:1731 — REDACTED:1731-1736 | REDACTED:1774-1779 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 73 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×91
  • Duplicated block (8 lines × 2) crates/dbx-ai-provider/src/ai.rs:4008 — crates/dbx-ai-provider/src/ai.rs:4008-4015 | crates/dbx-ai-provider/src/ai.rs:4711-4718 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) crates/dbx-ai-provider/src/ai.rs:4104 — crates/dbx-ai-provider/src/ai.rs:4104-4111 | crates/dbx-ai-provider/src/ai.rs:4965-4972 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) crates/dbx-ai-provider/src/ai_claude_code_cli.rs:279 — crates/dbx-ai-provider/src/ai_claude_code_cli.rs:279-286 | crates/dbx-ai-provider/src/ai_codebuddy_cli.rs:358-365 — before extracting anything, compare `crates/dbx-ai-provider/src/ai_claude_code_cli.rs` and `crates/dbx-ai-provider/src/ai_codebuddy_cli.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) crates/dbx-ai-provider/src/ai_claude_code_cli.rs:397 — crates/dbx-ai-provider/src/ai_claude_code_cli.rs:397-404 | crates/dbx-ai-provider/src/ai_codebuddy_cli.rs:508-515 — before extracting anything, compare `crates/dbx-ai-provider/src/ai_claude_code_cli.rs` and `crates/dbx-ai-provider/src/ai_codebuddy_cli.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) crates/dbx-ai-provider/src/ai_codex_cli.rs:391 — crates/dbx-ai-provider/src/ai_codex_cli.rs:391-398 | crates/dbx-ai-provider/src/ai_pi_agent_cli.rs:373-380 — before extracting anything, compare `crates/dbx-ai-provider/src/ai_codex_cli.rs` and `crates/dbx-ai-provider/src/ai_pi_agent_cli.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) crates/dbx-core/src/admin/nacos/http.rs:3946 — crates/dbx-core/src/admin/nacos/http.rs:3946-3953 | crates/dbx-core/src/admin/nacos/http.rs:4010-4017 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) REDACTED:341 — REDACTED:341-348 | crates/dbx-formats/src/text_export.rs:78-85 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) REDACTED:6842 — REDACTED:6842-6849 | REDACTED:6908-6915 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) REDACTED:7885 — REDACTED:7885-7892 | REDACTED:7918-7925 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) REDACTED:8491 — REDACTED:8491-8498 | REDACTED:8656-8663 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) crates/dbx-core/src/query/document_ops.rs:509 — crates/dbx-core/src/query/document_ops.rs:509-516 | crates/dbx-core/src/query/mongo_ops.rs:523-530 — before extracting anything, compare `crates/dbx-core/src/query/document_ops.rs` and `crates/dbx-core/src/query/mongo_ops.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) crates/dbx-core/src/query/document_ops.rs:534 — crates/dbx-core/src/query/document_ops.rs:534-541 | crates/dbx-core/src/query/document_ops.rs:575-582 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) REDACTED:1972 — REDACTED:1972-1979 | REDACTED:2142-2149 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) REDACTED:2126 — REDACTED:2126-2133 | REDACTED:2157-2164 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) REDACTED:6197 — REDACTED:6197-6204 | REDACTED:6221-6228 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) crates/dbx-core/src/schema/mod.rs:8458 — crates/dbx-core/src/schema/mod.rs:8458-8465 | crates/dbx-core/src/schema/mod.rs:8506-8513 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) crates/dbx-driver-agent/src/agent_driver.rs:50 — crates/dbx-driver-agent/src/agent_driver.rs:50-57 | crates/dbx-driver-agent/src/agent_driver.rs:1631-1638 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) crates/dbx-driver-agent/src/agent_manager.rs:1077 — crates/dbx-driver-agent/src/agent_manager.rs:1077-1084 | crates/dbx-driver-agent/src/agent_manager.rs:1100-1107 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) crates/dbx-driver-mongodb/src/mongo_driver.rs:511 — crates/dbx-driver-mongodb/src/mongo_driver.rs:511-518 | crates/dbx-driver-mongodb/src/mongo_driver.rs:1713-1720 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) crates/dbx-driver-mongodb/src/mongo_driver.rs:2707 — crates/dbx-driver-mongodb/src/mongo_driver.rs:2707-2714 | crates/dbx-driver-mongodb/src/mongo_driver.rs:2730-2737 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) REDACTED:1684 — REDACTED:1684-1691 | REDACTED:7942-7949 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) crates/dbx-driver-sqlserver/src/sqlserver.rs:2238 — crates/dbx-driver-sqlserver/src/sqlserver.rs:2238-2245 | crates/dbx-driver-sqlserver/src/sqlserver.rs:2297-2304 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) crates/dbx-drivers/src/db/duckdb_worker_process.rs:408 — crates/dbx-drivers/src/db/duckdb_worker_process.rs:408-415 | crates/dbx-drivers/src/db/duckdb_worker_process.rs:456-463 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) crates/dbx-drivers/src/db/dynamodb_driver.rs:789 — crates/dbx-drivers/src/db/dynamodb_driver.rs:789-796 | crates/dbx-drivers/src/db/dynamodb_driver.rs:845-852 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) crates/dbx-drivers/src/db/opentenbase.rs:64 — crates/dbx-drivers/src/db/opentenbase.rs:64-71 | crates/dbx-drivers/src/db/opentenbase.rs:97-104 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 66 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×87
  • Duplicated block (10 lines × 2) agents/drivers/duckdb/src/schema.rs:469 — agents/drivers/duckdb/src/schema.rs:469-478 | agents/drivers/duckdb/src/schema.rs:519-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.
  • Duplicated block (10 lines × 2) crates/dbx-ai-provider/src/ai.rs:2427 — crates/dbx-ai-provider/src/ai.rs:2427-2436 | crates/dbx-ai-provider/src/ai.rs:2455-2464 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) crates/dbx-core/src/admin/mq/adapters/kafka.rs:507 — crates/dbx-core/src/admin/mq/adapters/kafka.rs:507-516 | crates/dbx-core/src/admin/mq/adapters/rocketmq.rs:643-652 — before extracting anything, compare `crates/dbx-core/src/admin/mq/adapters/kafka.rs` and `crates/dbx-core/src/admin/mq/adapters/rocketmq.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 186 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) crates/dbx-core/src/admin/nacos/http.rs:3078 — crates/dbx-core/src/admin/nacos/http.rs:3078-3087 | crates/dbx-core/src/admin/nacos/http.rs:3094-3103 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) crates/dbx-core/src/connection/jdbc.rs:888 — crates/dbx-core/src/connection/jdbc.rs:888-897 | crates/dbx-core/src/connection/jdbc.rs:968-977 — both copies are in the same file, so extract the 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) REDACTED:2880 — REDACTED:2880-2889 | src-tauri/src/commands/connection.rs:1953-1962 — before extracting anything, compare `REDACTED` and `src-tauri/src/commands/connection.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 247 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) REDACTED:6164 — REDACTED:6164-6173 | REDACTED:6205-6214 — both copies are in the same file, so extract the 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) REDACTED:930 — REDACTED:930-939 | REDACTED:2827-2836 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) REDACTED:1044 — REDACTED:1044-1053 | REDACTED:1888-1897 — both copies are in the same file, so extract the 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) REDACTED:3734 — REDACTED:3734-3743 | REDACTED:3763-3772 — both copies are in the same file, so extract the 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) REDACTED:4112 — REDACTED:4112-4121 | REDACTED:4243-4252 — both copies are in the same file, so extract the 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) REDACTED:6839 — REDACTED:6839-6848 | crates/dbx-core/src/schema/mod.rs:209-218 — 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) REDACTED:747 — REDACTED:747-756 | REDACTED:806-817 — both copies are in the same file, so extract the 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) REDACTED:6787 — REDACTED:6787-6796 | REDACTED:6880-6889 — both copies are in the same file, so extract the 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) REDACTED:6833 — REDACTED:6833-6842 | REDACTED:6926-6935 — both copies are in the same file, so extract the 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) REDACTED:8280 — REDACTED:8280-8289 | REDACTED:8359-8368 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) crates/dbx-driver-agent/src/agent_runtime.rs:199 — crates/dbx-driver-agent/src/agent_runtime.rs:199-208 | crates/dbx-driver-agent/src/agent_runtime.rs:232-241 — both copies are in the same file, so extract the 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) REDACTED:8391 — REDACTED:8391-8400 | REDACTED:8752-8761 — both copies are in the same file, so extract the 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) REDACTED:9695 — REDACTED:9695-9704 | REDACTED:9750-9759 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) crates/dbx-mcp/src/server.rs:2836 — crates/dbx-mcp/src/server.rs:2836-2845 | crates/dbx-mcp/src/server.rs:2865-2874 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) crates/dbx-sql-core/src/sql_editability.rs:430 — crates/dbx-sql-core/src/sql_editability.rs:430-439 | crates/dbx-sql-core/src/sql_editability.rs:628-637 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) crates/dbx-sql-core/src/value_literals.rs:24 — crates/dbx-sql-core/src/value_literals.rs:24-33 | crates/dbx-sql-core/src/value_literals.rs:62-71 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) crates/dbx-sql-core/src/value_literals.rs:92 — crates/dbx-sql-core/src/value_literals.rs:92-101 | crates/dbx-sql-schema/src/db_admin_sql.rs:1271-1280 — 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) REDACTED:1905 — REDACTED:1905-1914 | crates/dbx-sql-data/src/data_grid_tdengine_sql.rs:19-28 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (10 lines × 2) crates/dbx-sql-data/src/query_result_sql.rs:1407 — crates/dbx-sql-data/src/query_result_sql.rs:1407-1416 | crates/dbx-sql-data/src/query_result_sql.rs:1462-1471 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 62 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Repeated repair · ×78
  • Repeated repair: src-tauri/src/commands/mcp.rs src-tauri/src/commands/mcp.rs:1251 — src-tauri/src/commands/mcp.rs changed 22 times in last 90 days and 15 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is dbx::commands::mcp::mcp_native_binary_path_for at line 1251), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(mcp): update pnpm-installed MCP server with @latest”; “fix(mcp): support pnpm global shim with separate node runtime”; “fix(mcp): resolve mise-managed server shims”; “fix(mcp): respect configured package registry”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- src-tauri/src/commands/mcp.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: agents/common/src/main/java/com/dbx/agent/AgentProtocol.java agents/common/src/main/java/com/dbx/agent/AgentProtocol.java:350 — agents/common/src/main/java/com/dbx/agent/AgentProtocol.java changed 26 times in last 90 days and 14 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 1 (its worst body is AgentProtocol.handshakeResult at line 350), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(mongodb): support legacy agent insertMany writes”; “fix(mongodb): support createUser shell commands”; “fix(mongodb): support legacy aggregate commands”; “fix(mongodb): support find explain commands”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- agents/common/src/main/java/com/dbx/agent/AgentProtocol.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: apps/desktop/src/components/layout/SqlFilePanel.vue apps/desktop/src/components/layout/SqlFilePanel.vue:121 — apps/desktop/src/components/layout/SqlFilePanel.vue changed 20 times in last 90 days and 14 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is loadFolderEntries at line 121), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(sql-file): preserve Oracle schema during file execution”; “fix(sql-file): open and save custom-filtered text files”; “fix(sql): restore SQL file schema for sidebar locate”; “fix(sql-files): prevent sticky folder header bleed-through”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- apps/desktop/src/components/layout/SqlFilePanel.vue`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: apps/desktop/src/components/objects/DdlViewDialog.vue apps/desktop/src/components/objects/DdlViewDialog.vue:126 — apps/desktop/src/components/objects/DdlViewDialog.vue changed 22 times in last 90 days and 13 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is onDialogHeaderPointerDown at line 126), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(editor): copy editor text with CRLF line endings on Windows”; “fix(grid): qualify generated save and copy SQL with database name”; “fix(ddl): honor database qualification settings”; “fix(oceanbase): preserve partition DDL and toggle storage options”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- apps/desktop/src/components/objects/DdlViewDialog.vue`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: apps/desktop/src/components/layout/EditorGroup.vue apps/desktop/src/components/layout/EditorGroup.vue:133 — apps/desktop/src/components/layout/EditorGroup.vue changed 17 times in last 90 days and 11 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is (anonymous) at line 133), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(mysql): optionally keep explicit transactions in autocommit tabs”; “fix(editor): hide commit/rollback for clean mysql/pg manual transactions”; “fix(oceanbase): support manual transaction control in oracle mode”; “fix(layout): keep panel resizing smooth across plugin iframes”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- apps/desktop/src/components/layout/EditorGroup.vue`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: crates/dbx-core/src/persistence/secret_codec.rs crates/dbx-core/src/persistence/secret_codec.rs:162 — crates/dbx-core/src/persistence/secret_codec.rs changed 11 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is SecretCodec::resolve_platform_default at line 162), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(core): cache resolved secret codec per storage instance”; “fix(dev): stabilize macOS signing and isolate test keys”; “fix(core): drop needless return in test secret key path”; “fix(core): gate default secret key path resolution out of test builds”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- crates/dbx-core/src/persistence/secret_codec.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:745 — agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java changed 15 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is PostgresLikeAgent.listForeignKeysFromCatalogArrays at line 745), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(postgres): keep expression index DDL text and key order in sync”; “fix(postgres): preserve index key ordering on transfer”; “fix(schema-diff): require explicit expression index provenance”; “fix(vastbase): support legacy catalog array metadata”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: apps/desktop/src/components/layout/SqlEditorWorkspace.vue apps/desktop/src/components/layout/SqlEditorWorkspace.vue:64 — apps/desktop/src/components/layout/SqlEditorWorkspace.vue changed 15 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is focusSearch at line 64), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(layout): fix plugin tab layout with vertical tab bar”; “fix(layout): keep panel resizing smooth across plugin iframes”; “fix(plugins): stabilize plugin integration”; “fix(editor): execute manually selected sql from the toolbar”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- apps/desktop/src/components/layout/SqlEditorWorkspace.vue`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: apps/desktop/src/lib/table/tableEditing.ts apps/desktop/src/lib/table/tableEditing.ts:21 — apps/desktop/src/lib/table/tableEditing.ts changed 12 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is tableEditing.editablePrimaryKeys at line 21), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(grid): keep hiding xugu __DBX_ROWID after metadata loads”; “fix(oracle): stop ROWID pagination injection on views”; “fix(xugu): enable safe row editing without primary keys”; “fix(oracle): prefer physical row identifiers over ROWID”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- apps/desktop/src/lib/table/tableEditing.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: apps/desktop/src/lib/dataGrid/binaryCellDownload.ts apps/desktop/src/lib/dataGrid/binaryCellDownload.ts:220 — apps/desktop/src/lib/dataGrid/binaryCellDownload.ts changed 11 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is binaryCellDownload.binaryCellDisplayText at line 220), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(doris): preserve aggregate-state bytes in query results”; “fix(grid): support text preview of binary cells”; “fix(grid): preview GBK-stored text in MySQL varbinary cells”; “fix(mysql): copy varbinary text values as raw strings”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- apps/desktop/src/lib/dataGrid/binaryCellDownload.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: apps/desktop/src/lib/redis/redisValuePresentation.ts apps/desktop/src/lib/redis/redisValuePresentation.ts:409 — apps/desktop/src/lib/redis/redisValuePresentation.ts changed 12 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is redisValuePresentation.toYamlLines at line 409), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(redis): show values for kvrocks bitmap and hyperloglog keys”; “fix(redis): bound large string previews to avoid crashes”; “fix(redis): support legacy pickle and valid XML tags”; “fix(redis): paginate stream entries”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- apps/desktop/src/lib/redis/redisValuePresentation.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: apps/desktop/src/components/grid/DataGridColumnHeader.vue apps/desktop/src/components/grid/DataGridColumnHeader.vue:45 — apps/desktop/src/components/grid/DataGridColumnHeader.vue changed 12 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is columnIndexText at line 45), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(theme): keep inverted text opaque over background images”; “fix(desktop): restore legacy webview dialog and highlight fixes”; “fix(desktop): add legacy webview fallbacks for snapshots and dialogs”; “fix(editor): scope column tooltips and autocomplete”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- apps/desktop/src/components/grid/DataGridColumnHeader.vue`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: apps/desktop/src/lib/sidebar/dataTabOpenPolicy.ts apps/desktop/src/lib/sidebar/dataTabOpenPolicy.ts:50 — apps/desktop/src/lib/sidebar/dataTabOpenPolicy.ts changed 11 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is dataTabOpenPolicy.canReuseActiveTableTab at line 50), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(connection): invalidate data-tab metadata on disconnect/reconnect”; “fix(grid): protect unsaved cell edits on data tab reuse”; “fix(tabs): reuse data tabs only for the same table”; “fix(tabs): honor data tab reuse across activation paths”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- apps/desktop/src/lib/sidebar/dataTabOpenPolicy.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: agents/common/src/main/java/com/dbx/agent/StandardJdbcMetadata.java agents/common/src/main/java/com/dbx/agent/StandardJdbcMetadata.java:170 — agents/common/src/main/java/com/dbx/agent/StandardJdbcMetadata.java changed 9 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is StandardJdbcMetadata.completionAssistantSearch at line 170), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(jdbc): escape completion masks for OceanBase hover preview”; “fix(metadata): scope schemas to current catalog”; “fix(databend): skip schema wildcard escaping so databases with underscore list tables”; “fix(gaussdb): support M-mode type metadata”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- agents/common/src/main/java/com/dbx/agent/StandardJdbcMetadata.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: agents/drivers/iris/src/main/java/com/dbx/agent/iris/IrisAgent.java agents/drivers/iris/src/main/java/com/dbx/agent/iris/IrisAgent.java:69 — agents/drivers/iris/src/main/java/com/dbx/agent/iris/IrisAgent.java changed 7 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is IrisAgent.resultValue at line 69), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(iris): display %Boolean columns as stored 1/0 values”; “fix(intersystems): read out-of-range integers via BigDecimal”; “fix(iris): raise jdbc query prefetch for large results”; “fix(iris): read vendor list values through JDBC objects”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- agents/drivers/iris/src/main/java/com/dbx/agent/iris/IrisAgent.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: apps/desktop/src/components/grid/TemporalCellEditor.vue apps/desktop/src/components/grid/TemporalCellEditor.vue:176 — apps/desktop/src/components/grid/TemporalCellEditor.vue changed 9 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is flushInputValue at line 176), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(grid): commit and save temporal cell edits on Ctrl+S”; “fix(grid): keep tz-aware Now values and duckdb lockfile in sync”; “fix(postgres): render temporal values in session timezone”; “fix(iotdb): correct timestamp display and table editing”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- apps/desktop/src/components/grid/TemporalCellEditor.vue`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: apps/desktop/src/lib/dataGrid/dataGridPagination.ts apps/desktop/src/lib/dataGrid/dataGridPagination.ts:76 — apps/desktop/src/lib/dataGrid/dataGridPagination.ts changed 9 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is dataGridPagination.hasCompleteLocalDataGridResult at line 76), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(grid): allow rerunning exact total row count from status”; “fix(grid): preserve exact totals beyond the result row limit”; “fix(mongo): stabilize estimated-total pagination”; “fix(grid): stop infinite scroll at exact total”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- apps/desktop/src/lib/dataGrid/dataGridPagination.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: apps/desktop/src/composables/useDatabaseOptions.ts apps/desktop/src/composables/useDatabaseOptions.ts:77 — apps/desktop/src/composables/useDatabaseOptions.ts changed 9 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is useDatabaseOptions.useDatabaseOptions at line 77), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(compare): let oracle pick schemas in data compare”; “fix(transfer): support gbase jdbc connections”; “fix(export): show all dameng databases in export dropdown”; “fix(mysql): use database-specific catalog switching”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- apps/desktop/src/composables/useDatabaseOptions.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: apps/desktop/src/components/ui/LightTooltip.vue apps/desktop/src/components/ui/LightTooltip.vue:132 — apps/desktop/src/components/ui/LightTooltip.vue changed 7 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is updatePosition at line 132), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ui): wrap oversized single-line tooltips instead of clipping”; “fix(theme): keep inverted text opaque over background images”; “fix(grid): show field metadata in transpose view”; “fix(sidebar): keep tooltips within the viewport”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- apps/desktop/src/components/ui/LightTooltip.vue`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: apps/desktop/src/components/connection/TunnelProfileManager.vue apps/desktop/src/components/connection/TunnelProfileManager.vue:167 — apps/desktop/src/components/connection/TunnelProfileManager.vue changed 9 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is testSelected at line 167), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(connection): strip invisible characters from saved credentials”; “fix(desktop): improve legacy WebView style compatibility”; “fix(errors): unify backend error protocol and preserve db detail”; “fix(tunnels): 恢复 SSH config 别名选择 (#3540)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- apps/desktop/src/components/connection/TunnelProfileManager.vue`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: apps/desktop/src/components/editor/DangerConfirmDialog.vue apps/desktop/src/components/editor/DangerConfirmDialog.vue:83 — apps/desktop/src/components/editor/DangerConfirmDialog.vue changed 9 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is (anonymous) at line 83), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(editor): guard danger dialog focus across reopen”; “fix(editor): keep scroll after canceling dangerous sql”; “fix(sidebar): keep destructive table operations cancellable”; “fix(editor): wrap dangerous SQL previews by default”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- apps/desktop/src/components/editor/DangerConfirmDialog.vue`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: apps/desktop/src/components/diff/SchemaDiffDdlPanel.vue apps/desktop/src/components/diff/SchemaDiffDdlPanel.vue:97 — apps/desktop/src/components/diff/SchemaDiffDdlPanel.vue changed 8 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is collectModifySegments at line 97), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(schema-diff): focus modified table DDL changes”; “fix(schema-diff): guard deploy script execution”; “fix(schema-diff): keep deploy script preview in sync with selection”; “fix(schema-diff): guard and review destructive DDL”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- apps/desktop/src/components/diff/SchemaDiffDdlPanel.vue`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: apps/desktop/src/lib/table/tableClipboard.ts apps/desktop/src/lib/table/tableClipboard.ts:96 — apps/desktop/src/lib/table/tableClipboard.ts changed 7 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is tableClipboard.isWritableTableDataCopyColumn at line 96), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(dameng): wrap identity columns when pasting table data”; “fix(table): keep mysql DEFAULT_GENERATED columns copyable”; “fix(table-paste): surface first batch paste error”; “fix(sqlserver): skip rowversion columns when copying table data”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- apps/desktop/src/lib/table/tableClipboard.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: apps/desktop/src/lib/tabs/contentSurfaceEvents.ts apps/desktop/src/lib/tabs/contentSurfaceEvents.ts:66 — apps/desktop/src/lib/tabs/contentSurfaceEvents.ts changed 7 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 2 (its worst body is contentSurfaceEvents.createContentSurfaceEventForwarders at line 66), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(plugin): close plugin tabs safely and hide load flash”; “fix(editor): preserve SQL tab viewport state”; “fix(objects): preserve category filter per tab”; “fix(objects): keep browse search filter per tab”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- apps/desktop/src/lib/tabs/contentSurfaceEvents.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: apps/desktop/src/lib/dataGrid/cellValue.ts apps/desktop/src/lib/dataGrid/cellValue.ts:17 — apps/desktop/src/lib/dataGrid/cellValue.ts changed 7 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is cellValue.firstLineCellDisplayValue at line 17), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(dataGrid): use single-char whitespace marker in cells”; “fix(grid): copy NULL cells as empty fields”; “fix(data-grid): show first nonblank cell preview line”; “fix(sqlserver): display long varchar query results”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 19:13:03 +00:00' --until='2026-09-28 19:13:03 +00:00' --full-history --no-merges -- apps/desktop/src/lib/dataGrid/cellValue.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • + 53 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×69
  • Duplicated block (11 lines × 2) crates/dbx-core/src/admin/mq/adapters/kafka.rs:578 — crates/dbx-core/src/admin/mq/adapters/kafka.rs:578-588 | crates/dbx-core/src/admin/mq/adapters/rocketmq.rs:720-730 — before extracting anything, compare `crates/dbx-core/src/admin/mq/adapters/kafka.rs` and `crates/dbx-core/src/admin/mq/adapters/rocketmq.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 186 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) crates/dbx-core/src/admin/nacos/access_control.rs:182 — crates/dbx-core/src/admin/nacos/access_control.rs:182-192 | crates/dbx-core/src/admin/nacos/access_control.rs:206-216 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) crates/dbx-core/src/ai/plugin_tools.rs:844 — crates/dbx-core/src/ai/plugin_tools.rs:844-854 | crates/dbx-mcp/src/plugin_tools.rs:116-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.
  • Duplicated block (11 lines × 2) REDACTED:2808 — REDACTED:2808-2818 | src-tauri/src/commands/connection.rs:1925-1935 — before extracting anything, compare `REDACTED` and `src-tauri/src/commands/connection.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 247 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) REDACTED:4944 — REDACTED:4944-4954 | REDACTED:5798-5808 — both copies are in the same file, so extract the 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) REDACTED:6200 — REDACTED:6200-6210 | REDACTED:6217-6227 — both copies are in the same file, so extract the 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) REDACTED:3637 — REDACTED:3637-3647 | REDACTED:3704-3714 — both copies are in the same file, so extract the 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) REDACTED:978 — REDACTED:978-988 | REDACTED:1006-1016 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) crates/dbx-core/src/schema/mod.rs:1559 — crates/dbx-core/src/schema/mod.rs:1559-1569 | crates/dbx-core/src/schema/mod.rs:1580-1590 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) crates/dbx-core/src/query/redis_ops.rs:1011 — crates/dbx-core/src/query/redis_ops.rs:1011-1021 | crates/dbx-core/src/query/redis_ops.rs:1050-1060 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) crates/dbx-driver-elasticsearch/src/lib.rs:2565 — crates/dbx-driver-elasticsearch/src/lib.rs:2565-2575 | crates/dbx-drivers/src/db/solr_driver.rs:1009-1019 — before extracting anything, compare `crates/dbx-driver-elasticsearch/src/lib.rs` and `crates/dbx-drivers/src/db/solr_driver.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) crates/dbx-driver-mongodb/src/mongo_driver.rs:1998 — crates/dbx-driver-mongodb/src/mongo_driver.rs:1998-2008 | crates/dbx-driver-mongodb/src/mongo_driver.rs:2021-2031 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) crates/dbx-driver-mysql/src/mysql.rs:2732 — crates/dbx-driver-mysql/src/mysql.rs:2732-2742 | crates/dbx-driver-mysql/src/mysql.rs:2770-2780 — both copies are in the same file, so extract the 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) REDACTED:8449 — REDACTED:8449-8459 | REDACTED:8501-8511 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) crates/dbx-driver-redis/src/lib.rs:2513 — crates/dbx-driver-redis/src/lib.rs:2513-2523 | crates/dbx-driver-redis/src/lib.rs:2614-2624 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) crates/dbx-driver-sqlserver/src/sqlserver.rs:1693 — crates/dbx-driver-sqlserver/src/sqlserver.rs:1693-1703 | crates/dbx-sql-data/src/query_result_sql.rs:2373-2383 — before extracting anything, compare `crates/dbx-driver-sqlserver/src/sqlserver.rs` and `crates/dbx-sql-data/src/query_result_sql.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) crates/dbx-drivers/src/db/proxy_tunnel.rs:373 — crates/dbx-drivers/src/db/proxy_tunnel.rs:373-383 | crates/dbx-drivers/src/db/proxy_tunnel.rs:404-414 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) crates/dbx-drivers/src/db/rqlite_driver.rs:106 — crates/dbx-drivers/src/db/rqlite_driver.rs:106-116 | crates/dbx-drivers/src/db/turso_driver.rs:148-158 — before extracting anything, compare `crates/dbx-drivers/src/db/rqlite_driver.rs` and `crates/dbx-drivers/src/db/turso_driver.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 203 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) crates/dbx-mcp/src/server.rs:1453 — crates/dbx-mcp/src/server.rs:1453-1463 | crates/dbx-mcp/src/server.rs:2776-2786 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) crates/dbx-mcp/src/session.rs:88 — crates/dbx-mcp/src/session.rs:88-98 | crates/dbx-mcp/src/session.rs:108-118 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) crates/dbx-plugin-runtime/src/plugins/installer.rs:930 — crates/dbx-plugin-runtime/src/plugins/installer.rs:930-940 | crates/dbx-plugin-runtime/src/plugins/installer.rs:957-967 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) crates/dbx-sql-dialect/src/sql_dialect/descriptor.rs:678 — crates/dbx-sql-dialect/src/sql_dialect/descriptor.rs:678-688 | crates/dbx-sql-dialect/src/sql_dialect/descriptor.rs:856-866 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) crates/dbx-sql-schema/src/table_structure_sql/indexes.rs:335 — crates/dbx-sql-schema/src/table_structure_sql/indexes.rs:335-345 | crates/dbx-sql-schema/src/table_structure_sql/indexes.rs:378-388 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) crates/dbx-types/src/models/connection.rs:1216 — crates/dbx-types/src/models/connection.rs:1216-1226 | crates/dbx-types/src/models/connection.rs:1501-1511 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) crates/dbx-web/src/routes/agents.rs:411 — crates/dbx-web/src/routes/agents.rs:411-421 | src-tauri/src/commands/agents.rs:318-328 — before extracting anything, compare `crates/dbx-web/src/routes/agents.rs` and `src-tauri/src/commands/agents.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • + 44 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×62
  • Duplicated block (12 lines × 2) crates/dbx-cli/src/main.rs:483 — crates/dbx-cli/src/main.rs:483-494 | crates/dbx-cli/src/main.rs:523-534 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) crates/dbx-core/src/admin/mq/adapters/kafka.rs:544 — crates/dbx-core/src/admin/mq/adapters/kafka.rs:544-555 | crates/dbx-core/src/admin/mq/adapters/rocketmq.rs:685-696 — before extracting anything, compare `crates/dbx-core/src/admin/mq/adapters/kafka.rs` and `crates/dbx-core/src/admin/mq/adapters/rocketmq.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 186 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) REDACTED:1874 — REDACTED:1874-1885 | REDACTED:2072-2083 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) REDACTED:308 — REDACTED:308-319 | REDACTED:2576-2587 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) REDACTED:11002 — REDACTED:11002-11013 | REDACTED:11022-11033 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) REDACTED:758 — REDACTED:758-769 | REDACTED:819-830 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) REDACTED:3755 — REDACTED:3755-3766 | REDACTED:3863-3874 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) REDACTED:5366 — REDACTED:5366-5377 | REDACTED:5432-5443 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) REDACTED:2020 — REDACTED:2020-2031 | REDACTED:2040-2051 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) crates/dbx-core/src/schema/mod.rs:1568 — crates/dbx-core/src/schema/mod.rs:1568-1579 | crates/dbx-core/src/schema/mod.rs:1642-1653 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) crates/dbx-driver-elasticsearch/src/lib.rs:1761 — crates/dbx-driver-elasticsearch/src/lib.rs:1761-1772 | crates/dbx-drivers/src/db/solr_driver.rs:445-456 — before extracting anything, compare `crates/dbx-driver-elasticsearch/src/lib.rs` and `crates/dbx-drivers/src/db/solr_driver.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) crates/dbx-driver-mongodb/src/mongo_oidc.rs:64 — crates/dbx-driver-mongodb/src/mongo_oidc.rs:64-75 | crates/dbx-drivers/src/salesforce_oauth.rs:143-154 — before extracting anything, compare `crates/dbx-driver-mongodb/src/mongo_oidc.rs` and `crates/dbx-drivers/src/salesforce_oauth.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 87 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) crates/dbx-driver-mysql/src/mysql.rs:5391 — crates/dbx-driver-mysql/src/mysql.rs:5391-5402 | crates/dbx-driver-mysql/src/mysql.rs:5695-5706 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) crates/dbx-driver-mysql/src/mysql.rs:6068 — crates/dbx-driver-mysql/src/mysql.rs:6068-6079 | crates/dbx-driver-mysql/src/mysql.rs:6116-6127 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) REDACTED:2421 — REDACTED:2421-2432 | REDACTED:2452-2463 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) crates/dbx-drivers/src/db/dynamodb_driver.rs:764 — crates/dbx-drivers/src/db/dynamodb_driver.rs:764-775 | crates/dbx-drivers/src/db/dynamodb_driver.rs:824-835 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) crates/dbx-drivers/src/db/rqlite_driver.rs:142 — crates/dbx-drivers/src/db/rqlite_driver.rs:142-153 | crates/dbx-drivers/src/db/turso_driver.rs:184-195 — before extracting anything, compare `crates/dbx-drivers/src/db/rqlite_driver.rs` and `crates/dbx-drivers/src/db/turso_driver.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 203 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) crates/dbx-drivers/src/db/sqlite_worker.rs:560 — crates/dbx-drivers/src/db/sqlite_worker.rs:560-571 | crates/dbx-drivers/src/db/sqlite_worker.rs:595-607 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) crates/dbx-sql-core/src/sql_analysis.rs:274 — crates/dbx-sql-core/src/sql_analysis.rs:274-285 | crates/dbx-sql-core/src/sql_analysis.rs:302-313 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) crates/dbx-sql-core/src/sql_editability.rs:512 — crates/dbx-sql-core/src/sql_editability.rs:512-523 | crates/dbx-sql-core/src/sql_editability.rs:628-639 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) crates/dbx-sql-data/src/query_result_sql.rs:957 — crates/dbx-sql-data/src/query_result_sql.rs:957-968 | crates/dbx-sql-data/src/query_result_sql.rs:2098-2109 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) crates/dbx-sql-data/src/data_grid_neo4j_sql.rs:27 — crates/dbx-sql-data/src/data_grid_neo4j_sql.rs:27-38 | crates/dbx-sql-data/src/data_grid_neo4j_sql.rs:139-152 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) crates/dbx-sql-schema/src/schema_diff.rs:1916 — crates/dbx-sql-schema/src/schema_diff.rs:1916-1927 | crates/dbx-sql-schema/src/sql_parser/input.rs:156-167 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (12 lines × 2) crates/dbx-web/src/routes/etcd.rs:379 — crates/dbx-web/src/routes/etcd.rs:379-390 | crates/dbx-web/src/routes/etcd.rs:424-435 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) plugins/sdk/packager/src/main.rs:87 — plugins/sdk/packager/src/main.rs:87-98 | plugins/sdk/packager/src/main.rs:213-224 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 37 more in this group — see findings.md.
D3 · God Classes · ClassTooLong · ×53
  • ClassTooLong: Storage REDACTED:194 — ClassTooLong — 3713 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 185 methods, 15 blocks, lines 194-7991. The bar is 400 significant lines; this is 3313 over it, 9.28× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: DbxJdbcPlugin REDACTED:63 — ClassTooLong — 3370 significant lines (blank, comment-only and punctuation-only lines excluded), 231 methods. The bar is 400 significant lines; this is 2970 over it, 8.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AppState REDACTED:391 — ClassTooLong — 3269 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 142 methods, 2 blocks, lines 391-5877. The bar is 400 significant lines; this is 2869 over it, 8.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: NacosOpenApiAdmin crates/dbx-core/src/admin/nacos/http.rs:167 — ClassTooLong — 2251 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 63 methods, 3 blocks, lines 167-3358. The bar is 400 significant lines; this is 1851 over it, 5.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: DamengAgent REDACTED:66 — ClassTooLong — 2208 significant lines (blank, comment-only and punctuation-only lines excluded), 170 methods. The bar is 400 significant lines; this is 1808 over it, 5.52× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: DbxMcpServer crates/dbx-mcp/src/server.rs:690 — ClassTooLong — 2088 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 61 methods, 5 blocks, lines 690-3765. The bar is 400 significant lines; this is 1688 over it, 5.22× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: KafkaAgent agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:39 — ClassTooLong — 1945 significant lines (blank, comment-only and punctuation-only lines excluded), 127 methods. The bar is 400 significant lines; this is 1545 over it, 4.86× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: server REDACTED:663 — ClassTooLong — 1745 significant lines (blank, comment-only and punctuation-only lines excluded), 89 methods, 82 blocks, lines 663-5435. The bar is 400 significant lines; this is 1345 over it, 4.36× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: MongoAgent agents/drivers/mongodb/src/main/java/com/dbx/agent/mongodb/MongoAgent.java:96 — ClassTooLong — 1742 significant lines (blank, comment-only and punctuation-only lines excluded), 143 methods. The bar is 400 significant lines; this is 1342 over it, 4.36× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: useDataGridEditor apps/desktop/src/composables/useDataGridEditor.ts:1 — ClassTooLong — 1591 significant lines (blank, comment-only and punctuation-only lines excluded), 7 methods. The bar is 400 significant lines; this is 1191 over it, 3.98× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: server REDACTED:553 — ClassTooLong — 1503 significant lines (blank, comment-only and punctuation-only lines excluded), 78 methods, 79 blocks, lines 553-5321. The bar is 400 significant lines; this is 1103 over it, 3.76× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: JdbcConnectionPoolRegistry agents/common/src/main/java/com/dbx/agent/JdbcConnectionPoolRegistry.java:40 — ClassTooLong — 1296 significant lines (blank, comment-only and punctuation-only lines excluded), 21 methods. The bar is 400 significant lines; this is 896 over it, 3.24× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: useDataGridExport apps/desktop/src/composables/useDataGridExport.ts:1 — ClassTooLong — 1202 significant lines (blank, comment-only and punctuation-only lines excluded), 9 methods. The bar is 400 significant lines; this is 802 over it, 3.01× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: useQueryEditorCompletion apps/desktop/src/components/editor/useQueryEditorCompletion.ts:1 — ClassTooLong — 1118 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 718 over it, 2.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AgentDriverClient crates/dbx-driver-agent/src/agent_driver.rs:880 — ClassTooLong — 1074 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 120 methods, 4 blocks, lines 880-3564. The bar is 400 significant lines; this is 674 over it, 2.69× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: OceanBaseOracleAgent agents/drivers/oceanbase-oracle/src/main/java/com/dbx/agent/oceanbaseoracle/OceanBaseOracleAgent.java:54 — ClassTooLong — 1024 significant lines (blank, comment-only and punctuation-only lines excluded), 77 methods. The bar is 400 significant lines; this is 624 over it, 2.56× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: WebBackend crates/dbx-mcp/src/backend.rs:465 — ClassTooLong — 1002 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 5 methods, 4 blocks, lines 465-2486. The bar is 400 significant lines; this is 602 over it, 2.51× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: useSidebarDatabaseSpecificMutationRuntime apps/desktop/src/composables/useSidebarDatabaseSpecificMutationRuntime.ts:1 — ClassTooLong — 875 significant lines (blank, comment-only and punctuation-only lines excluded), 2 methods. The bar is 400 significant lines; this is 475 over it, 2.19× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Gbase8sAgent agents/drivers/gbase8s/src/main/java/com/dbx/agent/gbase8s/Gbase8sAgent.java:34 — ClassTooLong — 817 significant lines (blank, comment-only and punctuation-only lines excluded), 75 methods. The bar is 400 significant lines; this is 417 over it, 2.04× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PostgresLikeAgent agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:13 — ClassTooLong — 798 significant lines (blank, comment-only and punctuation-only lines excluded), 47 methods. The bar is 400 significant lines; this is 398 over it, 2.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: JdbcExecutor agents/common/src/main/java/com/dbx/agent/JdbcExecutor.java:24 — ClassTooLong — 783 significant lines (blank, comment-only and punctuation-only lines excluded), 62 methods. The bar is 400 significant lines; this is 383 over it, 1.96× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Session agents/go-common/iotdb-client-go/client/session.go:73 — ClassTooLong — 728 significant lines (blank, comment-only and punctuation-only lines excluded), 46 methods, 47 blocks, lines 73-1477. The bar is 400 significant lines; this is 328 over it, 1.82× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: MqttClient crates/dbx-core/src/admin/mqtt/client.rs:303 — ClassTooLong — 633 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 34 methods, 3 blocks, lines 303-1199. The bar is 400 significant lines; this is 233 over it, 1.58× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: useSqlExecution apps/desktop/src/composables/useSqlExecution.ts:1 — ClassTooLong — 630 significant lines (blank, comment-only and punctuation-only lines excluded), 10 methods. The bar is 400 significant lines; this is 230 over it, 1.58× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: cursor REDACTED:757 — ClassTooLong — 595 significant lines (blank, comment-only and punctuation-only lines excluded), 19 methods, 20 blocks, lines 757-1604. The bar is 400 significant lines; this is 195 over it, 1.49× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • + 28 more in this group — see findings.md.
D2 · Cognitive Complexity · dbx_sql_schema · ×46
  • dbx_sql_schema::schema_diff::generate_schema_sync_sql_inner (cognitive 514) crates/dbx-sql-schema/src/schema_diff.rs:6118 — dbx_sql_schema::schema_diff::generate_schema_sync_sql_inner has cognitive complexity 514 (threshold 15). Drivers by points: if/else 114 (426 pts), loops 12 (35 pts), match/switch 7 (32 pts), boolean chains 21 (nesting depth added 360). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • dbx_sql_schema::table_structure_sql::columns::build_column_sql (cognitive 130) crates/dbx-sql-schema/src/table_structure_sql/columns.rs:26 — dbx_sql_schema::table_structure_sql::columns::build_column_sql has cognitive complexity 130 (threshold 15). Drivers by points: if/else 53 (97 pts), boolean chains 28, loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_schema::schema_diff::generate_create_table_sql (cognitive 124) crates/dbx-sql-schema/src/schema_diff.rs:5534 — dbx_sql_schema::schema_diff::generate_create_table_sql has cognitive complexity 124 (threshold 15). Drivers by points: if/else 47 (105 pts), loops 7 (11 pts), boolean chains 6, match/switch 1 (2 pts) (nesting depth added 63). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • dbx_sql_schema::table_structure_sql::create_table::build_create_table_sql_with_partition_clause (cognitive 116) crates/dbx-sql-schema/src/table_structure_sql/create_table.rs:37 — dbx_sql_schema::table_structure_sql::create_table::build_create_table_sql_with_partition_clause has cognitive complexity 116 (threshold 15). Drivers by points: if/else 46 (87 pts), boolean chains 16, loops 7 (12 pts), match/switch 1 (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_schema::schema_diff::diff_columns_with_identifier_options (cognitive 68) crates/dbx-sql-schema/src/schema_diff.rs:3317 — dbx_sql_schema::schema_diff::diff_columns_with_identifier_options has cognitive complexity 68 (threshold 15). Drivers by points: if/else 20 (52 pts), loops 5 (10 pts), boolean chains 6 (nesting depth added 37). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • dbx_sql_schema::schema_diff::consume_postgres_cast_type (cognitive 65) crates/dbx-sql-schema/src/schema_diff.rs:4897 — dbx_sql_schema::schema_diff::consume_postgres_cast_type has cognitive complexity 65 (threshold 15). Drivers by points: if/else 24 (55 pts), match/switch 2 (6 pts), boolean chains 2, loops 2 (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • dbx_sql_schema::schema_diff::generate_permission_sync_sql (cognitive 63) crates/dbx-sql-schema/src/schema_diff.rs:1776 — dbx_sql_schema::schema_diff::generate_permission_sync_sql has cognitive complexity 63 (threshold 15). Drivers by points: if/else 22 (60 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_schema::schema_diff::order_diffs_for_execution (cognitive 54) crates/dbx-sql-schema/src/schema_diff.rs:6019 — dbx_sql_schema::schema_diff::order_diffs_for_execution has cognitive complexity 54 (threshold 15). Drivers by points: if/else 9 (29 pts), loops 8 (15 pts), match/switch 3 (8 pts), boolean chains 2 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_schema::table_structure_sql::indexes::build_create_index_statements (cognitive 46) crates/dbx-sql-schema/src/table_structure_sql/indexes.rs:431 — dbx_sql_schema::table_structure_sql::indexes::build_create_index_statements has cognitive complexity 46 (threshold 15). Drivers by points: if/else 31 (32 pts), boolean chains 12, match/switch 1 (2 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • dbx_sql_schema::schema_diff::prepare_schema_diff (cognitive 43) crates/dbx-sql-schema/src/schema_diff.rs:2011 — dbx_sql_schema::schema_diff::prepare_schema_diff has cognitive complexity 43 (threshold 15). Drivers by points: if/else 19 (29 pts), loops 4 (7 pts), boolean chains 6, match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_schema::schema_diff::diff_schema (cognitive 42) crates/dbx-sql-schema/src/schema_diff.rs:2304 — dbx_sql_schema::schema_diff::diff_schema has cognitive complexity 42 (threshold 15). Drivers by points: if/else 21 (34 pts), loops 6, boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_schema::schema_diff::append_sequence_diff_sql (cognitive 42) crates/dbx-sql-schema/src/schema_diff.rs:5808 — dbx_sql_schema::schema_diff::append_sequence_diff_sql has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (38 pts), match/switch 1 (2 pts), boolean chains 1, loops 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.
  • dbx_sql_schema::table_structure_sql::triggers::oracle_trigger_body_start (cognitive 39) crates/dbx-sql-schema/src/table_structure_sql/triggers.rs:379 — dbx_sql_schema::table_structure_sql::triggers::oracle_trigger_body_start has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 4 (10 pts), boolean chains 6 (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.
  • dbx_sql_schema::table_structure_sql::indexes::build_index_sql (cognitive 38) crates/dbx-sql-schema/src/table_structure_sql/indexes.rs:7 — dbx_sql_schema::table_structure_sql::indexes::build_index_sql has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (35 pts), boolean chains 2, loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_schema::schema_diff::create_index_sql (cognitive 36) crates/dbx-sql-schema/src/schema_diff.rs:4466 — dbx_sql_schema::schema_diff::create_index_sql has cognitive complexity 36 (threshold 15). Drivers by points: if/else 24, boolean chains 8, match/switch 2 (4 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • dbx_sql_schema::table_structure_sql::column_alter::build_single_column_alter_sql (cognitive 35) crates/dbx-sql-schema/src/table_structure_sql/column_alter.rs:16 — dbx_sql_schema::table_structure_sql::column_alter::build_single_column_alter_sql has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 13, match/switch 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • dbx_sql_schema::schema_diff::consume_postgres_cast_group (cognitive 35) crates/dbx-sql-schema/src/schema_diff.rs:4845 — dbx_sql_schema::schema_diff::consume_postgres_cast_group has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (28 pts), boolean chains 6, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_schema::table_structure_sql::triggers::build_trigger_sql_with_mode (cognitive 34) crates/dbx-sql-schema/src/table_structure_sql/triggers.rs:16 — dbx_sql_schema::table_structure_sql::triggers::build_trigger_sql_with_mode has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (31 pts), boolean chains 2, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_schema::schema_diff::trim_outer_parentheses_for_match (cognitive 32) crates/dbx-sql-schema/src/schema_diff.rs:5111 — dbx_sql_schema::schema_diff::trim_outer_parentheses_for_match has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (27 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_schema::schema_diff::strip_postgres_default_casts (cognitive 31) crates/dbx-sql-schema/src/schema_diff.rs:5036 — dbx_sql_schema::schema_diff::strip_postgres_default_casts has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (23 pts), boolean chains 7, 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.
  • dbx_sql_schema::schema_diff::diff_names_with_patterns (cognitive 30) crates/dbx-sql-schema/src/schema_diff.rs:1090 — dbx_sql_schema::schema_diff::diff_names_with_patterns has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 3 (9 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_schema::schema_diff::resolve_schema_diff_table_names (cognitive 30) crates/dbx-sql-schema/src/schema_diff.rs:2224 — dbx_sql_schema::schema_diff::resolve_schema_diff_table_names has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 5 (6 pts), boolean chains 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.
  • dbx_sql_schema::schema_diff::sqlserver_default_literal_for_schema (cognitive 27) crates/dbx-sql-schema/src/schema_diff.rs:5186 — dbx_sql_schema::schema_diff::sqlserver_default_literal_for_schema has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18 (19 pts), boolean chains 8 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • dbx_sql_schema::table_structure_sql::column_alter::build_postgres_like_existing_column_sql (cognitive 26) crates/dbx-sql-schema/src/table_structure_sql/column_alter.rs:428 — dbx_sql_schema::table_structure_sql::column_alter::build_postgres_like_existing_column_sql has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_schema::table_structure_sql::column_format::column_definition (cognitive 26) crates/dbx-sql-schema/src/table_structure_sql/column_format.rs:39 — dbx_sql_schema::table_structure_sql::column_format::column_definition has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 6 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • + 21 more in this group — see findings.md.
D3 · God Classes · TooManyMethods · ×43
  • TooManyMethods: DbxJdbcPlugin REDACTED:63 — TooManyMethods — 231 methods. The bar is 30 methods; this is 201 over it, 7.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Storage REDACTED:194 — TooManyMethods — 185 methods. The bar is 30 methods; this is 155 over it, 6.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: DamengAgent REDACTED:66 — TooManyMethods — 170 methods. The bar is 30 methods; this is 140 over it, 5.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: MongoAgent agents/drivers/mongodb/src/main/java/com/dbx/agent/mongodb/MongoAgent.java:96 — TooManyMethods — 143 methods. The bar is 30 methods; this is 113 over it, 4.77× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AppState REDACTED:391 — TooManyMethods — 142 methods. The bar is 30 methods; this is 112 over it, 4.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: KafkaAgent agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:39 — TooManyMethods — 127 methods. The bar is 30 methods; this is 97 over it, 4.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AgentDriverClient crates/dbx-driver-agent/src/agent_driver.rs:880 — TooManyMethods — 120 methods. The bar is 30 methods; this is 90 over it, 4.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: server REDACTED:663 — TooManyMethods — 89 methods, declared across 3 files: REDACTED (81), xugu/type_members.go (6), xugu/package_members.go (2). The bar is 30 methods; this is 59 over it, 2.97× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: server REDACTED:553 — TooManyMethods — 78 methods. The bar is 30 methods; this is 48 over it, 2.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: OceanBaseOracleAgent agents/drivers/oceanbase-oracle/src/main/java/com/dbx/agent/oceanbaseoracle/OceanBaseOracleAgent.java:54 — TooManyMethods — 77 methods. The bar is 30 methods; this is 47 over it, 2.57× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Gbase8sAgent agents/drivers/gbase8s/src/main/java/com/dbx/agent/gbase8s/Gbase8sAgent.java:34 — TooManyMethods — 75 methods. The bar is 30 methods; this is 45 over it, 2.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: server agents/drivers/kingbase-go/main.go:132 — TooManyMethods — 74 methods, declared across 2 files: REDACTED (53), kingbase-go/main.go (21). The bar is 30 methods; this is 44 over it, 2.47× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: server agents/drivers/vastbase-go/main.go:144 — TooManyMethods — 68 methods, declared across 4 files: vastbase-go/vastbase_metadata.go (41), vastbase-go/main.go (22), vastbase-go/connection_state.go (3), vastbase-go/runtime_pool.go (2). The bar is 30 methods; this is 38 over it, 2.27× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ConsulClient crates/dbx-core/src/admin/consul/client.rs:15 — TooManyMethods — 65 methods, declared across 9 files: consul/agent.rs (17), consul/client.rs (16), consul/kv.rs (10), consul/session.rs (8), +5 more file(s). The bar is 30 methods; this is 35 over it, 2.17× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: NacosOpenApiAdmin crates/dbx-core/src/admin/nacos/http.rs:167 — TooManyMethods — 63 methods. The bar is 30 methods; this is 33 over it, 2.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: JdbcExecutor agents/common/src/main/java/com/dbx/agent/JdbcExecutor.java:24 — TooManyMethods — 62 methods. The bar is 30 methods; this is 32 over it, 2.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AbstractJdbcAgent agents/common/src/main/java/com/dbx/agent/AbstractJdbcAgent.java:19 — TooManyMethods — 61 methods. The bar is 30 methods; this is 31 over it, 2.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: IoTDBRpcDataSet agents/go-common/iotdb-client-go/client/rpcdataset.go:15 — TooManyMethods — 61 methods. The bar is 30 methods; this is 31 over it, 2.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: DbxMcpServer crates/dbx-mcp/src/server.rs:690 — TooManyMethods — 61 methods. The bar is 30 methods; this is 31 over it, 2.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SqlServerLegacyAgent agents/drivers/sqlserver-legacy/src/main/java/com/dbx/agent/sqlserverlegacy/SqlServerLegacyAgent.java:31 — TooManyMethods — 56 methods. The bar is 30 methods; this is 26 over it, 1.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AgentManager crates/dbx-driver-agent/src/agent_manager.rs:665 — TooManyMethods — 56 methods. The bar is 30 methods; this is 26 over it, 1.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: etcdSession agents/drivers/etcd-go/main.go:50 — TooManyMethods — 52 methods, declared across 9 files: etcd-go/auth.go (14), REDACTED (8), etcd-go/main.go (8), etcd-go/kv.go (7), +5 more file(s). The bar is 30 methods; this is 22 over it, 1.73× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: StandardJdbcMetadata agents/common/src/main/java/com/dbx/agent/StandardJdbcMetadata.java:16 — TooManyMethods — 48 methods. The bar is 30 methods; this is 18 over it, 1.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PostgresLikeAgent agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:13 — TooManyMethods — 47 methods. The bar is 30 methods; this is 17 over it, 1.57× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SpannerAgent agents/drivers/spanner/src/main/java/com/dbx/agent/spanner/SpannerAgent.java:58 — TooManyMethods — 46 methods. The bar is 30 methods; this is 16 over it, 1.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • + 18 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×42
  • Duplicated block (14 lines × 2) REDACTED:3590 — REDACTED:3590-3603 | REDACTED:3630-3643 — both copies are in the same file, so extract the 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) REDACTED:5825 — REDACTED:5825-5838 | REDACTED:5853-5866 — both copies are in the same file, so extract the 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) REDACTED:3885 — REDACTED:3885-3898 | REDACTED:3934-3947 — both copies are in the same file, so extract the 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) REDACTED:644 — REDACTED:644-657 | REDACTED:664-677 — both copies are in the same file, so extract the 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) crates/dbx-core/src/persistence/cloud_sync.rs:2289 — crates/dbx-core/src/persistence/cloud_sync.rs:2289-2302 | REDACTED:3041-3054 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (14 lines × 2) crates/dbx-core/src/query/mongo_ops.rs:1463 — crates/dbx-core/src/query/mongo_ops.rs:1463-1476 | crates/dbx-mcp/src/backend.rs:2653-2666 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (14 lines × 2) crates/dbx-driver-mysql/src/mysql.rs:2131 — crates/dbx-driver-mysql/src/mysql.rs:2131-2144 | REDACTED:3077-3090 — before extracting anything, compare `crates/dbx-driver-mysql/src/mysql.rs` and `REDACTED` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (14 lines × 2) crates/dbx-driver-mysql/src/mysql.rs:2745 — crates/dbx-driver-mysql/src/mysql.rs:2745-2758 | crates/dbx-types/src/models/connection.rs:1800-1813 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (14 lines × 2) crates/dbx-driver-sqlserver/src/sqlserver.rs:3549 — crates/dbx-driver-sqlserver/src/sqlserver.rs:3549-3562 | crates/dbx-driver-sqlserver/src/sqlserver.rs:3643-3656 — both copies are in the same file, so extract the 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) crates/dbx-drivers/src/db/victoriametrics_driver.rs:354 — crates/dbx-drivers/src/db/victoriametrics_driver.rs:354-367 | crates/dbx-drivers/src/db/victoriametrics_driver.rs:393-406 — both copies are in the same file, so extract the 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) crates/dbx-sql-core/src/query_execution_sql.rs:1107 — crates/dbx-sql-core/src/query_execution_sql.rs:1107-1120 | crates/dbx-sql-core/src/query_execution_sql.rs:1202-1215 — both copies are in the same file, so extract the 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) crates/dbx-sql-data/src/query_result_sql.rs:1063 — crates/dbx-sql-data/src/query_result_sql.rs:1063-1076 | crates/dbx-sql-data/src/query_result_sql.rs:1202-1215 — both copies are in the same file, so extract the 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) crates/dbx-web/src/routes/document_store.rs:471 — crates/dbx-web/src/routes/document_store.rs:471-484 | crates/dbx-web/src/routes/mongo.rs:791-804 — before extracting anything, compare `crates/dbx-web/src/routes/document_store.rs` and `crates/dbx-web/src/routes/mongo.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (14 lines × 2) src-tauri/src/commands/transfer.rs:56 — src-tauri/src/commands/transfer.rs:56-69 | src-tauri/src/commands/transfer.rs:506-519 — both copies are in the same file, so extract the 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) crates/dbx-mcp/src/backend.rs:2055 — crates/dbx-mcp/src/backend.rs:2055-2068 | crates/dbx-mcp/src/backend.rs:2078-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.
  • Duplicated block (14 lines × 2) agents/common/src/main/java/com/dbx/agent/StandardJdbcMetadata.java:525 — agents/common/src/main/java/com/dbx/agent/StandardJdbcMetadata.java:525-538 | agents/drivers/spanner/src/main/java/com/dbx/agent/spanner/SpannerAgent.java:729-742 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) agents/drivers/mongodb/src/main/java/com/dbx/agent/mongodb/MongoAgent.java:2150 — agents/drivers/mongodb/src/main/java/com/dbx/agent/mongodb/MongoAgent.java:2150-2163 | agents/drivers/mongodb/src/main/java/com/dbx/agent/mongodb/MongoAgent.java:2181-2194 — both copies are in the same file, so extract the 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 `agents/drivers/mongodb/src/main/java/com/dbx/agent/mongodb/MongoAgent.java:2150` 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 (14 lines × 2) agents/drivers/argo-go/config.go:1026 — agents/drivers/argo-go/config.go:1026-1039 | agents/drivers/hive-go/config.go:1057-1070 — `agents/drivers/argo-go/config.go` and `agents/drivers/hive-go/config.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 1107 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) agents/drivers/argo-go/config.go:1216 — agents/drivers/argo-go/config.go:1216-1229 | agents/drivers/hive-go/config.go:1247-1260 — `agents/drivers/argo-go/config.go` and `agents/drivers/hive-go/config.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 1107 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) REDACTED:312 — REDACTED:312-325 | REDACTED:312-325 — `REDACTED` and `REDACTED` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 17 separate duplicated blocks between them, totalling at least 340 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) REDACTED:353 — REDACTED:353-366 | REDACTED:353-366 — `REDACTED` and `REDACTED` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 17 separate duplicated blocks between them, totalling at least 340 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) agents/drivers/argo-go/main.go:316 — agents/drivers/argo-go/main.go:316-329 | agents/drivers/hive-go/main.go:316-329 — `agents/drivers/argo-go/main.go` and `agents/drivers/hive-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 43 separate duplicated blocks between them, totalling at least 699 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) agents/drivers/argo-go/metadata.go:148 — agents/drivers/argo-go/metadata.go:148-161 | agents/drivers/hive-go/metadata.go:148-161 — `agents/drivers/argo-go/metadata.go` and `agents/drivers/hive-go/metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 946 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) agents/drivers/argo-go/metadata.go:799 — agents/drivers/argo-go/metadata.go:799-812 | agents/drivers/hive-go/metadata.go:810-823 — `agents/drivers/argo-go/metadata.go` and `agents/drivers/hive-go/metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 946 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) agents/drivers/argo-go/metadata.go:1038 — agents/drivers/argo-go/metadata.go:1038-1051 | agents/drivers/hive-go/metadata.go:1049-1062 — `agents/drivers/argo-go/metadata.go` and `agents/drivers/hive-go/metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 946 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/metadata.go:1038` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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.
  • + 17 more in this group — see findings.md.
R4 · Test Coverage · No test reaches this file · ×40
  • No test reaches this file plugins/sdk/dev-host/ui/App.vue — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file deploy/plugin-stats-worker/worker.ts — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file scripts/sync-connection-types.mjs — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file scripts/build-knowledge-base.mjs — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file scripts/ai-html-runtime-canary.mjs — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file REDACTED — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file agents/scripts/build_offline_jdbc_payload.mjs — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file apps/desktop/src/components/config/TagManagementPanel.vue — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file agents/drivers/oceanbase-oracle/scripts/verify-partition-ddl.ts — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file scripts/run-check.mjs — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file REDACTED — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file apps/desktop/src/lib/sql/sqlServerQueryWrapping.ts — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file scripts/check-mq-integration.mjs — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file apps/desktop/src/components/diff/OscStatusPanel.vue — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file scripts/generate-doris-functions.mjs — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file apps/desktop/src/components/config/ConfigDriftPanel.vue — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file scripts/dev-backend.mjs — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/plugin-cli/scripts/stage-sdk.mjs — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file apps/desktop/src/components/diff/RebasePanel.vue — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file apps/desktop/viteConnectionTypesPlugin.ts — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file apps/desktop/src/components/ui/context-menu/ContextMenuItem.vue — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file apps/desktop/src/components/ui/sheet/SheetContent.vue — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file apps/desktop/src/components/config/ConfigHotReloadIndicator.vue — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file apps/desktop/src/types/pluginAiTools.ts — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file plugins/sdk/dev-host/ui/PluginIcon.vue — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • + 15 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×39
  • Duplicated block (13 lines × 2) agents/drivers/duckdb/src/sql.rs:207 — agents/drivers/duckdb/src/sql.rs:207-219 | agents/drivers/duckdb/src/sql.rs:332-344 — both copies are in the same file, so extract the 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) crates/dbx-ai-provider/src/ai_claude_code_cli.rs:262 — crates/dbx-ai-provider/src/ai_claude_code_cli.rs:262-274 | crates/dbx-ai-provider/src/ai_codebuddy_cli.rs:336-348 — before extracting anything, compare `crates/dbx-ai-provider/src/ai_claude_code_cli.rs` and `crates/dbx-ai-provider/src/ai_codebuddy_cli.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) crates/dbx-ai-provider/src/ai_claude_code_cli.rs:370 — crates/dbx-ai-provider/src/ai_claude_code_cli.rs:370-382 | crates/dbx-ai-provider/src/ai_codebuddy_cli.rs:481-493 — before extracting anything, compare `crates/dbx-ai-provider/src/ai_claude_code_cli.rs` and `crates/dbx-ai-provider/src/ai_codebuddy_cli.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) REDACTED:963 — REDACTED:963-975 | REDACTED:3078-3090 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) REDACTED:7629 — REDACTED:7629-7641 | REDACTED:8111-8123 — both copies are in the same file, so extract the 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) REDACTED:4350 — REDACTED:4350-4362 | REDACTED:4401-4413 — both copies are in the same file, so extract the 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) REDACTED:964 — REDACTED:964-976 | REDACTED:992-1004 — both copies are in the same file, so extract the 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) crates/dbx-core/src/schema/mod.rs:1019 — crates/dbx-core/src/schema/mod.rs:1019-1031 | crates/dbx-core/src/schema/mod.rs:1043-1055 — both copies are in the same file, so extract the 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) crates/dbx-core/src/schema/mod.rs:7830 — crates/dbx-core/src/schema/mod.rs:7830-7842 | crates/dbx-core/src/schema/mod.rs:7866-7878 — both copies are in the same file, so extract the 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) crates/dbx-core/src/schema/mod.rs:8202 — crates/dbx-core/src/schema/mod.rs:8202-8214 | crates/dbx-core/src/schema/normalization.rs:127-139 — before extracting anything, compare `crates/dbx-core/src/schema/mod.rs` and `crates/dbx-core/src/schema/normalization.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) crates/dbx-driver-support/src/ddl_scan.rs:74 — crates/dbx-driver-support/src/ddl_scan.rs:74-86 | crates/dbx-driver-support/src/ddl_scan.rs:111-123 — both copies are in the same file, so extract the 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) REDACTED:283 — REDACTED:283-295 | crates/dbx-drivers/src/db/turso_driver.rs:319-331 — before extracting anything, compare `REDACTED` and `crates/dbx-drivers/src/db/turso_driver.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 89 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) crates/dbx-drivers/src/db/rqlite_driver.rs:245 — crates/dbx-drivers/src/db/rqlite_driver.rs:245-257 | crates/dbx-drivers/src/db/turso_driver.rs:287-299 — before extracting anything, compare `crates/dbx-drivers/src/db/rqlite_driver.rs` and `crates/dbx-drivers/src/db/turso_driver.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 203 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) crates/dbx-mcp/src/server.rs:2485 — crates/dbx-mcp/src/server.rs:2485-2497 | crates/dbx-mcp/src/server.rs:2720-2732 — both copies are in the same file, so extract the 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) crates/dbx-sql-core/src/sql_editability.rs:509 — crates/dbx-sql-core/src/sql_editability.rs:509-521 | crates/dbx-sql-core/src/sql_editability.rs:996-1008 — both copies are in the same file, so extract the 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) crates/dbx-sql-schema/src/table_structure_sql/column_format.rs:188 — crates/dbx-sql-schema/src/table_structure_sql/column_format.rs:188-200 | crates/dbx-sql-schema/src/table_structure_sql/columns.rs:573-585 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (13 lines × 2) crates/dbx-types/src/models/connection.rs:1128 — crates/dbx-types/src/models/connection.rs:1128-1140 | crates/dbx-types/src/models/connection.rs:1315-1327 — both copies are in the same file, so extract the 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) crates/dbx-web/src/routes/etcd.rs:401 — crates/dbx-web/src/routes/etcd.rs:401-413 | src-tauri/src/commands/etcd_cmd.rs:266-278 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (13 lines × 2) crates/dbx-web/src/routes/etcd.rs:443 — crates/dbx-web/src/routes/etcd.rs:443-455 | src-tauri/src/commands/etcd_cmd.rs:299-311 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (13 lines × 2) src-tauri/src/commands/connection.rs:1568 — src-tauri/src/commands/connection.rs:1568-1580 | src-tauri/src/commands/connection.rs:2050-2062 — both copies are in the same file, so extract the 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-tauri/src/commands/mcp_bridge.rs:1571 — src-tauri/src/commands/mcp_bridge.rs:1571-1583 | src-tauri/src/commands/mcp_bridge.rs:1813-1825 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) src-tauri/src/commands/mongodb_dump.rs:47 — src-tauri/src/commands/mongodb_dump.rs:47-59 | src-tauri/src/commands/mongodb_dump.rs:78-90 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) crates/dbx-core/src/schema/mod.rs:2672 — crates/dbx-core/src/schema/mod.rs:2672-2684 | crates/dbx-core/src/schema/providers/native.rs:323-335 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (13 lines × 2) agents/common/src/main/java/com/dbx/agent/StandardJdbcMetadata.java:286 — agents/common/src/main/java/com/dbx/agent/StandardJdbcMetadata.java:286-298 | agents/drivers/access/src/main/java/com/dbx/agent/access/AccessAgent.java:192-204 — 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 `agents/common/src/main/java/com/dbx/agent/StandardJdbcMetadata.java:286` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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) REDACTED:49 — REDACTED:49-61 | REDACTED:49-61 — `REDACTED` and `REDACTED` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 17 separate duplicated blocks between them, totalling at least 340 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • + 14 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×38
  • Duplicated block (16 lines × 2) crates/dbx-ai-provider/src/ai.rs:3841 — crates/dbx-ai-provider/src/ai.rs:3841-3856 | crates/dbx-ai-provider/src/ai.rs:4070-4085 — both copies are in the same file, so extract the 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) crates/dbx-core/src/admin/nacos/http.rs:1008 — crates/dbx-core/src/admin/nacos/http.rs:1008-1023 | crates/dbx-core/src/admin/nacos/http.rs:1037-1052 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) REDACTED:2820 — REDACTED:2820-2835 | src-tauri/src/commands/connection.rs:1937-1952 — before extracting anything, compare `REDACTED` and `src-tauri/src/commands/connection.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 247 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (16 lines × 2) REDACTED:2844 — REDACTED:2844-2859 | src-tauri/src/commands/connection.rs:1971-1986 — before extracting anything, compare `REDACTED` and `src-tauri/src/commands/connection.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 247 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (16 lines × 2) REDACTED:951 — REDACTED:951-966 | REDACTED:992-1007 — both copies are in the same file, so extract the 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) crates/dbx-core/src/schema/mod.rs:8144 — crates/dbx-core/src/schema/mod.rs:8144-8159 | crates/dbx-core/src/schema/normalization.rs:103-118 — before extracting anything, compare `crates/dbx-core/src/schema/mod.rs` and `crates/dbx-core/src/schema/normalization.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (16 lines × 2) crates/dbx-sql-data/src/query_result_sql.rs:1319 — crates/dbx-sql-data/src/query_result_sql.rs:1319-1334 | crates/dbx-sql-data/src/query_result_sql.rs:1419-1434 — both copies are in the same file, so extract the 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) crates/dbx-sql-data/src/data_grid_neo4j_sql.rs:59 — crates/dbx-sql-data/src/data_grid_neo4j_sql.rs:59-74 | crates/dbx-sql-data/src/data_grid_neo4j_sql.rs:105-120 — both copies are in the same file, so extract the 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) crates/dbx-sql-schema/src/schema_diff.rs:718 — crates/dbx-sql-schema/src/schema_diff.rs:718-733 | crates/dbx-sql-schema/src/schema_diff.rs:740-755 — both copies are in the same file, so extract the 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) crates/dbx-web/src/routes/agents.rs:431 — crates/dbx-web/src/routes/agents.rs:431-446 | src-tauri/src/commands/agents.rs:351-366 — before extracting anything, compare `crates/dbx-web/src/routes/agents.rs` and `src-tauri/src/commands/agents.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (16 lines × 2) crates/dbx-web/src/routes/mongodb_import_export.rs:389 — crates/dbx-web/src/routes/mongodb_import_export.rs:389-404 | crates/dbx-web/src/routes/table_import.rs:435-450 — before extracting anything, compare `crates/dbx-web/src/routes/mongodb_import_export.rs` and `crates/dbx-web/src/routes/table_import.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 151 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (16 lines × 2) REDACTED:3769 — REDACTED:3769-3784 | crates/dbx-sql-schema/src/db_admin_sql.rs:1032-1047 — 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 (16 lines × 2) crates/dbx-core/src/ai/agent_tools.rs:462 — crates/dbx-core/src/ai/agent_tools.rs:462-478 | crates/dbx-core/src/ai/agent_tools.rs:626-641 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) REDACTED:3612 — REDACTED:3612-3627 | REDACTED:3642-3657 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) REDACTED:862 — REDACTED:862-877 | REDACTED:1344-1359 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (16 lines × 2) agents/drivers/argo-go/config.go:736 — agents/drivers/argo-go/config.go:736-751 | agents/drivers/hive-go/config.go:767-782 — `agents/drivers/argo-go/config.go` and `agents/drivers/hive-go/config.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 1107 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (16 lines × 2) agents/drivers/argo-go/connector.go:84 — agents/drivers/argo-go/connector.go:84-99 | agents/drivers/hive-go/connector.go:84-99 — `agents/drivers/argo-go/connector.go` and `agents/drivers/hive-go/connector.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 121 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/connector.go:84` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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) REDACTED:31 — REDACTED:31-46 | REDACTED:31-46 — `REDACTED` and `REDACTED` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 17 separate duplicated blocks between them, totalling at least 340 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (16 lines × 2) agents/drivers/argo-go/main.go:220 — agents/drivers/argo-go/main.go:220-235 | agents/drivers/hive-go/main.go:220-235 — `agents/drivers/argo-go/main.go` and `agents/drivers/hive-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 43 separate duplicated blocks between them, totalling at least 699 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/main.go:220` 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 register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (16 lines × 2) agents/drivers/argo-go/metadata.go:709 — agents/drivers/argo-go/metadata.go:709-724 | agents/drivers/hive-go/metadata.go:720-735 — `agents/drivers/argo-go/metadata.go` and `agents/drivers/hive-go/metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 946 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/metadata.go:709` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 (16 lines × 2) REDACTED:355 — REDACTED:355-370 | REDACTED:355-370 — `REDACTED` and `REDACTED` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 25 separate duplicated blocks between them, totalling at least 473 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:355` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 (16 lines × 2) REDACTED:483 — REDACTED:483-498 | REDACTED:483-498 — `REDACTED` and `REDACTED` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 25 separate duplicated blocks between them, totalling at least 473 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (16 lines × 2) agents/drivers/argo-go/query.go:391 — agents/drivers/argo-go/query.go:391-406 | agents/drivers/hive-go/query.go:394-409 — `agents/drivers/argo-go/query.go` and `agents/drivers/hive-go/query.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 20 separate duplicated blocks between them, totalling at least 444 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (16 lines × 2) agents/drivers/argo-go/query.go:446 — agents/drivers/argo-go/query.go:446-461 | agents/drivers/hive-go/query.go:449-464 — `agents/drivers/argo-go/query.go` and `agents/drivers/hive-go/query.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 20 separate duplicated blocks between them, totalling at least 444 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (16 lines × 2) agents/drivers/etcd-go/kv.go:482 — agents/drivers/etcd-go/kv.go:482-497 | agents/drivers/etcd2-go/kv.go:393-408 — `agents/drivers/etcd-go/kv.go` and `agents/drivers/etcd2-go/kv.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 11 separate duplicated blocks between them, totalling at least 134 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • + 13 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×38
  • Duplicated block (15 lines × 2) crates/dbx-ai-provider/src/ai.rs:3057 — crates/dbx-ai-provider/src/ai.rs:3057-3071 | crates/dbx-ai-provider/src/ai.rs:3076-3090 — both copies are in the same file, so extract the 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) crates/dbx-core/src/admin/mq/adapters/pulsar.rs:670 — crates/dbx-core/src/admin/mq/adapters/pulsar.rs:670-684 | crates/dbx-core/src/admin/mq/adapters/pulsar.rs:690-704 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) REDACTED:1572 — REDACTED:1572-1586 | REDACTED:1601-1615 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) REDACTED:2185 — REDACTED:2185-2199 | REDACTED:2280-2294 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) REDACTED:3789 — REDACTED:3789-3803 | REDACTED:3835-3849 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) REDACTED:6232 — REDACTED:6232-6246 | REDACTED:6427-6441 — both copies are in the same file, so extract the 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) crates/dbx-core/src/schema/mod.rs:2480 — crates/dbx-core/src/schema/mod.rs:2480-2494 | crates/dbx-core/src/schema/mod.rs:2525-2539 — both copies are in the same file, so extract the 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) crates/dbx-core/src/schema/mod.rs:14297 — crates/dbx-core/src/schema/mod.rs:14297-14311 | crates/dbx-core/src/schema/mod.rs:14314-14328 — both copies are in the same file, so extract the 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) crates/dbx-core/src/schema/state_calibrator.rs:468 — crates/dbx-core/src/schema/state_calibrator.rs:468-482 | crates/dbx-core/src/schema/state_calibrator.rs:491-505 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) REDACTED:9676 — REDACTED:9676-9690 | REDACTED:9725-9739 — both copies are in the same file, so extract the 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) crates/dbx-driver-redis/src/lib.rs:4553 — crates/dbx-driver-redis/src/lib.rs:4553-4567 | crates/dbx-driver-redis/src/lib.rs:4586-4600 — both copies are in the same file, so extract the 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) crates/dbx-driver-sqlserver/src/sqlserver.rs:1603 — crates/dbx-driver-sqlserver/src/sqlserver.rs:1603-1617 | crates/dbx-sql-data/src/query_result_sql.rs:2271-2285 — before extracting anything, compare `crates/dbx-driver-sqlserver/src/sqlserver.rs` and `crates/dbx-sql-data/src/query_result_sql.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) crates/dbx-driver-sqlserver/src/sqlserver.rs:1710 — crates/dbx-driver-sqlserver/src/sqlserver.rs:1710-1724 | crates/dbx-sql-data/src/query_result_sql.rs:2397-2411 — before extracting anything, compare `crates/dbx-driver-sqlserver/src/sqlserver.rs` and `crates/dbx-sql-data/src/query_result_sql.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) crates/dbx-drivers/src/db/rqlite_driver.rs:216 — crates/dbx-drivers/src/db/rqlite_driver.rs:216-230 | crates/dbx-drivers/src/db/turso_driver.rs:258-272 — before extracting anything, compare `crates/dbx-drivers/src/db/rqlite_driver.rs` and `crates/dbx-drivers/src/db/turso_driver.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 203 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) crates/dbx-drivers/src/db/ssh_tunnel.rs:494 — crates/dbx-drivers/src/db/ssh_tunnel.rs:494-508 | crates/dbx-drivers/src/db/ssh_tunnel.rs:533-547 — both copies are in the same file, so extract the 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) crates/dbx-mcp/src/server.rs:3403 — crates/dbx-mcp/src/server.rs:3403-3417 | crates/dbx-mcp/src/server.rs:3526-3540 — both copies are in the same file, so extract the 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) crates/dbx-sql-core/src/sql.rs:2343 — crates/dbx-sql-core/src/sql.rs:2343-2357 | crates/dbx-sql-core/src/sql.rs:2390-2404 — both copies are in the same file, so extract the 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) crates/dbx-sql-schema/src/table_structure_sql/column_alter.rs:548 — crates/dbx-sql-schema/src/table_structure_sql/column_alter.rs:548-562 | crates/dbx-sql-schema/src/table_structure_sql/column_alter.rs:664-678 — both copies are in the same file, so extract the 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) crates/dbx-web/src/routes/document_store.rs:15 — crates/dbx-web/src/routes/document_store.rs:15-29 | crates/dbx-web/src/routes/mongo.rs:28-42 — before extracting anything, compare `crates/dbx-web/src/routes/document_store.rs` and `crates/dbx-web/src/routes/mongo.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) crates/dbx-web/src/routes/mongodb_import_export.rs:142 — crates/dbx-web/src/routes/mongodb_import_export.rs:142-156 | crates/dbx-web/src/routes/table_import.rs:140-154 — before extracting anything, compare `crates/dbx-web/src/routes/mongodb_import_export.rs` and `crates/dbx-web/src/routes/table_import.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 151 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) crates/dbx-web/src/routes/schema.rs:240 — crates/dbx-web/src/routes/schema.rs:240-254 | crates/dbx-web/src/routes/schema.rs:304-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 (15 lines × 2) src-tauri/src/commands/cloud_sync.rs:138 — src-tauri/src/commands/cloud_sync.rs:138-152 | src-tauri/src/commands/cloud_sync.rs:295-309 — both copies are in the same file, so extract the 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) agents/drivers/cache/src/main/java/com/dbx/agent/cache/CacheAgent.java:161 — agents/drivers/cache/src/main/java/com/dbx/agent/cache/CacheAgent.java:161-175 | agents/drivers/iris/src/main/java/com/dbx/agent/iris/IrisAgent.java:174-188 — before extracting anything, compare `agents/drivers/cache/src/main/java/com/dbx/agent/cache/CacheAgent.java` and `agents/drivers/iris/src/main/java/com/dbx/agent/iris/IrisAgent.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (15 lines × 2) REDACTED:884 — REDACTED:884-898 | REDACTED:1366-1380 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:884` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) agents/drivers/cassandra-go/protocol_error.go:34 — agents/drivers/cassandra-go/protocol_error.go:34-48 | agents/drivers/vastbase-go/protocol_error.go:35-49 — `agents/drivers/cassandra-go/protocol_error.go` and `agents/drivers/vastbase-go/protocol_error.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 98 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • + 13 more in this group — see findings.md.
D2 · Cognitive Complexity · dbx_sql_core · ×35
  • dbx_sql_core::sql::split_sql_statement_ranges_with_options (cognitive 126) crates/dbx-sql-core/src/sql.rs:991 — dbx_sql_core::sql::split_sql_statement_ranges_with_options has cognitive complexity 126 (threshold 15). Drivers by points: if/else 36 (104 pts), boolean chains 19, match/switch 1 (2 pts), loops 1 (nesting depth added 69). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • dbx_sql_core::sql_diagnostics::redact_literals (cognitive 73) crates/dbx-sql-core/src/sql_diagnostics.rs:37 — dbx_sql_core::sql_diagnostics::redact_literals has cognitive complexity 73 (threshold 15). Drivers by points: if/else 14 (43 pts), loops 7 (21 pts), boolean chains 9 (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_core::sql::mysql_routine_tokens (cognitive 71) crates/dbx-sql-core/src/sql.rs:1491 — dbx_sql_core::sql::mysql_routine_tokens has cognitive complexity 71 (threshold 15). Drivers by points: if/else 24 (60 pts), boolean chains 7, loops 2 (4 pts) (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_core::sql_analysis::spark_datasource_clause_removals (cognitive 63) crates/dbx-sql-core/src/sql_analysis.rs:239 — dbx_sql_core::sql_analysis::spark_datasource_clause_removals has cognitive complexity 63 (threshold 15). Drivers by points: if/else 21 (57 pts), match/switch 2 (5 pts), loops 1 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_core::sql::oracle_plsql_tokens_fallback (cognitive 62) crates/dbx-sql-core/src/sql.rs:2800 — dbx_sql_core::sql::oracle_plsql_tokens_fallback has cognitive complexity 62 (threshold 15). Drivers by points: if/else 15 (41 pts), loops 6 (16 pts), boolean chains 5 (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.
  • dbx_sql_core::query_execution_sql::strip_sql_comments_and_literals_with_metadata (cognitive 60) crates/dbx-sql-core/src/query_execution_sql.rs:1141 — dbx_sql_core::query_execution_sql::strip_sql_comments_and_literals_with_metadata has cognitive complexity 60 (threshold 15). Drivers by points: if/else 23 (55 pts), boolean chains 4, loops 1 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_core::sql::first_executable_sql_token_with_options (cognitive 48) crates/dbx-sql-core/src/sql.rs:2377 — dbx_sql_core::sql::first_executable_sql_token_with_options has cognitive complexity 48 (threshold 15). Drivers by points: loops 7 (17 pts), if/else 7 (16 pts), boolean chains 15 (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.
  • dbx_sql_core::object_source_sql::oceanbase_sequence_edit_sql (cognitive 41) crates/dbx-sql-core/src/object_source_sql.rs:341 — dbx_sql_core::object_source_sql::oceanbase_sequence_edit_sql has cognitive complexity 41 (threshold 15). Drivers by points: if/else 19 (33 pts), boolean chains 5, loops 2, match/switch 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.
  • dbx_sql_core::dml_preview_sql::build_update_preview (cognitive 37) crates/dbx-sql-core/src/dml_preview_sql.rs:116 — dbx_sql_core::dml_preview_sql::build_update_preview has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (25 pts), loops 3 (7 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_core::sql::leading_executable_sql_with_options (cognitive 32) crates/dbx-sql-core/src/sql.rs:2330 — dbx_sql_core::sql::leading_executable_sql_with_options has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 9, loops 4 (9 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_core::sql_editability::strip_sql_server_top_clause (cognitive 29) crates/dbx-sql-core/src/sql_editability.rs:616 — dbx_sql_core::sql_editability::strip_sql_server_top_clause has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (24 pts), match/switch 1 (3 pts), loops 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_core::sql::mysql_routine_block_is_complete (cognitive 28) crates/dbx-sql-core/src/sql.rs:1431 — dbx_sql_core::sql::mysql_routine_block_is_complete has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (25 pts), boolean chains 2, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_core::sql_analysis::normalize_sqlserver_alter_table_add_tokens (cognitive 27) crates/dbx-sql-core/src/sql_analysis.rs:516 — dbx_sql_core::sql_analysis::normalize_sqlserver_alter_table_add_tokens has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 3 (4 pts), match/switch 1 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_core::object_source_sql::build_executable_object_source_statements (cognitive 27) crates/dbx-sql-core/src/object_source_sql.rs:129 — dbx_sql_core::object_source_sql::build_executable_object_source_statements has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 9 (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.
  • dbx_sql_core::sql::leading_mysql_executable_comment_start (cognitive 26) crates/dbx-sql-core/src/sql.rs:2246 — dbx_sql_core::sql::leading_mysql_executable_comment_start has cognitive complexity 26 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 4 (9 pts), boolean chains 8 (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.
  • dbx_sql_core::sql::has_executable_sql_with_options (cognitive 26) crates/dbx-sql-core/src/sql.rs:2930 — dbx_sql_core::sql::has_executable_sql_with_options has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 4, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_core::sql_diagnostics::redact_sensitive_assignments (cognitive 24) crates/dbx-sql-core/src/sql_diagnostics.rs:135 — dbx_sql_core::sql_diagnostics::redact_sensitive_assignments has cognitive complexity 24 (threshold 15). Drivers by points: loops 5 (11 pts), boolean chains 7, if/else 3 (6 pts) (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • dbx_sql_core::sql_editability::analyze_editable_query_editability (cognitive 24) crates/dbx-sql-core/src/sql_editability.rs:131 — dbx_sql_core::sql_editability::analyze_editable_query_editability has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18 (19 pts), boolean chains 5 (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.
  • dbx_sql_core::query_execution_sql::strip_sql_comments (cognitive 24) crates/dbx-sql-core/src/query_execution_sql.rs:1086 — dbx_sql_core::query_execution_sql::strip_sql_comments has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 3, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_core::mysql_ddl_normalize::normalize_mysql_export_ddl (cognitive 23) crates/dbx-sql-core/src/mysql_ddl_normalize.rs:59 — dbx_sql_core::mysql_ddl_normalize::normalize_mysql_export_ddl has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 3, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_core::sql::parse_insert_values_tail (cognitive 23) crates/dbx-sql-core/src/sql.rs:1971 — dbx_sql_core::sql::parse_insert_values_tail has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_core::sql_editability::parse_expression_alias (cognitive 22) crates/dbx-sql-core/src/sql_editability.rs:379 — dbx_sql_core::sql_editability::parse_expression_alias has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_core::sql_editability::strip_sql_comments (cognitive 22) crates/dbx-sql-core/src/sql_editability.rs:961 — dbx_sql_core::sql_editability::strip_sql_comments has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 3 (7 pts), boolean chains 3 (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.
  • dbx_sql_core::sql::split_statement_range_at_blank_lines (cognitive 20) crates/dbx-sql-core/src/sql.rs:906 — dbx_sql_core::sql::split_statement_range_at_blank_lines has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_core::sql::find_sqlserver_statement_at_cursor (cognitive 20) crates/dbx-sql-core/src/sql.rs:1322 — dbx_sql_core::sql::find_sqlserver_statement_at_cursor has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 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.
  • + 10 more in this group — see findings.md.
D2 · Cognitive Complexity · dbx_drivers · ×34
  • dbx_drivers::db::sqlite::normalize_sqlite_sql (cognitive 64) crates/dbx-drivers/src/db/sqlite.rs:2767 — dbx_drivers::db::sqlite::normalize_sqlite_sql has cognitive complexity 64 (threshold 15). Drivers by points: if/else 14 (37 pts), loops 6 (18 pts), boolean chains 9 (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.
  • dbx_drivers::db::ssh_tunnel::connect_and_authenticate (cognitive 63) crates/dbx-drivers/src/db/ssh_tunnel.rs:380 — dbx_drivers::db::ssh_tunnel::connect_and_authenticate has cognitive complexity 63 (threshold 15). Drivers by points: if/else 24 (42 pts), match/switch 5 (13 pts), boolean chains 7, loops 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.
  • dbx_drivers::db::sqlite::tokenize_entry (cognitive 60) crates/dbx-drivers/src/db/sqlite.rs:2374 — dbx_drivers::db::sqlite::tokenize_entry has cognitive complexity 60 (threshold 15). Drivers by points: if/else 15 (43 pts), loops 5 (13 pts), boolean chains 4 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_drivers::db::ssh_tunnel::forward_loop (cognitive 54) crates/dbx-drivers/src/db/ssh_tunnel.rs:1071 — dbx_drivers::db::ssh_tunnel::forward_loop has cognitive complexity 54 (threshold 15). Drivers by points: if/else 11 (33 pts), match/switch 8 (20 pts), loops 1 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_drivers::db::sqlite::parse_sqlite_autoincrement_pk_columns (cognitive 48) crates/dbx-drivers/src/db/sqlite.rs:1960 — dbx_drivers::db::sqlite::parse_sqlite_autoincrement_pk_columns has cognitive complexity 48 (threshold 15). Drivers by points: if/else 17 (38 pts), loops 4 (6 pts), boolean chains 3, match/switch 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_drivers::db::cloudflare_d1::sql_lexer::lex_sql (cognitive 45) crates/dbx-drivers/src/db/cloudflare_d1/sql_lexer.rs:9 — dbx_drivers::db::cloudflare_d1::sql_lexer::lex_sql has cognitive complexity 45 (threshold 15). Drivers by points: loops 7 (19 pts), if/else 6 (18 pts), boolean chains 6, match/switch 1 (2 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_drivers::db::sqlite::strip_sql_comments (cognitive 42) crates/dbx-drivers/src/db/sqlite.rs:2116 — dbx_drivers::db::sqlite::strip_sql_comments has cognitive complexity 42 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 5 (13 pts), boolean chains 6 (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.
  • dbx_drivers::db::sqlite::extract_create_table_body (cognitive 36) crates/dbx-drivers/src/db/sqlite.rs:2047 — dbx_drivers::db::sqlite::extract_create_table_body has cognitive complexity 36 (threshold 15). Drivers by points: if/else 7 (25 pts), loops 4 (8 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_drivers::db::sqlite::parse_column_definition (cognitive 36) crates/dbx-drivers/src/db/sqlite.rs:2241 — dbx_drivers::db::sqlite::parse_column_definition has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (30 pts), loops 1 (5 pts), boolean chains 1 (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • dbx_drivers::db::solr_driver::solr_docs_to_table (cognitive 36) crates/dbx-drivers/src/db/solr_driver.rs:910 — dbx_drivers::db::solr_driver::solr_docs_to_table has cognitive complexity 36 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 4 (10 pts), match/switch 3 (8 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_drivers::db::dynamodb_driver::json_to_attribute_value (cognitive 33) crates/dbx-drivers/src/db/dynamodb_driver.rs:1363 — dbx_drivers::db::dynamodb_driver::json_to_attribute_value has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (32 pts), match/switch 1 (nesting depth added 22). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • dbx_drivers::db::duckdb_sql::split_sql_statements (cognitive 33) crates/dbx-drivers/src/db/duckdb_sql.rs:11 — dbx_drivers::db::duckdb_sql::split_sql_statements has cognitive complexity 33 (threshold 15). Drivers by points: if/else 5 (15 pts), boolean chains 9, loops 3 (7 pts), match/switch 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_drivers::db::sqlite::split_table_body_entries (cognitive 32) crates/dbx-drivers/src/db/sqlite.rs:2178 — dbx_drivers::db::sqlite::split_table_body_entries has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (23 pts), loops 3 (7 pts), match/switch 1 (2 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_drivers::db::proxy_tunnel::test_proxy_endpoint (cognitive 29) crates/dbx-drivers/src/db/proxy_tunnel.rs:510 — dbx_drivers::db::proxy_tunnel::test_proxy_endpoint has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 5 (9 pts), boolean chains 2 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • dbx_drivers::db::salesforce_driver::apply_fields_function_limit (cognitive 27) REDACTED:892 — dbx_drivers::db::salesforce_driver::apply_fields_function_limit has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 7, loops 2 (nesting depth added 10). Of this number, 19 points are the body's own statements and 8 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_drivers::db::dynamodb_driver::parse_dynamodb_statement (cognitive 26) crates/dbx-drivers/src/db/dynamodb_driver.rs:396 — dbx_drivers::db::dynamodb_driver::parse_dynamodb_statement has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 4, match/switch 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.
  • dbx_drivers::db::transport_layer_tunnel::start_transport_layers_internal (cognitive 26) crates/dbx-drivers/src/db/transport_layer_tunnel.rs:112 — dbx_drivers::db::transport_layer_tunnel::start_transport_layers_internal has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 5, match/switch 2 (3 pts), loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_drivers::db::sqlite_worker::connect_sqlite_worker (cognitive 25) crates/dbx-drivers/src/db/sqlite_worker.rs:331 — dbx_drivers::db::sqlite_worker::connect_sqlite_worker has cognitive complexity 25 (threshold 15). Drivers by points: if/else 17 (21 pts), boolean chains 2, match/switch 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • dbx_drivers::db::solr_driver::translate_field_operator_filter (cognitive 24) crates/dbx-drivers/src/db/solr_driver.rs:426 — dbx_drivers::db::solr_driver::translate_field_operator_filter has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 4 (9 pts), loops 2 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_drivers::db::sqlite::sqlite_unistr_text (cognitive 23) crates/dbx-drivers/src/db/sqlite.rs:416 — dbx_drivers::db::sqlite::sqlite_unistr_text has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (20 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_drivers::db::solr_driver::translate_solr_document_filter_value (cognitive 23) crates/dbx-drivers/src/db/solr_driver.rs:519 — dbx_drivers::db::solr_driver::translate_solr_document_filter_value has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (7 pts), match/switch 2 (5 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_drivers::db::cloudflare_d1::sql_lexer::complete_sql_statements (cognitive 22) crates/dbx-drivers/src/db/cloudflare_d1/sql_lexer.rs:92 — dbx_drivers::db::cloudflare_d1::sql_lexer::complete_sql_statements has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 5, match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_drivers::salesforce_oauth::wait_for_callback (cognitive 21) crates/dbx-drivers/src/salesforce_oauth.rs:309 — dbx_drivers::salesforce_oauth::wait_for_callback has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 2 (5 pts), loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_drivers::db::dynamodb_driver::validate_number (cognitive 20) crates/dbx-drivers/src/db/dynamodb_driver.rs:1466 — dbx_drivers::db::dynamodb_driver::validate_number has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_drivers::db::sqlite::parse_table_level_primary_key (cognitive 20) crates/dbx-drivers/src/db/sqlite.rs:2316 — dbx_drivers::db::sqlite::parse_table_level_primary_key has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 7, loops 2 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • + 9 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×34
  • Duplicated block (5 lines × 3) agents/drivers/duckdb/src/sql.rs:239 — agents/drivers/duckdb/src/sql.rs:239-243 | agents/drivers/duckdb/src/sql.rs:361-365 | crates/dbx-drivers/src/db/cloudflare_d1/sql_lexer.rs:23-27 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (5 lines × 3) crates/dbx-ai-provider/src/ai_claude_code_cli.rs:71 — crates/dbx-ai-provider/src/ai_claude_code_cli.rs:71-75 | crates/dbx-ai-provider/src/ai_codebuddy_cli.rs:148-152 | crates/dbx-ai-provider/src/ai_grok_cli.rs:118-122 — before extracting anything, compare `crates/dbx-ai-provider/src/ai_claude_code_cli.rs` and `crates/dbx-ai-provider/src/ai_codebuddy_cli.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 3) crates/dbx-ai-provider/src/ai_claude_code_cli.rs:231 — crates/dbx-ai-provider/src/ai_claude_code_cli.rs:231-236 | crates/dbx-ai-provider/src/ai_codebuddy_cli.rs:312-316 | crates/dbx-ai-provider/src/ai_qoder_cli.rs:204-208 — before extracting anything, compare `crates/dbx-ai-provider/src/ai_claude_code_cli.rs` and `crates/dbx-ai-provider/src/ai_codebuddy_cli.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 3) crates/dbx-ai-provider/src/ai_cli_agent.rs:463 — crates/dbx-ai-provider/src/ai_cli_agent.rs:463-467 | crates/dbx-ai-provider/src/ai_cli_agent.rs:641-645 | crates/dbx-ai-provider/src/ai_cli_agent.rs:984-988 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (5 lines × 3) crates/dbx-ai-provider/src/ai_codebuddy_cli.rs:361 — crates/dbx-ai-provider/src/ai_codebuddy_cli.rs:361-365 | crates/dbx-ai-provider/src/ai_codebuddy_cli.rs:766-770 | crates/dbx-ai-provider/src/ai_qoder_cli.rs:247-251 — before extracting anything, compare `crates/dbx-ai-provider/src/ai_codebuddy_cli.rs` and `crates/dbx-ai-provider/src/ai_qoder_cli.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 3) REDACTED:922 — REDACTED:922-926 | REDACTED:941-945 | REDACTED:3221-3225 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 3) crates/dbx-core/src/schema/mod.rs:8949 — crates/dbx-core/src/schema/mod.rs:8949-8953 | crates/dbx-core/src/schema/mod.rs:9074-9078 | crates/dbx-core/src/schema/mod.rs:9093-9097 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (5 lines × 3) crates/dbx-driver-mongodb/src/mongo_driver.rs:1294 — crates/dbx-driver-mongodb/src/mongo_driver.rs:1294-1298 | crates/dbx-driver-mongodb/src/mongo_driver.rs:1424-1428 | crates/dbx-driver-mongodb/src/mongo_driver.rs:1492-1496 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (5 lines × 3) crates/dbx-driver-mongodb/src/mongo_driver.rs:2563 — crates/dbx-driver-mongodb/src/mongo_driver.rs:2563-2567 | crates/dbx-driver-mongodb/src/mongo_driver.rs:2608-2612 | crates/dbx-driver-mongodb/src/mongo_driver.rs:2628-2632 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (5 lines × 3) crates/dbx-driver-mongodb/src/mongo_driver.rs:2670 — crates/dbx-driver-mongodb/src/mongo_driver.rs:2670-2674 | crates/dbx-driver-mongodb/src/mongo_driver.rs:2707-2711 | crates/dbx-driver-mongodb/src/mongo_driver.rs:2730-2734 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (5 lines × 3) crates/dbx-driver-mongodb/src/mongo_shell.rs:394 — crates/dbx-driver-mongodb/src/mongo_shell.rs:394-398 | crates/dbx-web/src/routes/mcp_policy.rs:76-80 | src-tauri/src/commands/mcp_bridge.rs:1302-1306 — before extracting anything, compare `crates/dbx-driver-mongodb/src/mongo_shell.rs` and `crates/dbx-web/src/routes/mcp_policy.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 145 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 3) crates/dbx-driver-mysql/src/mysql.rs:2732 — crates/dbx-driver-mysql/src/mysql.rs:2732-2736 | crates/dbx-driver-mysql/src/mysql.rs:2770-2774 | crates/dbx-driver-mysql/src/mysql.rs:2912-2916 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (5 lines × 3) crates/dbx-driver-mysql/src/mysql.rs:4489 — crates/dbx-driver-mysql/src/mysql.rs:4489-4493 | crates/dbx-driver-mysql/src/oceanbase_mysql.rs:93-97 | crates/dbx-driver-mysql/src/starrocks.rs:140-144 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (5 lines × 3) REDACTED:443 — REDACTED:443-447 | crates/dbx-drivers/src/db/rqlite_driver.rs:403-407 | crates/dbx-drivers/src/db/turso_driver.rs:625-629 — before extracting anything, compare `REDACTED` and `crates/dbx-drivers/src/db/rqlite_driver.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 3) crates/dbx-web/src/routes/query_result_export.rs:66 — crates/dbx-web/src/routes/query_result_export.rs:66-70 | crates/dbx-web/src/routes/sql_file.rs:300-304 | crates/dbx-web/src/routes/table_export.rs:67-71 — before extracting anything, compare `crates/dbx-web/src/routes/query_result_export.rs` and `crates/dbx-web/src/routes/table_export.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 3) crates/dbx-core/src/connection/connection_secrets.rs:836 — crates/dbx-core/src/connection/connection_secrets.rs:836-840 | crates/dbx-core/src/persistence/cloud_sync.rs:2670-2674 | REDACTED:8697-8701 — before extracting anything, compare `crates/dbx-core/src/connection/connection_secrets.rs` and `REDACTED` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 3) REDACTED:189 — REDACTED:189-193 | REDACTED:1088-1092 | REDACTED:170-174 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (5 lines × 3) crates/dbx-driver-mongodb/src/mongo_shell.rs:537 — crates/dbx-driver-mongodb/src/mongo_shell.rs:537-541 | crates/dbx-web/src/routes/mcp_policy.rs:219-223 | src-tauri/src/commands/mcp_bridge.rs:1445-1449 — before extracting anything, compare `crates/dbx-driver-mongodb/src/mongo_shell.rs` and `crates/dbx-web/src/routes/mcp_policy.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 145 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 3) crates/dbx-driver-mongodb/src/mongo_shell.rs:543 — crates/dbx-driver-mongodb/src/mongo_shell.rs:543-547 | crates/dbx-web/src/routes/mcp_policy.rs:225-229 | src-tauri/src/commands/mcp_bridge.rs:1451-1455 — before extracting anything, compare `crates/dbx-driver-mongodb/src/mongo_shell.rs` and `crates/dbx-web/src/routes/mcp_policy.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 145 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 3) crates/dbx-ai-provider/src/ai_cursor_cli.rs:105 — crates/dbx-ai-provider/src/ai_cursor_cli.rs:105-110 | crates/dbx-ai-provider/src/ai_opencode_cli.rs:58-63 | crates/dbx-ai-provider/src/ai_pi_agent_cli.rs:229-233 — before extracting anything, compare `crates/dbx-ai-provider/src/ai_cursor_cli.rs` and `crates/dbx-ai-provider/src/ai_opencode_cli.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 3) crates/dbx-drivers/src/db/influxdb3_driver.rs:80 — crates/dbx-drivers/src/db/influxdb3_driver.rs:80-84 | crates/dbx-drivers/src/db/influxdb_driver.rs:105-109 | crates/dbx-drivers/src/db/victoriametrics_driver.rs:144-148 — before extracting anything, compare `crates/dbx-drivers/src/db/influxdb3_driver.rs` and `crates/dbx-drivers/src/db/influxdb_driver.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 3) crates/dbx-core/src/persistence/state_persistence.rs:397 — crates/dbx-core/src/persistence/state_persistence.rs:397-401 | crates/dbx-core/src/persistence/state_persistence.rs:425-429 | crates/dbx-core/src/persistence/state_persistence.rs:449-453 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (5 lines × 3) crates/dbx-core/src/admin/nacos/service.rs:57 — crates/dbx-core/src/admin/nacos/service.rs:57-61 | crates/dbx-core/src/admin/nacos/service.rs:533-537 | crates/dbx-core/src/admin/nacos/service.rs:545-549 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (5 lines × 3) crates/dbx-driver-agent/src/agent_service.rs:1937 — crates/dbx-driver-agent/src/agent_service.rs:1937-1941 | crates/dbx-driver-agent/src/agent_service.rs:1968-1972 | crates/dbx-driver-agent/src/agent_service.rs:2962-2966 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (5 lines × 3) crates/dbx-driver-mongodb/src/mongo_driver.rs:2185 — crates/dbx-driver-mongodb/src/mongo_driver.rs:2185-2189 | crates/dbx-driver-mongodb/src/mongo_driver.rs:2544-2548 | crates/dbx-driver-mongodb/src/mongo_driver.rs:2654-2658 — 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.
  • + 9 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×32
  • MethodTooLong: AppState.get_or_create_pool_for_session_inner REDACTED:2500 — MethodTooLong — get_or_create_pool_for_session_inner runs 598 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 498 over it, 5.98× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: WebBackend.execute_mongo_command crates/dbx-mcp/src/backend.rs:2008 — MethodTooLong — execute_mongo_command runs 402 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 302 over it, 4.02× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: DialectCapabilityDescriptor.for_dialect crates/dbx-sql-dialect/src/sql_dialect/descriptor.rs:223 — MethodTooLong — for_dialect runs 366 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 266 over it, 3.66× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AppState.remove_stale_connection_pool REDACTED:4062 — MethodTooLong — remove_stale_connection_pool runs 239 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 139 over it, 2.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: DbxMcpServer.execute_batch_request crates/dbx-mcp/src/server.rs:1649 — MethodTooLong — execute_batch_request runs 230 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 130 over it, 2.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: DialectYaml.from_descriptor_with_caps REDACTED:689 — MethodTooLong — from_descriptor_with_caps runs 224 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 124 over it, 2.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PluginHostBridge.dispatch REDACTED:537 — MethodTooLong — dispatch runs 213 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 113 over it, 2.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: BackupService.export_job crates/dbx-core/src/scheduled_backup/engine.rs:152 — MethodTooLong — export_job runs 207 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 107 over it, 2.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: DbxMcpServer.execute_query crates/dbx-mcp/src/server.rs:1324 — MethodTooLong — execute_query runs 205 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 105 over it, 2.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: TypeMappingMatrix.build_rules crates/dbx-sql-dialect/src/sql_dialect/descriptor.rs:630 — MethodTooLong — build_rules runs 203 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 103 over it, 2.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AppState.refresh_connections REDACTED:5367 — MethodTooLong — refresh_connections runs 197 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 97 over it, 1.97× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PickleUnpickler.dispatch apps/desktop/src/lib/redis/codec/pickle.ts:114 — MethodTooLong — dispatch runs 187 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 87 over it, 1.87× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Storage.inspect_data_migration REDACTED:1448 — MethodTooLong — inspect_data_migration runs 178 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 78 over it, 1.78× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SqlStatementSplitter.push_chunk_with_control crates/dbx-sql-core/src/sql.rs:436 — MethodTooLong — push_chunk_with_control runs 172 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 72 over it, 1.72× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: server.dispatch REDACTED:1053 — MethodTooLong — dispatch runs 164 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 64 over it, 1.64× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: JsonRpcServer.dispatch agents/common/src/main/java/com/dbx/agent/JsonRpcServer.java:183 — MethodTooLong — dispatch runs 157 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 57 over it, 1.57× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: cursor.fetchOne REDACTED:1117 — MethodTooLong — fetchOne runs 151 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 51 over it, 1.51× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: MysqlDumpBinaryLiteralNormalizer.normalize REDACTED:1412 — MethodTooLong — normalize runs 147 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 47 over it, 1.47× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: server.dispatch REDACTED:848 — MethodTooLong — dispatch runs 143 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 43 over it, 1.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: etcdSession.history agents/drivers/etcd-go/history.go:39 — MethodTooLong — history runs 140 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 40 over it, 1.40× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PluginPackageInstaller.install_bytes_locked crates/dbx-plugin-runtime/src/plugins/installer.rs:514 — MethodTooLong — install_bytes_locked runs 129 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 29 over it, 1.29× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: server.dispatch REDACTED:141 — MethodTooLong — dispatch runs 121 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 21 over it, 1.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: etcd2Session.status agents/drivers/etcd2-go/status.go:14 — MethodTooLong — status runs 120 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 20 over it, 1.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: etcdSession.status agents/drivers/etcd-go/status.go:12 — MethodTooLong — status runs 114 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 14 over it, 1.14× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: DdlBuilder.buildTableDdl agents/common/src/main/java/com/dbx/agent/DdlBuilder.java:77 — MethodTooLong — buildTableDdl runs 110 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 10 over it, 1.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • + 7 more in this group — see findings.md.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×30
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/dbx-ai-provider/src/ai_claude_code_cli.rs:84 — crates/dbx-ai-provider/src/ai_claude_code_cli.rs:84-93 | crates/dbx-ai-provider/src/ai_codebuddy_cli.rs:161-170 | crates/dbx-ai-provider/src/ai_codex_cli.rs:372-387 | crates/dbx-ai-provider/src/ai_grok_cli.rs:131-140 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/dbx-ai-provider/src/ai_claude_code_cli.rs:95 — crates/dbx-ai-provider/src/ai_claude_code_cli.rs:95-118 | crates/dbx-ai-provider/src/ai_codebuddy_cli.rs:172-195 | crates/dbx-ai-provider/src/ai_codex_cli.rs:342-365 | crates/dbx-ai-provider/src/ai_grok_cli.rs:142-168 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/dbx-ai-provider/src/ai_claude_code_cli.rs:152 — crates/dbx-ai-provider/src/ai_claude_code_cli.rs:152-158 | crates/dbx-ai-provider/src/ai_codebuddy_cli.rs:232-238 | crates/dbx-ai-provider/src/ai_grok_cli.rs:202-208 | crates/dbx-ai-provider/src/ai_qoder_cli.rs:84-90 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/dbx-ai-provider/src/ai_claude_code_cli.rs:260 — crates/dbx-ai-provider/src/ai_claude_code_cli.rs:260-297 | crates/dbx-ai-provider/src/ai_codebuddy_cli.rs:334-372 | crates/dbx-ai-provider/src/ai_codebuddy_cli.rs:751-798 | crates/dbx-ai-provider/src/ai_qoder_cli.rs:222-262 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/dbx-core/src/admin/mq/adapters/rabbitmq.rs:253 — crates/dbx-core/src/admin/mq/adapters/rabbitmq.rs:253-265 | crates/dbx-core/src/admin/mq/adapters/rabbitmq.rs:330-349 | crates/dbx-core/src/admin/mq/adapters/rabbitmq.rs:363-375 | crates/dbx-core/src/admin/mq/adapters/rabbitmq.rs:381-397 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/dbx-core/src/connection/jdbc.rs:812 — crates/dbx-core/src/connection/jdbc.rs:812-845 | crates/dbx-core/src/connection/jdbc.rs:884-902 | crates/dbx-core/src/connection/jdbc.rs:964-982 | crates/dbx-plugin-runtime/src/plugins.rs:191-249 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) REDACTED:4477 — REDACTED:4477-4598 | REDACTED:5268-5308 | REDACTED:5576-5639 | REDACTED:8951-9000 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/dbx-core/src/schema/mod.rs:855 — crates/dbx-core/src/schema/mod.rs:855-954 | crates/dbx-core/src/schema/mod.rs:2233-2670 | crates/dbx-core/src/schema/mod.rs:7052-7315 | crates/dbx-core/src/schema/mod.rs:7795-8120 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/dbx-driver-mysql/src/mysql.rs:6041 — crates/dbx-driver-mysql/src/mysql.rs:6041-6079 | crates/dbx-driver-mysql/src/mysql.rs:6089-6127 | REDACTED:2406-2441 | REDACTED:2450-2480 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) REDACTED:36 — REDACTED:36-55 | crates/dbx-drivers/src/db/influxdb3_driver.rs:74-86 | crates/dbx-drivers/src/db/influxdb_driver.rs:99-111 | crates/dbx-drivers/src/db/victoriametrics_driver.rs:138-150 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) REDACTED:79 — REDACTED:79-102 | crates/dbx-drivers/src/db/influxdb3_driver.rs:88-111 | crates/dbx-drivers/src/db/influxdb_driver.rs:129-152 | crates/dbx-drivers/src/db/victoriametrics_driver.rs:152-175 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) REDACTED:175 — REDACTED:175-206 | crates/dbx-drivers/src/db/rqlite_driver.rs:155-191 | crates/dbx-drivers/src/db/sqlite.rs:2493-2591 | crates/dbx-drivers/src/db/turso_driver.rs:197-233 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/dbx-drivers/src/db/sqlite.rs:1508 — crates/dbx-drivers/src/db/sqlite.rs:1508-1560 | crates/dbx-drivers/src/db/sqlite.rs:1562-1637 | crates/dbx-drivers/src/db/sqlite.rs:2593-2638 | crates/dbx-drivers/src/db/sqlite.rs:2640-2733 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/dbx-sql-core/src/sql_editability.rs:423 — crates/dbx-sql-core/src/sql_editability.rs:423-450 | crates/dbx-sql-core/src/sql_editability.rs:508-532 | crates/dbx-sql-core/src/sql_editability.rs:616-680 | crates/dbx-sql-core/src/sql_editability.rs:995-1015 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/dbx-sql-data/src/query_result_sql.rs:1265 — crates/dbx-sql-data/src/query_result_sql.rs:1265-1311 | crates/dbx-sql-data/src/query_result_sql.rs:1318-1416 | crates/dbx-sql-data/src/query_result_sql.rs:1418-1471 | crates/dbx-sql-data/src/query_result_sql.rs:1530-1595 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/dbx-sql-schema/src/table_structure_sql/column_alter.rs:432 — crates/dbx-sql-schema/src/table_structure_sql/column_alter.rs:432-504 | crates/dbx-sql-schema/src/table_structure_sql/column_alter.rs:546-589 | crates/dbx-sql-schema/src/table_structure_sql/column_alter.rs:662-707 | crates/dbx-sql-schema/src/table_structure_sql/column_alter.rs:877-926 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/dbx-sql-schema/src/table_structure_sql/column_alter.rs:546 — crates/dbx-sql-schema/src/table_structure_sql/column_alter.rs:546-589 | crates/dbx-sql-schema/src/table_structure_sql/column_alter.rs:662-707 | crates/dbx-sql-schema/src/table_structure_sql/column_alter.rs:877-926 | crates/dbx-sql-schema/src/table_structure_sql/column_alter.rs:932-988 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src-tauri/src/commands/mcp_bridge.rs:1880 — src-tauri/src/commands/mcp_bridge.rs:1880-1906 | src-tauri/src/commands/mcp_bridge.rs:1908-1933 | src-tauri/src/commands/mcp_bridge.rs:2311-2365 | src-tauri/src/commands/mcp_bridge.rs:2367-2434 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) agents/common/src/main/java/com/dbx/agent/EwkbWktDecoder.java:276 — agents/common/src/main/java/com/dbx/agent/EwkbWktDecoder.java:276-284 | agents/common/src/main/java/com/dbx/agent/JdbcExecutor.java:717-728 | REDACTED:2729-2740 | REDACTED:4610-4618 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) agents/common/src/main/java/com/dbx/agent/BaseDatabaseAgent.java:29 — agents/common/src/main/java/com/dbx/agent/BaseDatabaseAgent.java:29-52 | agents/common/src/main/java/com/dbx/agent/ConfiguredJdbcAgent.java:132-158 | agents/common/src/main/java/com/dbx/agent/DatabaseAgent.java:85-108 | agents/drivers/spanner/src/main/java/com/dbx/agent/spanner/SpannerAgent.java:196-229 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) agents/common/src/main/java/com/dbx/agent/MultiSessionJsonRpcServer.java:129 — agents/common/src/main/java/com/dbx/agent/MultiSessionJsonRpcServer.java:129-171 | agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:114-136 | agents/drivers/mongodb/src/main/java/com/dbx/agent/mongodb/MongoAgent.java:2442-2476 | agents/drivers/mongodb/src/main/java/com/dbx/agent/mongodb/MongoAgent.java:2500-2545 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) agents/drivers/argo-go/config.go:295 — agents/drivers/argo-go/config.go:295-372 | agents/drivers/argo-go/config.go:455-472 | agents/drivers/hive-go/config.go:301-378 | agents/drivers/hive-go/config.go:461-478 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) agents/drivers/argo-go/metadata.go:595 — agents/drivers/argo-go/metadata.go:595-647 | agents/drivers/argo-go/metadata.go:649-676 | agents/drivers/hive-go/metadata.go:606-658 | agents/drivers/hive-go/metadata.go:660-687 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) agents/drivers/cassandra-go/metadata.go:536 — agents/drivers/cassandra-go/metadata.go:536-594 | agents/drivers/iotdb/metadata.go:486-544 | REDACTED:1759-1819 | agents/drivers/vastbase-go/vastbase_metadata.go:1090-1150 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) agents/drivers/etcd-go/auth.go:228 — agents/drivers/etcd-go/auth.go:228-247 | agents/drivers/etcd-go/auth.go:266-285 | agents/drivers/etcd2-go/auth.go:103-127 | agents/drivers/etcd2-go/auth.go:148-168 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • + 5 more in this group — see findings.md.
D31 · IaC & Container Security · Medium IaC · ×27
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 2 more in this group — see findings.md.
D1 · Cyclomatic Complexity · dbx_sql_schema · ×26
  • dbx_sql_schema::schema_diff::generate_schema_sync_sql_inner (cyclomatic 150) crates/dbx-sql-schema/src/schema_diff.rs:6118 — dbx_sql_schema::schema_diff::generate_schema_sync_sql_inner has cyclomatic complexity 150 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • dbx_sql_schema::table_structure_sql::columns::build_column_sql (cyclomatic 85) crates/dbx-sql-schema/src/table_structure_sql/columns.rs:26 — dbx_sql_schema::table_structure_sql::columns::build_column_sql has cyclomatic complexity 85 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • dbx_sql_schema::table_structure_sql::create_table::build_create_table_sql_with_partition_clause (cyclomatic 70) crates/dbx-sql-schema/src/table_structure_sql/create_table.rs:37 — dbx_sql_schema::table_structure_sql::create_table::build_create_table_sql_with_partition_clause has cyclomatic complexity 70 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • dbx_sql_schema::schema_diff::generate_create_table_sql (cyclomatic 57) crates/dbx-sql-schema/src/schema_diff.rs:5534 — dbx_sql_schema::schema_diff::generate_create_table_sql has cyclomatic complexity 57 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • dbx_sql_schema::table_structure_sql::column_alter::build_single_column_alter_sql (cyclomatic 40) crates/dbx-sql-schema/src/table_structure_sql/column_alter.rs:16 — dbx_sql_schema::table_structure_sql::column_alter::build_single_column_alter_sql has cyclomatic complexity 40 (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.
  • dbx_sql_schema::table_structure_sql::indexes::build_create_index_statements (cyclomatic 38) crates/dbx-sql-schema/src/table_structure_sql/indexes.rs:431 — dbx_sql_schema::table_structure_sql::indexes::build_create_index_statements has cyclomatic complexity 38 (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.
  • dbx_sql_schema::schema_diff::consume_postgres_cast_type (cyclomatic 36) crates/dbx-sql-schema/src/schema_diff.rs:4897 — dbx_sql_schema::schema_diff::consume_postgres_cast_type 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.
  • dbx_sql_schema::schema_diff::create_index_sql (cyclomatic 32) crates/dbx-sql-schema/src/schema_diff.rs:4466 — dbx_sql_schema::schema_diff::create_index_sql 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.
  • dbx_sql_schema::schema_diff::diff_columns_with_identifier_options (cyclomatic 30) crates/dbx-sql-schema/src/schema_diff.rs:3317 — dbx_sql_schema::schema_diff::diff_columns_with_identifier_options 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.
  • dbx_sql_schema::schema_diff::order_diffs_for_execution (cyclomatic 26) crates/dbx-sql-schema/src/schema_diff.rs:6019 — dbx_sql_schema::schema_diff::order_diffs_for_execution 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.
  • dbx_sql_schema::schema_diff::prepare_schema_diff (cyclomatic 24) crates/dbx-sql-schema/src/schema_diff.rs:2011 — dbx_sql_schema::schema_diff::prepare_schema_diff 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.
  • dbx_sql_schema::schema_diff::sqlserver_default_literal_for_schema (cyclomatic 24) crates/dbx-sql-schema/src/schema_diff.rs:5186 — dbx_sql_schema::schema_diff::sqlserver_default_literal_for_schema 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.
  • dbx_sql_schema::schema_diff::diff_schema (cyclomatic 22) crates/dbx-sql-schema/src/schema_diff.rs:2304 — dbx_sql_schema::schema_diff::diff_schema 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.
  • dbx_sql_schema::table_structure_sql::triggers::oracle_trigger_body_start (cyclomatic 21) crates/dbx-sql-schema/src/table_structure_sql/triggers.rs:379 — dbx_sql_schema::table_structure_sql::triggers::oracle_trigger_body_start 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.
  • dbx_sql_schema::table_structure_sql::column_format::column_definition (cyclomatic 21) crates/dbx-sql-schema/src/table_structure_sql/column_format.rs:39 — dbx_sql_schema::table_structure_sql::column_format::column_definition 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.
  • dbx_sql_schema::schema_diff::consume_postgres_cast_group (cyclomatic 20) crates/dbx-sql-schema/src/schema_diff.rs:4845 — dbx_sql_schema::schema_diff::consume_postgres_cast_group 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.
  • dbx_sql_schema::table_structure_sql::transwarp::validate_create_options (cyclomatic 20) crates/dbx-sql-schema/src/table_structure_sql/transwarp.rs:7 — dbx_sql_schema::table_structure_sql::transwarp::validate_create_options 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.
  • dbx_sql_schema::schema_diff::resolve_schema_diff_table_names (cyclomatic 19) crates/dbx-sql-schema/src/schema_diff.rs:2224 — dbx_sql_schema::schema_diff::resolve_schema_diff_table_names 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.
  • dbx_sql_schema::schema_diff::strip_postgres_default_casts (cyclomatic 18) crates/dbx-sql-schema/src/schema_diff.rs:5036 — dbx_sql_schema::schema_diff::strip_postgres_default_casts 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.
  • dbx_sql_schema::table_structure_sql::triggers::build_trigger_sql_with_mode (cyclomatic 17) crates/dbx-sql-schema/src/table_structure_sql/triggers.rs:16 — dbx_sql_schema::table_structure_sql::triggers::build_trigger_sql_with_mode 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.
  • dbx_sql_schema::table_structure_sql::indexes::build_index_sql (cyclomatic 17) crates/dbx-sql-schema/src/table_structure_sql/indexes.rs:7 — dbx_sql_schema::table_structure_sql::indexes::build_index_sql 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.
  • dbx_sql_schema::table_structure_sql::column_alter::build_sqlserver_existing_column_sql (cyclomatic 17) crates/dbx-sql-schema/src/table_structure_sql/column_alter.rs:709 — dbx_sql_schema::table_structure_sql::column_alter::build_sqlserver_existing_column_sql 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.
  • dbx_sql_schema::schema_diff::generate_permission_sync_sql (cyclomatic 17) crates/dbx-sql-schema/src/schema_diff.rs:1776 — dbx_sql_schema::schema_diff::generate_permission_sync_sql 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.
  • dbx_sql_schema::table_structure_sql::column_format::column_extra_clause (cyclomatic 17) crates/dbx-sql-schema/src/table_structure_sql/column_format.rs:113 — dbx_sql_schema::table_structure_sql::column_format::column_extra_clause 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.
  • dbx_sql_schema::table_structure_sql::column_format::normalize_column_data_type (cyclomatic 17) crates/dbx-sql-schema/src/table_structure_sql/column_format.rs:255 — dbx_sql_schema::table_structure_sql::column_format::normalize_column_data_type has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • + 1 more in this group — see findings.md.
D35 · Change Coupling · Change coupling · ×24
  • Change coupling: column_format.rs ↔ tests.rs crates/dbx-sql-schema/src/table_structure_sql/column_format.rs — `crates/dbx-sql-schema/src/table_structure_sql/column_format.rs` and `crates/dbx-sql-schema/src/table_structure_sql/tests.rs` change together 91% of the time (10 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `3767f4a8` feat(sqlite): support autoincrement primary key in structure editor (at that commit the files were still `crates/dbx-core/src/table_structure_sql/column_format.rs` and `crates/dbx-core/src/table_structure_sql/tests.rs`); `d2de5042` fix(mysql): carry datetime precision into current_timestamp clauses (at that commit the files were still `crates/dbx-core/src/table_structure_sql/column_format.rs` and `crates/dbx-core/src/table_structure_sql/tests.rs`); `06dcd001` fix(mysql): show inherited charset and collation in structure editor (at that commit the files were still `crates/dbx-core/src/table_structure_sql/column_format.rs` and `crates/dbx-core/src/table_structure_sql/tests.rs`) — run `git show` on any of them.
  • Change coupling: columns.rs ↔ tests.rs crates/dbx-sql-schema/src/table_structure_sql/columns.rs — `crates/dbx-sql-schema/src/table_structure_sql/columns.rs` and `crates/dbx-sql-schema/src/table_structure_sql/tests.rs` change together 88% of the time (14 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 14 shared commits counted here, the most recent 3 are `0a4e46a2` feat(duckdb): support column rename; `cd8300c3` fix(table-editor): clear stale auto-increment flag on PK change (at that commit the files were still `crates/dbx-core/src/table_structure_sql/columns.rs` and `crates/dbx-core/src/table_structure_sql/tests.rs`); `a1e94d82` feat(oracle): support adding primary keys to existing tables (at that commit the files were still `crates/dbx-core/src/table_structure_sql/columns.rs` and `crates/dbx-core/src/table_structure_sql/tests.rs`) — run `git show` on any of them.
  • Change coupling: layout.tsx ↔ LandingFooter.tsx docs/app/[lang]/layout.tsx — `docs/app/[lang]/layout.tsx` and `docs/components/landing/LandingFooter.tsx` change together 70% of the time (7 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `a3038e25` docs: raise advertised database count from 90+ to 100+; `d766228b` feat(site): polish dark theme, typography, and docs nav; `28c0977a` docs: bump app size claim to 25 MB — run `git show` on any of them.
  • Change coupling: tauri.ts ↔ main.rs apps/desktop/src/lib/backend/tauri.ts — `apps/desktop/src/lib/backend/tauri.ts` and `crates/dbx-web/src/main.rs` change together 70% of the time (74 of the 106 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 74 shared commits counted here, the most recent 3 are `f468399f` perf(execution): prewarm tab session pools and report perceived wait; `f909f850` feat(plugins): expose read-only estimated plan host api; `5b937388` feat(meilisearch): add index creation — run `git show` on any of them.
  • Change coupling: QueryEditor.vue ↔ diagnostics.ts apps/desktop/src/components/editor/QueryEditor.vue — `apps/desktop/src/components/editor/QueryEditor.vue` and `apps/desktop/src/lib/sql/semantic/diagnostics.ts` change together 68% of the time (15 of the 22 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 15 shared commits counted here, the most recent 3 are `79d6ab64` fix(sqlserver): diagnose DECLARE without data type in routine bodies; `deb47df2` feat(opengauss): support A-compatibility packages; `c8c7a40e` fix(editor): smooth SQL editor state synchronization — run `git show` on any of them.
  • Change coupling: es.ts ↔ shortcutRegistry.ts apps/desktop/src/i18n/locales/es.ts — `apps/desktop/src/i18n/locales/es.ts` and `apps/desktop/src/lib/editor/shortcutRegistry.ts` change together 65% of the time (11 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `89aa315a` Merge pull request #1037 (at that commit the file was still `apps/desktop/src/lib/shortcutRegistry.ts`); `51fe5de9` fix(shortcuts): allow clearing keyboard shortcuts in settings (at that commit the file was still `apps/desktop/src/lib/shortcutRegistry.ts`); `def1cacf` feat(ui): add Mod+B shortcut to toggle sidebar (at that commit the file was still `apps/desktop/src/lib/shortcutRegistry.ts`) — run `git show` on any of them.
  • Change coupling: queryStore.ts ↔ mongo_cmd.rs apps/desktop/src/stores/queryStore.ts — `apps/desktop/src/stores/queryStore.ts` and `src-tauri/src/commands/mongo_cmd.rs` change together 64% of the time (18 of the 28 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 18 shared commits counted here, the most recent 3 are `a78fc48a` feat(mongodb): support find explain in the SQL editor; `f78dc1ba` feat(mongodb): support bulkWrite; `9eafac70` feat(mongodb): support replaceOne — run `git show` on any of them.
  • Change coupling: ContentArea.vue ↔ openTabsPersistence.ts apps/desktop/src/components/layout/ContentArea.vue — `apps/desktop/src/components/layout/ContentArea.vue` and `apps/desktop/src/lib/app/openTabsPersistence.ts` change together 62% of the time (15 of the 24 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 15 shared commits counted here, the most recent 3 are `9c23e319` feat(redis): add command-line query result mode; `760d2c64` fix(source): open pending tab while loading object source; `5fb66771` feat(editor): 持久化SQL编辑器光标位置 — run `git show` on any of them.
  • Change coupling: sidebarTreeItemLayout.ts ↔ connectionStore.ts apps/desktop/src/lib/sidebar/sidebarTreeItemLayout.ts — `apps/desktop/src/lib/sidebar/sidebarTreeItemLayout.ts` and `apps/desktop/src/stores/connectionStore.ts` change together 62% of the time (13 of the 21 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 13 shared commits counted here, the most recent 3 are `1b37e974` feat(xugu): expose object type members in schema tree; `ad9075e1` feat(xugu): expose package members in schema tree; `9dbbfb4a` feat(sidebar): show connection note next to label with tight comment … — run `git show` on any of them.
  • Change coupling: LandingFooter.tsx ↔ metadata.ts docs/components/landing/LandingFooter.tsx — `docs/components/landing/LandingFooter.tsx` and `docs/lib/metadata.ts` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `a3038e25` docs: raise advertised database count from 90+ to 100+; `28c0977a` docs: bump app size claim to 25 MB; `d53c855b` feat(docs): update database coverage to 90+ — run `git show` on any of them.
  • Change coupling: DriverStoreDialog.vue ↔ agents.rs apps/desktop/src/components/config/DriverStoreDialog.vue — `apps/desktop/src/components/config/DriverStoreDialog.vue` and `crates/dbx-web/src/routes/agents.rs` change together 59% of the time (10 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `da95bd43` fix(updates): auto-continue client upgrade on update-all; `8737114d` fix(jdbc): include managed drivers in offline bundles; `95db01e3` feat(agents): concurrent all-agent-driver upgrade — run `git show` on any of them.
  • Change coupling: App.vue ↔ openTabsPersistence.ts apps/desktop/src/App.vue — `apps/desktop/src/App.vue` and `apps/desktop/src/lib/app/openTabsPersistence.ts` change together 58% of the time (14 of the 24 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 14 shared commits counted here, the most recent 3 are `760d2c64` fix(source): open pending tab while loading object source; `5fb66771` feat(editor): 持久化SQL编辑器光标位置; `14834549` fix(desktop): unify grouped tab bar portal across special pages — run `git show` on any of them.
  • Change coupling: connection_secrets.rs ↔ REDACTED crates/dbx-core/src/connection/connection_secrets.rs — `crates/dbx-core/src/connection/connection_secrets.rs` and `REDACTED` change together 56% of the time (15 of the 27 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 15 shared commits counted here, the most recent 3 are `2929b1c0` feat(hive): add Kerberos connection options (at that commit the files were still `crates/dbx-core/src/connection_secrets.rs` and `crates/dbx-core/src/query.rs`); `d815a16b` feat(redis): move scan page size to connections (at that commit the files were still `crates/dbx-core/src/connection_secrets.rs` and `crates/dbx-core/src/query.rs`); `71db2481` fix(informix): add informix_server field to test helpers (at that commit the files were still `crates/dbx-core/src/connection_secrets.rs` and `crates/dbx-core/src/query.rs`) — run `git show` on any of them.
  • Change coupling: connectionPresentation.ts ↔ REDACTED apps/desktop/src/lib/connection/connectionPresentation.ts — `apps/desktop/src/lib/connection/connectionPresentation.ts` and `REDACTED` change together 56% of the time (10 of the 18 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `264f5c48` feat(influxdb3): add influxdb 3 engine over http (at that commit the file was still `crates/dbx-core/src/connection.rs`); `50e6476c` fix(meilisearch): preserve proxy paths and secure REST requests (at that commit the file was still `crates/dbx-core/src/connection.rs`); `0bd07ccf` feat: add InfluxDB support (#980) (at that commit the files were still `apps/desktop/src/lib/connectionPresentation.ts` and `crates/dbx-core/src/connection.rs`) — run `git show` on any of them.
  • Change coupling: tauri.ts ↔ exportFormats.ts apps/desktop/src/lib/backend/tauri.ts — `apps/desktop/src/lib/backend/tauri.ts` and `apps/desktop/src/lib/export/exportFormats.ts` change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `1d07cb05` feat(export): add portable standard SQL inserts; `d715b16b` fix(sqlserver): wrap identity inserts with SET IDENTITY_INSERT; `d17ce466` feat(export): honor exclude-primary-keys in SQL script exports — run `git show` on any of them.
  • Change coupling: exportFormats.ts ↔ REDACTED apps/desktop/src/lib/export/exportFormats.ts — `apps/desktop/src/lib/export/exportFormats.ts` and `REDACTED` change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `1d07cb05` feat(export): add portable standard SQL inserts; `d715b16b` fix(sqlserver): wrap identity inserts with SET IDENTITY_INSERT; `d17ce466` feat(export): honor exclude-primary-keys in SQL script exports (at that commit the file was still `crates/dbx-core/src/table_export.rs`) — run `git show` on any of them.
  • Change coupling: AiAssistant.vue ↔ ai.rs apps/desktop/src/components/editor/AiAssistant.vue — `apps/desktop/src/components/editor/AiAssistant.vue` and `src-tauri/src/commands/ai.rs` change together 54% of the time (13 of the 24 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 13 shared commits counted here, the most recent 3 are `57e98b6d` feat(ai): session-level prompt cache key for openai responses; `61dc49ca` fix(ai): preserve Dameng database and schema scopes; `cb9d0f7c` fix(ai): harden write SQL confirmation flow — run `git show` on any of them.
  • Change coupling: es.ts ↔ keyboardShortcuts.ts apps/desktop/src/i18n/locales/es.ts — `apps/desktop/src/i18n/locales/es.ts` and `apps/desktop/src/lib/editor/keyboardShortcuts.ts` change together 54% of the time (13 of the 24 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 13 shared commits counted here, the most recent 3 are `51fe5de9` fix(shortcuts): allow clearing keyboard shortcuts in settings (at that commit the file was still `apps/desktop/src/lib/keyboardShortcuts.ts`); `def1cacf` feat(ui): add Mod+B shortcut to toggle sidebar (at that commit the file was still `apps/desktop/src/lib/keyboardShortcuts.ts`); `178a800c` ✨ feat(shortcuts): 添加打开设置的键盘快捷键 (at that commit the file was still `apps/desktop/src/lib/keyboardShortcuts.ts`) — run `git show` on any of them.
  • Change coupling: AiAssistant.vue ↔ agent_loop.rs apps/desktop/src/components/editor/AiAssistant.vue — `apps/desktop/src/components/editor/AiAssistant.vue` and `crates/dbx-core/src/ai/agent_loop.rs` change together 52% of the time (11 of the 21 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `57e98b6d` feat(ai): session-level prompt cache key for openai responses (at that commit the file was still `crates/dbx-core/src/agent_loop.rs`); `61dc49ca` fix(ai): preserve Dameng database and schema scopes (at that commit the file was still `crates/dbx-core/src/agent_loop.rs`); `cb9d0f7c` fix(ai): harden write SQL confirmation flow (at that commit the file was still `crates/dbx-core/src/agent_loop.rs`) — run `git show` on any of them.
  • Change coupling: connectionStore.ts ↔ schema.rs apps/desktop/src/stores/connectionStore.ts — `apps/desktop/src/stores/connectionStore.ts` and `crates/dbx-web/src/routes/schema.rs` change together 52% of the time (12 of the 23 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 12 shared commits counted here, the most recent 3 are `1b37e974` feat(xugu): expose object type members in schema tree; `486a73ef` fix(sqlserver): honor USE context in completions; `6b2f55e4` fix(postgresql): show trigger source details — run `git show` on any of them.
  • Change coupling: TreeItem.vue ↔ useNavigationTargets.ts apps/desktop/src/components/sidebar/TreeItem.vue — `apps/desktop/src/components/sidebar/TreeItem.vue` and `apps/desktop/src/composables/useNavigationTargets.ts` change together 50% of the time (19 of the 38 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 19 shared commits counted here, the most recent 3 are `dfdf9169` fix(database): handle Kingbase metadata and rename refresh; `a9ca66a8` fix(doris): qualify external catalog tables; `a1b81749` fix(doris): preserve external catalog in object browser — run `git show` on any of them.
  • Change coupling: ContentArea.vue ↔ tabResultCache.ts apps/desktop/src/components/layout/ContentArea.vue — `apps/desktop/src/components/layout/ContentArea.vue` and `apps/desktop/src/lib/tabs/tabResultCache.ts` change together 50% of the time (8 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `9c23e319` feat(redis): add command-line query result mode; `14e1d4f2` fix(query): enable editing multi-table JOIN result sets; `64e5e88c` fix(grid): show comments for joined query results — run `git show` on any of them.
  • Change coupling: useSidebarDataOpenRuntime.ts ↔ table_select.rs apps/desktop/src/composables/useSidebarDataOpenRuntime.ts — `apps/desktop/src/composables/useSidebarDataOpenRuntime.ts` and `crates/dbx-sql-dialect/src/sql_dialect/table_select.rs` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `625d84bb` fix(neo4j): pick node identity function by server version; `b84d1620` fix(oracle): stop ROWID pagination injection on views (at that commit the file was still `crates/dbx-core/src/sql_dialect/table_select.rs`); `3e75be87` fix(xugu): enable safe row editing without primary keys (at that commit the file was still `crates/dbx-core/src/sql_dialect/table_select.rs`) — run `git show` on any of them.
  • Change coupling: tableSelectSql.ts ↔ identifiers.rs apps/desktop/src/lib/table/tableSelectSql.ts — `apps/desktop/src/lib/table/tableSelectSql.ts` and `crates/dbx-sql-dialect/src/sql_dialect/identifiers.rs` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `d33161bb` fix(databricks): use backticks for generated identifiers (at that commit the file was still `crates/dbx-core/src/sql_dialect/identifiers.rs`); `a9ca66a8` fix(doris): qualify external catalog tables (at that commit the file was still `crates/dbx-core/src/sql_dialect/identifiers.rs`); `c3893bf3` feat(spark): add Apache Spark database driver with catalog support (at that commit the file was still `crates/dbx-core/src/sql_dialect/identifiers.rs`) — run `git show` on any of them.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×23
  • Duplicated block (19 lines × 2) crates/dbx-core/src/admin/mq/adapters/kafka.rs:486 — crates/dbx-core/src/admin/mq/adapters/kafka.rs:486-504 | crates/dbx-core/src/admin/mq/adapters/rocketmq.rs:622-640 — before extracting anything, compare `crates/dbx-core/src/admin/mq/adapters/kafka.rs` and `crates/dbx-core/src/admin/mq/adapters/rocketmq.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 186 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (19 lines × 2) REDACTED:1253 — REDACTED:1253-1271 | REDACTED:1736-1754 — both copies are in the same file, so extract the 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) REDACTED:1396 — REDACTED:1396-1414 | REDACTED:2086-2104 — both copies are in the same file, so extract the 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) REDACTED:1252 — REDACTED:1252-1270 | REDACTED:1282-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.
  • Duplicated block (19 lines × 2) crates/dbx-driver-mongodb/src/mongo_oidc.rs:262 — crates/dbx-driver-mongodb/src/mongo_oidc.rs:262-280 | crates/dbx-drivers/src/salesforce_oauth.rs:339-357 — before extracting anything, compare `crates/dbx-driver-mongodb/src/mongo_oidc.rs` and `crates/dbx-drivers/src/salesforce_oauth.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 87 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (19 lines × 2) crates/dbx-sql-data/src/query_result_sql.rs:1348 — crates/dbx-sql-data/src/query_result_sql.rs:1348-1366 | crates/dbx-sql-data/src/query_result_sql.rs:1441-1459 — both copies are in the same file, so extract the 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) crates/dbx-types/src/models/connection.rs:1102 — crates/dbx-types/src/models/connection.rs:1102-1120 | crates/dbx-types/src/models/connection.rs:1281-1299 — both copies are in the same file, so extract the 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) crates/dbx-web/src/routes/mongodb_import_export.rs:123 — crates/dbx-web/src/routes/mongodb_import_export.rs:123-141 | crates/dbx-web/src/routes/table_import.rs:121-139 — before extracting anything, compare `crates/dbx-web/src/routes/mongodb_import_export.rs` and `crates/dbx-web/src/routes/table_import.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 151 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (19 lines × 2) agents/drivers/argo-go/metadata.go:177 — agents/drivers/argo-go/metadata.go:177-195 | agents/drivers/hive-go/metadata.go:177-195 — `agents/drivers/argo-go/metadata.go` and `agents/drivers/hive-go/metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 946 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (19 lines × 2) agents/drivers/argo-go/metadata.go:599 — agents/drivers/argo-go/metadata.go:599-617 | agents/drivers/hive-go/metadata.go:610-628 — `agents/drivers/argo-go/metadata.go` and `agents/drivers/hive-go/metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 946 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/metadata.go:599` 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 (19 lines × 2) agents/drivers/argo-go/protocol_error.go:104 — agents/drivers/argo-go/protocol_error.go:104-122 | agents/drivers/hive-go/protocol_error.go:104-122 — `agents/drivers/argo-go/protocol_error.go` and `agents/drivers/hive-go/protocol_error.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 136 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (19 lines × 2) REDACTED:387 — REDACTED:387-405 | REDACTED:387-405 — `REDACTED` and `REDACTED` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 25 separate duplicated blocks between them, totalling at least 473 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (19 lines × 2) agents/drivers/argo-go/query.go:425 — agents/drivers/argo-go/query.go:425-443 | agents/drivers/hive-go/query.go:428-446 — `agents/drivers/argo-go/query.go` and `agents/drivers/hive-go/query.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 20 separate duplicated blocks between them, totalling at least 444 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (19 lines × 2) agents/drivers/argo-go/zookeeper_tls.go:176 — agents/drivers/argo-go/zookeeper_tls.go:176-194 | agents/drivers/hive-go/zookeeper_tls.go:176-194 — `agents/drivers/argo-go/zookeeper_tls.go` and `agents/drivers/hive-go/zookeeper_tls.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 223 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (19 lines × 2) agents/drivers/etcd-go/kv.go:371 — agents/drivers/etcd-go/kv.go:371-389 | agents/drivers/etcd2-go/kv.go:287-305 — `agents/drivers/etcd-go/kv.go` and `agents/drivers/etcd2-go/kv.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 11 separate duplicated blocks between them, totalling at least 134 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (19 lines × 2) agents/drivers/etcd-go/protocol_error.go:37 — agents/drivers/etcd-go/protocol_error.go:37-55 | agents/drivers/etcd2-go/protocol_error.go:34-52 — `agents/drivers/etcd-go/protocol_error.go` and `agents/drivers/etcd2-go/protocol_error.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 81 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/etcd-go/protocol_error.go:37` 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 (19 lines × 2) REDACTED:438 — REDACTED:438-456 | agents/drivers/vastbase-go/vastbase_metadata.go:301-319 — `REDACTED` and `agents/drivers/vastbase-go/vastbase_metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 71 separate duplicated blocks between them, totalling at least 1426 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:438` 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 (19 lines × 2) REDACTED:844 — REDACTED:844-862 | agents/drivers/vastbase-go/vastbase_metadata.go:703-721 — `REDACTED` and `agents/drivers/vastbase-go/vastbase_metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 71 separate duplicated blocks between them, totalling at least 1426 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (19 lines × 2) REDACTED:1951 — REDACTED:1951-1969 | agents/drivers/vastbase-go/vastbase_metadata.go:1280-1298 — `REDACTED` and `agents/drivers/vastbase-go/vastbase_metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 71 separate duplicated blocks between them, totalling at least 1426 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (19 lines × 2) REDACTED:2225 — REDACTED:2225-2243 | agents/drivers/vastbase-go/vastbase_metadata.go:1469-1487 — `REDACTED` and `agents/drivers/vastbase-go/vastbase_metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 71 separate duplicated blocks between them, totalling at least 1426 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (19 lines × 2) REDACTED:2504 — REDACTED:2504-2522 | agents/drivers/vastbase-go/vastbase_metadata.go:1755-1773 — `REDACTED` and `agents/drivers/vastbase-go/vastbase_metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 71 separate duplicated blocks between them, totalling at least 1426 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (19 lines × 2) REDACTED:1699 — REDACTED:1699-1717 | REDACTED:2449-2467 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (19 lines × 2) plugins/sdk/go/dbx-plugin-sdk/sdk.go:225 — plugins/sdk/go/dbx-plugin-sdk/sdk.go:225-243 | plugins/sdk/go/dbx-plugin-sdk/sdk.go:302-320 — both copies are in the same file, so extract the 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 register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D2 · Cognitive Complexity · dbx_sql_data · ×21
  • dbx_sql_data::data_grid_sql::format_grid_sql_literal_with_identifier_quote (cognitive 75) REDACTED:2484 — dbx_sql_data::data_grid_sql::format_grid_sql_literal_with_identifier_quote has cognitive complexity 75 (threshold 15). Drivers by points: if/else 46 (68 pts), boolean chains 7 (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.
  • dbx_sql_data::data_grid_salesforce_sql::build_salesforce_data_grid_save_statements (cognitive 48) crates/dbx-sql-data/src/data_grid_salesforce_sql.rs:15 — dbx_sql_data::data_grid_salesforce_sql::build_salesforce_data_grid_save_statements has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (40 pts), loops 5 (7 pts), boolean chains 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_data::query_result_sql::top_level_sql_tokens (cognitive 45) crates/dbx-sql-data/src/query_result_sql.rs:2270 — dbx_sql_data::query_result_sql::top_level_sql_tokens has cognitive complexity 45 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 5 (13 pts), boolean chains 7 (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.
  • dbx_sql_data::data_grid_sql::build_data_grid_save_statements (cognitive 44) REDACTED:1583 — dbx_sql_data::data_grid_sql::build_data_grid_save_statements has cognitive complexity 44 (threshold 15). Drivers by points: if/else 23 (38 pts), boolean chains 3, loops 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_data::data_grid_sql::build_data_grid_rollback_statements (cognitive 42) REDACTED:1786 — dbx_sql_data::data_grid_sql::build_data_grid_rollback_statements has cognitive complexity 42 (threshold 15). Drivers by points: if/else 21 (37 pts), loops 4 (5 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_data::query_result_sql::build_query_pagination_execution_plan (cognitive 33) crates/dbx-sql-data/src/query_result_sql.rs:124 — dbx_sql_data::query_result_sql::build_query_pagination_execution_plan has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 10, match/switch 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.
  • dbx_sql_data::data_grid_sql::validate_data_grid_save (cognitive 29) REDACTED:1241 — dbx_sql_data::data_grid_sql::validate_data_grid_save has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (20 pts), loops 4 (8 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_data::query_result_sql::is_simple_sqlserver_order_projection (cognitive 29) crates/dbx-sql-data/src/query_result_sql.rs:1096 — dbx_sql_data::query_result_sql::is_simple_sqlserver_order_projection has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_data::data_grid_tdengine_sql::build_tdengine_data_grid_save_statements (cognitive 25) crates/dbx-sql-data/src/data_grid_tdengine_sql.rs:6 — dbx_sql_data::data_grid_tdengine_sql::build_tdengine_data_grid_save_statements has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 4 (7 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_data::query_result_sql::build_sorted_query_sql (cognitive 25) crates/dbx-sql-data/src/query_result_sql.rs:421 — dbx_sql_data::query_result_sql::build_sorted_query_sql has cognitive complexity 25 (threshold 15). Drivers by points: if/else 20 (23 pts), boolean chains 2 (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.
  • dbx_sql_data::query_result_sql::iotdb_tree_count_sql (cognitive 24) crates/dbx-sql-data/src/query_result_sql.rs:1318 — dbx_sql_data::query_result_sql::iotdb_tree_count_sql has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (11 pts), match/switch 6 (9 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • dbx_sql_data::data_grid_iotdb_sql::build_iotdb_data_grid_rollback_statements (cognitive 21) crates/dbx-sql-data/src/data_grid_iotdb_sql.rs:42 — dbx_sql_data::data_grid_iotdb_sql::build_iotdb_data_grid_rollback_statements has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 3, 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.
  • dbx_sql_data::query_result_sql::build_count_query_sql (cognitive 21) crates/dbx-sql-data/src/query_result_sql.rs:331 — dbx_sql_data::query_result_sql::build_count_query_sql has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 1, match/switch 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.
  • dbx_sql_data::query_result_sql::line_has_open_line_comment (cognitive 21) crates/dbx-sql-data/src/query_result_sql.rs:2084 — dbx_sql_data::query_result_sql::line_has_open_line_comment has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_data::data_grid_sql::last_qualified_identifier_component (cognitive 20) REDACTED:2231 — dbx_sql_data::data_grid_sql::last_qualified_identifier_component has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (15 pts), match/switch 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_data::data_grid_neo4j_sql::build_neo4j_data_grid_rollback_statements (cognitive 19) crates/dbx-sql-data/src/data_grid_neo4j_sql.rs:79 — dbx_sql_data::data_grid_neo4j_sql::build_neo4j_data_grid_rollback_statements has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_data::query_result_sql::leading_execution_hint_prefix (cognitive 18) crates/dbx-sql-data/src/query_result_sql.rs:1004 — dbx_sql_data::query_result_sql::leading_execution_hint_prefix has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_data::query_result_sql::skip_leading_sql_comments (cognitive 17) crates/dbx-sql-data/src/query_result_sql.rs:946 — dbx_sql_data::query_result_sql::skip_leading_sql_comments has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_data::data_grid_neo4j_sql::build_neo4j_data_grid_save_statements (cognitive 16) crates/dbx-sql-data/src/data_grid_neo4j_sql.rs:7 — dbx_sql_data::data_grid_neo4j_sql::build_neo4j_data_grid_save_statements has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), 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.
  • dbx_sql_data::data_grid_tdengine_sql::validate_tdengine_existing_rows (cognitive 16) crates/dbx-sql-data/src/data_grid_tdengine_sql.rs:114 — dbx_sql_data::data_grid_tdengine_sql::validate_tdengine_existing_rows has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 7, loops 1 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_data::data_grid_sql::push_mysql_delete_batches (cognitive 16) REDACTED:1994 — dbx_sql_data::data_grid_sql::push_mysql_delete_batches has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 6). Of this number, 12 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×21
  • Duplicated block (18 lines × 2) REDACTED:1175 — REDACTED:1175-1192 | REDACTED:1226-1243 — both copies are in the same file, so extract the 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 (18 lines × 2) REDACTED:1221 — REDACTED:1221-1238 | REDACTED:6344-6361 — both copies are in the same file, so extract the 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 (18 lines × 2) crates/dbx-driver-mongodb/src/mongo_shell.rs:1708 — crates/dbx-driver-mongodb/src/mongo_shell.rs:1708-1725 | crates/dbx-driver-mongodb/src/mongo_shell.rs:1750-1767 — both copies are in the same file, so extract the 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 (18 lines × 2) crates/dbx-driver-mongodb/src/mongo_shell.rs:1717 — crates/dbx-driver-mongodb/src/mongo_shell.rs:1717-1734 | crates/dbx-driver-mongodb/src/mongo_shell.rs:1800-1817 — both copies are in the same file, so extract the 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 (18 lines × 2) crates/dbx-drivers/src/db/dynamodb_driver.rs:585 — crates/dbx-drivers/src/db/dynamodb_driver.rs:585-602 | REDACTED:1210-1227 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (18 lines × 2) crates/dbx-drivers/src/db/ssh_tunnel.rs:475 — crates/dbx-drivers/src/db/ssh_tunnel.rs:475-492 | crates/dbx-drivers/src/db/ssh_tunnel.rs:569-586 — both copies are in the same file, so extract the 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 (18 lines × 2) crates/dbx-web/src/routes/query.rs:418 — crates/dbx-web/src/routes/query.rs:418-435 | crates/dbx-web/src/routes/query.rs:562-579 — both copies are in the same file, so extract the 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 (18 lines × 2) crates/dbx-sql-schema/src/schema_diff.rs:5831 — crates/dbx-sql-schema/src/schema_diff.rs:5831-5851 | crates/dbx-sql-schema/src/schema_diff.rs:5876-5893 — both copies are in the same file, so extract the 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 (18 lines × 2) agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:230 — agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:230-247 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:231-248 — before extracting anything, compare `agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java` and `agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 288 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:230` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (18 lines × 2) agents/drivers/argo-go/connector.go:182 — agents/drivers/argo-go/connector.go:182-199 | agents/drivers/hive-go/connector.go:182-199 — `agents/drivers/argo-go/connector.go` and `agents/drivers/hive-go/connector.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 121 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (18 lines × 2) agents/drivers/argo-go/main.go:296 — agents/drivers/argo-go/main.go:296-313 | agents/drivers/hive-go/main.go:296-313 — `agents/drivers/argo-go/main.go` and `agents/drivers/hive-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 43 separate duplicated blocks between them, totalling at least 699 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (18 lines × 2) agents/drivers/argo-go/metadata.go:756 — agents/drivers/argo-go/metadata.go:756-773 | agents/drivers/hive-go/metadata.go:767-784 — `agents/drivers/argo-go/metadata.go` and `agents/drivers/hive-go/metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 946 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/metadata.go:756` 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 (18 lines × 2) REDACTED:242 — REDACTED:242-259 | REDACTED:242-259 — `REDACTED` and `REDACTED` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 25 separate duplicated blocks between them, totalling at least 473 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (18 lines × 2) REDACTED:262 — REDACTED:262-279 | REDACTED:262-279 — `REDACTED` and `REDACTED` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 25 separate duplicated blocks between them, totalling at least 473 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (18 lines × 2) agents/drivers/cassandra-go/main.go:325 — agents/drivers/cassandra-go/main.go:325-342 | agents/drivers/iotdb/main.go:327-344 — `agents/drivers/cassandra-go/main.go` and `agents/drivers/iotdb/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 30 separate duplicated blocks between them, totalling at least 389 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/cassandra-go/main.go:325` 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 (18 lines × 2) agents/drivers/cassandra-go/metadata.go:563 — agents/drivers/cassandra-go/metadata.go:563-580 | agents/drivers/iotdb/metadata.go:517-534 — 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 `agents/drivers/cassandra-go/metadata.go:563` 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 (18 lines × 2) REDACTED:344 — REDACTED:344-361 | agents/drivers/vastbase-go/vastbase_metadata.go:225-242 — `REDACTED` and `agents/drivers/vastbase-go/vastbase_metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 71 separate duplicated blocks between them, totalling at least 1426 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:344` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (18 lines × 2) REDACTED:3038 — REDACTED:3038-3055 | agents/drivers/vastbase-go/vastbase_metadata.go:2132-2149 — `REDACTED` and `agents/drivers/vastbase-go/vastbase_metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 71 separate duplicated blocks between them, totalling at least 1426 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (18 lines × 2) REDACTED:824 — REDACTED:824-841 | agents/drivers/vastbase-go/vastbase_metadata.go:683-700 — `REDACTED` and `agents/drivers/vastbase-go/vastbase_metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 71 separate duplicated blocks between them, totalling at least 1426 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (18 lines × 2) REDACTED:323 — REDACTED:323-340 | agents/drivers/vastbase-go/vastbase_metadata.go:204-221 — `REDACTED` and `agents/drivers/vastbase-go/vastbase_metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 71 separate duplicated blocks between them, totalling at least 1426 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (18 lines × 2) REDACTED:26 — REDACTED:26-43 | REDACTED:26-43 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 397 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×21
  • Duplicated block (10 lines × 3) crates/dbx-ai-provider/src/ai_claude_code_cli.rs:262 — crates/dbx-ai-provider/src/ai_claude_code_cli.rs:262-271 | crates/dbx-ai-provider/src/ai_codebuddy_cli.rs:336-345 | crates/dbx-ai-provider/src/ai_codebuddy_cli.rs:754-763 — before extracting anything, compare `crates/dbx-ai-provider/src/ai_claude_code_cli.rs` and `crates/dbx-ai-provider/src/ai_codebuddy_cli.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 3) REDACTED:2868 — REDACTED:2868-2877 | src-tauri/src/commands/connection.rs:1509-1518 | src-tauri/src/commands/connection.rs:1995-2004 — before extracting anything, compare `REDACTED` and `src-tauri/src/commands/connection.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 247 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 3) REDACTED:4941 — REDACTED:4941-4950 | REDACTED:5762-5771 | REDACTED:5795-5804 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (10 lines × 3) REDACTED:1273 — REDACTED:1273-1282 | REDACTED:1465-1474 | REDACTED:1756-1765 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (10 lines × 3) REDACTED:10972 — REDACTED:10972-10981 | REDACTED:11054-11063 | REDACTED:11106-11115 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (10 lines × 3) crates/dbx-driver-agent/src/agent_service.rs:1485 — crates/dbx-driver-agent/src/agent_service.rs:1485-1496 | crates/dbx-driver-agent/src/agent_service.rs:1658-1667 | crates/dbx-driver-agent/src/agent_service.rs:1787-1798 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (10 lines × 3) crates/dbx-driver-mongodb/src/mongo_shell.rs:356 — crates/dbx-driver-mongodb/src/mongo_shell.rs:356-365 | crates/dbx-web/src/routes/mcp_policy.rs:38-47 | src-tauri/src/commands/mcp_bridge.rs:1264-1273 — before extracting anything, compare `crates/dbx-driver-mongodb/src/mongo_shell.rs` and `crates/dbx-web/src/routes/mcp_policy.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 145 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 3) crates/dbx-driver-mongodb/src/mongo_shell.rs:428 — crates/dbx-driver-mongodb/src/mongo_shell.rs:428-437 | crates/dbx-web/src/routes/mcp_policy.rs:110-119 | src-tauri/src/commands/mcp_bridge.rs:1336-1345 — before extracting anything, compare `crates/dbx-driver-mongodb/src/mongo_shell.rs` and `crates/dbx-web/src/routes/mcp_policy.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 145 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 3) crates/dbx-driver-redis/src/lib.rs:686 — crates/dbx-driver-redis/src/lib.rs:686-695 | crates/dbx-driver-redis/src/lib.rs:864-873 | crates/dbx-driver-redis/src/lib.rs:898-907 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (10 lines × 3) crates/dbx-sql-data/src/query_result_sql.rs:957 — crates/dbx-sql-data/src/query_result_sql.rs:957-966 | crates/dbx-sql-data/src/query_result_sql.rs:1023-1032 | crates/dbx-sql-data/src/query_result_sql.rs:2098-2107 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (10 lines × 3) crates/dbx-web/src/routes/query.rs:417 — crates/dbx-web/src/routes/query.rs:417-426 | crates/dbx-web/src/routes/query.rs:477-486 | crates/dbx-web/src/routes/query.rs:561-570 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (10 lines × 3) REDACTED:11052 — REDACTED:11052-11061 | REDACTED:11073-11082 | REDACTED:11104-11113 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (10 lines × 3) REDACTED:2330 — REDACTED:2330-2339 | REDACTED:2352-2361 | REDACTED:3788-3797 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2330` 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 (10 lines × 3) REDACTED:3817 — REDACTED:3817-3826 | REDACTED:3840-3849 | REDACTED:3871-3880 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:3817` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:3814` calls `oracleListObjects`, `createArrayNode` and `REDACTED:3869` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 3) agents/common/src/main/java/com/dbx/agent/MetadataSqlSupport.java:23 — agents/common/src/main/java/com/dbx/agent/MetadataSqlSupport.java:23-32 | REDACTED:1071-1080 | REDACTED:274-283 — 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 `agents/common/src/main/java/com/dbx/agent/MetadataSqlSupport.java:23` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `agents/common/src/main/java/com/dbx/agent/MetadataSqlSupport.java:22` calls `orNone` and `REDACTED:1070` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 3) agents/drivers/argo-go/query.go:494 — agents/drivers/argo-go/query.go:494-503 | agents/drivers/hive-go/query.go:497-506 | REDACTED:5539-5548 — `agents/drivers/argo-go/query.go` and `agents/drivers/hive-go/query.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 20 separate duplicated blocks between them, totalling at least 444 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 3) agents/drivers/etcd-go/main.go:169 — agents/drivers/etcd-go/main.go:169-178 | agents/drivers/etcd2-go/main.go:139-148 | agents/drivers/neo4j-go/main.go:167-176 — `agents/drivers/etcd-go/main.go` and `agents/drivers/etcd2-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 19 separate duplicated blocks between them, totalling at least 278 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/etcd-go/main.go:169` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 × 3) agents/drivers/iotdb/main.go:285 — agents/drivers/iotdb/main.go:285-294 | agents/drivers/kingbase-go/main.go:323-332 | agents/drivers/vastbase-go/main.go:348-357 — `agents/drivers/iotdb/main.go` and `agents/drivers/kingbase-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 24 separate duplicated blocks between them, totalling at least 269 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (10 lines × 3) agents/drivers/argo-go/kerberos_defaults_windows.go:10 — agents/drivers/argo-go/kerberos_defaults_windows.go:10-19 | agents/drivers/hive-go/kerberos_defaults_windows.go:10-19 | agents/go-common/go-gssapi/krb5/default_paths_windows.go:10-23 — `agents/drivers/argo-go/kerberos_defaults_windows.go` and `agents/drivers/hive-go/kerberos_defaults_windows.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 1 separate duplicated blocks between them, totalling at least 14 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (10 lines × 3) agents/drivers/etcd-go/auth.go:250 — agents/drivers/etcd-go/auth.go:250-259 | agents/drivers/etcd-go/auth.go:363-372 | agents/drivers/etcd-go/auth.go:380-389 — 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 register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (10 lines × 3) agents/drivers/rabbitmq/operations.go:318 — agents/drivers/rabbitmq/operations.go:318-327 | agents/drivers/rabbitmq/operations.go:913-922 | agents/drivers/rabbitmq/operations.go:1392-1401 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/rabbitmq/operations.go:318` 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.
D1 · Cyclomatic Complexity · dbx_sql_core · ×20
  • dbx_sql_core::sql::split_sql_statement_ranges_with_options (cyclomatic 56) crates/dbx-sql-core/src/sql.rs:991 — dbx_sql_core::sql::split_sql_statement_ranges_with_options 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.
  • dbx_sql_core::sql::mysql_routine_tokens (cyclomatic 33) crates/dbx-sql-core/src/sql.rs:1491 — dbx_sql_core::sql::mysql_routine_tokens has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • dbx_sql_core::sql_diagnostics::redact_literals (cyclomatic 30) crates/dbx-sql-core/src/sql_diagnostics.rs:37 — dbx_sql_core::sql_diagnostics::redact_literals 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.
  • dbx_sql_core::sql_analysis::spark_datasource_clause_removals (cyclomatic 30) crates/dbx-sql-core/src/sql_analysis.rs:239 — dbx_sql_core::sql_analysis::spark_datasource_clause_removals 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.
  • dbx_sql_core::sql::first_executable_sql_token_with_options (cyclomatic 29) crates/dbx-sql-core/src/sql.rs:2377 — dbx_sql_core::sql::first_executable_sql_token_with_options has cyclomatic complexity 29 (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.
  • dbx_sql_core::query_execution_sql::strip_sql_comments_and_literals_with_metadata (cyclomatic 26) crates/dbx-sql-core/src/query_execution_sql.rs:1141 — dbx_sql_core::query_execution_sql::strip_sql_comments_and_literals_with_metadata 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.
  • dbx_sql_core::object_source_sql::oceanbase_sequence_edit_sql (cyclomatic 25) crates/dbx-sql-core/src/object_source_sql.rs:341 — dbx_sql_core::object_source_sql::oceanbase_sequence_edit_sql 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.
  • dbx_sql_core::sql::oracle_plsql_tokens_fallback (cyclomatic 25) crates/dbx-sql-core/src/sql.rs:2800 — dbx_sql_core::sql::oracle_plsql_tokens_fallback 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.
  • dbx_sql_core::object_source_sql::build_executable_object_source_statements (cyclomatic 23) crates/dbx-sql-core/src/object_source_sql.rs:129 — dbx_sql_core::object_source_sql::build_executable_object_source_statements 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.
  • dbx_sql_core::sql_editability::analyze_editable_query_editability (cyclomatic 22) crates/dbx-sql-core/src/sql_editability.rs:131 — dbx_sql_core::sql_editability::analyze_editable_query_editability has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • dbx_sql_core::sql_analysis::analyze_sql_references (cyclomatic 20) crates/dbx-sql-core/src/sql_analysis.rs:104 — dbx_sql_core::sql_analysis::analyze_sql_references has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • dbx_sql_core::sql::leading_executable_sql_with_options (cyclomatic 20) crates/dbx-sql-core/src/sql.rs:2330 — dbx_sql_core::sql::leading_executable_sql_with_options has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • dbx_sql_core::dml_preview_sql::build_update_preview (cyclomatic 18) crates/dbx-sql-core/src/dml_preview_sql.rs:116 — dbx_sql_core::dml_preview_sql::build_update_preview 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.
  • dbx_sql_core::sql_analysis::is_postgres_create_procedure_parser_gap (cyclomatic 17) crates/dbx-sql-core/src/sql_analysis.rs:982 — dbx_sql_core::sql_analysis::is_postgres_create_procedure_parser_gap has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • dbx_sql_core::sql_editability::strip_sql_server_top_clause (cyclomatic 17) crates/dbx-sql-core/src/sql_editability.rs:616 — dbx_sql_core::sql_editability::strip_sql_server_top_clause 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.
  • dbx_sql_core::sql::parse_insert_values_tail (cyclomatic 17) crates/dbx-sql-core/src/sql.rs:1971 — dbx_sql_core::sql::parse_insert_values_tail 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.
  • dbx_sql_core::sql::leading_mysql_executable_comment_start (cyclomatic 17) crates/dbx-sql-core/src/sql.rs:2246 — dbx_sql_core::sql::leading_mysql_executable_comment_start has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • dbx_sql_core::sql_diagnostics::redact_sensitive_assignments (cyclomatic 16) crates/dbx-sql-core/src/sql_diagnostics.rs:135 — dbx_sql_core::sql_diagnostics::redact_sensitive_assignments has cyclomatic complexity 16 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • dbx_sql_core::object_source_sql::parse_object_source_kind (cyclomatic 16) crates/dbx-sql-core/src/object_source_sql.rs:1095 — dbx_sql_core::object_source_sql::parse_object_source_kind 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.
  • dbx_sql_core::query_execution_sql::build_explain_sql (cyclomatic 16) crates/dbx-sql-core/src/query_execution_sql.rs:120 — dbx_sql_core::query_execution_sql::build_explain_sql has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D2 · Cognitive Complexity · dbx_ai_provider · ×20
  • dbx_ai_provider::ai::stream_claude_with_tools (cognitive 122) crates/dbx-ai-provider/src/ai.rs:4286 — dbx_ai_provider::ai::stream_claude_with_tools has cognitive complexity 122 (threshold 15). Drivers by points: if/else 24 (99 pts), match/switch 3 (13 pts), loops 4 (9 pts), boolean chains 1 (nesting depth added 90). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_ai_provider::ai::stream_openai_with_tools (cognitive 105) crates/dbx-ai-provider/src/ai.rs:4504 — dbx_ai_provider::ai::stream_openai_with_tools has cognitive complexity 105 (threshold 15). Drivers by points: if/else 22 (89 pts), loops 3 (10 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 76). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_ai_provider::ai::stream_openai (cognitive 63) crates/dbx-ai-provider/src/ai.rs:3858 — dbx_ai_provider::ai::stream_openai has cognitive complexity 63 (threshold 15). Drivers by points: if/else 13 (54 pts), loops 2 (4 pts), match/switch 2 (4 pts), boolean chains 1 (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.
  • dbx_ai_provider::ai::build_gemini_contents (cognitive 60) crates/dbx-ai-provider/src/ai.rs:4842 — dbx_ai_provider::ai::build_gemini_contents has cognitive complexity 60 (threshold 15). Drivers by points: if/else 16 (46 pts), loops 3 (11 pts), boolean chains 3 (nesting depth added 38). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • dbx_ai_provider::ai::stream_responses_with_tools (cognitive 52) crates/dbx-ai-provider/src/ai.rs:4690 — dbx_ai_provider::ai::stream_responses_with_tools has cognitive complexity 52 (threshold 15). Drivers by points: if/else 10 (41 pts), match/switch 2 (7 pts), loops 2 (4 pts) (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_ai_provider::ai::stream_gemini_with_tools (cognitive 49) crates/dbx-ai-provider/src/ai.rs:4947 — dbx_ai_provider::ai::stream_gemini_with_tools has cognitive complexity 49 (threshold 15). Drivers by points: if/else 8 (36 pts), loops 3 (11 pts), match/switch 1 (2 pts) (nesting depth added 37). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • dbx_ai_provider::ai::stream_claude (cognitive 43) crates/dbx-ai-provider/src/ai.rs:3755 — dbx_ai_provider::ai::stream_claude has cognitive complexity 43 (threshold 15). Drivers by points: if/else 10 (37 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_ai_provider::ai_pi_agent_cli::emit_pi_event (cognitive 35) crates/dbx-ai-provider/src/ai_pi_agent_cli.rs:655 — dbx_ai_provider::ai_pi_agent_cli::emit_pi_event has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (28 pts), loops 1 (4 pts), match/switch 2 (3 pts) (nesting depth added 23). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • dbx_ai_provider::ai_cli_agent::run_cli_jsonl_agent (cognitive 35) crates/dbx-ai-provider/src/ai_cli_agent.rs:1073 — dbx_ai_provider::ai_cli_agent::run_cli_jsonl_agent has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (24 pts), match/switch 3 (6 pts), loops 3 (5 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_ai_provider::ai::stream_responses_api (cognitive 30) crates/dbx-ai-provider/src/ai.rs:3995 — dbx_ai_provider::ai::stream_responses_api has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (24 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_ai_provider::ai::measure_first_stream_chunk (cognitive 28) crates/dbx-ai-provider/src/ai.rs:3015 — dbx_ai_provider::ai::measure_first_stream_chunk has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_ai_provider::ai_claude_code_cli::parse_claude_code_models (cognitive 25) crates/dbx-ai-provider/src/ai_claude_code_cli.rs:355 — dbx_ai_provider::ai_claude_code_cli::parse_claude_code_models has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_ai_provider::ai::stream_gemini (cognitive 23) crates/dbx-ai-provider/src/ai.rs:4087 — dbx_ai_provider::ai::stream_gemini has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_ai_provider::ai_opencode_cli::parse_opencode_models (cognitive 21) crates/dbx-ai-provider/src/ai_opencode_cli.rs:269 — dbx_ai_provider::ai_opencode_cli::parse_opencode_models has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_ai_provider::ai::resolve_endpoint (cognitive 21) crates/dbx-ai-provider/src/ai.rs:890 — dbx_ai_provider::ai::resolve_endpoint has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_ai_provider::ai::test_connection_core (cognitive 21) crates/dbx-ai-provider/src/ai.rs:3153 — dbx_ai_provider::ai::test_connection_core has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 pts), match/switch 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_ai_provider::ai::list_claude_models (cognitive 18) crates/dbx-ai-provider/src/ai.rs:2000 — dbx_ai_provider::ai::list_claude_models has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_ai_provider::ai::classify_error (cognitive 18) crates/dbx-ai-provider/src/ai.rs:3323 — dbx_ai_provider::ai::classify_error has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, boolean chains 8. 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.
  • dbx_ai_provider::ai::build_responses_input_with_tools_variant (cognitive 17) crates/dbx-ai-provider/src/ai.rs:1613 — dbx_ai_provider::ai::build_responses_input_with_tools_variant has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_ai_provider::ai::with_stream_retry (cognitive 17) crates/dbx-ai-provider/src/ai.rs:3569 — dbx_ai_provider::ai::with_stream_retry has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), match/switch 2 (6 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D30 · Dependency Vulnerabilities · Medium CVE · ×20
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×20
  • Duplicated block (20 lines × 2) agents/drivers/duckdb/src/sql.rs:82 — agents/drivers/duckdb/src/sql.rs:82-101 | crates/dbx-drivers/src/db/duckdb_sql.rs:98-117 — before extracting anything, compare `agents/drivers/duckdb/src/sql.rs` and `crates/dbx-drivers/src/db/duckdb_sql.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 147 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (20 lines × 2) REDACTED:2860 — REDACTED:2860-2879 | src-tauri/src/commands/connection.rs:1987-2006 — before extracting anything, compare `REDACTED` and `src-tauri/src/commands/connection.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 247 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (20 lines × 2) REDACTED:3122 — REDACTED:3122-3141 | REDACTED:3315-3334 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (20 lines × 2) crates/dbx-driver-mysql/src/mysql.rs:5514 — crates/dbx-driver-mysql/src/mysql.rs:5514-5533 | crates/dbx-driver-mysql/src/mysql.rs:5863-5882 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (20 lines × 2) crates/dbx-driver-mysql/src/mysql.rs:6047 — crates/dbx-driver-mysql/src/mysql.rs:6047-6066 | crates/dbx-driver-mysql/src/mysql.rs:6095-6114 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (20 lines × 2) crates/dbx-sql-core/src/query_execution_sql.rs:1089 — crates/dbx-sql-core/src/query_execution_sql.rs:1089-1108 | crates/dbx-sql-core/src/query_execution_sql.rs:1148-1167 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (20 lines × 2) crates/dbx-sql-core/src/sql_analysis.rs:206 — crates/dbx-sql-core/src/sql_analysis.rs:206-225 | crates/dbx-sql-core/src/sql_analysis.rs:414-433 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (20 lines × 2) agents/common/src/main/java/com/dbx/agent/JdbcExecutor.java:159 — agents/common/src/main/java/com/dbx/agent/JdbcExecutor.java:159-178 | agents/common/src/main/java/com/dbx/agent/JdbcExecutor.java:411-430 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (20 lines × 2) agents/drivers/argo-go/config.go:799 — agents/drivers/argo-go/config.go:799-818 | agents/drivers/hive-go/config.go:830-849 — `agents/drivers/argo-go/config.go` and `agents/drivers/hive-go/config.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 1107 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (20 lines × 2) REDACTED:277 — REDACTED:277-296 | REDACTED:277-296 — `REDACTED` and `REDACTED` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 17 separate duplicated blocks between them, totalling at least 340 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (20 lines × 2) agents/drivers/argo-go/main.go:369 — agents/drivers/argo-go/main.go:369-388 | agents/drivers/hive-go/main.go:369-388 — `agents/drivers/argo-go/main.go` and `agents/drivers/hive-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 43 separate duplicated blocks between them, totalling at least 699 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (20 lines × 2) agents/drivers/argo-go/metadata.go:235 — agents/drivers/argo-go/metadata.go:235-254 | agents/drivers/hive-go/metadata.go:241-260 — `agents/drivers/argo-go/metadata.go` and `agents/drivers/hive-go/metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 946 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (20 lines × 2) agents/drivers/argo-go/metadata.go:275 — agents/drivers/argo-go/metadata.go:275-294 | agents/drivers/hive-go/metadata.go:281-300 — `agents/drivers/argo-go/metadata.go` and `agents/drivers/hive-go/metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 946 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (20 lines × 2) REDACTED:506 — REDACTED:506-525 | REDACTED:506-525 — `REDACTED` and `REDACTED` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 25 separate duplicated blocks between them, totalling at least 473 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (20 lines × 2) agents/drivers/etcd-go/watch.go:49 — agents/drivers/etcd-go/watch.go:49-68 | agents/drivers/etcd2-go/watch.go:52-71 — `agents/drivers/etcd-go/watch.go` and `agents/drivers/etcd2-go/watch.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 117 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (20 lines × 2) REDACTED:865 — REDACTED:865-884 | agents/drivers/vastbase-go/vastbase_metadata.go:724-743 — `REDACTED` and `agents/drivers/vastbase-go/vastbase_metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 71 separate duplicated blocks between them, totalling at least 1426 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (20 lines × 2) REDACTED:2178 — REDACTED:2178-2197 | agents/drivers/vastbase-go/vastbase_metadata.go:1682-1701 — `REDACTED` and `agents/drivers/vastbase-go/vastbase_metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 71 separate duplicated blocks between them, totalling at least 1426 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (20 lines × 2) agents/drivers/kingbase-go/main.go:21 — agents/drivers/kingbase-go/main.go:21-40 | agents/drivers/vastbase-go/main.go:19-38 — `agents/drivers/kingbase-go/main.go` and `agents/drivers/vastbase-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 50 separate duplicated blocks between them, totalling at least 708 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (20 lines × 2) REDACTED:301 — REDACTED:301-320 | agents/drivers/xugu/type_members.go:111-130 — 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 `REDACTED:301` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (20 lines × 2) agents/drivers/kingbase-go/bench/agent_compare.go:232 — agents/drivers/kingbase-go/bench/agent_compare.go:232-251 | agents/drivers/vastbase-go/bench/agent_compare.go:598-617 — before extracting anything, compare `agents/drivers/kingbase-go/bench/agent_compare.go` and `agents/drivers/vastbase-go/bench/agent_compare.go` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/kingbase-go/bench/agent_compare.go:232` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `agents/drivers/vastbase-go/bench/agent_compare.go:597` calls `Delete` and `agents/drivers/kingbase-go/bench/agent_compare.go:231` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×20
  • Duplicated block (7 lines × 3) crates/dbx-ai-provider/src/ai_claude_code_cli.rs:433 — crates/dbx-ai-provider/src/ai_claude_code_cli.rs:433-439 | crates/dbx-ai-provider/src/ai_codebuddy_cli.rs:722-728 | crates/dbx-ai-provider/src/ai_pi_agent_cli.rs:494-500 — before extracting anything, compare `crates/dbx-ai-provider/src/ai_claude_code_cli.rs` and `crates/dbx-ai-provider/src/ai_codebuddy_cli.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 3) crates/dbx-core/src/admin/mq/token.rs:115 — crates/dbx-core/src/admin/mq/token.rs:115-121 | crates/dbx-core/src/admin/nacos/archive.rs:253-259 | crates/dbx-driver-mysql/src/mysql.rs:1044-1050 — 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 (7 lines × 3) crates/dbx-core/src/admin/nacos/http.rs:3536 — crates/dbx-core/src/admin/nacos/http.rs:3536-3542 | crates/dbx-core/src/admin/nacos/http.rs:3586-3592 | crates/dbx-core/src/admin/nacos/http.rs:3611-3617 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (7 lines × 3) REDACTED:3419 — REDACTED:3419-3425 | REDACTED:3718-3724 | REDACTED:4089-4095 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (7 lines × 3) crates/dbx-driver-agent/src/agent_service.rs:4295 — crates/dbx-driver-agent/src/agent_service.rs:4295-4301 | crates/dbx-driver-agent/src/agent_service.rs:4313-4319 | crates/dbx-driver-agent/src/agent_service.rs:4327-4333 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (7 lines × 3) crates/dbx-driver-mongodb/src/mongo_shell.rs:370 — crates/dbx-driver-mongodb/src/mongo_shell.rs:370-376 | crates/dbx-web/src/routes/mcp_policy.rs:52-58 | src-tauri/src/commands/mcp_bridge.rs:1278-1284 — before extracting anything, compare `crates/dbx-driver-mongodb/src/mongo_shell.rs` and `crates/dbx-web/src/routes/mcp_policy.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 145 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 3) crates/dbx-driver-mongodb/src/mongo_shell.rs:529 — crates/dbx-driver-mongodb/src/mongo_shell.rs:529-535 | crates/dbx-web/src/routes/mcp_policy.rs:211-217 | src-tauri/src/commands/mcp_bridge.rs:1437-1443 — before extracting anything, compare `crates/dbx-driver-mongodb/src/mongo_shell.rs` and `crates/dbx-web/src/routes/mcp_policy.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 145 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 3) REDACTED:179 — REDACTED:179-185 | crates/dbx-drivers/src/db/rqlite_driver.rs:160-166 | crates/dbx-drivers/src/db/turso_driver.rs:202-208 — before extracting anything, compare `REDACTED` and `crates/dbx-drivers/src/db/rqlite_driver.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 3) crates/dbx-formats/src/csv_export.rs:213 — crates/dbx-formats/src/csv_export.rs:213-219 | crates/dbx-formats/src/csv_export.rs:292-298 | crates/dbx-formats/src/csv_export.rs:324-330 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (7 lines × 3) crates/dbx-sql-schema/src/schema_diff.rs:1422 — crates/dbx-sql-schema/src/schema_diff.rs:1422-1428 | crates/dbx-sql-schema/src/schema_diff.rs:1434-1440 | crates/dbx-sql-schema/src/schema_diff.rs:1446-1452 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (7 lines × 3) crates/dbx-ai-provider/src/ai_claude_code_cli.rs:480 — crates/dbx-ai-provider/src/ai_claude_code_cli.rs:480-486 | crates/dbx-ai-provider/src/ai_codex_cli.rs:1013-1019 | crates/dbx-ai-provider/src/ai_grok_cli.rs:702-708 — before extracting anything, compare `crates/dbx-ai-provider/src/ai_claude_code_cli.rs` and `crates/dbx-ai-provider/src/ai_codex_cli.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 3) REDACTED:431 — REDACTED:431-437 | crates/dbx-drivers/src/db/rqlite_driver.rs:391-397 | crates/dbx-drivers/src/db/turso_driver.rs:613-619 — before extracting anything, compare `REDACTED` and `crates/dbx-drivers/src/db/rqlite_driver.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 3) crates/dbx-ai-provider/src/ai.rs:1528 — crates/dbx-ai-provider/src/ai.rs:1528-1534 | crates/dbx-ai-provider/src/ai.rs:1543-1549 | crates/dbx-ai-provider/src/ai.rs:1558-1564 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (7 lines × 3) crates/dbx-ai-provider/src/ai_claude_code_cli.rs:122 — crates/dbx-ai-provider/src/ai_claude_code_cli.rs:122-128 | crates/dbx-ai-provider/src/ai_grok_cli.rs:172-178 | crates/dbx-ai-provider/src/ai_qoder_cli.rs:54-60 — before extracting anything, compare `crates/dbx-ai-provider/src/ai_claude_code_cli.rs` and `crates/dbx-ai-provider/src/ai_grok_cli.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 92 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 3) crates/dbx-web/src/routes/mongodb_import_export.rs:258 — crates/dbx-web/src/routes/mongodb_import_export.rs:258-264 | crates/dbx-web/src/routes/nacos.rs:934-940 | crates/dbx-web/src/routes/table_import.rs:274-280 — before extracting anything, compare `crates/dbx-web/src/routes/mongodb_import_export.rs` and `crates/dbx-web/src/routes/table_import.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 151 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 3) agents/common/src/main/java/com/dbx/agent/AbstractJdbcAgent.java:575 — agents/common/src/main/java/com/dbx/agent/AbstractJdbcAgent.java:575-581 | REDACTED:202-208 | agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2DriverLoader.java:36-42 — 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 (7 lines × 3) agents/drivers/cassandra-go/metadata.go:573 — agents/drivers/cassandra-go/metadata.go:573-580 | REDACTED:1797-1803 | agents/drivers/vastbase-go/vastbase_metadata.go:1128-1134 — 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 `agents/drivers/cassandra-go/metadata.go:573` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7 lines × 3) REDACTED:987 — REDACTED:987-993 | REDACTED:1011-1017 | REDACTED:1023-1029 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:987` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 3) REDACTED:156 — REDACTED:156-162 | REDACTED:175-181 | REDACTED:169-175 — 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (7 lines × 3) REDACTED:616 — REDACTED:616-622 | agents/drivers/cassandra-go/bench/agent_compare.py:297-303 | REDACTED:616-622 — before extracting anything, compare `REDACTED` and `agents/drivers/cassandra-go/bench/agent_compare.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:611` calls `elapsed_ms`, `perf_counter` and `agents/drivers/cassandra-go/bench/agent_compare.py:293` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D1 · Cyclomatic Complexity · dbx_drivers · ×19
  • dbx_drivers::db::ssh_tunnel::connect_and_authenticate (cyclomatic 35) crates/dbx-drivers/src/db/ssh_tunnel.rs:380 — dbx_drivers::db::ssh_tunnel::connect_and_authenticate 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.
  • dbx_drivers::db::sqlite::normalize_sqlite_sql (cyclomatic 27) crates/dbx-drivers/src/db/sqlite.rs:2767 — dbx_drivers::db::sqlite::normalize_sqlite_sql 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.
  • dbx_drivers::db::sqlite::parse_sqlite_autoincrement_pk_columns (cyclomatic 26) crates/dbx-drivers/src/db/sqlite.rs:1960 — dbx_drivers::db::sqlite::parse_sqlite_autoincrement_pk_columns 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.
  • dbx_drivers::db::cloudflare_d1::sql_lexer::lex_sql (cyclomatic 26) crates/dbx-drivers/src/db/cloudflare_d1/sql_lexer.rs:9 — dbx_drivers::db::cloudflare_d1::sql_lexer::lex_sql has cyclomatic complexity 26 (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.
  • dbx_drivers::db::duckdb_sql::split_sql_statements (cyclomatic 25) crates/dbx-drivers/src/db/duckdb_sql.rs:11 — dbx_drivers::db::duckdb_sql::split_sql_statements has cyclomatic complexity 25 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • dbx_drivers::db::solr_driver::translate_field_operator_filter (cyclomatic 25) crates/dbx-drivers/src/db/solr_driver.rs:426 — dbx_drivers::db::solr_driver::translate_field_operator_filter has cyclomatic complexity 25 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • dbx_drivers::db::ssh_tunnel::forward_loop (cyclomatic 24) crates/dbx-drivers/src/db/ssh_tunnel.rs:1071 — dbx_drivers::db::ssh_tunnel::forward_loop 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.
  • dbx_drivers::db::dynamodb_driver::parse_dynamodb_statement (cyclomatic 23) crates/dbx-drivers/src/db/dynamodb_driver.rs:396 — dbx_drivers::db::dynamodb_driver::parse_dynamodb_statement 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.
  • dbx_drivers::db::sqlite::tokenize_entry (cyclomatic 23) crates/dbx-drivers/src/db/sqlite.rs:2374 — dbx_drivers::db::sqlite::tokenize_entry 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.
  • dbx_drivers::db::sqlite_worker::connect_sqlite_worker (cyclomatic 21) crates/dbx-drivers/src/db/sqlite_worker.rs:331 — dbx_drivers::db::sqlite_worker::connect_sqlite_worker 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.
  • dbx_drivers::db::sqlite::strip_sql_comments (cyclomatic 20) crates/dbx-drivers/src/db/sqlite.rs:2116 — dbx_drivers::db::sqlite::strip_sql_comments 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.
  • dbx_drivers::db::transport_layer_tunnel::start_transport_layers_internal (cyclomatic 20) crates/dbx-drivers/src/db/transport_layer_tunnel.rs:112 — dbx_drivers::db::transport_layer_tunnel::start_transport_layers_internal 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.
  • dbx_drivers::db::proxy_tunnel::test_proxy_endpoint (cyclomatic 19) crates/dbx-drivers/src/db/proxy_tunnel.rs:510 — dbx_drivers::db::proxy_tunnel::test_proxy_endpoint 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.
  • dbx_drivers::db::dynamodb_driver::validate_number (cyclomatic 17) crates/dbx-drivers/src/db/dynamodb_driver.rs:1466 — dbx_drivers::db::dynamodb_driver::validate_number 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.
  • dbx_drivers::db::salesforce_driver::apply_fields_function_limit (cyclomatic 17) REDACTED:892 — dbx_drivers::db::salesforce_driver::apply_fields_function_limit has cyclomatic complexity 17 (threshold 15). Of this number, 10 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • dbx_drivers::db::sqlite::extract_create_table_body (cyclomatic 17) crates/dbx-drivers/src/db/sqlite.rs:2047 — dbx_drivers::db::sqlite::extract_create_table_body 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.
  • dbx_drivers::db::sqlite::parse_table_level_primary_key (cyclomatic 17) crates/dbx-drivers/src/db/sqlite.rs:2316 — dbx_drivers::db::sqlite::parse_table_level_primary_key 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.
  • dbx_drivers::db::solr_driver::solr_docs_to_table (cyclomatic 17) crates/dbx-drivers/src/db/solr_driver.rs:910 — dbx_drivers::db::solr_driver::solr_docs_to_table 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.
  • dbx_drivers::db::dynamodb_driver::json_to_attribute_value (cyclomatic 16) crates/dbx-drivers/src/db/dynamodb_driver.rs:1363 — dbx_drivers::db::dynamodb_driver::json_to_attribute_value has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D2 · Cognitive Complexity · dbx · ×18
  • dbx::commands::connection::test_connection_with_info_inner (cognitive 97) src-tauri/src/commands/connection.rs:1180 — dbx::commands::connection::test_connection_with_info_inner has cognitive complexity 97 (threshold 15). Drivers by points: match/switch 19 (51 pts), if/else 23 (40 pts), boolean chains 6 (nesting depth added 49). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • dbx::run (cognitive 93) src-tauri/src/lib.rs:1464 — dbx::run has cognitive complexity 93 (threshold 15). Drivers by points: if/else 50 (90 pts), match/switch 2, boolean chains 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.
  • dbx::commands::connection::connect_db (cognitive 63) src-tauri/src/commands/connection.rs:1740 — dbx::commands::connection::connect_db has cognitive complexity 63 (threshold 15). Drivers by points: if/else 27 (46 pts), match/switch 5 (12 pts), boolean chains 5 (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.
  • dbx::commands::transfer::start_transfer (cognitive 45) src-tauri/src/commands/transfer.rs:17 — dbx::commands::transfer::start_transfer has cognitive complexity 45 (threshold 15). Drivers by points: if/else 24 (32 pts), match/switch 4 (7 pts), 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.
  • dbx::commands::global_search::search_root (cognitive 35) src-tauri/src/commands/global_search.rs:136 — dbx::commands::global_search::search_root has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (24 pts), match/switch 5 (9 pts), boolean chains 1, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx::commands::mcp_bridge::start (cognitive 33) src-tauri/src/commands/mcp_bridge.rs:200 — dbx::commands::mcp_bridge::start has cognitive complexity 33 (threshold 15). Drivers by points: if/else 25 (27 pts), match/switch 3 (5 pts), loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • dbx::commands::list_sql_files::scan_sql_files (cognitive 22) src-tauri/src/commands/list_sql_files.rs:139 — dbx::commands::list_sql_files::scan_sql_files has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 3 (5 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx::commands::connection::sync_connection_configs (cognitive 20) src-tauri/src/commands/connection.rs:951 — dbx::commands::connection::sync_connection_configs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx::commands::saved_sql::sync_saved_sql_directory_blocking (cognitive 20) src-tauri/src/commands/saved_sql.rs:133 — dbx::commands::saved_sql::sync_saved_sql_directory_blocking has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (6 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx::commands::redis_pubsub_server::handle_monitor_socket (cognitive 19) src-tauri/src/commands/redis_pubsub_server.rs:107 — dbx::commands::redis_pubsub_server::handle_monitor_socket has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 5 (10 pts), if/else 3 (8 pts), loops 1 (nesting depth added 10). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • dbx::commands::plugin_download::download_plugin_file (cognitive 18) src-tauri/src/commands/plugin_download.rs:36 — dbx::commands::plugin_download::download_plugin_file has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, loops 1, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx::background_backup::run_if_requested (cognitive 18) src-tauri/src/background_backup.rs:359 — dbx::background_backup::run_if_requested has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (8 pts), match/switch 2 (5 pts), boolean chains 4, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx::plugin_ui_protocol::media_response (cognitive 18) src-tauri/src/plugin_ui_protocol.rs:141 — dbx::plugin_ui_protocol::media_response has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
  • dbx::commands::mcp_bridge::handle_execute_query_data (cognitive 17) src-tauri/src/commands/mcp_bridge.rs:2367 — dbx::commands::mcp_bridge::handle_execute_query_data has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (10 pts), match/switch 4 (6 pts), loops 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.
  • dbx::commands::update::download_update_inner (cognitive 17) src-tauri/src/commands/update.rs:555 — dbx::commands::update::download_update_inner has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 2 (4 pts), loops 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx::commands::mcp_bridge::read_bridge_request (cognitive 16) src-tauri/src/commands/mcp_bridge.rs:326 — dbx::commands::mcp_bridge::read_bridge_request has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx::commands::fs_open::validate_database_backup_file (cognitive 16) src-tauri/src/commands/fs_open.rs:93 — dbx::commands::fs_open::validate_database_backup_file has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx::plugin_ui_protocol::serve_plugin_media (cognitive 16) src-tauri/src/plugin_ui_protocol.rs:76 — dbx::plugin_ui_protocol::serve_plugin_media has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), match/switch 3 (4 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · dbx_driver_agent · ×18
  • dbx_driver_agent::agent_service::download_with_progress (cognitive 78) crates/dbx-driver-agent/src/agent_service.rs:2027 — dbx_driver_agent::agent_service::download_with_progress has cognitive complexity 78 (threshold 15). Drivers by points: if/else 26 (53 pts), match/switch 5 (15 pts), loops 3 (6 pts), boolean chains 4 (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.
  • dbx_driver_agent::agent_service::import_offline_zip (cognitive 73) crates/dbx-driver-agent/src/agent_service.rs:3019 — dbx_driver_agent::agent_service::import_offline_zip has cognitive complexity 73 (threshold 15). Drivers by points: if/else 24 (53 pts), match/switch 6 (12 pts), loops 6, boolean chains 2 (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.
  • dbx_driver_agent::agent_offline_export::append_jre_tree_with_limits (cognitive 58) crates/dbx-driver-agent/src/agent_offline_export.rs:691 — dbx_driver_agent::agent_offline_export::append_jre_tree_with_limits has cognitive complexity 58 (threshold 15). Drivers by points: if/else 17 (45 pts), loops 3 (7 pts), boolean chains 6 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_agent::backend_error::consume_sensitive_value (cognitive 37) crates/dbx-driver-agent/src/backend_error.rs:924 — dbx_driver_agent::backend_error::consume_sensitive_value has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 4 (9 pts), boolean chains 3 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_agent::agent_service::open_agent_download_response (cognitive 34) crates/dbx-driver-agent/src/agent_service.rs:2269 — dbx_driver_agent::agent_service::open_agent_download_response has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 4 (13 pts), boolean chains 2, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_agent::agent_service::validate_offline_zip_preflight (cognitive 34) crates/dbx-driver-agent/src/agent_service.rs:3387 — dbx_driver_agent::agent_service::validate_offline_zip_preflight has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (30 pts), boolean chains 2, loops 2 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • dbx_driver_agent::agent_offline_export::validate_managed_jre_tree (cognitive 30) crates/dbx-driver-agent/src/agent_offline_export.rs:922 — dbx_driver_agent::agent_offline_export::validate_managed_jre_tree has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_agent::agent_service::is_macho_binary_for_cpu (cognitive 26) crates/dbx-driver-agent/src/agent_service.rs:4287 — dbx_driver_agent::agent_service::is_macho_binary_for_cpu has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (22 pts), match/switch 2, boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_agent::backend_error::next_sensitive_assignment (cognitive 25) crates/dbx-driver-agent/src/backend_error.rs:866 — dbx_driver_agent::backend_error::next_sensitive_assignment has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 4 (7 pts), boolean chains 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.
  • dbx_driver_agent::agent_service::collect_offline_entries (cognitive 25) crates/dbx-driver-agent/src/agent_service.rs:3274 — dbx_driver_agent::agent_service::collect_offline_entries has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_agent::agent_connection::agent_connect_params_with_role (cognitive 24) crates/dbx-driver-agent/src/agent_connection.rs:95 — dbx_driver_agent::agent_connection::agent_connect_params_with_role has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21, match/switch 1 (2 pts), boolean chains 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.
  • dbx_driver_agent::agent_service::install_agent_driver_from_registry (cognitive 20) crates/dbx-driver-agent/src/agent_service.rs:1697 — dbx_driver_agent::agent_service::install_agent_driver_from_registry has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • dbx_driver_agent::agent_service::upgrade_all_agent_drivers_with_registry (cognitive 18) crates/dbx-driver-agent/src/agent_service.rs:950 — dbx_driver_agent::agent_service::upgrade_all_agent_drivers_with_registry has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (14 pts), loops 2, match/switch 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
  • dbx_driver_agent::agent_offline_export::export_agents_offline_unlocked (cognitive 18) crates/dbx-driver-agent/src/agent_offline_export.rs:312 — dbx_driver_agent::agent_offline_export::export_agents_offline_unlocked has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 2 (4 pts), loops 3, 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.
  • dbx_driver_agent::agent_driver::parse_agent_java_opts (cognitive 17) crates/dbx-driver-agent/src/agent_driver.rs:3242 — dbx_driver_agent::agent_driver::parse_agent_java_opts has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_agent::backend_error::structured_entry (cognitive 16) crates/dbx-driver-agent/src/backend_error.rs:562 — dbx_driver_agent::backend_error::structured_entry has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), match/switch 3 (5 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • dbx_driver_agent::agent_service::open_download_response (cognitive 16) crates/dbx-driver-agent/src/agent_service.rs:702 — dbx_driver_agent::agent_service::open_download_response has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 4 (12 pts), if/else 2 (3 pts), loops 1 (nesting depth added 9). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • dbx_driver_agent::agent_offline_export::snapshot_driver_source (cognitive 16) crates/dbx-driver-agent/src/agent_offline_export.rs:574 — dbx_driver_agent::agent_offline_export::snapshot_driver_source has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 3, match/switch 2 (3 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · dbx_driver_mysql · ×18
  • dbx_driver_mysql::mysql::find_if_not_exists_clause (cognitive 51) crates/dbx-driver-mysql/src/mysql.rs:6714 — dbx_driver_mysql::mysql::find_if_not_exists_clause has cognitive complexity 51 (threshold 15). Drivers by points: if/else 13 (27 pts), loops 5 (13 pts), boolean chains 11 (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.
  • dbx_driver_mysql::mysql::execute_result_sets_with_text_protocol_on_conn (cognitive 50) crates/dbx-driver-mysql/src/mysql.rs:5549 — dbx_driver_mysql::mysql::execute_result_sets_with_text_protocol_on_conn has cognitive complexity 50 (threshold 15). Drivers by points: if/else 20 (43 pts), loops 3 (5 pts), boolean chains 2 (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.
  • dbx_driver_mysql::mysql::mysql_async_url (cognitive 33) crates/dbx-driver-mysql/src/mysql.rs:2901 — dbx_driver_mysql::mysql::mysql_async_url has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (24 pts), match/switch 2 (5 pts), boolean chains 3, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_mysql::mysql::list_objects (cognitive 30) crates/dbx-driver-mysql/src/mysql.rs:4304 — dbx_driver_mysql::mysql::list_objects has cognitive complexity 30 (threshold 15). Drivers by points: match/switch 7 (17 pts), if/else 9 (12 pts), boolean chains 1 (nesting depth added 13). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • dbx_driver_mysql::mysql::completion_assistant_search (cognitive 29) crates/dbx-driver-mysql/src/mysql.rs:3363 — dbx_driver_mysql::mysql::completion_assistant_search has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 4 (9 pts), boolean chains 4 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_mysql::mysql::execute_non_result_batch_on_conn (cognitive 29) crates/dbx-driver-mysql/src/mysql.rs:6533 — dbx_driver_mysql::mysql::execute_non_result_batch_on_conn has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (21 pts), match/switch 2 (4 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_mysql::mysql::ssl_fallback_url (cognitive 26) crates/dbx-driver-mysql/src/mysql.rs:2661 — dbx_driver_mysql::mysql::ssl_fallback_url has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 4, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_mysql::mysql::parse_mysql_enum_values (cognitive 25) crates/dbx-driver-mysql/src/mysql.rs:4787 — dbx_driver_mysql::mysql::parse_mysql_enum_values has cognitive complexity 25 (threshold 15). Drivers by points: match/switch 4 (11 pts), loops 4 (7 pts), if/else 3 (6 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_mysql::mysql::skip_sql_whitespace_and_comments (cognitive 25) crates/dbx-driver-mysql/src/mysql.rs:6879 — dbx_driver_mysql::mysql::skip_sql_whitespace_and_comments has cognitive complexity 25 (threshold 15). Drivers by points: loops 5 (12 pts), boolean chains 7, if/else 3 (6 pts) (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • dbx_driver_mysql::mysql::resolve_doris_opaque_column_types (cognitive 21) crates/dbx-driver-mysql/src/mysql.rs:468 — dbx_driver_mysql::mysql::resolve_doris_opaque_column_types has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (6 pts), match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_mysql::mysql::mysql_column_type_name (cognitive 21) crates/dbx-driver-mysql/src/mysql.rs:861 — dbx_driver_mysql::mysql::mysql_column_type_name has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (20 pts), match/switch 1 (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • dbx_driver_mysql::mysql::split_mysql_session_variables (cognitive 19) crates/dbx-driver-mysql/src/mysql.rs:2455 — dbx_driver_mysql::mysql::split_mysql_session_variables has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_mysql::mysql::mysql_connection_time_zone (cognitive 18) crates/dbx-driver-mysql/src/mysql.rs:2520 — dbx_driver_mysql::mysql::mysql_connection_time_zone has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3, 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.
  • dbx_driver_mysql::mysql::execute_result_set_with_text_protocol_on_conn (cognitive 18) crates/dbx-driver-mysql/src/mysql.rs:5364 — dbx_driver_mysql::mysql::execute_result_set_with_text_protocol_on_conn has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_mysql::mysql::execute_query_on_conn_with_limits_progress_resolved (cognitive 18) crates/dbx-driver-mysql/src/mysql.rs:6334 — dbx_driver_mysql::mysql::execute_query_on_conn_with_limits_progress_resolved has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 3 (10 pts), if/else 4 (5 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • dbx_driver_mysql::mysql_compatible::indexes_from_create_table_ddl (cognitive 16) crates/dbx-driver-mysql/src/mysql_compatible.rs:281 — dbx_driver_mysql::mysql_compatible::indexes_from_create_table_ddl has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_mysql::mysql::verify_pool_connection_with_setup_fallback (cognitive 16) crates/dbx-driver-mysql/src/mysql.rs:1679 — dbx_driver_mysql::mysql::verify_pool_connection_with_setup_fallback has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), match/switch 4 (6 pts), boolean chains 1, loops 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.
  • dbx_driver_mysql::mysql::mysql_tls_url (cognitive 16) crates/dbx-driver-mysql/src/mysql.rs:2098 — dbx_driver_mysql::mysql::mysql_tls_url has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×18
  • Duplicated block (17 lines × 2) crates/dbx-core/src/admin/consul/blocking.rs:121 — crates/dbx-core/src/admin/consul/blocking.rs:121-137 | crates/dbx-core/src/admin/consul/blocking.rs:176-192 — both copies are in the same file, so extract the 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) crates/dbx-core/src/admin/mq/adapters/kafka.rs:247 — crates/dbx-core/src/admin/mq/adapters/kafka.rs:247-263 | crates/dbx-core/src/admin/mq/adapters/rocketmq.rs:293-309 — before extracting anything, compare `crates/dbx-core/src/admin/mq/adapters/kafka.rs` and `crates/dbx-core/src/admin/mq/adapters/rocketmq.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 186 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (17 lines × 2) crates/dbx-core/src/admin/mq/adapters/kafka.rs:467 — crates/dbx-core/src/admin/mq/adapters/kafka.rs:467-483 | crates/dbx-core/src/admin/mq/adapters/rocketmq.rs:603-619 — before extracting anything, compare `crates/dbx-core/src/admin/mq/adapters/kafka.rs` and `crates/dbx-core/src/admin/mq/adapters/rocketmq.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 186 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (17 lines × 2) crates/dbx-core/src/admin/mq/adapters/kafka.rs:723 — crates/dbx-core/src/admin/mq/adapters/kafka.rs:723-739 | crates/dbx-core/src/admin/mq/adapters/rocketmq.rs:911-927 — before extracting anything, compare `crates/dbx-core/src/admin/mq/adapters/kafka.rs` and `crates/dbx-core/src/admin/mq/adapters/rocketmq.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 186 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (17 lines × 2) crates/dbx-core/src/data/mongodb_import_export.rs:1870 — crates/dbx-core/src/data/mongodb_import_export.rs:1870-1886 | crates/dbx-core/src/data/mongodb_import_export.rs:1945-1961 — both copies are in the same file, so extract the 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) crates/dbx-driver-mongodb/src/mongo_oidc.rs:207 — crates/dbx-driver-mongodb/src/mongo_oidc.rs:207-223 | crates/dbx-drivers/src/salesforce_oauth.rs:284-300 — before extracting anything, compare `crates/dbx-driver-mongodb/src/mongo_oidc.rs` and `crates/dbx-drivers/src/salesforce_oauth.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 87 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (17 lines × 2) crates/dbx-web/src/routes/mongodb_import_export.rs:158 — crates/dbx-web/src/routes/mongodb_import_export.rs:158-174 | crates/dbx-web/src/routes/table_import.rs:158-174 — before extracting anything, compare `crates/dbx-web/src/routes/mongodb_import_export.rs` and `crates/dbx-web/src/routes/table_import.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 151 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (17 lines × 2) REDACTED:1551 — REDACTED:1551-1567 | agents/drivers/oscar/src/main/java/com/dbx/agent/oscar/OscarAgent.java:139-155 — 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 (17 lines × 2) agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:1081 — agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:1081-1097 | agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:1267-1283 — both copies are in the same file, so extract the 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 `agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:1081` 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 (17 lines × 2) REDACTED:993 — REDACTED:993-1009 | REDACTED:1027-1043 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:993` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (17 lines × 2) agents/drivers/argo-go/config.go:456 — agents/drivers/argo-go/config.go:456-472 | agents/drivers/hive-go/config.go:462-478 — `agents/drivers/argo-go/config.go` and `agents/drivers/hive-go/config.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 1107 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (17 lines × 2) agents/drivers/argo-go/metadata.go:1009 — agents/drivers/argo-go/metadata.go:1009-1025 | agents/drivers/hive-go/metadata.go:1020-1036 — `agents/drivers/argo-go/metadata.go` and `agents/drivers/hive-go/metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 946 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (17 lines × 2) agents/drivers/etcd-go/kv.go:533 — agents/drivers/etcd-go/kv.go:533-549 | agents/drivers/etcd2-go/kv.go:444-460 — `agents/drivers/etcd-go/kv.go` and `agents/drivers/etcd2-go/kv.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 11 separate duplicated blocks between them, totalling at least 134 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (17 lines × 2) REDACTED:1008 — REDACTED:1008-1024 | agents/drivers/vastbase-go/vastbase_metadata.go:867-883 — `REDACTED` and `agents/drivers/vastbase-go/vastbase_metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 71 separate duplicated blocks between them, totalling at least 1426 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (17 lines × 2) REDACTED:1060 — REDACTED:1060-1076 | agents/drivers/vastbase-go/vastbase_metadata.go:919-935 — `REDACTED` and `agents/drivers/vastbase-go/vastbase_metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 71 separate duplicated blocks between them, totalling at least 1426 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1060` 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 (17 lines × 2) REDACTED:1829 — REDACTED:1829-1845 | REDACTED:2734-2750 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (17 lines × 2) agents/go-common/iotdb-client-go/client/session.go:726 — agents/go-common/iotdb-client-go/client/session.go:726-742 | agents/go-common/iotdb-client-go/client/session.go:746-762 — both copies are in the same file, so extract the 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 `agents/go-common/iotdb-client-go/client/session.go:726` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17 lines × 2) REDACTED:113 — REDACTED:113-129 | REDACTED:113-129 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 397 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×18
  • Duplicated block (6 lines × 3) crates/dbx-core/src/data/docs/dbml.rs:238 — crates/dbx-core/src/data/docs/dbml.rs:238-244 | crates/dbx-core/src/data/docs/dbml.rs:286-291 | crates/dbx-core/src/data/docs/dbml.rs:307-313 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (6 lines × 3) REDACTED:1433 — REDACTED:1433-1438 | REDACTED:1717-1722 | REDACTED:1922-1927 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (6 lines × 3) REDACTED:6733 — REDACTED:6733-6738 | REDACTED:6794-6799 | REDACTED:6817-6822 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (6 lines × 3) REDACTED:724 — REDACTED:724-729 | REDACTED:761-766 | REDACTED:822-827 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (6 lines × 3) crates/dbx-core/src/schema/mod.rs:1173 — crates/dbx-core/src/schema/mod.rs:1173-1178 | crates/dbx-core/src/schema/mod.rs:8306-8311 | crates/dbx-core/src/schema/mod.rs:8411-8416 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (6 lines × 3) crates/dbx-core/src/query/redis_ops.rs:16 — crates/dbx-core/src/query/redis_ops.rs:16-21 | crates/dbx-core/src/query/redis_ops.rs:56-61 | crates/dbx-core/src/query/redis_ops.rs:86-91 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (6 lines × 3) crates/dbx-driver-mongodb/src/mongo_shell.rs:494 — crates/dbx-driver-mongodb/src/mongo_shell.rs:494-499 | crates/dbx-web/src/routes/mcp_policy.rs:176-181 | src-tauri/src/commands/mcp_bridge.rs:1402-1407 — before extracting anything, compare `crates/dbx-driver-mongodb/src/mongo_shell.rs` and `crates/dbx-web/src/routes/mcp_policy.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 145 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 3) crates/dbx-sql-data/src/query_result_sql.rs:1330 — crates/dbx-sql-data/src/query_result_sql.rs:1330-1335 | crates/dbx-sql-data/src/query_result_sql.rs:1430-1435 | crates/dbx-sql-data/src/query_result_sql.rs:1570-1575 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (6 lines × 3) crates/dbx-sql-schema/src/schema_diff.rs:6184 — crates/dbx-sql-schema/src/schema_diff.rs:6184-6189 | crates/dbx-sql-schema/src/schema_diff.rs:6231-6236 | crates/dbx-sql-schema/src/schema_diff.rs:6258-6263 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (6 lines × 3) crates/dbx-web/src/routes/database_export.rs:168 — crates/dbx-web/src/routes/database_export.rs:168-173 | crates/dbx-web/src/routes/query_result_export.rs:154-159 | crates/dbx-web/src/routes/table_export.rs:139-144 — before extracting anything, compare `crates/dbx-web/src/routes/query_result_export.rs` and `crates/dbx-web/src/routes/table_export.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 3) crates/dbx-ai-provider/src/ai_claude_code_cli.rs:77 — crates/dbx-ai-provider/src/ai_claude_code_cli.rs:77-82 | crates/dbx-ai-provider/src/ai_codebuddy_cli.rs:154-159 | crates/dbx-ai-provider/src/ai_grok_cli.rs:124-129 — before extracting anything, compare `crates/dbx-ai-provider/src/ai_claude_code_cli.rs` and `crates/dbx-ai-provider/src/ai_codebuddy_cli.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 3) crates/dbx-ai-provider/src/ai_codex_cli.rs:434 — crates/dbx-ai-provider/src/ai_codex_cli.rs:434-439 | crates/dbx-ai-provider/src/ai_pi_agent_cli.rs:411-416 | src-tauri/src/commands/mcp.rs:1592-1597 — before extracting anything, compare `crates/dbx-ai-provider/src/ai_codex_cli.rs` and `crates/dbx-ai-provider/src/ai_pi_agent_cli.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 3) crates/dbx-driver-mongodb/src/mongo_shell.rs:348 — crates/dbx-driver-mongodb/src/mongo_shell.rs:348-353 | crates/dbx-web/src/routes/mcp_policy.rs:30-35 | src-tauri/src/commands/mcp_bridge.rs:1256-1261 — before extracting anything, compare `crates/dbx-driver-mongodb/src/mongo_shell.rs` and `crates/dbx-web/src/routes/mcp_policy.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 145 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 3) crates/dbx-core/src/admin/consul/client.rs:42 — crates/dbx-core/src/admin/consul/client.rs:42-47 | crates/dbx-core/src/ai/agent_kv.rs:1243-1248 | crates/dbx-mcp/src/backend.rs:548-553 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (6 lines × 3) crates/dbx-driver-mongodb/src/mongo_driver.rs:2372 — crates/dbx-driver-mongodb/src/mongo_driver.rs:2372-2377 | crates/dbx-driver-mongodb/src/mongo_driver.rs:2592-2597 | crates/dbx-driver-mongodb/src/mongo_driver.rs:2690-2695 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (6 lines × 3) agents/drivers/ignite/src/main/java/com/dbx/agent/ignite/IgniteAgent.java:130 — agents/drivers/ignite/src/main/java/com/dbx/agent/ignite/IgniteAgent.java:130-135 | REDACTED:2464-2469 | REDACTED:3966-3971 — 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 `agents/drivers/ignite/src/main/java/com/dbx/agent/ignite/IgniteAgent.java:130` 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 (6 lines × 3) agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:307 — agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:307-312 | agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:337-342 | agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:366-371 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:307` 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 (6 lines × 3) agents/go-common/iotdb-client-go/client/session.go:616 — agents/go-common/iotdb-client-go/client/session.go:616-621 | agents/go-common/iotdb-client-go/client/session.go:650-655 | agents/go-common/iotdb-client-go/client/session.go:682-687 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `agents/go-common/iotdb-client-go/client/session.go:616` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D2 · Cognitive Complexity · dbx_driver_postgres · ×17
  • dbx_driver_postgres::postgres::completion_assistant_search_inner (cognitive 56) REDACTED:3564 — dbx_driver_postgres::postgres::completion_assistant_search_inner has cognitive complexity 56 (threshold 15). Drivers by points: if/else 21 (33 pts), loops 6 (13 pts), boolean chains 5, match/switch 2 (5 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_postgres::postgres::pg_ndim_array_element_json (cognitive 43) REDACTED:394 — dbx_driver_postgres::postgres::pg_ndim_array_element_json has cognitive complexity 43 (threshold 15). Drivers by points: if/else 28 (42 pts), match/switch 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.
  • dbx_driver_postgres::postgres::classify_pg_type (cognitive 30) REDACTED:988 — dbx_driver_postgres::postgres::classify_pg_type has cognitive complexity 30 (threshold 15). Drivers by points: if/else 24 (25 pts), boolean chains 5 (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.
  • dbx_driver_postgres::postgres::build_custom_type_ddl (cognitive 27) REDACTED:7121 — dbx_driver_postgres::postgres::build_custom_type_ddl has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (21 pts), match/switch 2 (3 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_postgres::postgres::postgres_connection_url (cognitive 26) REDACTED:2996 — dbx_driver_postgres::postgres::postgres_connection_url has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (18 pts), match/switch 2 (6 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_postgres::postgres::list_sequences (cognitive 26) REDACTED:9706 — dbx_driver_postgres::postgres::list_sequences has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 2 (6 pts), match/switch 2 (3 pts) (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • dbx_driver_postgres::postgres::pg_temporal_array_text_to_json (cognitive 24) REDACTED:1230 — dbx_driver_postgres::postgres::pg_temporal_array_text_to_json has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 5 (7 pts), match/switch 3 (5 pts) (nesting depth added 8). Most of this is not in the body itself: 4 of the 24 points are its own statements and the rest belongs to 4 function items inside it that branch (parse_array, parse_quoted, skip_whitespace, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • dbx_driver_postgres::postgres::execute_select_text (cognitive 24) REDACTED:2002 — dbx_driver_postgres::postgres::execute_select_text has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (14 pts), match/switch 2 (6 pts), loops 2 (4 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_postgres::postgres::cancel_postgres_query (cognitive 24) REDACTED:8884 — dbx_driver_postgres::postgres::cancel_postgres_query has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 4 (10 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_postgres::postgres::decode_pg_numeric_bytes (cognitive 18) REDACTED:192 — dbx_driver_postgres::postgres::decode_pg_numeric_bytes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (12 pts), loops 2 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • dbx_driver_postgres::postgres::pg_array_to_json_value (cognitive 18) REDACTED:822 — dbx_driver_postgres::postgres::pg_array_to_json_value has cognitive complexity 18 (threshold 15). Drivers by points: if/else 18. 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.
  • dbx_driver_postgres::postgres::list_indexes_for_relations_with_sql (cognitive 18) REDACTED:4809 — dbx_driver_postgres::postgres::list_indexes_for_relations_with_sql has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_postgres::postgres::custom_type_domain_attributes (cognitive 18) REDACTED:6954 — dbx_driver_postgres::postgres::custom_type_domain_attributes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), match/switch 3 (7 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_postgres::postgres::decode_tsvector_bytes (cognitive 16) REDACTED:1424 — dbx_driver_postgres::postgres::decode_tsvector_bytes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), loops 3 (5 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_postgres::postgres::stream_select_query_text (cognitive 16) REDACTED:2231 — dbx_driver_postgres::postgres::stream_select_query_text has cognitive complexity 16 (threshold 15). Drivers by points: if/else 2 (6 pts), match/switch 2 (6 pts), loops 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_postgres::postgres::list_opengauss_constraints (cognitive 16) REDACTED:5314 — dbx_driver_postgres::postgres::list_opengauss_constraints has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_postgres::postgres::list_opengauss_foreign_keys (cognitive 16) REDACTED:9327 — dbx_driver_postgres::postgres::list_opengauss_foreign_keys has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D29 · Static Analysis (SAST) · REDACTED · ×17
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×17
  • Duplicated block (9 lines × 3) crates/dbx-core/src/connection/jdbc.rs:1131 — crates/dbx-core/src/connection/jdbc.rs:1131-1139 | crates/dbx-plugin-runtime/src/plugins/installer.rs:1250-1258 | plugins/sdk/packager/src/main.rs:625-633 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (9 lines × 3) REDACTED:2668 — REDACTED:2668-2676 | src-tauri/src/commands/connection.rs:1555-1565 | src-tauri/src/commands/connection.rs:2038-2046 — before extracting anything, compare `REDACTED` and `src-tauri/src/commands/connection.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 247 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 3) REDACTED:1015 — REDACTED:1015-1023 | crates/dbx-sql-core/src/sqlserver_temporal.rs:143-151 | REDACTED:3109-3117 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 3) REDACTED:3666 — REDACTED:3666-3674 | REDACTED:3755-3763 | REDACTED:3863-3871 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (9 lines × 3) crates/dbx-core/src/schema/state_calibrator.rs:473 — crates/dbx-core/src/schema/state_calibrator.rs:473-481 | crates/dbx-core/src/schema/state_calibrator.rs:496-504 | crates/dbx-core/src/schema/state_calibrator.rs:507-515 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (9 lines × 3) crates/dbx-driver-elasticsearch/src/lib.rs:522 — crates/dbx-driver-elasticsearch/src/lib.rs:522-530 | crates/dbx-drivers/src/db/solr_driver.rs:158-166 | crates/dbx-drivers/src/db/vector_driver.rs:997-1005 — before extracting anything, compare `crates/dbx-driver-elasticsearch/src/lib.rs` and `crates/dbx-drivers/src/db/solr_driver.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 3) crates/dbx-driver-mysql/src/mysql.rs:2136 — crates/dbx-driver-mysql/src/mysql.rs:2136-2144 | crates/dbx-driver-mysql/src/mysql.rs:2711-2719 | REDACTED:3082-3090 — before extracting anything, compare `crates/dbx-driver-mysql/src/mysql.rs` and `REDACTED` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 3) REDACTED:126 — REDACTED:126-134 | crates/dbx-drivers/src/db/rqlite_driver.rs:117-125 | crates/dbx-drivers/src/db/turso_driver.rs:159-167 — before extracting anything, compare `REDACTED` and `crates/dbx-drivers/src/db/rqlite_driver.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 3) crates/dbx-drivers/src/salesforce_oauth.rs:459 — crates/dbx-drivers/src/salesforce_oauth.rs:459-469 | crates/dbx-drivers/src/salesforce_oauth.rs:555-563 | crates/dbx-drivers/src/salesforce_oauth.rs:618-628 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (9 lines × 3) REDACTED:2312 — REDACTED:2312-2320 | REDACTED:4021-4029 | REDACTED:4188-4196 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (9 lines × 3) agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java:37 — agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java:37-45 | agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:46-54 | agents/drivers/trino/src/main/java/com/dbx/agent/trino/TrinoAgent.java:44-52 — before extracting anything, compare `agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java` and `agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java:37` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 × 3) REDACTED:92 — REDACTED:92-100 | agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:191-199 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:76-84 — 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 `REDACTED:92` 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 (9 lines × 3) agents/drivers/databend/src/main/java/com/dbx/agent/databend/DatabendAgent.java:142 — agents/drivers/databend/src/main/java/com/dbx/agent/databend/DatabendAgent.java:142-150 | REDACTED:329-337 | agents/drivers/oceanbase-oracle/src/main/java/com/dbx/agent/oceanbaseoracle/OceanBaseOracleAgent.java:875-883 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `stmt` to `PreparedStatement` in one and `java.sql.PreparedStatement` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9 lines × 3) agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java:191 — agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java:191-199 | agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:359-367 | agents/drivers/trino/src/main/java/com/dbx/agent/trino/TrinoAgent.java:324-332 — before extracting anything, compare `agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java` and `agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 3) agents/drivers/argo-go/main.go:146 — agents/drivers/argo-go/main.go:146-154 | agents/drivers/hive-go/main.go:146-154 | agents/drivers/iotdb/main.go:150-158 — `agents/drivers/argo-go/main.go` and `agents/drivers/hive-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 43 separate duplicated blocks between them, totalling at least 699 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/main.go:146` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 × 3) agents/drivers/rocketmq/acl.go:32 — agents/drivers/rocketmq/acl.go:32-40 | agents/drivers/rocketmq/acl.go:95-103 | agents/drivers/rocketmq/acl.go:148-156 — 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (9 lines × 3) REDACTED:652 — REDACTED:652-660 | agents/drivers/cassandra-go/bench/agent_compare.py:325-333 | REDACTED:652-660 — before extracting anything, compare `REDACTED` and `agents/drivers/cassandra-go/bench/agent_compare.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×17
  • Duplicated block (8 lines × 3) agents/drivers/duckdb/src/sql.rs:396 — agents/drivers/duckdb/src/sql.rs:396-403 | crates/dbx-driver-mysql/src/mysql.rs:6894-6902 | crates/dbx-driver-sqlserver/src/sqlserver.rs:3963-3971 — 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 (8 lines × 3) crates/dbx-core/src/admin/nacos/access_control.rs:161 — crates/dbx-core/src/admin/nacos/access_control.rs:161-168 | crates/dbx-core/src/admin/nacos/access_control.rs:184-192 | crates/dbx-core/src/admin/nacos/access_control.rs:208-216 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 3) REDACTED:5806 — REDACTED:5806-5813 | REDACTED:5836-5843 | REDACTED:5864-5871 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 3) REDACTED:936 — REDACTED:936-943 | REDACTED:3216-3223 | REDACTED:2833-2840 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 3) crates/dbx-driver-mongodb/src/mongo_shell.rs:399 — crates/dbx-driver-mongodb/src/mongo_shell.rs:399-406 | crates/dbx-web/src/routes/mcp_policy.rs:81-88 | src-tauri/src/commands/mcp_bridge.rs:1307-1314 — before extracting anything, compare `crates/dbx-driver-mongodb/src/mongo_shell.rs` and `crates/dbx-web/src/routes/mcp_policy.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 145 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 3) crates/dbx-sql-schema/src/table_structure_sql/column_alter.rs:547 — crates/dbx-sql-schema/src/table_structure_sql/column_alter.rs:547-554 | crates/dbx-sql-schema/src/table_structure_sql/column_alter.rs:663-670 | crates/dbx-sql-schema/src/table_structure_sql/column_alter.rs:933-940 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 3) crates/dbx-core/src/connection/connection_secrets.rs:882 — crates/dbx-core/src/connection/connection_secrets.rs:882-889 | crates/dbx-core/src/persistence/cloud_sync.rs:2782-2789 | REDACTED:3015-3022 — before extracting anything, compare `crates/dbx-core/src/connection/connection_secrets.rs` and `REDACTED` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 3) crates/dbx-plugin-runtime/src/plugins/assets.rs:114 — crates/dbx-plugin-runtime/src/plugins/assets.rs:114-121 | crates/dbx-plugin-runtime/src/plugins/installer.rs:1266-1273 | plugins/sdk/packager/src/main.rs:637-644 — 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 (8 lines × 3) crates/dbx-sql-schema/src/table_structure_sql/comments.rs:97 — crates/dbx-sql-schema/src/table_structure_sql/comments.rs:97-104 | crates/dbx-sql-schema/src/table_structure_sql/comments.rs:135-142 | crates/dbx-sql-schema/src/table_structure_sql/comments.rs:183-190 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 3) agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:71 — agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:71-78 | agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:141-148 | agents/drivers/trino/src/main/java/com/dbx/agent/trino/TrinoAgent.java:72-79 — before extracting anything, compare `agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java` and `agents/drivers/trino/src/main/java/com/dbx/agent/trino/TrinoAgent.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 144 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:71` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:137` calls `listTables`, `add`, `ObjectInfo` and `agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:70` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 3) agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:811 — agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:811-818 | agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:880-887 | agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:1375-1382 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:811` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:819` calls `put`, `partitions`, `size` and `agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:1383` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 3) agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:473 — agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:473-480 | REDACTED:1937-1944 | agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:417-424 — 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 `agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:473` 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 × 3) agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:187 — agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:187-194 | agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:213-221 | agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:227-235 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:187` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:186` calls `catalogBuiltinFunction`, `catalogRelation` and `agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:213` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 3) agents/drivers/argo-go/main.go:441 — agents/drivers/argo-go/main.go:441-448 | agents/drivers/cassandra-go/main.go:370-377 | agents/drivers/hive-go/main.go:441-448 — `agents/drivers/argo-go/main.go` and `agents/drivers/cassandra-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 276 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/main.go:441` 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 (8 lines × 3) REDACTED:2810 — REDACTED:2810-2817 | agents/drivers/vastbase-go/vastbase_metadata.go:1940-1947 | agents/drivers/vastbase-go/vastbase_metadata.go:1976-1983 — `REDACTED` and `agents/drivers/vastbase-go/vastbase_metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 71 separate duplicated blocks between them, totalling at least 1426 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2810` 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 register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (8 lines × 3) agents/drivers/kingbase-go/main.go:744 — agents/drivers/kingbase-go/main.go:744-751 | agents/drivers/neo4j-go/main.go:515-522 | agents/drivers/vastbase-go/main.go:667-674 — `agents/drivers/kingbase-go/main.go` and `agents/drivers/neo4j-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 253 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (8 lines × 3) agents/drivers/kingbase-go/main.go:1665 — agents/drivers/kingbase-go/main.go:1665-1672 | agents/drivers/vastbase-go/bench/direct/main.go:162-169 | agents/drivers/vastbase-go/main.go:1343-1350 — `agents/drivers/kingbase-go/main.go` and `agents/drivers/vastbase-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 50 separate duplicated blocks between them, totalling at least 708 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×14
  • Duplicated block (21 lines × 2) REDACTED:8631 — REDACTED:8631-8651 | REDACTED:10105-10125 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (21 lines × 2) REDACTED:5261 — REDACTED:5261-5281 | REDACTED:5386-5406 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (21 lines × 2) agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:69 — agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:69-89 | agents/drivers/trino/src/main/java/com/dbx/agent/trino/TrinoAgent.java:70-90 — before extracting anything, compare `agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java` and `agents/drivers/trino/src/main/java/com/dbx/agent/trino/TrinoAgent.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 144 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (21 lines × 2) agents/drivers/mongodb/src/main/java/com/dbx/agent/mongodb/MongoAgent.java:556 — agents/drivers/mongodb/src/main/java/com/dbx/agent/mongodb/MongoAgent.java:556-576 | agents/drivers/mongodb/src/main/java/com/dbx/agent/mongodb/MongoAgent.java:888-908 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (21 lines × 2) agents/drivers/argo-go/config.go:352 — agents/drivers/argo-go/config.go:352-372 | agents/drivers/hive-go/config.go:358-378 — `agents/drivers/argo-go/config.go` and `agents/drivers/hive-go/config.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 1107 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/config.go:352` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 (21 lines × 2) agents/drivers/argo-go/metadata.go:485 — agents/drivers/argo-go/metadata.go:485-505 | agents/drivers/hive-go/metadata.go:496-516 — `agents/drivers/argo-go/metadata.go` and `agents/drivers/hive-go/metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 946 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (21 lines × 2) agents/drivers/argo-go/metadata.go:627 — agents/drivers/argo-go/metadata.go:627-647 | agents/drivers/hive-go/metadata.go:638-658 — `agents/drivers/argo-go/metadata.go` and `agents/drivers/hive-go/metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 946 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/metadata.go:627` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 (21 lines × 2) agents/drivers/argo-go/zookeeper_tls.go:207 — agents/drivers/argo-go/zookeeper_tls.go:207-227 | agents/drivers/hive-go/zookeeper_tls.go:207-227 — `agents/drivers/argo-go/zookeeper_tls.go` and `agents/drivers/hive-go/zookeeper_tls.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 223 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (21 lines × 2) REDACTED:887 — REDACTED:887-907 | agents/drivers/vastbase-go/vastbase_metadata.go:746-766 — `REDACTED` and `agents/drivers/vastbase-go/vastbase_metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 71 separate duplicated blocks between them, totalling at least 1426 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (21 lines × 2) REDACTED:2806 — REDACTED:2806-2826 | agents/drivers/vastbase-go/vastbase_metadata.go:1936-1956 — `REDACTED` and `agents/drivers/vastbase-go/vastbase_metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 71 separate duplicated blocks between them, totalling at least 1426 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2806` 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 register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (21 lines × 2) agents/drivers/kingbase-go/main.go:911 — agents/drivers/kingbase-go/main.go:911-931 | REDACTED:4012-4032 — 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 (21 lines × 2) REDACTED:345 — REDACTED:345-365 | REDACTED:380-400 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:345` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 (21 lines × 2) agents/go-common/iotdb-client-go/client/session.go:792 — agents/go-common/iotdb-client-go/client/session.go:792-812 | agents/go-common/iotdb-client-go/client/session.go:838-858 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (21 lines × 2) agents/drivers/argo-go/bench/functional_probe.py:12 — agents/drivers/argo-go/bench/functional_probe.py:12-32 | agents/drivers/hive-go/bench/functional_probe.py:12-32 — before extracting anything, compare `agents/drivers/argo-go/bench/functional_probe.py` and `agents/drivers/hive-go/bench/functional_probe.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 155 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D2 · Cognitive Complexity · dbx_driver_mongodb · ×13
  • dbx_driver_mongodb::mongo_shell::parse (cognitive 195) crates/dbx-driver-mongodb/src/mongo_shell.rs:549 — dbx_driver_mongodb::mongo_shell::parse has cognitive complexity 195 (threshold 15). Drivers by points: if/else 83 (151 pts), boolean chains 29, loops 8 (10 pts), match/switch 2 (5 pts) (nesting depth added 73). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_mongodb::mongo_driver::json_filter_value_to_bson (cognitive 54) crates/dbx-driver-mongodb/src/mongo_driver.rs:3243 — dbx_driver_mongodb::mongo_driver::json_filter_value_to_bson has cognitive complexity 54 (threshold 15). Drivers by points: if/else 16 (45 pts), match/switch 2 (5 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_mongodb::mongo_shell::trim_mongo_outer_comments (cognitive 42) crates/dbx-driver-mongodb/src/mongo_shell.rs:982 — dbx_driver_mongodb::mongo_shell::trim_mongo_outer_comments has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (32 pts), boolean chains 8, loops 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_mongodb::mongo_driver::bulk_write (cognitive 38) crates/dbx-driver-mongodb/src/mongo_driver.rs:2238 — dbx_driver_mongodb::mongo_driver::bulk_write has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (34 pts), match/switch 2 (3 pts), loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_mongodb::mongo_shell::is_shell_regex_value_position (cognitive 28) crates/dbx-driver-mongodb/src/mongo_shell.rs:1332 — dbx_driver_mongodb::mongo_shell::is_shell_regex_value_position has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_mongodb::mongo_shell::read_shell_regex_literal (cognitive 22) crates/dbx-driver-mongodb/src/mongo_shell.rs:1213 — dbx_driver_mongodb::mongo_shell::read_shell_regex_literal has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (17 pts), 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.
  • dbx_driver_mongodb::mongo_shell::matching_paren (cognitive 22) crates/dbx-driver-mongodb/src/mongo_shell.rs:1707 — dbx_driver_mongodb::mongo_shell::matching_paren has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_mongodb::mongo_shell::split_top_level (cognitive 22) crates/dbx-driver-mongodb/src/mongo_shell.rs:1785 — dbx_driver_mongodb::mongo_shell::split_top_level has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 3, 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.
  • dbx_driver_mongodb::mongo_oidc::wait_for_callback (cognitive 21) crates/dbx-driver-mongodb/src/mongo_oidc.rs:232 — dbx_driver_mongodb::mongo_oidc::wait_for_callback has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 2 (5 pts), loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_mongodb::mongo_shell::parse_bulk_write_operation (cognitive 20) crates/dbx-driver-mongodb/src/mongo_shell.rs:228 — dbx_driver_mongodb::mongo_shell::parse_bulk_write_operation has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 7 (9 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_mongodb::mongo_shell::transform_shell_regex_literals (cognitive 19) crates/dbx-driver-mongodb/src/mongo_shell.rs:1272 — dbx_driver_mongodb::mongo_shell::transform_shell_regex_literals has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_mongodb::mongo_shell::matching_bracket (cognitive 17) crates/dbx-driver-mongodb/src/mongo_shell.rs:1749 — dbx_driver_mongodb::mongo_shell::matching_bracket has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_mongodb::mongo_shell::transform_shell_constructors (cognitive 16) crates/dbx-driver-mongodb/src/mongo_shell.rs:1407 — dbx_driver_mongodb::mongo_shell::transform_shell_constructors has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D3 · God Classes · TooManyFields · ×13
  • TooManyFields: KvPrometheusMetrics crates/dbx-core/src/ai/agent_kv.rs:369 — TooManyFields — 89 stored fields. The bar is 30 stored fields; this is 59 over it, 2.97× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: ConnectionConfig crates/dbx-types/src/models/connection.rs:97 — TooManyFields — 63 stored fields beside 37 methods. The bar is 30 stored fields; this is 33 over it, 2.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: ConnectionConfigData crates/dbx-types/src/models/connection.rs:557 — TooManyFields — 63 stored fields. The bar is 30 stored fields; this is 33 over it, 2.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: DdlDialectProfile crates/dbx-sql-dialect/src/sql_dialect/ddl_profile.rs:100 — TooManyFields — 48 stored fields beside 6 methods. The bar is 30 stored fields; this is 18 over it, 1.60× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: connectionConfig agents/drivers/hive-go/config.go:102 — TooManyFields — 40 stored fields beside 1 method. The bar is 30 stored fields; this is 10 over it, 1.33× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: connectionConfig agents/drivers/argo-go/config.go:99 — TooManyFields — 40 stored fields. The bar is 30 stored fields; this is 10 over it, 1.33× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: cassandraConfig agents/drivers/cassandra-go/config.go:15 — TooManyFields — 36 stored fields beside 2 methods. The bar is 30 stored fields; this is 6 over it, 1.20× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: Config REDACTED:17 — TooManyFields — 35 stored fields. The bar is 30 stored fields; this is 5 over it, 1.17× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: connectConfiguration REDACTED:241 — TooManyFields — 35 stored fields. The bar is 30 stored fields; this is 5 over it, 1.17× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: SchemaDiffPreparationOptions crates/dbx-sql-schema/src/schema_diff.rs:418 — TooManyFields — 34 stored fields beside 10 methods. The bar is 30 stored fields; this is 4 over it, 1.13× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: QueryResultExportRequest REDACTED:70 — TooManyFields — 34 stored fields. The bar is 30 stored fields; this is 4 over it, 1.13× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: DdlCapabilitiesYaml REDACTED:86 — TooManyFields — 33 stored fields beside 1 method. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: AiConfig crates/dbx-ai-provider/src/ai.rs:401 — TooManyFields — 33 stored fields. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
D1 · Cyclomatic Complexity · dbx_sql_data · ×12
  • dbx_sql_data::data_grid_sql::format_grid_sql_literal_with_identifier_quote (cyclomatic 49) REDACTED:2484 — dbx_sql_data::data_grid_sql::format_grid_sql_literal_with_identifier_quote has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • dbx_sql_data::query_result_sql::build_query_pagination_execution_plan (cyclomatic 29) crates/dbx-sql-data/src/query_result_sql.rs:124 — dbx_sql_data::query_result_sql::build_query_pagination_execution_plan 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.
  • dbx_sql_data::data_grid_sql::build_data_grid_save_statements (cyclomatic 27) REDACTED:1583 — dbx_sql_data::data_grid_sql::build_data_grid_save_statements 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.
  • dbx_sql_data::query_result_sql::top_level_sql_tokens (cyclomatic 24) crates/dbx-sql-data/src/query_result_sql.rs:2270 — dbx_sql_data::query_result_sql::top_level_sql_tokens 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.
  • dbx_sql_data::data_grid_salesforce_sql::build_salesforce_data_grid_save_statements (cyclomatic 23) crates/dbx-sql-data/src/data_grid_salesforce_sql.rs:15 — dbx_sql_data::data_grid_salesforce_sql::build_salesforce_data_grid_save_statements 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.
  • dbx_sql_data::data_grid_sql::build_data_grid_rollback_statements (cyclomatic 23) REDACTED:1786 — dbx_sql_data::data_grid_sql::build_data_grid_rollback_statements 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.
  • dbx_sql_data::data_grid_sql::validate_data_grid_save (cyclomatic 21) REDACTED:1241 — dbx_sql_data::data_grid_sql::validate_data_grid_save 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. This is NOT this file's highest cyclomatic complexity: dbx_sql_data::data_grid_sql::build_data_grid_context_filter_condition (cyclomatic 23) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • dbx_sql_data::query_result_sql::iotdb_tree_count_sql (cyclomatic 21) crates/dbx-sql-data/src/query_result_sql.rs:1318 — dbx_sql_data::query_result_sql::iotdb_tree_count_sql has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • dbx_sql_data::query_result_sql::build_sorted_query_sql (cyclomatic 18) crates/dbx-sql-data/src/query_result_sql.rs:421 — dbx_sql_data::query_result_sql::build_sorted_query_sql 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.
  • dbx_sql_data::query_result_sql::build_count_query_sql (cyclomatic 17) crates/dbx-sql-data/src/query_result_sql.rs:331 — dbx_sql_data::query_result_sql::build_count_query_sql has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • dbx_sql_data::data_grid_sql::build_data_grid_column_distinct_values_sql (cyclomatic 16) REDACTED:1027 — dbx_sql_data::data_grid_sql::build_data_grid_column_distinct_values_sql 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. This is NOT this file's highest cyclomatic complexity: dbx_sql_data::data_grid_sql::build_data_grid_context_filter_condition (cyclomatic 23) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • dbx_sql_data::query_result_sql::is_simple_sqlserver_order_projection (cyclomatic 16) crates/dbx-sql-data/src/query_result_sql.rs:1096 — dbx_sql_data::query_result_sql::is_simple_sqlserver_order_projection 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.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×12
  • Members sharing a duplicated core (5 members, 50+ identical tokens) crates/dbx-ai-provider/src/ai_claude_code_cli.rs:441 — crates/dbx-ai-provider/src/ai_claude_code_cli.rs:441-468 | crates/dbx-ai-provider/src/ai_codex_cli.rs:975-999 | crates/dbx-ai-provider/src/ai_grok_cli.rs:650-688 | crates/dbx-ai-provider/src/ai_opencode_cli.rs:355-365 | crates/dbx-ai-provider/src/ai_pi_agent_cli.rs:574-584 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) REDACTED:4910 — REDACTED:4910-4965 | REDACTED:5753-5782 | REDACTED:5785-5813 | REDACTED:5815-5843 | REDACTED:5845-5871 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) REDACTED:897 — REDACTED:897-1240 | REDACTED:1248-1438 | REDACTED:1446-1722 | REDACTED:1730-1927 | REDACTED:1935-2122 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) REDACTED:4327 — REDACTED:4327-4347 | REDACTED:5074-5095 | REDACTED:5097-5118 | REDACTED:5120-5140 | REDACTED:5151-5173 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) crates/dbx-core/src/schema/mod.rs:408 — crates/dbx-core/src/schema/mod.rs:408-438 | crates/dbx-core/src/schema/mod.rs:478-491 | crates/dbx-core/src/schema/mod.rs:513-526 | crates/dbx-core/src/schema/mod.rs:548-560 | crates/dbx-core/src/schema/mod.rs:582-594 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) crates/dbx-core/src/schema/mod.rs:1018 — crates/dbx-core/src/schema/mod.rs:1018-1034 | crates/dbx-core/src/schema/mod.rs:1042-1058 | crates/dbx-core/src/schema/mod.rs:1060-1070 | crates/dbx-core/src/schema/mod.rs:1077-1087 | crates/dbx-core/src/schema/mod.rs:1095-1105 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) crates/dbx-driver-sqlserver/src/sqlserver.rs:1664 — crates/dbx-driver-sqlserver/src/sqlserver.rs:1664-1676 | crates/dbx-driver-sqlserver/src/sqlserver.rs:1678-1690 | crates/dbx-sql-data/src/query_result_sql.rs:1813-1828 | crates/dbx-sql-data/src/query_result_sql.rs:1830-1848 | crates/dbx-sql-data/src/query_result_sql.rs:2243-2255 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) crates/dbx-mcp/src/server.rs:2025 — crates/dbx-mcp/src/server.rs:2025-2094 | crates/dbx-mcp/src/server.rs:2264-2345 | crates/dbx-mcp/src/server.rs:2758-2825 | crates/dbx-mcp/src/server.rs:2834-2854 | crates/dbx-mcp/src/server.rs:2863-2940 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) crates/dbx-web/src/routes/schema.rs:477 — crates/dbx-web/src/routes/schema.rs:477-516 | crates/dbx-web/src/routes/schema.rs:543-576 | crates/dbx-web/src/routes/schema.rs:581-596 | crates/dbx-web/src/routes/schema.rs:601-616 | crates/dbx-web/src/routes/schema.rs:621-654 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java:34 — agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java:34-45 | agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:43-54 | agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:38-50 | agents/drivers/spark/src/main/java/com/dbx/agent/spark/SparkAgent.java:95-113 | agents/drivers/trino/src/main/java/com/dbx/agent/trino/TrinoAgent.java:41-52 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) agents/drivers/argo-go/metadata.go:233 — agents/drivers/argo-go/metadata.go:233-257 | agents/drivers/argo-go/metadata.go:259-272 | agents/drivers/hive-go/metadata.go:239-263 | agents/drivers/hive-go/metadata.go:265-278 | agents/drivers/iotdb/metadata.go:165-182 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) REDACTED:3689 — REDACTED:3689-3725 | REDACTED:4403-4447 | REDACTED:4945-4981 | REDACTED:4983-5012 | REDACTED:5014-5040 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×12
  • Duplicated block (23 lines × 2) crates/dbx-core/src/admin/mq/adapters/kafka.rs:403 — crates/dbx-core/src/admin/mq/adapters/kafka.rs:403-425 | crates/dbx-core/src/admin/mq/adapters/rocketmq.rs:539-561 — before extracting anything, compare `crates/dbx-core/src/admin/mq/adapters/kafka.rs` and `crates/dbx-core/src/admin/mq/adapters/rocketmq.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 186 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (23 lines × 2) crates/dbx-drivers/src/db/rqlite_driver.rs:358 — crates/dbx-drivers/src/db/rqlite_driver.rs:358-380 | crates/dbx-drivers/src/db/turso_driver.rs:580-602 — before extracting anything, compare `crates/dbx-drivers/src/db/rqlite_driver.rs` and `crates/dbx-drivers/src/db/turso_driver.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 203 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (23 lines × 2) crates/dbx-mcp/src/server.rs:1383 — crates/dbx-mcp/src/server.rs:1383-1405 | crates/dbx-mcp/src/server.rs:1677-1699 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (23 lines × 2) REDACTED:328 — REDACTED:328-350 | REDACTED:328-350 — `REDACTED` and `REDACTED` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 17 separate duplicated blocks between them, totalling at least 340 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (23 lines × 2) agents/drivers/argo-go/metadata.go:679 — agents/drivers/argo-go/metadata.go:679-701 | agents/drivers/hive-go/metadata.go:690-712 — `agents/drivers/argo-go/metadata.go` and `agents/drivers/hive-go/metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 946 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (23 lines × 2) agents/drivers/etcd-go/main.go:143 — agents/drivers/etcd-go/main.go:143-165 | agents/drivers/etcd2-go/main.go:113-135 — `agents/drivers/etcd-go/main.go` and `agents/drivers/etcd2-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 19 separate duplicated blocks between them, totalling at least 278 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/etcd-go/main.go:143` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (23 lines × 2) REDACTED:2949 — REDACTED:2949-2971 | agents/drivers/vastbase-go/vastbase_metadata.go:2041-2063 — `REDACTED` and `agents/drivers/vastbase-go/vastbase_metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 71 separate duplicated blocks between them, totalling at least 1426 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (23 lines × 2) REDACTED:1508 — REDACTED:1508-1530 | REDACTED:1599-1621 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1508` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (23 lines × 2) REDACTED:45 — REDACTED:45-67 | agents/drivers/zookeeper/main.go:18-40 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (23 lines × 2) REDACTED:2653 — REDACTED:2653-2675 | REDACTED:2781-2811 — both copies are in the same file, so extract the 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 register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (23 lines × 2) REDACTED:2652 — REDACTED:2652-2674 | REDACTED:2712-2734 — both copies are in the same file, so extract the 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 (23 lines × 2) REDACTED:49 — REDACTED:49-71 | REDACTED:49-71 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 397 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D5 · Coupling · Off the main sequence · ×12
  • Off the main sequence: dbx-formats — dbx-formats: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: dbx-platform — dbx-platform: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 6 project(s), so it's rigid to change.
  • Off the main sequence: dbx-plugin-packager — dbx-plugin-packager: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: dbx-sqlite-worker — dbx-sqlite-worker: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: dbx-types — dbx-types: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 16 project(s), so it's rigid to change.
  • Off the main sequence: github.com/apache/iotdb-client-go/v2 — github.com/apache/iotdb-client-go/v2: abstractness 0.07, instability 0.00, distance 0.93 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: github.com/golang-auth/go-gssapi/v2 — github.com/golang-auth/go-gssapi/v2: abstractness 0.09, instability 0.00, distance 0.91 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: dbx-sql-core — dbx-sql-core: abstractness 0.00, instability 0.11, distance 0.89 — zone of pain — concrete and depended on by 8 project(s), so it's rigid to change.
  • Off the main sequence: dbx-sql-dialect — dbx-sql-dialect: abstractness 0.02, instability 0.17, distance 0.81 — zone of pain — concrete and depended on by 5 project(s), so it's rigid to change.
  • Off the main sequence: dbx-agents:common — dbx-agents:common: abstractness 0.19, instability 0.00, distance 0.81 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.
  • Off the main sequence: dbx-driver-support — dbx-driver-support: abstractness 0.00, instability 0.22, distance 0.78 — zone of pain — concrete and depended on by 7 project(s), so it's rigid to change.
  • Off the main sequence: dbx-mcp — dbx-mcp: abstractness 0.03, instability 0.25, distance 0.72 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
D1 · Cyclomatic Complexity · dbx_driver_mysql · ×11
  • dbx_driver_mysql::mysql::mysql_column_type_name (cyclomatic 34) crates/dbx-driver-mysql/src/mysql.rs:861 — dbx_driver_mysql::mysql::mysql_column_type_name has cyclomatic complexity 34 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • dbx_driver_mysql::mysql::mysql_async_url (cyclomatic 27) crates/dbx-driver-mysql/src/mysql.rs:2901 — dbx_driver_mysql::mysql::mysql_async_url 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. This is NOT this file's highest cyclomatic complexity: dbx_driver_mysql::mysql::fix_potential_double_encoding (cyclomatic 32) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • dbx_driver_mysql::mysql::find_if_not_exists_clause (cyclomatic 26) crates/dbx-driver-mysql/src/mysql.rs:6714 — dbx_driver_mysql::mysql::find_if_not_exists_clause 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. This is NOT this file's highest cyclomatic complexity: dbx_driver_mysql::mysql::fix_potential_double_encoding (cyclomatic 32) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • dbx_driver_mysql::mysql::parse_mysql_enum_values (cyclomatic 23) crates/dbx-driver-mysql/src/mysql.rs:4787 — dbx_driver_mysql::mysql::parse_mysql_enum_values has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: dbx_driver_mysql::mysql::fix_potential_double_encoding (cyclomatic 32) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • dbx_driver_mysql::mysql::execute_result_sets_with_text_protocol_on_conn (cyclomatic 21) crates/dbx-driver-mysql/src/mysql.rs:5549 — dbx_driver_mysql::mysql::execute_result_sets_with_text_protocol_on_conn 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. This is NOT this file's highest cyclomatic complexity: dbx_driver_mysql::mysql::fix_potential_double_encoding (cyclomatic 32) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • dbx_driver_mysql::mysql::ssl_fallback_url (cyclomatic 17) crates/dbx-driver-mysql/src/mysql.rs:2661 — dbx_driver_mysql::mysql::ssl_fallback_url has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: dbx_driver_mysql::mysql::fix_potential_double_encoding (cyclomatic 32) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • dbx_driver_mysql::mysql::completion_assistant_search (cyclomatic 17) crates/dbx-driver-mysql/src/mysql.rs:3363 — dbx_driver_mysql::mysql::completion_assistant_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. This is NOT this file's highest cyclomatic complexity: dbx_driver_mysql::mysql::fix_potential_double_encoding (cyclomatic 32) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • dbx_driver_mysql::mysql::list_objects (cyclomatic 17) crates/dbx-driver-mysql/src/mysql.rs:4304 — dbx_driver_mysql::mysql::list_objects has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: dbx_driver_mysql::mysql::fix_potential_double_encoding (cyclomatic 32) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • dbx_driver_mysql::mysql::execute_non_result_batch_on_conn (cyclomatic 17) crates/dbx-driver-mysql/src/mysql.rs:6533 — dbx_driver_mysql::mysql::execute_non_result_batch_on_conn has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: dbx_driver_mysql::mysql::fix_potential_double_encoding (cyclomatic 32) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • dbx_driver_mysql::mysql::verify_pool_connection_with_setup_fallback (cyclomatic 16) crates/dbx-driver-mysql/src/mysql.rs:1679 — dbx_driver_mysql::mysql::verify_pool_connection_with_setup_fallback has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: dbx_driver_mysql::mysql::fix_potential_double_encoding (cyclomatic 32) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • dbx_driver_mysql::mysql::skip_sql_whitespace_and_comments (cyclomatic 16) crates/dbx-driver-mysql/src/mysql.rs:6879 — dbx_driver_mysql::mysql::skip_sql_whitespace_and_comments has cyclomatic complexity 16 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This is NOT this file's highest cyclomatic complexity: dbx_driver_mysql::mysql::fix_potential_double_encoding (cyclomatic 32) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D29 · Static Analysis (SAST) · REDACTED · ×11
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×11
  • Duplicated block (6 lines × 4) crates/dbx-ai-provider/src/ai_codex_cli.rs:989 — crates/dbx-ai-provider/src/ai_codex_cli.rs:989-994 | crates/dbx-ai-provider/src/ai_grok_cli.rs:679-684 | crates/dbx-ai-provider/src/ai_opencode_cli.rs:359-365 | crates/dbx-ai-provider/src/ai_pi_agent_cli.rs:578-584 — before extracting anything, compare `crates/dbx-ai-provider/src/ai_codex_cli.rs` and `crates/dbx-ai-provider/src/ai_grok_cli.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 4) REDACTED:3482 — REDACTED:3482-3487 | REDACTED:3496-3501 | REDACTED:4177-4182 | REDACTED:4186-4191 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (6 lines × 4) REDACTED:7363 — REDACTED:7363-7368 | REDACTED:7432-7437 | REDACTED:7502-7507 | REDACTED:7593-7598 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (6 lines × 4) crates/dbx-drivers/src/db/sqlite.rs:1555 — crates/dbx-drivers/src/db/sqlite.rs:1555-1560 | crates/dbx-drivers/src/db/sqlite.rs:1632-1637 | crates/dbx-drivers/src/db/sqlite.rs:2633-2638 | crates/dbx-drivers/src/db/sqlite.rs:2728-2733 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (6 lines × 4) crates/dbx-drivers/src/db/sqlite.rs:1597 — crates/dbx-drivers/src/db/sqlite.rs:1597-1602 | crates/dbx-drivers/src/db/sqlite.rs:2532-2537 | crates/dbx-drivers/src/db/sqlite.rs:2611-2616 | crates/dbx-drivers/src/db/sqlite.rs:2684-2689 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (6 lines × 4) crates/dbx-web/src/routes/consul.rs:252 — crates/dbx-web/src/routes/consul.rs:252-257 | crates/dbx-web/src/routes/consul.rs:282-287 | crates/dbx-web/src/routes/consul.rs:292-297 | crates/dbx-web/src/routes/etcd.rs:197-202 — 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.
  • Duplicated block (6 lines × 4) crates/dbx-ai-provider/src/ai_claude_code_cli.rs:153 — crates/dbx-ai-provider/src/ai_claude_code_cli.rs:153-158 | crates/dbx-ai-provider/src/ai_codebuddy_cli.rs:233-238 | crates/dbx-ai-provider/src/ai_grok_cli.rs:203-208 | crates/dbx-ai-provider/src/ai_qoder_cli.rs:85-90 — before extracting anything, compare `crates/dbx-ai-provider/src/ai_claude_code_cli.rs` and `crates/dbx-ai-provider/src/ai_codebuddy_cli.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 4) REDACTED:3793 — REDACTED:3793-3798 | REDACTED:3820-3825 | REDACTED:3843-3848 | REDACTED:3874-3879 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:3793` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:3792` calls `setString` and `REDACTED:3842` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 4) REDACTED:91 — REDACTED:91-96 | agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:73-78 | agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:190-195 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:75-80 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:91` 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 (6 lines × 4) agents/drivers/informix/src/main/java/com/dbx/agent/informix/InformixAgent.java:508 — agents/drivers/informix/src/main/java/com/dbx/agent/informix/InformixAgent.java:508-513 | agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:318-323 | agents/drivers/spark/src/main/java/com/dbx/agent/spark/SparkAgent.java:250-255 | agents/drivers/trino/src/main/java/com/dbx/agent/trino/TrinoAgent.java:221-226 — before extracting anything, compare `agents/drivers/informix/src/main/java/com/dbx/agent/informix/InformixAgent.java` and `agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:325` calls `buildUrl`, `getHost`, `getPort` and `agents/drivers/informix/src/main/java/com/dbx/agent/informix/InformixAgent.java:515` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 4) REDACTED:467 — REDACTED:467-472 | REDACTED:505-510 | REDACTED:535-540 | REDACTED:555-560 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. 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.
D30 · Dependency Vulnerabilities · Medium advisory (unmaintained) · ×10
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×10
  • Duplicated block (12 lines × 3) crates/dbx-driver-elasticsearch/src/lib.rs:2001 — crates/dbx-driver-elasticsearch/src/lib.rs:2001-2012 | crates/dbx-drivers/src/db/solr_driver.rs:858-869 | crates/dbx-sql-core/src/query_execution_sql.rs:681-692 — before extracting anything, compare `crates/dbx-driver-elasticsearch/src/lib.rs` and `crates/dbx-drivers/src/db/solr_driver.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 3) crates/dbx-driver-mongodb/src/mongo_shell.rs:379 — crates/dbx-driver-mongodb/src/mongo_shell.rs:379-390 | crates/dbx-web/src/routes/mcp_policy.rs:61-72 | src-tauri/src/commands/mcp_bridge.rs:1287-1298 — before extracting anything, compare `crates/dbx-driver-mongodb/src/mongo_shell.rs` and `crates/dbx-web/src/routes/mcp_policy.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 145 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 3) agents/drivers/oscar/src/main/java/com/dbx/agent/oscar/OscarAgent.java:105 — agents/drivers/oscar/src/main/java/com/dbx/agent/oscar/OscarAgent.java:105-116 | agents/drivers/sqlserver-legacy/src/main/java/com/dbx/agent/sqlserverlegacy/SqlServerLegacyAgent.java:499-510 | agents/drivers/yashandb/src/main/java/com/dbx/agent/yashandb/YashandbAgent.java:116-127 — 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 `agents/drivers/oscar/src/main/java/com/dbx/agent/oscar/OscarAgent.java:105` 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 × 3) agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:230 — agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:230-242 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:334-347 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:365-376 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:230` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 3) agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:249 — agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:249-261 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:334-347 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:365-376 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:249` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 3) agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:385 — agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:385-396 | agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:394-405 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:390-401 — before extracting anything, compare `agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java` and `agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 98 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 3) agents/drivers/argo-go/zookeeper_tls.go:139 — agents/drivers/argo-go/zookeeper_tls.go:139-150 | REDACTED:136-147 | agents/drivers/hive-go/zookeeper_tls.go:139-150 — `agents/drivers/argo-go/zookeeper_tls.go` and `agents/drivers/hive-go/zookeeper_tls.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 223 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/zookeeper_tls.go:139` 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 register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (12 lines × 3) agents/drivers/kingbase-go/main.go:208 — agents/drivers/kingbase-go/main.go:208-219 | REDACTED:654-665 | REDACTED:835-846 — 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 `agents/drivers/kingbase-go/main.go:208` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 (12 lines × 3) agents/drivers/kingbase-go/main.go:724 — agents/drivers/kingbase-go/main.go:724-735 | agents/drivers/neo4j-go/main.go:495-506 | agents/drivers/vastbase-go/main.go:647-658 — `agents/drivers/kingbase-go/main.go` and `agents/drivers/neo4j-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 253 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 3) agents/drivers/argo-go/metadata.go:1009 — agents/drivers/argo-go/metadata.go:1009-1020 | agents/drivers/hive-go/metadata.go:1020-1031 | agents/drivers/iotdb/metadata.go:594-605 — `agents/drivers/argo-go/metadata.go` and `agents/drivers/hive-go/metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 946 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/metadata.go:1009` 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.
R11 · Import Boundaries · Boundary violation [package · ×10
  • Boundary violation [package:third-party-deep-import] apps/desktop/src/lib/diagram/elk-layout.ts:1 — apps/desktop/src/lib/diagram/elk-layout.ts:1 imports elkjs/lib/elk.bundled.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] apps/desktop/src/lib/sql/layout/internals.ts:60 — apps/desktop/src/lib/sql/layout/internals.ts:60 imports sql-formatter/dist/esm/parser/createParser.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] apps/desktop/src/lib/sql/layout/internals.ts:61 — apps/desktop/src/lib/sql/layout/internals.ts:61 imports sql-formatter/dist/esm/dialect.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] apps/desktop/src/lib/sql/layout/internals.ts:62 — apps/desktop/src/lib/sql/layout/internals.ts:62 imports sql-formatter/dist/esm/allDialects.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] apps/desktop/src/lib/sql/layout/internals.ts:63 — apps/desktop/src/lib/sql/layout/internals.ts:63 imports sql-formatter/dist/esm/formatter/ExpressionFormatter.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] apps/desktop/src/lib/sql/layout/internals.ts:64 — apps/desktop/src/lib/sql/layout/internals.ts:64 imports sql-formatter/dist/esm/formatter/InlineLayout.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] apps/desktop/src/lib/sql/layout/internals.ts:65 — apps/desktop/src/lib/sql/layout/internals.ts:65 imports sql-formatter/dist/esm/formatter/Params.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] apps/desktop/src/lib/sql/layout/internals.ts:66 — apps/desktop/src/lib/sql/layout/internals.ts:66 imports sql-formatter/dist/esm/formatter/Layout.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] apps/desktop/src/lib/sql/layout/internals.ts:67 — apps/desktop/src/lib/sql/layout/internals.ts:67 imports sql-formatter/dist/esm/formatter/Indentation.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:test-cross-package-internals] packages/app-tests/mongoShellCommand.test.ts:42 — packages/app-tests/mongoShellCommand.test.ts:42 reaches past another workspace package's public entry into its internals with a relative path (../mongo-shell/src/json.ts) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
D1 · Cyclomatic Complexity · dbx_driver_mongodb · ×9
  • dbx_driver_mongodb::mongo_shell::parse (cyclomatic 128) crates/dbx-driver-mongodb/src/mongo_shell.rs:549 — dbx_driver_mongodb::mongo_shell::parse has cyclomatic complexity 128 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • dbx_driver_mongodb::mongo_shell::parse_bulk_write_operation (cyclomatic 26) crates/dbx-driver-mongodb/src/mongo_shell.rs:228 — dbx_driver_mongodb::mongo_shell::parse_bulk_write_operation has cyclomatic complexity 26 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • dbx_driver_mongodb::mongo_shell::trim_mongo_outer_comments (cyclomatic 26) crates/dbx-driver-mongodb/src/mongo_shell.rs:982 — dbx_driver_mongodb::mongo_shell::trim_mongo_outer_comments 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.
  • dbx_driver_mongodb::mongo_driver::json_filter_value_to_bson (cyclomatic 21) crates/dbx-driver-mongodb/src/mongo_driver.rs:3243 — dbx_driver_mongodb::mongo_driver::json_filter_value_to_bson 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.
  • dbx_driver_mongodb::mongo_shell::mongo_pure_field_predicate (cyclomatic 19) crates/dbx-driver-mongodb/src/mongo_shell.rs:439 — dbx_driver_mongodb::mongo_shell::mongo_pure_field_predicate has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • dbx_driver_mongodb::mongo_driver::bulk_write (cyclomatic 16) crates/dbx-driver-mongodb/src/mongo_driver.rs:2238 — dbx_driver_mongodb::mongo_driver::bulk_write 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.
  • dbx_driver_mongodb::mongo_shell::read_shell_regex_literal (cyclomatic 16) crates/dbx-driver-mongodb/src/mongo_shell.rs:1213 — dbx_driver_mongodb::mongo_shell::read_shell_regex_literal 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.
  • dbx_driver_mongodb::mongo_shell::shell_constructor_to_extended_json (cyclomatic 16) crates/dbx-driver-mongodb/src/mongo_shell.rs:1503 — dbx_driver_mongodb::mongo_shell::shell_constructor_to_extended_json has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • dbx_driver_mongodb::mongo_shell::split_top_level (cyclomatic 16) crates/dbx-driver-mongodb/src/mongo_shell.rs:1785 — dbx_driver_mongodb::mongo_shell::split_top_level has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D2 · Cognitive Complexity · dbx_driver_elasticsearch · ×9
  • dbx_driver_elasticsearch::parse_aggregations (cognitive 58) crates/dbx-driver-elasticsearch/src/lib.rs:3171 — dbx_driver_elasticsearch::parse_aggregations has cognitive complexity 58 (threshold 15). Drivers by points: if/else 11 (36 pts), loops 5 (15 pts), match/switch 2 (7 pts) (nesting depth added 40). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • dbx_driver_elasticsearch::adapt_elasticsearch_sql_query (cognitive 27) crates/dbx-driver-elasticsearch/src/lib.rs:2865 — dbx_driver_elasticsearch::adapt_elasticsearch_sql_query has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (21 pts), match/switch 2 (5 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_elasticsearch::normalize_elasticsearch_rest_path (cognitive 25) crates/dbx-driver-elasticsearch/src/lib.rs:2050 — dbx_driver_elasticsearch::normalize_elasticsearch_rest_path has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (20 pts), match/switch 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_elasticsearch::es_send_page (cognitive 23) crates/dbx-driver-elasticsearch/src/lib.rs:1214 — dbx_driver_elasticsearch::es_send_page has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (9 pts), match/switch 7 (9 pts), boolean chains 5 (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.
  • dbx_driver_elasticsearch::execute_sql_query (cognitive 23) crates/dbx-driver-elasticsearch/src/lib.rs:2784 — dbx_driver_elasticsearch::execute_sql_query has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (18 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_elasticsearch::collect_mapping_columns (cognitive 21) crates/dbx-driver-elasticsearch/src/lib.rs:786 — dbx_driver_elasticsearch::collect_mapping_columns has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_elasticsearch::es_execute_paged_search (cognitive 21) crates/dbx-driver-elasticsearch/src/lib.rs:1338 — dbx_driver_elasticsearch::es_execute_paged_search has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 3 (7 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_elasticsearch::translate_field_operator_filter (cognitive 20) crates/dbx-driver-elasticsearch/src/lib.rs:1743 — dbx_driver_elasticsearch::translate_field_operator_filter has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 2 (3 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_elasticsearch::parse_select_star_search_query (cognitive 20) crates/dbx-driver-elasticsearch/src/lib.rs:2646 — dbx_driver_elasticsearch::parse_select_star_search_query has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Storage · ×9
  • Storage::inspect_data_migration (cognitive 38) REDACTED:1448 — Storage::inspect_data_migration has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 13, match/switch 4 (7 pts), loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Storage::load_connections (cognitive 35) REDACTED:6443 — Storage::load_connections has cognitive complexity 35 (threshold 15). Drivers by points: match/switch 5 (17 pts), if/else 5 (12 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 21). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • Storage::cleanup_migration_backups (cognitive 25) REDACTED:1790 — Storage::cleanup_migration_backups has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 4 (5 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Storage::apply_sync_import_transaction (cognitive 20) REDACTED:5952 — Storage::apply_sync_import_transaction has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Storage::verify_migration (cognitive 19) REDACTED:2014 — Storage::verify_migration has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 5 (6 pts), match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Storage::load_ai_configs (cognitive 19) REDACTED:3808 — Storage::load_ai_configs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Storage::finalize_legacy_json_files (cognitive 17) REDACTED:2088 — Storage::finalize_legacy_json_files has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Storage::load_ai_provider_configs (cognitive 17) REDACTED:3716 — Storage::load_ai_provider_configs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2, match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Storage::prune_tab_runtime_cache (cognitive 16) REDACTED:7704 — Storage::prune_tab_runtime_cache has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3, boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dbx_driver_sqlserver · ×9
  • dbx_driver_sqlserver::sqlserver::top_level_sqlserver_tokens (cognitive 34) crates/dbx-driver-sqlserver/src/sqlserver.rs:1602 — dbx_driver_sqlserver::sqlserver::top_level_sqlserver_tokens has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 4 (10 pts), boolean chains 6 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_sqlserver::sqlserver::collect_ordered_result_sets_limited (cognitive 26) crates/dbx-driver-sqlserver/src/sqlserver.rs:1838 — dbx_driver_sqlserver::sqlserver::collect_ordered_result_sets_limited has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (23 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_sqlserver::sqlserver::stream_first_result_set (cognitive 26) crates/dbx-driver-sqlserver/src/sqlserver.rs:1907 — dbx_driver_sqlserver::sqlserver::stream_first_result_set has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (17 pts), match/switch 4 (8 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_sqlserver::sqlserver::first_sql_tokens (cognitive 26) crates/dbx-driver-sqlserver/src/sqlserver.rs:3952 — dbx_driver_sqlserver::sqlserver::first_sql_tokens has cognitive complexity 26 (threshold 15). Drivers by points: loops 5 (11 pts), boolean chains 8, if/else 4 (7 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_sqlserver::sqlserver::sqlserver_completion_assistant_sql (cognitive 25) crates/dbx-driver-sqlserver/src/sqlserver.rs:2527 — dbx_driver_sqlserver::sqlserver::sqlserver_completion_assistant_sql has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18 (20 pts), boolean chains 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
  • dbx_driver_sqlserver::sqlserver::build_sqlserver_unsafe_type_query (cognitive 24) crates/dbx-driver-sqlserver/src/sqlserver.rs:1276 — dbx_driver_sqlserver::sqlserver::build_sqlserver_unsafe_type_query has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 1, match/switch 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.
  • dbx_driver_sqlserver::sqlserver::sqlserver_cell_to_json (cognitive 20) crates/dbx-driver-sqlserver/src/sqlserver.rs:2004 — dbx_driver_sqlserver::sqlserver::sqlserver_cell_to_json has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, match/switch 2 (4 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • dbx_driver_sqlserver::sqlserver::sqlserver_balanced_transaction_batch_can_use_execute (cognitive 18) crates/dbx-driver-sqlserver/src/sqlserver.rs:3803 — dbx_driver_sqlserver::sqlserver::sqlserver_balanced_transaction_batch_can_use_execute has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_sqlserver::sqlserver::describe_sqlserver_result_set_with_mode (cognitive 16) crates/dbx-driver-sqlserver/src/sqlserver.rs:947 — dbx_driver_sqlserver::sqlserver::describe_sqlserver_result_set_with_mode has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 2 (4 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Duplicated block (26 lines × 2) · ×9
  • Duplicated block (26 lines × 2) crates/dbx-driver-mongodb/src/mongo_driver.rs:1314 — crates/dbx-driver-mongodb/src/mongo_driver.rs:1314-1339 | crates/dbx-driver-mongodb/src/mongo_driver.rs:1510-1535 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (26 lines × 2) crates/dbx-driver-mongodb/src/mongo_oidc.rs:236 — crates/dbx-driver-mongodb/src/mongo_oidc.rs:236-261 | crates/dbx-drivers/src/salesforce_oauth.rs:313-338 — before extracting anything, compare `crates/dbx-driver-mongodb/src/mongo_oidc.rs` and `crates/dbx-drivers/src/salesforce_oauth.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 87 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (26 lines × 2) crates/dbx-web/src/routes/redis_pubsub_ws.rs:158 — crates/dbx-web/src/routes/redis_pubsub_ws.rs:158-183 | src-tauri/src/commands/redis_pubsub_server.rs:225-250 — before extracting anything, compare `crates/dbx-web/src/routes/redis_pubsub_ws.rs` and `src-tauri/src/commands/redis_pubsub_server.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 119 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (26 lines × 2) agents/drivers/cache/src/main/java/com/dbx/agent/cache/CacheAgent.java:45 — agents/drivers/cache/src/main/java/com/dbx/agent/cache/CacheAgent.java:45-70 | agents/drivers/iris/src/main/java/com/dbx/agent/iris/IrisAgent.java:70-95 — before extracting anything, compare `agents/drivers/cache/src/main/java/com/dbx/agent/cache/CacheAgent.java` and `agents/drivers/iris/src/main/java/com/dbx/agent/iris/IrisAgent.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (26 lines × 2) agents/drivers/argo-go/config.go:862 — agents/drivers/argo-go/config.go:862-887 | agents/drivers/hive-go/config.go:893-918 — `agents/drivers/argo-go/config.go` and `agents/drivers/hive-go/config.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 1107 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (26 lines × 2) REDACTED:191 — REDACTED:191-216 | REDACTED:191-216 — `REDACTED` and `REDACTED` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 17 separate duplicated blocks between them, totalling at least 340 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (26 lines × 2) REDACTED:219 — REDACTED:219-244 | REDACTED:219-244 — `REDACTED` and `REDACTED` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 17 separate duplicated blocks between them, totalling at least 340 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (26 lines × 2) agents/drivers/argo-go/main.go:508 — agents/drivers/argo-go/main.go:508-533 | agents/drivers/hive-go/main.go:508-533 — `agents/drivers/argo-go/main.go` and `agents/drivers/hive-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 43 separate duplicated blocks between them, totalling at least 699 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (26 lines × 2) agents/drivers/kingbase-go/main.go:1002 — agents/drivers/kingbase-go/main.go:1002-1027 | agents/drivers/vastbase-go/main.go:996-1021 — `agents/drivers/kingbase-go/main.go` and `agents/drivers/vastbase-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 50 separate duplicated blocks between them, totalling at least 708 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×9
  • Duplicated block (5 lines × 4) REDACTED:1233 — REDACTED:1233-1238 | REDACTED:1432-1436 | REDACTED:1716-1720 | REDACTED:1921-1925 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (5 lines × 4) REDACTED:1293 — REDACTED:1293-1297 | REDACTED:1496-1500 | REDACTED:1776-1780 | REDACTED:1962-1966 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (5 lines × 4) REDACTED:2305 — REDACTED:2305-2309 | REDACTED:2462-2466 | REDACTED:2477-2481 | REDACTED:2487-2491 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (5 lines × 4) crates/dbx-driver-sqlserver/src/sqlserver.rs:2933 — crates/dbx-driver-sqlserver/src/sqlserver.rs:2933-2937 | crates/dbx-driver-sqlserver/src/sqlserver.rs:2939-2943 | crates/dbx-driver-sqlserver/src/sqlserver.rs:2945-2949 | crates/dbx-driver-sqlserver/src/sqlserver.rs:2951-2955 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (5 lines × 4) REDACTED:39 — REDACTED:39-43 | crates/dbx-drivers/src/db/influxdb3_driver.rs:77-81 | crates/dbx-drivers/src/db/influxdb_driver.rs:102-106 | crates/dbx-drivers/src/db/victoriametrics_driver.rs:141-145 — before extracting anything, compare `crates/dbx-drivers/src/db/influxdb3_driver.rs` and `crates/dbx-drivers/src/db/influxdb_driver.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 4) agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java:108 — agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java:108-112 | agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:111-115 | agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:115-119 | agents/drivers/trino/src/main/java/com/dbx/agent/trino/TrinoAgent.java:116-120 — before extracting anything, compare `agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java` and `agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java:108` 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 (5 lines × 4) agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:230 — agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:230-234 | agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:312-316 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:114-118 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:190-194 — before extracting anything, compare `agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java` and `agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 210 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:230` 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 (5 lines × 4) REDACTED:2431 — REDACTED:2431-2435 | REDACTED:2460-2464 | REDACTED:2491-2495 | agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:367-371 — 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 `REDACTED:2431` 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 (5 lines × 4) agents/drivers/argo-go/metadata.go:596 — agents/drivers/argo-go/metadata.go:596-600 | agents/drivers/argo-go/metadata.go:650-654 | agents/drivers/hive-go/metadata.go:607-611 | agents/drivers/hive-go/metadata.go:661-665 — `agents/drivers/argo-go/metadata.go` and `agents/drivers/hive-go/metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 946 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/metadata.go:596` 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.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×9
  • Sync-over-async blocking REDACTED:1370 — `enable_wal_mode` is async and calls thread::sleep — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs.
  • Sync-over-async blocking agents/drivers/oceanbase-oracle/scripts/verify-partition-ddl.ts:10 — `main` is async and calls mkdirSync, writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:10 — `main` is async and calls mkdirSync, writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking agents/scripts/build_offline_jdbc_payload.mjs:82 — `validateAndCopyBundle` is async and calls existsSync, statSync, mkdirSync, copyFileSync, writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking agents/scripts/build_offline_jdbc_payload.mjs:140 — `main` is async and calls existsSync, rmSync, mkdirSync, copyFileSync, mkdtempSync, writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking agents/scripts/verify_offline_jdbc_release.mjs:41 — `validatePayload` is async and calls readFileSync, statSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking agents/scripts/verify_offline_jdbc_release.mjs:64 — `main` is async and calls existsSync, mkdtempSync, spawnSync, rmSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking scripts/verify-plugin-cli-package.mjs:107 — `verifyTemplate` is async and calls readdirSync, existsSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking scripts/verify-plugin-cli-package.mjs:132 — `verifyDev` is async and calls existsSync, readFileSync, spawnSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
D1 · Cyclomatic Complexity · dbx · ×8
  • dbx::commands::connection::test_connection_with_info_inner (cyclomatic 81) src-tauri/src/commands/connection.rs:1180 — dbx::commands::connection::test_connection_with_info_inner has cyclomatic complexity 81 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • dbx::commands::connection::connect_db (cyclomatic 68) src-tauri/src/commands/connection.rs:1740 — dbx::commands::connection::connect_db has cyclomatic complexity 68 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • dbx::run (cyclomatic 51) src-tauri/src/lib.rs:1464 — dbx::run has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • dbx::commands::transfer::start_transfer (cyclomatic 31) src-tauri/src/commands/transfer.rs:17 — dbx::commands::transfer::start_transfer 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.
  • dbx::commands::mcp_bridge::start (cyclomatic 29) src-tauri/src/commands/mcp_bridge.rs:200 — dbx::commands::mcp_bridge::start has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • dbx::commands::mcp_bridge::mongo_pure_field_predicate (cyclomatic 19) src-tauri/src/commands/mcp_bridge.rs:1347 — dbx::commands::mcp_bridge::mongo_pure_field_predicate has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • dbx::commands::global_search::search_root (cyclomatic 19) src-tauri/src/commands/global_search.rs:136 — dbx::commands::global_search::search_root 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.
  • dbx::background_backup::run_if_requested (cyclomatic 16) src-tauri/src/background_backup.rs:359 — dbx::background_backup::run_if_requested 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 · dbx_ai_provider · ×8
  • dbx_ai_provider::ai::stream_claude_with_tools (cyclomatic 37) crates/dbx-ai-provider/src/ai.rs:4286 — dbx_ai_provider::ai::stream_claude_with_tools has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • dbx_ai_provider::ai::stream_openai_with_tools (cyclomatic 30) crates/dbx-ai-provider/src/ai.rs:4504 — dbx_ai_provider::ai::stream_openai_with_tools 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.
  • dbx_ai_provider::ai_pi_agent_cli::emit_pi_event (cyclomatic 22) crates/dbx-ai-provider/src/ai_pi_agent_cli.rs:655 — dbx_ai_provider::ai_pi_agent_cli::emit_pi_event 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.
  • dbx_ai_provider::ai_cli_agent::run_cli_jsonl_agent (cyclomatic 20) crates/dbx-ai-provider/src/ai_cli_agent.rs:1073 — dbx_ai_provider::ai_cli_agent::run_cli_jsonl_agent 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.
  • dbx_ai_provider::ai::stream_openai (cyclomatic 19) crates/dbx-ai-provider/src/ai.rs:3858 — dbx_ai_provider::ai::stream_openai 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. This is NOT this file's highest cyclomatic complexity: AiProvider::as_str (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • dbx_ai_provider::ai::classify_error (cyclomatic 18) crates/dbx-ai-provider/src/ai.rs:3323 — dbx_ai_provider::ai::classify_error 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. This is NOT this file's highest cyclomatic complexity: AiProvider::as_str (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • dbx_ai_provider::ai::stream_responses_with_tools (cyclomatic 18) crates/dbx-ai-provider/src/ai.rs:4690 — dbx_ai_provider::ai::stream_responses_with_tools 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. This is NOT this file's highest cyclomatic complexity: AiProvider::as_str (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • dbx_ai_provider::ai::build_gemini_contents (cyclomatic 17) crates/dbx-ai-provider/src/ai.rs:4842 — dbx_ai_provider::ai::build_gemini_contents has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: AiProvider::as_str (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · dbx_driver_postgres · ×8
  • dbx_driver_postgres::postgres::pg_ndim_array_element_json (cyclomatic 30) REDACTED:394 — dbx_driver_postgres::postgres::pg_ndim_array_element_json 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.
  • dbx_driver_postgres::postgres::completion_assistant_search_inner (cyclomatic 30) REDACTED:3564 — dbx_driver_postgres::postgres::completion_assistant_search_inner 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.
  • dbx_driver_postgres::postgres::classify_pg_type (cyclomatic 29) REDACTED:988 — dbx_driver_postgres::postgres::classify_pg_type has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • dbx_driver_postgres::postgres::pg_value_to_json_classified (cyclomatic 28) REDACTED:1072 — dbx_driver_postgres::postgres::pg_value_to_json_classified has cyclomatic complexity 28 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • dbx_driver_postgres::postgres::build_custom_type_ddl (cyclomatic 21) REDACTED:7121 — dbx_driver_postgres::postgres::build_custom_type_ddl 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.
  • dbx_driver_postgres::postgres::pg_temporal_array_text_to_json (cyclomatic 20) REDACTED:1230 — dbx_driver_postgres::postgres::pg_temporal_array_text_to_json has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 4 of the 20 points are its own statements and the rest belongs to 4 function items inside it that branch (parse_array, parse_quoted, normalize_array_value, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • dbx_driver_postgres::postgres::pg_array_to_json_value (cyclomatic 19) REDACTED:822 — dbx_driver_postgres::postgres::pg_array_to_json_value 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.
  • dbx_driver_postgres::postgres::postgres_connection_url (cyclomatic 19) REDACTED:2996 — dbx_driver_postgres::postgres::postgres_connection_url 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.
D3 · God Classes · TooManyFunctions · ×8
  • TooManyFunctions: dbx::commands::app_settings src-tauri/src/commands/app_settings.rs:21 — TooManyFunctions — 57 free functions. The bar is 30 free functions; this is 27 over it, 1.90× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyFunctions: dbx_core::admin::nacos::service crates/dbx-core/src/admin/nacos/service.rs:7 — TooManyFunctions — 48 free functions. The bar is 30 free functions; this is 18 over it, 1.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyFunctions: dbx::commands::nacos_cmd src-tauri/src/commands/nacos_cmd.rs:10 — TooManyFunctions — 45 free functions. The bar is 30 free functions; this is 15 over it, 1.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyFunctions: dbx::commands::redis_cmd src-tauri/src/commands/redis_cmd.rs:12 — TooManyFunctions — 41 free functions. The bar is 30 free functions; this is 11 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyFunctions: dbx::commands::document_cmd src-tauri/src/commands/document_cmd.rs:9 — TooManyFunctions — 40 free functions. The bar is 30 free functions; this is 10 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyFunctions: dbx_formats::csv_export crates/dbx-formats/src/csv_export.rs:22 — TooManyFunctions — 36 free functions. The bar is 30 free functions; this is 6 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyFunctions: dbx_core::admin::nacos::namespace_access crates/dbx-core/src/admin/nacos/namespace_access.rs:34 — TooManyFunctions — 32 free functions. The bar is 30 free functions; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyFunctions: dbx::commands::agents src-tauri/src/commands/agents.rs:31 — TooManyFunctions — 31 free functions. The bar is 30 free functions; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication · Duplicated block (24 lines × 2) · ×8
  • Duplicated block (24 lines × 2) agents/drivers/duckdb/src/sql.rs:128 — agents/drivers/duckdb/src/sql.rs:128-151 | crates/dbx-drivers/src/db/duckdb_sql.rs:166-189 — before extracting anything, compare `agents/drivers/duckdb/src/sql.rs` and `crates/dbx-drivers/src/db/duckdb_sql.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 147 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (24 lines × 2) REDACTED:7558 — REDACTED:7558-7581 | REDACTED:8050-8073 — both copies are in the same file, so extract the 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 (24 lines × 2) crates/dbx-web/src/routes/redis_pubsub_ws.rs:119 — crates/dbx-web/src/routes/redis_pubsub_ws.rs:119-142 | src-tauri/src/commands/redis_pubsub_server.rs:186-209 — before extracting anything, compare `crates/dbx-web/src/routes/redis_pubsub_ws.rs` and `src-tauri/src/commands/redis_pubsub_server.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 119 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (24 lines × 2) agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:249 — agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:249-272 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:250-273 — before extracting anything, compare `agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java` and `agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 288 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:249` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. 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 (24 lines × 2) agents/drivers/argo-go/metadata.go:517 — agents/drivers/argo-go/metadata.go:517-540 | agents/drivers/hive-go/metadata.go:528-551 — `agents/drivers/argo-go/metadata.go` and `agents/drivers/hive-go/metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 946 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/metadata.go:517` 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 (24 lines × 2) agents/drivers/argo-go/metadata.go:653 — agents/drivers/argo-go/metadata.go:653-676 | agents/drivers/hive-go/metadata.go:664-687 — `agents/drivers/argo-go/metadata.go` and `agents/drivers/hive-go/metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 946 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/metadata.go:653` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 (24 lines × 2) agents/drivers/argo-go/metadata.go:896 — agents/drivers/argo-go/metadata.go:896-919 | agents/drivers/hive-go/metadata.go:907-930 — `agents/drivers/argo-go/metadata.go` and `agents/drivers/hive-go/metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 946 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (24 lines × 2) REDACTED:1690 — REDACTED:1690-1713 | agents/drivers/vastbase-go/vastbase_metadata.go:1065-1088 — `REDACTED` and `agents/drivers/vastbase-go/vastbase_metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 71 separate duplicated blocks between them, totalling at least 1426 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1690` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 (10–11 lines × 2) · ×8
  • Duplicated block (10–11 lines × 2) crates/dbx-driver-mysql/src/mysql.rs:2107 — crates/dbx-driver-mysql/src/mysql.rs:2107-2117 | crates/dbx-driver-mysql/src/mysql.rs:2678-2687 — both copies are in the same file, so extract the 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–11 lines × 2) crates/dbx-sql-data/src/query_result_sql.rs:1281 — crates/dbx-sql-data/src/query_result_sql.rs:1281-1290 | crates/dbx-sql-data/src/query_result_sql.rs:1554-1564 — both copies are in the same file, so extract the 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–11 lines × 2) crates/dbx-sql-schema/src/schema_diff.rs:827 — crates/dbx-sql-schema/src/schema_diff.rs:827-837 | crates/dbx-sql-schema/src/schema_diff.rs:905-914 — both copies are in the same file, so extract the 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–11 lines × 2) crates/dbx-sql-schema/src/schema_diff.rs:943 — crates/dbx-sql-schema/src/schema_diff.rs:943-952 | crates/dbx-sql-schema/src/schema_diff.rs:955-965 — both copies are in the same file, so extract the 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–11 lines × 2) crates/dbx-web/src/routes/connection.rs:418 — crates/dbx-web/src/routes/connection.rs:418-427 | crates/dbx-web/src/routes/connection.rs:565-575 — both copies are in the same file, so extract the 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–11 lines × 2) agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:119 — agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:119-128 | agents/drivers/mongodb/src/main/java/com/dbx/agent/mongodb/MongoAgent.java:2452-2462 — 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 `agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:119` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:129` calls `logger`, `warn` and `agents/drivers/mongodb/src/main/java/com/dbx/agent/mongodb/MongoAgent.java:2463` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10–11 lines × 2) REDACTED:707 — REDACTED:707-716 | REDACTED:747-757 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:717` calls `contains` and `REDACTED:758` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10–11 lines × 2) agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:465 — agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:465-474 | agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:719-729 — both copies are in the same file, so extract the 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 `agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:465` 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 (7–8 lines × 2) · ×8
  • Duplicated block (7–8 lines × 2) crates/dbx-core/src/ai/agent_kv.rs:1009 — crates/dbx-core/src/ai/agent_kv.rs:1009-1015 | crates/dbx-core/src/ai/agent_kv.rs:1737-1744 — both copies are in the same file, so extract the 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–8 lines × 2) REDACTED:684 — REDACTED:684-690 | REDACTED:797-804 — both copies are in the same file, so extract the 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–8 lines × 2) crates/dbx-formats/src/temporal_format.rs:288 — crates/dbx-formats/src/temporal_format.rs:288-295 | crates/dbx-formats/src/temporal_format.rs:317-323 — both copies are in the same file, so extract the 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–8 lines × 2) REDACTED:2916 — REDACTED:2916-2923 | REDACTED:4379-4385 — 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 `REDACTED:2916` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7–8 lines × 2) agents/drivers/sqlserver-legacy/src/main/java/com/dbx/agent/sqlserverlegacy/SqlServerLegacyAgent.java:303 — agents/drivers/sqlserver-legacy/src/main/java/com/dbx/agent/sqlserverlegacy/SqlServerLegacyAgent.java:303-309 | agents/drivers/sqlserver-legacy/src/main/java/com/dbx/agent/sqlserverlegacy/SqlServerLegacyAgent.java:801-808 — both copies are in the same file, so extract the 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 `agents/drivers/sqlserver-legacy/src/main/java/com/dbx/agent/sqlserverlegacy/SqlServerLegacyAgent.java:303` 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–8 lines × 2) agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:498 — agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:498-504 | agents/drivers/oceanbase-oracle/src/main/java/com/dbx/agent/oceanbaseoracle/OceanBaseOracleAgent.java:922-929 — 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 `agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:498` 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–8 lines × 2) agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:556 — agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:556-562 | agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:714-721 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:555` calls `catalogRelation` and `agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:714` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7–8 lines × 2) agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:642 — agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:642-648 | agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:752-759 — both copies are in the same file, so extract the 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.
D1 · Cyclomatic Complexity · dbx_driver_agent · ×7
  • dbx_driver_agent::agent_service::download_with_progress (cyclomatic 37) crates/dbx-driver-agent/src/agent_service.rs:2027 — dbx_driver_agent::agent_service::download_with_progress has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • dbx_driver_agent::agent_service::import_offline_zip (cyclomatic 37) crates/dbx-driver-agent/src/agent_service.rs:3019 — dbx_driver_agent::agent_service::import_offline_zip has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • dbx_driver_agent::agent_offline_export::append_jre_tree_with_limits (cyclomatic 26) crates/dbx-driver-agent/src/agent_offline_export.rs:691 — dbx_driver_agent::agent_offline_export::append_jre_tree_with_limits 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.
  • dbx_driver_agent::agent_service::is_macho_binary_for_cpu (cyclomatic 21) crates/dbx-driver-agent/src/agent_service.rs:4287 — dbx_driver_agent::agent_service::is_macho_binary_for_cpu 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.
  • dbx_driver_agent::agent_connection::agent_connect_params_with_role (cyclomatic 20) crates/dbx-driver-agent/src/agent_connection.rs:95 — dbx_driver_agent::agent_connection::agent_connect_params_with_role 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.
  • dbx_driver_agent::backend_error::consume_sensitive_value (cyclomatic 19) crates/dbx-driver-agent/src/backend_error.rs:924 — dbx_driver_agent::backend_error::consume_sensitive_value 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.
  • dbx_driver_agent::agent_service::open_agent_download_response (cyclomatic 16) crates/dbx-driver-agent/src/agent_service.rs:2269 — dbx_driver_agent::agent_service::open_agent_download_response has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D2 · Cognitive Complexity · dbx_plugin_runtime · ×7
  • dbx_plugin_runtime::plugins::manifest::validate_contributions (cognitive 141) crates/dbx-plugin-runtime/src/plugins/manifest.rs:1322 — dbx_plugin_runtime::plugins::manifest::validate_contributions has cognitive complexity 141 (threshold 15). Drivers by points: if/else 41 (112 pts), loops 10 (18 pts), boolean chains 6, match/switch 2 (5 pts) (nesting depth added 82). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_plugin_runtime::plugins::manifest::validate_form_fields (cognitive 48) crates/dbx-plugin-runtime/src/plugins/manifest.rs:1854 — dbx_plugin_runtime::plugins::manifest::validate_form_fields has cognitive complexity 48 (threshold 15). Drivers by points: if/else 12 (31 pts), loops 4 (9 pts), boolean chains 5, match/switch 1 (3 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_plugin_runtime::plugins::marketplace::validate_and_resolve_catalog (cognitive 36) crates/dbx-plugin-runtime/src/plugins/marketplace.rs:589 — dbx_plugin_runtime::plugins::marketplace::validate_and_resolve_catalog has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_plugin_runtime::plugins::manifest::validate_localizations (cognitive 27) crates/dbx-plugin-runtime/src/plugins/manifest.rs:1211 — dbx_plugin_runtime::plugins::manifest::validate_localizations has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 4 (9 pts), boolean chains 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_plugin_runtime::plugins::installer::prune_plugin_history (cognitive 20) crates/dbx-plugin-runtime/src/plugins/installer.rs:978 — dbx_plugin_runtime::plugins::installer::prune_plugin_history has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (4 pts), boolean chains 2, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_plugin_runtime::plugins::installer::extract_package (cognitive 18) crates/dbx-plugin-runtime/src/plugins/installer.rs:781 — dbx_plugin_runtime::plugins::installer::extract_package has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_plugin_runtime::plugins::host::plugin_connection_action_result (cognitive 16) crates/dbx-plugin-runtime/src/plugins/host.rs:587 — dbx_plugin_runtime::plugins::host::plugin_connection_action_result has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 2, loops 1 (2 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dbx_web · ×7
  • dbx_web::routes::mongodb_dump::receive_source (cognitive 65) crates/dbx-web/src/routes/mongodb_dump.rs:87 — dbx_web::routes::mongodb_dump::receive_source has cognitive complexity 65 (threshold 15). Drivers by points: if/else 21 (51 pts), boolean chains 7, loops 2 (4 pts), match/switch 2 (3 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_web::routes::transfer::start_transfer (cognitive 52) crates/dbx-web/src/routes/transfer.rs:76 — dbx_web::routes::transfer::start_transfer has cognitive complexity 52 (threshold 15). Drivers by points: if/else 27 (35 pts), match/switch 8 (11 pts), boolean chains 4, loops 2 (nesting depth added 11). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • dbx_web::routes::mongodb_import_export::preview_import (cognitive 31) crates/dbx-web/src/routes/mongodb_import_export.rs:112 — dbx_web::routes::mongodb_import_export::preview_import has cognitive complexity 31 (threshold 15). Drivers by points: match/switch 7 (20 pts), if/else 5 (10 pts), loops 1 (nesting depth added 18). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • dbx_web::routes::table_import::preview_import (cognitive 31) crates/dbx-web/src/routes/table_import.rs:108 — dbx_web::routes::table_import::preview_import has cognitive complexity 31 (threshold 15). Drivers by points: match/switch 7 (20 pts), if/else 5 (10 pts), loops 1 (nesting depth added 18). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • dbx_web::routes::connection::run_temporary_connection_test (cognitive 29) crates/dbx-web/src/routes/connection.rs:284 — dbx_web::routes::connection::run_temporary_connection_test has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (15 pts), match/switch 5 (12 pts), boolean chains 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.
  • dbx_web::routes::connection::sync_connection_configs (cognitive 20) crates/dbx-web/src/routes/connection.rs:807 — dbx_web::routes::connection::sync_connection_configs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_web::routes::redis_pubsub_ws::handle_monitor_socket (cognitive 19) crates/dbx-web/src/routes/redis_pubsub_ws.rs:40 — dbx_web::routes::redis_pubsub_ws::handle_monitor_socket has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 5 (10 pts), if/else 3 (8 pts), loops 1 (nesting depth added 10). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D30 · Dependency Vulnerabilities · Medium vulnerability · ×7
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×7
  • Duplicated block (27 lines × 2) crates/dbx-core/src/admin/mq/adapters/kafka.rs:438 — crates/dbx-core/src/admin/mq/adapters/kafka.rs:438-464 | crates/dbx-core/src/admin/mq/adapters/rocketmq.rs:574-600 — before extracting anything, compare `crates/dbx-core/src/admin/mq/adapters/kafka.rs` and `crates/dbx-core/src/admin/mq/adapters/rocketmq.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 186 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (27 lines × 2) agents/drivers/argo-go/config.go:821 — agents/drivers/argo-go/config.go:821-847 | agents/drivers/hive-go/config.go:852-878 — `agents/drivers/argo-go/config.go` and `agents/drivers/hive-go/config.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 1107 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (27 lines × 2) agents/drivers/argo-go/main.go:332 — agents/drivers/argo-go/main.go:332-358 | agents/drivers/hive-go/main.go:332-358 — `agents/drivers/argo-go/main.go` and `agents/drivers/hive-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 43 separate duplicated blocks between them, totalling at least 699 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (27 lines × 2) REDACTED:1837 — REDACTED:1837-1863 | agents/drivers/vastbase-go/vastbase_metadata.go:1168-1194 — `REDACTED` and `agents/drivers/vastbase-go/vastbase_metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 71 separate duplicated blocks between them, totalling at least 1426 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (27 lines × 2) REDACTED:1894 — REDACTED:1894-1920 | agents/drivers/vastbase-go/vastbase_metadata.go:1225-1251 — `REDACTED` and `agents/drivers/vastbase-go/vastbase_metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 71 separate duplicated blocks between them, totalling at least 1426 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1894` 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 register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (27 lines × 2) REDACTED:282 — REDACTED:282-308 | REDACTED:282-308 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 397 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (27 lines × 2) agents/drivers/argo-go/bench/functional_probe.py:158 — agents/drivers/argo-go/bench/functional_probe.py:158-184 | agents/drivers/hive-go/bench/functional_probe.py:158-184 — before extracting anything, compare `agents/drivers/argo-go/bench/functional_probe.py` and `agents/drivers/hive-go/bench/functional_probe.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 155 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×7
  • Duplicated block (14 lines × 3) REDACTED:7374 — REDACTED:7374-7387 | REDACTED:7451-7464 | REDACTED:7518-7531 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (14 lines × 3) crates/dbx-driver-mongodb/src/mongo_shell.rs:1714 — crates/dbx-driver-mongodb/src/mongo_shell.rs:1714-1727 | crates/dbx-driver-mongodb/src/mongo_shell.rs:1756-1769 | crates/dbx-driver-mongodb/src/mongo_shell.rs:1797-1810 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (14 lines × 3) crates/dbx-driver-mysql/src/mysql.rs:5456 — crates/dbx-driver-mysql/src/mysql.rs:5456-5469 | crates/dbx-driver-mysql/src/mysql.rs:5614-5627 | crates/dbx-driver-mysql/src/mysql.rs:5805-5818 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (14 lines × 3) agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:172 — agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:172-185 | agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:296-309 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:174-187 — before extracting anything, compare `agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java` and `agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 145 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:172` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 3) agents/drivers/argo-go/main.go:492 — agents/drivers/argo-go/main.go:492-505 | agents/drivers/hive-go/main.go:492-505 | agents/drivers/iotdb/main.go:413-426 — `agents/drivers/argo-go/main.go` and `agents/drivers/hive-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 43 separate duplicated blocks between them, totalling at least 699 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 3) REDACTED:51 — REDACTED:51-64 | REDACTED:51-64 | agents/drivers/zookeeper/tls.go:20-33 — `REDACTED` and `REDACTED` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 25 separate duplicated blocks between them, totalling at least 473 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 3) agents/go-common/iotdb-client-go/client/session.go:1226 — agents/go-common/iotdb-client-go/client/session.go:1226-1239 | agents/go-common/iotdb-client-go/client/session.go:1252-1265 | agents/go-common/iotdb-client-go/client/session.go:1278-1291 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `agents/go-common/iotdb-client-go/client/session.go:1226` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `agents/go-common/iotdb-client-go/client/session.go:1224` calls `getColumnCategories` and `agents/go-common/iotdb-client-go/client/session.go:1250` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (12 lines × 4) · ×7
  • Duplicated block (12 lines × 4) REDACTED:4197 — REDACTED:4197-4208 | REDACTED:4256-4267 | REDACTED:4315-4326 | REDACTED:4380-4391 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (12 lines × 4) crates/dbx-mcp/src/server.rs:1184 — crates/dbx-mcp/src/server.rs:1184-1195 | crates/dbx-mcp/src/server.rs:1221-1232 | crates/dbx-mcp/src/server.rs:1245-1256 | crates/dbx-mcp/src/server.rs:1276-1287 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (12 lines × 4) agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:229 — agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:229-241 | agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:248-261 | agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:338-351 | agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:369-380 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:229` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 4) agents/drivers/cache/src/main/java/com/dbx/agent/cache/CacheAgent.java:177 — agents/drivers/cache/src/main/java/com/dbx/agent/cache/CacheAgent.java:177-188 | agents/drivers/cache/src/main/java/com/dbx/agent/cache/CacheAgent.java:216-227 | agents/drivers/iris/src/main/java/com/dbx/agent/iris/IrisAgent.java:190-201 | agents/drivers/iris/src/main/java/com/dbx/agent/iris/IrisAgent.java:229-240 — before extracting anything, compare `agents/drivers/cache/src/main/java/com/dbx/agent/cache/CacheAgent.java` and `agents/drivers/iris/src/main/java/com/dbx/agent/iris/IrisAgent.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 4) agents/drivers/argo-go/main.go:176 — agents/drivers/argo-go/main.go:176-187 | agents/drivers/cassandra-go/main.go:174-185 | agents/drivers/hive-go/main.go:176-187 | agents/drivers/iotdb/main.go:180-191 — `agents/drivers/argo-go/main.go` and `agents/drivers/cassandra-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 276 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/main.go:176` 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 (12 lines × 4) agents/drivers/iotdb/main.go:299 — agents/drivers/iotdb/main.go:299-310 | agents/drivers/kingbase-go/main.go:337-348 | agents/drivers/neo4j-go/main.go:322-333 | agents/drivers/vastbase-go/main.go:364-375 — `agents/drivers/iotdb/main.go` and `agents/drivers/kingbase-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 24 separate duplicated blocks between them, totalling at least 269 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `agents/drivers/vastbase-go/main.go:376` calls `closeConnectionRuntimes` and `agents/drivers/iotdb/main.go:311` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 4) agents/drivers/kingbase-go/main.go:363 — agents/drivers/kingbase-go/main.go:363-374 | REDACTED:860-871 | agents/drivers/vastbase-go/main.go:393-404 | REDACTED:1060-1071 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/kingbase-go/main.go:363` 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–9 lines × 2) · ×7
  • Duplicated block (8–9 lines × 2) agents/drivers/duckdb/src/sql.rs:395 — agents/drivers/duckdb/src/sql.rs:395-402 | crates/dbx-driver-sqlserver/src/sqlserver.rs:3962-3970 — 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–9 lines × 2) REDACTED:2685 — REDACTED:2685-2692 | src-tauri/src/commands/connection.rs:2068-2076 — before extracting anything, compare `REDACTED` and `src-tauri/src/commands/connection.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 247 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (8–9 lines × 2) crates/dbx-plugin-runtime/src/plugins/host.rs:139 — crates/dbx-plugin-runtime/src/plugins/host.rs:139-146 | crates/dbx-plugin-runtime/src/plugins/host.rs:389-397 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8–9 lines × 2) crates/dbx-sql-data/src/data_grid_neo4j_sql.rs:10 — crates/dbx-sql-data/src/data_grid_neo4j_sql.rs:10-18 | REDACTED:1626-1633 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8–9 lines × 2) crates/dbx-sql-schema/src/schema_diff.rs:823 — crates/dbx-sql-schema/src/schema_diff.rs:823-830 | crates/dbx-sql-schema/src/schema_diff.rs:847-855 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8–9 lines × 2) REDACTED:3227 — REDACTED:3227-3234 | REDACTED:1552-1560 — 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 `REDACTED:3227` 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–9 lines × 2) REDACTED:2238 — REDACTED:2238-2245 | REDACTED:3858-3866 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:3858` 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 (22 lines × 2) · ×7
  • Duplicated block (22 lines × 2) agents/drivers/argo-go/metadata.go:542 — agents/drivers/argo-go/metadata.go:542-563 | agents/drivers/hive-go/metadata.go:553-574 — `agents/drivers/argo-go/metadata.go` and `agents/drivers/hive-go/metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 946 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/metadata.go:542` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 (22 lines × 2) agents/drivers/argo-go/metadata.go:727 — agents/drivers/argo-go/metadata.go:727-748 | agents/drivers/hive-go/metadata.go:738-759 — `agents/drivers/argo-go/metadata.go` and `agents/drivers/hive-go/metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 946 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (22 lines × 2) agents/drivers/argo-go/metadata.go:775 — agents/drivers/argo-go/metadata.go:775-796 | agents/drivers/hive-go/metadata.go:786-807 — `agents/drivers/argo-go/metadata.go` and `agents/drivers/hive-go/metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 946 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/metadata.go:775` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 (22 lines × 2) REDACTED:274 — REDACTED:274-295 | REDACTED:177-198 — `REDACTED` and `REDACTED` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 61 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:274` 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 (22 lines × 2) REDACTED:338 — REDACTED:338-359 | REDACTED:405-426 — `REDACTED` and `REDACTED` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 61 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:338` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 (22 lines × 2) REDACTED:300 — REDACTED:300-321 | agents/drivers/vastbase-go/vastbase_metadata.go:181-202 — `REDACTED` and `agents/drivers/vastbase-go/vastbase_metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 71 separate duplicated blocks between them, totalling at least 1426 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:300` 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 (22 lines × 2) agents/drivers/vastbase-go/bench/direct/main.go:139 — agents/drivers/vastbase-go/bench/direct/main.go:139-160 | agents/drivers/vastbase-go/main.go:1320-1341 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
R7 · Dead Code · Dead file (~10 LoC) · ×7
  • Dead file (~10 LoC) apps/desktop/src/components/ui/context-menu/ContextMenu.vue — no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (apps/desktop/src/components/ui/context-menu/index.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
  • Dead file (~10 LoC) apps/desktop/src/components/ui/context-menu/ContextMenuLabel.vue — no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (apps/desktop/src/components/ui/context-menu/index.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
  • Dead file (~10 LoC) apps/desktop/src/components/ui/context-menu/ContextMenuSeparator.vue — no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (apps/desktop/src/components/ui/context-menu/index.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
  • Dead file (~10 LoC) apps/desktop/src/components/ui/sheet/SheetDescription.vue — no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (apps/desktop/src/components/ui/sheet/index.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
  • Dead file (~10 LoC) apps/desktop/src/components/ui/sheet/SheetOverlay.vue — no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (apps/desktop/src/components/ui/sheet/SheetContent.vue) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
  • Dead file (~10 LoC) apps/desktop/src/components/ui/sheet/SheetTitle.vue — no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (apps/desktop/src/components/ui/sheet/index.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
  • Dead file (~10 LoC) apps/desktop/src/lib/app/pinnedTreeNodeIds.ts — no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
D1 · Cyclomatic Complexity · dbx_web · ×6
  • dbx_web::routes::transfer::start_transfer (cyclomatic 38) crates/dbx-web/src/routes/transfer.rs:76 — dbx_web::routes::transfer::start_transfer has cyclomatic complexity 38 (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.
  • dbx_web::routes::mongodb_dump::receive_source (cyclomatic 36) crates/dbx-web/src/routes/mongodb_dump.rs:87 — dbx_web::routes::mongodb_dump::receive_source 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.
  • dbx_web::routes::mcp_policy::mongo_pure_field_predicate (cyclomatic 19) crates/dbx-web/src/routes/mcp_policy.rs:121 — dbx_web::routes::mcp_policy::mongo_pure_field_predicate has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • dbx_web::routes::table_import::preview_import (cyclomatic 18) crates/dbx-web/src/routes/table_import.rs:108 — dbx_web::routes::table_import::preview_import has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • dbx_web::routes::mongodb_import_export::preview_import (cyclomatic 16) crates/dbx-web/src/routes/mongodb_import_export.rs:112 — dbx_web::routes::mongodb_import_export::preview_import has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • dbx_web::routes::connection::run_temporary_connection_test (cyclomatic 16) crates/dbx-web/src/routes/connection.rs:284 — dbx_web::routes::connection::run_temporary_connection_test 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.
D2 · Cognitive Complexity · DbxMcpServer · ×6
  • DbxMcpServer::execute_batch_request (cognitive 66) crates/dbx-mcp/src/server.rs:1649 — DbxMcpServer::execute_batch_request has cognitive complexity 66 (threshold 15). Drivers by points: if/else 23 (34 pts), match/switch 11 (18 pts), boolean chains 8, loops 3 (6 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DbxMcpServer::execute_query (cognitive 63) crates/dbx-mcp/src/server.rs:1324 — DbxMcpServer::execute_query has cognitive complexity 63 (threshold 15). Drivers by points: if/else 25 (34 pts), match/switch 13 (25 pts), boolean chains 4 (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.
  • DbxMcpServer::execute_redis_command (cognitive 18) crates/dbx-mcp/src/server.rs:2261 — DbxMcpServer::execute_redis_command has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8, boolean chains 6, match/switch 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.
  • DbxMcpServer::execute_and_show (cognitive 17) crates/dbx-mcp/src/server.rs:2758 — DbxMcpServer::execute_and_show has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), match/switch 4 (5 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DbxMcpServer::resolve_connection (cognitive 17) crates/dbx-mcp/src/server.rs:3237 — DbxMcpServer::resolve_connection has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DbxMcpServer::call_plugin_tool_dispatch (cognitive 16) crates/dbx-mcp/src/server.rs:3374 — DbxMcpServer::call_plugin_tool_dispatch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), match/switch 4, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dbx_driver_redis · ×6
  • dbx_driver_redis::scan_keys_batch_inner (cognitive 52) crates/dbx-driver-redis/src/lib.rs:2456 — dbx_driver_redis::scan_keys_batch_inner has cognitive complexity 52 (threshold 15). Drivers by points: if/else 18 (35 pts), loops 4 (12 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_redis::parse_command_argv (cognitive 29) crates/dbx-driver-redis/src/lib.rs:1913 — dbx_driver_redis::parse_command_argv has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 2 (4 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_redis::get_slowlog (cognitive 25) crates/dbx-driver-redis/src/lib.rs:2238 — dbx_driver_redis::get_slowlog has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 3 (6 pts), loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_redis::list_keyspace_databases (cognitive 23) crates/dbx-driver-redis/src/lib.rs:1341 — dbx_driver_redis::list_keyspace_databases has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (21 pts), boolean chains 1, loops 1 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • dbx_driver_redis::scan_values_page (cognitive 19) crates/dbx-driver-redis/src/lib.rs:2596 — dbx_driver_redis::scan_values_page has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_redis::scan_cluster_keys_batch_on_session (cognitive 16) crates/dbx-driver-redis/src/lib.rs:1559 — dbx_driver_redis::scan_cluster_keys_batch_on_session has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NacosOpenApiAdmin · ×6
  • NacosOpenApiAdmin::list_instances (cognitive 26) crates/dbx-core/src/admin/nacos/http.rs:3045 — NacosOpenApiAdmin::list_instances has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 4 (9 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • NacosOpenApiAdmin::get_config (cognitive 25) crates/dbx-core/src/admin/nacos/http.rs:2578 — NacosOpenApiAdmin::get_config has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (14 pts), match/switch 3 (8 pts), boolean chains 2, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • NacosOpenApiAdmin::list_services (cognitive 20) crates/dbx-core/src/admin/nacos/http.rs:2903 — NacosOpenApiAdmin::list_services has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • NacosOpenApiAdmin::test_connection (cognitive 19) crates/dbx-core/src/admin/nacos/http.rs:1771 — NacosOpenApiAdmin::test_connection has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 4, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • NacosOpenApiAdmin::access_token (cognitive 17) crates/dbx-core/src/admin/nacos/http.rs:306 — NacosOpenApiAdmin::access_token has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), match/switch 2 (5 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • NacosOpenApiAdmin::list_configs_by_client_filters (cognitive 16) crates/dbx-core/src/admin/nacos/http.rs:1116 — NacosOpenApiAdmin::list_configs_by_client_filters has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D35 · Change Coupling · Change-coupling hub · ×6
  • Change-coupling hub: http.ts → useAppUpdater.ts, redis_ops.rs, mongo_cmd.rs, redis_cmd.rs apps/desktop/src/lib/backend/http.ts — `apps/desktop/src/lib/backend/http.ts` changes together with 4 other files — `apps/desktop/src/composables/useAppUpdater.ts`, `crates/dbx-core/src/query/redis_ops.rs`, `src-tauri/src/commands/mongo_cmd.rs`, `src-tauri/src/commands/redis_cmd.rs` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 4.
  • Change-coupling hub: api.ts → main.rs, mongo.rs, redis.rs, mongo_cmd.rs, redis_cmd.rs, lib.rs apps/desktop/src/lib/backend/api.ts — `apps/desktop/src/lib/backend/api.ts` changes together with 6 other files — `crates/dbx-web/src/main.rs`, `crates/dbx-web/src/routes/mongo.rs`, `crates/dbx-web/src/routes/redis.rs`, `src-tauri/src/commands/mongo_cmd.rs`, `src-tauri/src/commands/redis_cmd.rs`, `src-tauri/src/lib.rs` — none of which declares a dependency on it: one file is the hub of 6 separate couplings, not 6 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 6.
  • Change-coupling hub: ConnectionDialog.vue → DatabaseIcon.vue, DatabaseSearchDialog.vue, connection_secrets.rs, agent_catalog.rs, database_capabilities.rs apps/desktop/src/components/connection/ConnectionDialog.vue — `apps/desktop/src/components/connection/ConnectionDialog.vue` changes together with 5 other files — `apps/desktop/src/components/icons/DatabaseIcon.vue`, `apps/desktop/src/components/search/DatabaseSearchDialog.vue`, `crates/dbx-core/src/connection/connection_secrets.rs`, `crates/dbx-driver-agent/src/agent_catalog.rs`, `crates/dbx-driver-agent/src/database_capabilities.rs` — none of which declares a dependency on it: one file is the hub of 5 separate couplings, not 5 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 5.
  • Change-coupling hub: RedisKeyBrowser.vue → redis_ops.rs, redis.rs, redis_cmd.rs apps/desktop/src/components/redis/RedisKeyBrowser.vue — `apps/desktop/src/components/redis/RedisKeyBrowser.vue` changes together with 3 other files — `crates/dbx-core/src/query/redis_ops.rs`, `crates/dbx-web/src/routes/redis.rs`, `src-tauri/src/commands/redis_cmd.rs` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
  • Change-coupling hub: en.ts → cellDetailPresentation.ts, keyboardShortcuts.ts, shortcutRegistry.ts, settingsStore.ts, redis.rs apps/desktop/src/i18n/locales/en.ts — `apps/desktop/src/i18n/locales/en.ts` changes together with 5 other files — `apps/desktop/src/lib/dataGrid/cellDetailPresentation.ts`, `apps/desktop/src/lib/editor/keyboardShortcuts.ts`, `apps/desktop/src/lib/editor/shortcutRegistry.ts`, `apps/desktop/src/stores/settingsStore.ts`, `crates/dbx-web/src/routes/redis.rs` — none of which declares a dependency on it: one file is the hub of 5 separate couplings, not 5 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 5.
  • Change-coupling hub: REDACTED → cellDetailPresentation.ts, keyboardShortcuts.ts, shortcutRegistry.ts, settingsStore.ts, redis.rs, redis_cmd.rs REDACTED — `REDACTED` changes together with 6 other files — `apps/desktop/src/lib/dataGrid/cellDetailPresentation.ts`, `apps/desktop/src/lib/editor/keyboardShortcuts.ts`, `apps/desktop/src/lib/editor/shortcutRegistry.ts`, `apps/desktop/src/stores/settingsStore.ts`, `crates/dbx-web/src/routes/redis.rs`, `src-tauri/src/commands/redis_cmd.rs` — none of which declares a dependency on it: one file is the hub of 6 separate couplings, not 6 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 6.
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×6
  • Members sharing a duplicated core (6 members, 50+ identical tokens) crates/dbx-core/src/query/redis_ops.rs:905 — crates/dbx-core/src/query/redis_ops.rs:905-923 | crates/dbx-core/src/query/redis_ops.rs:1089-1136 | crates/dbx-core/src/query/redis_ops.rs:1138-1155 | crates/dbx-core/src/query/redis_ops.rs:1163-1193 | crates/dbx-core/src/query/redis_ops.rs:1246-1264 | crates/dbx-core/src/query/redis_ops.rs:1308-1331 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
  • Members sharing a duplicated core (6 members, 50+ identical tokens) crates/dbx-mcp/src/server.rs:1182 — crates/dbx-mcp/src/server.rs:1182-1216 | crates/dbx-mcp/src/server.rs:1219-1240 | crates/dbx-mcp/src/server.rs:1243-1271 | crates/dbx-mcp/src/server.rs:1274-1310 | crates/dbx-mcp/src/server.rs:2483-2531 | crates/dbx-mcp/src/server.rs:2718-2752 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
  • Members sharing a duplicated core (6 members, 50+ identical tokens) crates/dbx-sql-schema/src/schema_diff.rs:3611 — crates/dbx-sql-schema/src/schema_diff.rs:3611-3707 | crates/dbx-sql-schema/src/schema_diff.rs:3768-3844 | crates/dbx-sql-schema/src/schema_diff.rs:3846-3896 | crates/dbx-sql-schema/src/schema_diff.rs:3910-3966 | crates/dbx-sql-schema/src/schema_diff.rs:3968-4035 | crates/dbx-sql-schema/src/schema_diff.rs:4037-4082 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
  • Members sharing a duplicated core (6 members, 50+ identical tokens) agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:171 — agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:171-184 | agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:148-161 | agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:268-281 | agents/drivers/informix/src/main/java/com/dbx/agent/informix/InformixAgent.java:292-305 | agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:158-171 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:150-163 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
  • Members sharing a duplicated core (6 members, 50+ identical tokens) agents/drivers/argo-go/protocol_error.go:34 — agents/drivers/argo-go/protocol_error.go:34-70 | agents/drivers/cassandra-go/protocol_error.go:32-84 | agents/drivers/hive-go/protocol_error.go:34-70 | agents/drivers/iotdb/protocol_error.go:33-70 | agents/drivers/neo4j-go/protocol_error.go:38-83 | agents/drivers/vastbase-go/protocol_error.go:33-82 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
  • Members sharing a duplicated core (6 members, 50+ identical tokens) agents/go-common/iotdb-client-go/client/column.go:227 — agents/go-common/iotdb-client-go/client/column.go:227-246 | agents/go-common/iotdb-client-go/client/column.go:299-318 | agents/go-common/iotdb-client-go/client/column.go:371-390 | agents/go-common/iotdb-client-go/client/column.go:443-462 | agents/go-common/iotdb-client-go/client/column.go:515-534 | agents/go-common/iotdb-client-go/client/column.go:587-606 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×6
  • Duplicated block (11 lines × 3) crates/dbx-driver-mongodb/src/mongo_shell.rs:516 — crates/dbx-driver-mongodb/src/mongo_shell.rs:516-526 | crates/dbx-web/src/routes/mcp_policy.rs:198-208 | src-tauri/src/commands/mcp_bridge.rs:1424-1434 — before extracting anything, compare `crates/dbx-driver-mongodb/src/mongo_shell.rs` and `crates/dbx-web/src/routes/mcp_policy.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 145 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 3) crates/dbx-driver-mysql/src/mysql.rs:6881 — crates/dbx-driver-mysql/src/mysql.rs:6881-6891 | crates/dbx-driver-sqlserver/src/sqlserver.rs:3958-3968 | crates/dbx-sql-core/src/sql.rs:2251-2261 — 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 (11 lines × 3) REDACTED:286 — REDACTED:286-296 | crates/dbx-drivers/src/db/rqlite_driver.rs:280-290 | crates/dbx-drivers/src/db/turso_driver.rs:322-332 — before extracting anything, compare `REDACTED` and `crates/dbx-drivers/src/db/rqlite_driver.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 3) agents/drivers/argo-go/main.go:283 — agents/drivers/argo-go/main.go:283-293 | agents/drivers/hive-go/main.go:283-293 | REDACTED:796-806 — `agents/drivers/argo-go/main.go` and `agents/drivers/hive-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 43 separate duplicated blocks between them, totalling at least 699 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/main.go:283` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (11 lines × 3) agents/drivers/argo-go/zookeeper_tls.go:230 — agents/drivers/argo-go/zookeeper_tls.go:230-240 | REDACTED:171-181 | agents/drivers/hive-go/zookeeper_tls.go:230-240 — `agents/drivers/argo-go/zookeeper_tls.go` and `agents/drivers/hive-go/zookeeper_tls.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 223 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 3) REDACTED:1512 — REDACTED:1512-1522 | REDACTED:1603-1613 | REDACTED:1742-1752 — 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 `REDACTED:1512` 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 register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×6
  • Duplicated block (9–10 lines × 2) crates/dbx-driver-agent/src/agent_service.rs:1231 — crates/dbx-driver-agent/src/agent_service.rs:1231-1240 | crates/dbx-driver-agent/src/agent_service.rs:1267-1275 — both copies are in the same file, so extract the 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–10 lines × 2) crates/dbx-driver-support/src/ddl_scan.rs:54 — crates/dbx-driver-support/src/ddl_scan.rs:54-62 | crates/dbx-sql-data/src/query_result_sql.rs:2361-2370 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9–10 lines × 2) crates/dbx-sql-core/src/sql.rs:1194 — crates/dbx-sql-core/src/sql.rs:1194-1202 | crates/dbx-sql-core/src/sql.rs:1311-1320 — both copies are in the same file, so extract the 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–10 lines × 2) REDACTED:2858 — REDACTED:2858-2867 | REDACTED:3822-3830 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2858` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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–10 lines × 2) agents/drivers/mongodb/src/main/java/com/dbx/agent/mongodb/MongoAgent.java:634 — agents/drivers/mongodb/src/main/java/com/dbx/agent/mongodb/MongoAgent.java:634-642 | agents/drivers/mongodb/src/main/java/com/dbx/agent/mongodb/MongoAgent.java:1609-1618 — both copies are in the same file, so extract the 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 `agents/drivers/mongodb/src/main/java/com/dbx/agent/mongodb/MongoAgent.java:634` 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–10 lines × 2) agents/drivers/gbase8s/src/main/java/com/dbx/agent/gbase8s/Gbase8sAgent.java:436 — agents/drivers/gbase8s/src/main/java/com/dbx/agent/gbase8s/Gbase8sAgent.java:436-445 | agents/drivers/gbase8s/src/main/java/com/dbx/agent/gbase8s/Gbase8sAgent.java:838-846 — both copies are in the same file, so extract the 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 `agents/drivers/gbase8s/src/main/java/com/dbx/agent/gbase8s/Gbase8sAgent.java:436` 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 × 4) · ×6
  • Duplicated block (8 lines × 4) crates/dbx-driver-mysql/src/mysql.rs:6894 — crates/dbx-driver-mysql/src/mysql.rs:6894-6901 | crates/dbx-sql-core/src/sql.rs:2264-2271 | crates/dbx-sql-core/src/sql.rs:2352-2359 | crates/dbx-sql-core/src/sql.rs:2399-2406 — 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.
  • Duplicated block (8 lines × 4) crates/dbx-core/src/admin/consul/agent.rs:604 — crates/dbx-core/src/admin/consul/agent.rs:604-611 | crates/dbx-core/src/admin/consul/health.rs:165-172 | crates/dbx-core/src/admin/consul/kv.rs:448-455 | crates/dbx-core/src/admin/consul/session.rs:213-220 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
  • Duplicated block (8 lines × 4) crates/dbx-core/src/admin/mq/adapters/rabbitmq.rs:258 — crates/dbx-core/src/admin/mq/adapters/rabbitmq.rs:258-265 | crates/dbx-core/src/admin/mq/adapters/rabbitmq.rs:342-349 | crates/dbx-core/src/admin/mq/adapters/rabbitmq.rs:368-375 | crates/dbx-core/src/admin/mq/adapters/rabbitmq.rs:390-397 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 4) agents/drivers/argo-go/config.go:333 — agents/drivers/argo-go/config.go:333-340 | agents/drivers/argo-go/config.go:462-469 | agents/drivers/hive-go/config.go:339-346 | agents/drivers/hive-go/config.go:468-475 — `agents/drivers/argo-go/config.go` and `agents/drivers/hive-go/config.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 1107 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (8 lines × 4) agents/go-common/iotdb-client-go/client/session.go:596 — agents/go-common/iotdb-client-go/client/session.go:596-603 | agents/go-common/iotdb-client-go/client/session.go:629-636 | agents/go-common/iotdb-client-go/client/session.go:663-670 | agents/go-common/iotdb-client-go/client/session.go:695-702 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `agents/go-common/iotdb-client-go/client/session.go:596` 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 × 4) agents/drivers/argo-go/main.go:558 — agents/drivers/argo-go/main.go:558-565 | agents/drivers/cassandra-go/main.go:482-489 | agents/drivers/hive-go/main.go:558-565 | agents/drivers/iotdb/main.go:456-463 — `agents/drivers/argo-go/main.go` and `agents/drivers/cassandra-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 276 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×6
  • Duplicated block (13 lines × 3) agents/drivers/ignite/src/main/java/com/dbx/agent/ignite/IgniteAgent.java:76 — agents/drivers/ignite/src/main/java/com/dbx/agent/ignite/IgniteAgent.java:76-88 | agents/drivers/ignite3/src/main/java/com/dbx/agent/ignite3/Ignite3Agent.java:90-102 | agents/drivers/kylin/src/main/java/com/dbx/agent/kylin/KylinAgent.java:55-67 — before extracting anything, compare `agents/drivers/ignite/src/main/java/com/dbx/agent/ignite/IgniteAgent.java` and `agents/drivers/ignite3/src/main/java/com/dbx/agent/ignite3/Ignite3Agent.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/ignite/src/main/java/com/dbx/agent/ignite/IgniteAgent.java:76` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 × 3) agents/drivers/cassandra-go/metadata.go:658 — agents/drivers/cassandra-go/metadata.go:658-670 | REDACTED:1822-1834 | agents/drivers/vastbase-go/vastbase_metadata.go:1153-1165 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 3) agents/drivers/iotdb/protocol_error.go:56 — agents/drivers/iotdb/protocol_error.go:56-68 | agents/drivers/neo4j-go/protocol_error.go:68-80 | agents/drivers/vastbase-go/protocol_error.go:67-79 — `agents/drivers/iotdb/protocol_error.go` and `agents/drivers/neo4j-go/protocol_error.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 66 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/iotdb/protocol_error.go: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.
  • Duplicated block (13 lines × 3) agents/drivers/argo-go/metadata.go:994 — agents/drivers/argo-go/metadata.go:994-1006 | agents/drivers/hive-go/metadata.go:1005-1017 | agents/drivers/rocketmq/helpers.go:196-208 — `agents/drivers/argo-go/metadata.go` and `agents/drivers/hive-go/metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 946 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (13 lines × 3) REDACTED:372 — REDACTED:372-384 | REDACTED:372-384 | agents/drivers/zookeeper/sasl.go:182-194 — `REDACTED` and `REDACTED` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 25 separate duplicated blocks between them, totalling at least 473 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (13 lines × 3) agents/drivers/cassandra-go/metadata.go:626 — agents/drivers/cassandra-go/metadata.go:626-638 | agents/drivers/iotdb/metadata.go:579-591 | agents/drivers/neo4j-go/metadata.go:337-349 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
D4 · Code Duplication · Duplicated block (9 lines × 5) · ×6
  • Duplicated block (9 lines × 5) agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:234 — agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:234-242 | agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:137-145 | agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:257-265 | agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:147-155 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:139-147 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times. Read the line range as the matched WINDOW rather than a finished unit: at `agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:234` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 × 5) agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:205 — agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:205-213 | agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:179-187 | agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:303-311 | agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:188-196 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:181-189 — before extracting anything, compare `agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java` and `agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 98 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:205` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:178` calls `appendRoutineTypePredicate` and `agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:187` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 5) agents/drivers/cassandra-go/main.go:244 — agents/drivers/cassandra-go/main.go:244-252 | agents/drivers/iotdb/main.go:245-253 | agents/drivers/kingbase-go/main.go:288-296 | agents/drivers/neo4j-go/main.go:265-273 | agents/drivers/vastbase-go/main.go:310-318 — `agents/drivers/cassandra-go/main.go` and `agents/drivers/iotdb/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 30 separate duplicated blocks between them, totalling at least 389 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (9 lines × 5) agents/drivers/cassandra-go/protocol_error.go:121 — agents/drivers/cassandra-go/protocol_error.go:121-133 | agents/drivers/etcd-go/protocol_error.go:74-82 | agents/drivers/etcd2-go/protocol_error.go:66-74 | agents/drivers/neo4j-go/protocol_error.go:120-128 | agents/drivers/vastbase-go/protocol_error.go:119-131 — `agents/drivers/cassandra-go/protocol_error.go` and `agents/drivers/etcd-go/protocol_error.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 40 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/cassandra-go/protocol_error.go:121` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 5) REDACTED:3702 — REDACTED:3702-3710 | REDACTED:4413-4421 | REDACTED:4955-4963 | REDACTED:4991-4999 | REDACTED:5022-5030 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:3702` 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 (9 lines × 5) agents/drivers/cassandra-go/main.go:274 — agents/drivers/cassandra-go/main.go:274-282 | agents/drivers/iotdb/main.go:274-282 | agents/drivers/kingbase-go/main.go:312-320 | agents/drivers/neo4j-go/main.go:295-303 | agents/drivers/vastbase-go/main.go:337-345 — `agents/drivers/cassandra-go/main.go` and `agents/drivers/iotdb/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 30 separate duplicated blocks between them, totalling at least 389 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D1 · Cyclomatic Complexity · dbx_driver_elasticsearch · ×5
  • dbx_driver_elasticsearch::es_send_page (cyclomatic 22) crates/dbx-driver-elasticsearch/src/lib.rs:1214 — dbx_driver_elasticsearch::es_send_page has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • dbx_driver_elasticsearch::normalize_elasticsearch_rest_path (cyclomatic 20) crates/dbx-driver-elasticsearch/src/lib.rs:2050 — dbx_driver_elasticsearch::normalize_elasticsearch_rest_path 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.
  • dbx_driver_elasticsearch::adapt_elasticsearch_sql_query (cyclomatic 19) crates/dbx-driver-elasticsearch/src/lib.rs:2865 — dbx_driver_elasticsearch::adapt_elasticsearch_sql_query 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.
  • dbx_driver_elasticsearch::translate_field_operator_filter (cyclomatic 18) crates/dbx-driver-elasticsearch/src/lib.rs:1743 — dbx_driver_elasticsearch::translate_field_operator_filter 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.
  • dbx_driver_elasticsearch::parse_aggregations (cyclomatic 17) crates/dbx-driver-elasticsearch/src/lib.rs:3171 — dbx_driver_elasticsearch::parse_aggregations 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 · dbx_driver_sqlserver · ×5
  • dbx_driver_sqlserver::sqlserver::sqlserver_completion_assistant_sql (cyclomatic 20) crates/dbx-driver-sqlserver/src/sqlserver.rs:2527 — dbx_driver_sqlserver::sqlserver::sqlserver_completion_assistant_sql 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.
  • dbx_driver_sqlserver::sqlserver::top_level_sqlserver_tokens (cyclomatic 19) crates/dbx-driver-sqlserver/src/sqlserver.rs:1602 — dbx_driver_sqlserver::sqlserver::top_level_sqlserver_tokens 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.
  • dbx_driver_sqlserver::sqlserver::sqlserver_cell_to_json (cyclomatic 19) crates/dbx-driver-sqlserver/src/sqlserver.rs:2004 — dbx_driver_sqlserver::sqlserver::sqlserver_cell_to_json 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.
  • dbx_driver_sqlserver::sqlserver::sqlserver_column_metadata_from_row (cyclomatic 17) crates/dbx-driver-sqlserver/src/sqlserver.rs:2931 — dbx_driver_sqlserver::sqlserver::sqlserver_column_metadata_from_row has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • dbx_driver_sqlserver::sqlserver::first_sql_tokens (cyclomatic 17) crates/dbx-driver-sqlserver/src/sqlserver.rs:3952 — dbx_driver_sqlserver::sqlserver::first_sql_tokens has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · runtimeServer.dispatch (cyclomatic 18) · ×5
  • runtimeServer.dispatch (cyclomatic 18) agents/drivers/argo-go/main.go:175 — runtimeServer.dispatch 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. This is NOT this file's highest cyclomatic complexity: server.dispatch (cyclomatic 27) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • runtimeServer.dispatch (cyclomatic 18) agents/drivers/hive-go/main.go:175 — runtimeServer.dispatch 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. This is NOT this file's highest cyclomatic complexity: server.dispatch (cyclomatic 27) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • runtimeServer.dispatch (cyclomatic 18) agents/drivers/iotdb/main.go:179 — runtimeServer.dispatch 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. This is NOT this file's highest cyclomatic complexity: server.dispatch (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • runtimeServer.dispatch (cyclomatic 18) agents/drivers/neo4j-go/main.go:200 — runtimeServer.dispatch 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. This is NOT this file's highest cyclomatic complexity: server.dispatch (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • runtimeServer.dispatch (cyclomatic 18) REDACTED:667 — runtimeServer.dispatch 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.
D2 · Cognitive Complexity · AppState · ×5
  • AppState::get_or_create_pool_for_session_inner (cognitive 162) REDACTED:2500 — AppState::get_or_create_pool_for_session_inner has cognitive complexity 162 (threshold 15). Drivers by points: if/else 51 (109 pts), match/switch 8 (28 pts), loops 5 (18 pts), boolean chains 7 (nesting depth added 91). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • AppState::refresh_connections (cognitive 87) REDACTED:5367 — AppState::refresh_connections has cognitive complexity 87 (threshold 15). Drivers by points: match/switch 23 (69 pts), if/else 6 (12 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 53). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • AppState::start_keepalive_task (cognitive 58) REDACTED:2116 — AppState::start_keepalive_task has cognitive complexity 58 (threshold 15). Drivers by points: if/else 18 (49 pts), match/switch 3 (7 pts), boolean chains 1, 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.
  • AppState::remove_stale_connection_pool (cognitive 54) REDACTED:4062 — AppState::remove_stale_connection_pool has cognitive complexity 54 (threshold 15). Drivers by points: match/switch 24 (49 pts), if/else 4 (5 pts) (nesting depth added 26). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • AppState::insert_connection_pool_inner (cognitive 18) REDACTED:1939 — AppState::insert_connection_pool_inner has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DependencyGraph · ×5
  • DependencyGraph::build_with_functions_and_options (cognitive 121) crates/dbx-sql-schema/src/schema_diff.rs:657 — DependencyGraph::build_with_functions_and_options has cognitive complexity 121 (threshold 15). Drivers by points: if/else 23 (100 pts), loops 9 (21 pts) (nesting depth added 89). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • DependencyGraph::collect_uncovered_edges (cognitive 22) crates/dbx-sql-schema/src/schema_diff.rs:940 — DependencyGraph::collect_uncovered_edges has cognitive complexity 22 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 4 (9 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DependencyGraph::coverage_score_level2 (cognitive 21) crates/dbx-sql-schema/src/schema_diff.rs:846 — DependencyGraph::coverage_score_level2 has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DependencyGraph::topological_sort (cognitive 19) crates/dbx-sql-schema/src/schema_diff.rs:774 — DependencyGraph::topological_sort has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 4 (7 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DependencyGraph::count_transitive_edges (cognitive 18) crates/dbx-sql-schema/src/schema_diff.rs:918 — DependencyGraph::count_transitive_edges has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D29 · Static Analysis (SAST) · REDACTED · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) · ×5
  • Members sharing a duplicated core (7 members, 50+ identical tokens) crates/dbx-core/src/admin/mq/adapters/pulsar.rs:524 — crates/dbx-core/src/admin/mq/adapters/pulsar.rs:524-540 | crates/dbx-core/src/admin/mq/adapters/pulsar.rs:542-560 | crates/dbx-core/src/admin/mq/adapters/pulsar.rs:575-600 | crates/dbx-core/src/admin/mq/adapters/pulsar.rs:602-621 | crates/dbx-core/src/admin/mq/adapters/pulsar.rs:669-687 | crates/dbx-core/src/admin/mq/adapters/pulsar.rs:689-706 | crates/dbx-core/src/admin/mq/adapters/pulsar.rs:708-734 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
  • Members sharing a duplicated core (7 members, 50+ identical tokens) REDACTED:2299 — REDACTED:2299-2353 | REDACTED:2456-2543 | REDACTED:2904-2956 | REDACTED:4163-4180 | REDACTED:5893-5921 | REDACTED:8096-8166 | REDACTED:8184-8244 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
  • Members sharing a duplicated core (7 members, 50+ identical tokens) agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:112 — agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:112-125 | agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:88-101 | agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:205-218 | agents/drivers/informix/src/main/java/com/dbx/agent/informix/InformixAgent.java:238-251 | agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:92-105 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:90-103 | agents/drivers/trino/src/main/java/com/dbx/agent/trino/TrinoAgent.java:93-106 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
  • Members sharing a duplicated core (7 members, 50+ identical tokens) agents/drivers/argo-go/protocol_error.go:103 — agents/drivers/argo-go/protocol_error.go:103-122 | agents/drivers/cassandra-go/protocol_error.go:119-143 | agents/drivers/etcd-go/protocol_error.go:69-90 | agents/drivers/etcd2-go/protocol_error.go:64-82 | agents/drivers/hive-go/protocol_error.go:103-122 | agents/drivers/neo4j-go/protocol_error.go:118-136 | agents/drivers/vastbase-go/protocol_error.go:117-141 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
  • Members sharing a duplicated core (7 members, 50+ identical tokens) agents/drivers/cassandra-go/main.go:242 — agents/drivers/cassandra-go/main.go:242-272 | agents/drivers/iotdb/main.go:243-272 | agents/drivers/kingbase-go/main.go:286-310 | agents/drivers/neo4j-go/main.go:263-293 | REDACTED:744-772 | agents/drivers/vastbase-go/main.go:308-335 | REDACTED:847-907 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×5
  • Duplicated block (9 lines × 4) crates/dbx-driver-mysql/src/mysql.rs:6055 — crates/dbx-driver-mysql/src/mysql.rs:6055-6063 | crates/dbx-driver-mysql/src/mysql.rs:6103-6111 | REDACTED:2423-2431 | REDACTED:2454-2462 — before extracting anything, compare `crates/dbx-driver-mysql/src/mysql.rs` and `REDACTED` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 4) crates/dbx-driver-sqlserver/src/sqlserver.rs:1666 — crates/dbx-driver-sqlserver/src/sqlserver.rs:1666-1674 | crates/dbx-driver-sqlserver/src/sqlserver.rs:1680-1688 | crates/dbx-sql-data/src/query_result_sql.rs:1818-1826 | crates/dbx-sql-data/src/query_result_sql.rs:1838-1846 — before extracting anything, compare `crates/dbx-driver-sqlserver/src/sqlserver.rs` and `crates/dbx-sql-data/src/query_result_sql.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 4) agents/drivers/kingbase-go/main.go:251 — agents/drivers/kingbase-go/main.go:251-259 | REDACTED:704-712 | agents/drivers/vastbase-go/main.go:268-276 | REDACTED:808-816 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/kingbase-go/main.go:251` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:714` calls `closeAllSessions` and `agents/drivers/kingbase-go/main.go:261` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 4) agents/drivers/argo-go/main.go:586 — agents/drivers/argo-go/main.go:586-594 | agents/drivers/cassandra-go/main.go:510-518 | agents/drivers/hive-go/main.go:586-594 | agents/drivers/iotdb/main.go:484-492 — `agents/drivers/argo-go/main.go` and `agents/drivers/cassandra-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 276 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (9 lines × 4) agents/drivers/argo-go/main.go:596 — agents/drivers/argo-go/main.go:596-604 | agents/drivers/cassandra-go/main.go:520-528 | agents/drivers/hive-go/main.go:596-604 | agents/drivers/iotdb/main.go:494-502 — `agents/drivers/argo-go/main.go` and `agents/drivers/cassandra-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 276 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×5
  • Duplicated block (7 lines × 4) crates/dbx-sql-schema/src/table_structure_sql/column_alter.rs:547 — crates/dbx-sql-schema/src/table_structure_sql/column_alter.rs:547-553 | crates/dbx-sql-schema/src/table_structure_sql/column_alter.rs:663-669 | crates/dbx-sql-schema/src/table_structure_sql/column_alter.rs:878-884 | crates/dbx-sql-schema/src/table_structure_sql/column_alter.rs:933-939 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (7 lines × 4) crates/dbx-ai-provider/src/ai_claude_code_cli.rs:122 — crates/dbx-ai-provider/src/ai_claude_code_cli.rs:122-128 | crates/dbx-ai-provider/src/ai_codebuddy_cli.rs:199-205 | crates/dbx-ai-provider/src/ai_grok_cli.rs:172-178 | crates/dbx-ai-provider/src/ai_qoder_cli.rs:54-60 — before extracting anything, compare `crates/dbx-ai-provider/src/ai_claude_code_cli.rs` and `crates/dbx-ai-provider/src/ai_codebuddy_cli.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 4) REDACTED:2337 — REDACTED:2337-2343 | REDACTED:2359-2365 | REDACTED:3891-3897 | REDACTED:3906-3912 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2337` 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 × 4) agents/common/src/main/java/com/dbx/agent/EwkbWktDecoder.java:278 — agents/common/src/main/java/com/dbx/agent/EwkbWktDecoder.java:278-284 | agents/common/src/main/java/com/dbx/agent/JdbcExecutor.java:722-728 | REDACTED:2734-2740 | REDACTED:4612-4618 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `agents/common/src/main/java/com/dbx/agent/EwkbWktDecoder.java:278` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (7 lines × 4) agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java:48 — agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java:48-54 | agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:57-63 | agents/drivers/spark/src/main/java/com/dbx/agent/spark/SparkAgent.java:116-122 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:59-65 — before extracting anything, compare `agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java` and `agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (40 lines × 2) · ×5
  • Duplicated block (40 lines × 2) REDACTED:92 — REDACTED:92-131 | REDACTED:92-131 — `REDACTED` and `REDACTED` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 25 separate duplicated blocks between them, totalling at least 473 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (40 lines × 2) agents/drivers/argo-go/query.go:217 — agents/drivers/argo-go/query.go:217-256 | agents/drivers/hive-go/query.go:217-256 — `agents/drivers/argo-go/query.go` and `agents/drivers/hive-go/query.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 20 separate duplicated blocks between them, totalling at least 444 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (40 lines × 2) agents/drivers/argo-go/zookeeper_tls.go:19 — agents/drivers/argo-go/zookeeper_tls.go:19-58 | agents/drivers/hive-go/zookeeper_tls.go:19-58 — `agents/drivers/argo-go/zookeeper_tls.go` and `agents/drivers/hive-go/zookeeper_tls.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 223 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (40 lines × 2) REDACTED:910 — REDACTED:910-949 | agents/drivers/vastbase-go/vastbase_metadata.go:769-808 — `REDACTED` and `agents/drivers/vastbase-go/vastbase_metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 71 separate duplicated blocks between them, totalling at least 1426 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (40 lines × 2) agents/drivers/kingbase-go/main.go:1162 — agents/drivers/kingbase-go/main.go:1162-1201 | agents/drivers/vastbase-go/main.go:1163-1202 — `agents/drivers/kingbase-go/main.go` and `agents/drivers/vastbase-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 50 separate duplicated blocks between them, totalling at least 708 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/kingbase-go/main.go:1162` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 (37 lines × 2) · ×5
  • Duplicated block (37 lines × 2) agents/drivers/argo-go/config.go:959 — agents/drivers/argo-go/config.go:959-995 | agents/drivers/hive-go/config.go:990-1026 — `agents/drivers/argo-go/config.go` and `agents/drivers/hive-go/config.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 1107 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (37 lines × 2) agents/drivers/argo-go/connector.go:132 — agents/drivers/argo-go/connector.go:132-168 | agents/drivers/hive-go/connector.go:132-168 — `agents/drivers/argo-go/connector.go` and `agents/drivers/hive-go/connector.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 121 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (37 lines × 2) agents/drivers/argo-go/metadata.go:339 — agents/drivers/argo-go/metadata.go:339-375 | agents/drivers/hive-go/metadata.go:345-381 — `agents/drivers/argo-go/metadata.go` and `agents/drivers/hive-go/metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 946 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/metadata.go:339` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (37 lines × 2) REDACTED:194 — REDACTED:194-230 | REDACTED:194-230 — `REDACTED` and `REDACTED` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 25 separate duplicated blocks between them, totalling at least 473 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (37 lines × 2) REDACTED:528 — REDACTED:528-564 | REDACTED:528-564 — `REDACTED` and `REDACTED` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 25 separate duplicated blocks between them, totalling at least 473 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D1 · Cyclomatic Complexity · AppState · ×4
  • AppState::get_or_create_pool_for_session_inner (cyclomatic 95) REDACTED:2500 — AppState::get_or_create_pool_for_session_inner has cyclomatic complexity 95 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • AppState::refresh_connections (cyclomatic 60) REDACTED:5367 — AppState::refresh_connections has cyclomatic complexity 60 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • AppState::remove_stale_connection_pool (cyclomatic 57) REDACTED:4062 — AppState::remove_stale_connection_pool has cyclomatic complexity 57 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • AppState::start_keepalive_task (cyclomatic 22) REDACTED:2116 — AppState::start_keepalive_task 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. This is NOT this file's highest cyclomatic complexity: dbx_core::connection::close_pool_kind (cyclomatic 31) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · dbx_duckdb_driver · ×4
  • dbx_duckdb_driver::sql::rewrite_duckdb_current_date_literal_arithmetic (cyclomatic 26) agents/drivers/duckdb/src/sql.rs:202 — dbx_duckdb_driver::sql::rewrite_duckdb_current_date_literal_arithmetic has cyclomatic complexity 26 (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.
  • dbx_duckdb_driver::sql::split_sql_statements (cyclomatic 25) agents/drivers/duckdb/src/sql.rs:1 — dbx_duckdb_driver::sql::split_sql_statements has cyclomatic complexity 25 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • dbx_duckdb_driver::sql::contains_unquoted_sql_keyword (cyclomatic 23) agents/drivers/duckdb/src/sql.rs:330 — dbx_duckdb_driver::sql::contains_unquoted_sql_keyword has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • dbx_duckdb_driver::sql::first_executable_sql_token (cyclomatic 17) agents/drivers/duckdb/src/sql.rs:384 — dbx_duckdb_driver::sql::first_executable_sql_token has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D2 · Cognitive Complexity · BackupService · ×4
  • BackupService::export_job (cognitive 101) crates/dbx-core/src/scheduled_backup/engine.rs:152 — BackupService::export_job has cognitive complexity 101 (threshold 15). Drivers by points: if/else 39 (85 pts), loops 5 (11 pts), boolean chains 5 (nesting depth added 52). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • BackupService::serve (cognitive 25) crates/dbx-core/src/scheduled_backup/engine.rs:15 — BackupService::serve has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 3 (9 pts), boolean chains 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.
  • BackupService::tick (cognitive 25) crates/dbx-core/src/scheduled_backup/engine.rs:58 — BackupService::tick has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (17 pts), match/switch 2 (5 pts), boolean chains 2, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • BackupService::cleanup (cognitive 19) crates/dbx-core/src/scheduled_backup/service.rs:151 — BackupService::cleanup has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dbx_sql_dialect · ×4
  • dbx_sql_dialect::sql_dialect::table_select::build_table_data_select_sql_with_database (cognitive 44) crates/dbx-sql-dialect/src/sql_dialect/table_select.rs:193 — dbx_sql_dialect::sql_dialect::table_select::build_table_data_select_sql_with_database has cognitive complexity 44 (threshold 15). Drivers by points: if/else 32 (38 pts), boolean chains 5, match/switch 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.
  • dbx_sql_dialect::sql_dialect::type_rewrite::rewrite_column_type (cognitive 20) crates/dbx-sql-dialect/src/sql_dialect/type_rewrite.rs:314 — dbx_sql_dialect::sql_dialect::type_rewrite::rewrite_column_type has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_dialect::sql_dialect::table_select::build_select_columns (cognitive 19) crates/dbx-sql-dialect/src/sql_dialect/table_select.rs:737 — dbx_sql_dialect::sql_dialect::table_select::build_select_columns has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_sql_dialect::sql_dialect::table_select::large_value_preview_kind (cognitive 18) crates/dbx-sql-dialect/src/sql_dialect/table_select.rs:49 — dbx_sql_dialect::sql_dialect::table_select::large_value_preview_kind has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 5, match/switch 1 (nesting depth added 2). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · dbx_duckdb_driver · ×4
  • dbx_duckdb_driver::sql::split_sql_statements (cognitive 33) agents/drivers/duckdb/src/sql.rs:1 — dbx_duckdb_driver::sql::split_sql_statements has cognitive complexity 33 (threshold 15). Drivers by points: if/else 5 (15 pts), boolean chains 9, loops 3 (7 pts), match/switch 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_duckdb_driver::sql::rewrite_duckdb_current_date_literal_arithmetic (cognitive 33) agents/drivers/duckdb/src/sql.rs:202 — dbx_duckdb_driver::sql::rewrite_duckdb_current_date_literal_arithmetic has cognitive complexity 33 (threshold 15). Drivers by points: if/else 4 (12 pts), boolean chains 11, loops 3 (7 pts), match/switch 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_duckdb_driver::sql::contains_unquoted_sql_keyword (cognitive 31) agents/drivers/duckdb/src/sql.rs:330 — dbx_duckdb_driver::sql::contains_unquoted_sql_keyword has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 10, loops 4 (10 pts), if/else 3 (9 pts), match/switch 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_duckdb_driver::sql::first_executable_sql_token (cognitive 24) agents/drivers/duckdb/src/sql.rs:384 — dbx_duckdb_driver::sql::first_executable_sql_token has cognitive complexity 24 (threshold 15). Drivers by points: loops 5 (10 pts), boolean chains 8, if/else 3 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D29 · Static Analysis (SAST) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (32 lines × 2) · ×4
  • Duplicated block (32 lines × 2) REDACTED:3497 — REDACTED:3497-3528 | REDACTED:4187-4218 — both copies are in the same file, so extract the 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 (32 lines × 2) agents/drivers/argo-go/config.go:422 — agents/drivers/argo-go/config.go:422-453 | agents/drivers/hive-go/config.go:428-459 — `agents/drivers/argo-go/config.go` and `agents/drivers/hive-go/config.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 1107 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/config.go:422` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 (32 lines × 2) agents/drivers/argo-go/config.go:686 — agents/drivers/argo-go/config.go:686-717 | agents/drivers/hive-go/config.go:692-723 — `agents/drivers/argo-go/config.go` and `agents/drivers/hive-go/config.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 1107 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (32 lines × 2) REDACTED:79 — REDACTED:79-110 | REDACTED:79-110 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 397 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (31 lines × 2) · ×4
  • Duplicated block (31 lines × 2) crates/dbx-web/src/routes/redis_pubsub_ws.rs:86 — crates/dbx-web/src/routes/redis_pubsub_ws.rs:86-116 | src-tauri/src/commands/redis_pubsub_server.rs:153-183 — before extracting anything, compare `crates/dbx-web/src/routes/redis_pubsub_ws.rs` and `src-tauri/src/commands/redis_pubsub_server.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 119 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (31 lines × 2) agents/drivers/argo-go/metadata.go:436 — agents/drivers/argo-go/metadata.go:436-466 | agents/drivers/hive-go/metadata.go:442-472 — `agents/drivers/argo-go/metadata.go` and `agents/drivers/hive-go/metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 946 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (31 lines × 2) agents/drivers/argo-go/metadata.go:942 — agents/drivers/argo-go/metadata.go:942-972 | agents/drivers/hive-go/metadata.go:953-983 — `agents/drivers/argo-go/metadata.go` and `agents/drivers/hive-go/metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 946 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (31 lines × 2) REDACTED:1137 — REDACTED:1137-1167 | agents/drivers/vastbase-go/vastbase_metadata.go:996-1026 — `REDACTED` and `agents/drivers/vastbase-go/vastbase_metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 71 separate duplicated blocks between them, totalling at least 1426 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1137` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (30 lines × 2) · ×4
  • Duplicated block (30 lines × 2) crates/dbx-web/src/routes/redis_pubsub_ws.rs:43 — crates/dbx-web/src/routes/redis_pubsub_ws.rs:43-72 | src-tauri/src/commands/redis_pubsub_server.rs:110-139 — before extracting anything, compare `crates/dbx-web/src/routes/redis_pubsub_ws.rs` and `src-tauri/src/commands/redis_pubsub_server.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 119 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (30 lines × 2) agents/drivers/argo-go/config.go:143 — agents/drivers/argo-go/config.go:143-172 | agents/drivers/hive-go/config.go:146-175 — `agents/drivers/argo-go/config.go` and `agents/drivers/hive-go/config.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 1107 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (30 lines × 2) REDACTED:64 — REDACTED:64-93 | REDACTED:64-93 — `REDACTED` and `REDACTED` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 17 separate duplicated blocks between them, totalling at least 340 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (30 lines × 2) agents/drivers/iotdb/metadata.go:23 — agents/drivers/iotdb/metadata.go:23-52 | agents/drivers/neo4j-go/metadata.go:18-47 — `agents/drivers/iotdb/metadata.go` and `agents/drivers/neo4j-go/metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 187 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/iotdb/metadata.go:23` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `agents/drivers/iotdb/metadata.go:20` calls `MustCompile` and `agents/drivers/neo4j-go/metadata.go:16` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (28 lines × 2) · ×4
  • Duplicated block (28 lines × 2) crates/dbx-core/src/admin/nacos/search.rs:250 — crates/dbx-core/src/admin/nacos/search.rs:250-277 | crates/dbx-core/src/admin/nacos/search.rs:331-358 — both copies are in the same file, so extract the 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 (28 lines × 2) REDACTED:247 — REDACTED:247-274 | REDACTED:247-274 — `REDACTED` and `REDACTED` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 17 separate duplicated blocks between them, totalling at least 340 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (28 lines × 2) agents/drivers/argo-go/main.go:240 — agents/drivers/argo-go/main.go:240-267 | agents/drivers/hive-go/main.go:240-267 — `agents/drivers/argo-go/main.go` and `agents/drivers/hive-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 43 separate duplicated blocks between them, totalling at least 699 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (28 lines × 2) REDACTED:3058 — REDACTED:3058-3085 | agents/drivers/vastbase-go/vastbase_metadata.go:2156-2183 — `REDACTED` and `agents/drivers/vastbase-go/vastbase_metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 71 separate duplicated blocks between them, totalling at least 1426 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/vastbase-go/vastbase_metadata.go:2156` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (18–19 lines × 2) · ×4
  • Duplicated block (18–19 lines × 2) REDACTED:10412 — REDACTED:10412-10429 | REDACTED:10450-10468 — both copies are in the same file, so extract the 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 (18–19 lines × 2) crates/dbx-sql-schema/src/schema_diff.rs:852 — crates/dbx-sql-schema/src/schema_diff.rs:852-870 | crates/dbx-sql-schema/src/schema_diff.rs:919-936 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (18–19 lines × 2) crates/dbx-web/src/routes/mongodb_import_export.rs:254 — crates/dbx-web/src/routes/mongodb_import_export.rs:254-271 | crates/dbx-web/src/routes/table_import.rs:270-288 — before extracting anything, compare `crates/dbx-web/src/routes/mongodb_import_export.rs` and `crates/dbx-web/src/routes/table_import.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 151 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (18–19 lines × 2) crates/dbx-web/src/routes/query.rs:1287 — crates/dbx-web/src/routes/query.rs:1287-1304 | src-tauri/src/commands/query.rs:942-960 — before extracting anything, compare `crates/dbx-web/src/routes/query.rs` and `src-tauri/src/commands/query.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (14 lines × 4) · ×4
  • Duplicated block (14 lines × 4) crates/dbx-core/src/schema/mod.rs:921 — crates/dbx-core/src/schema/mod.rs:921-935 | crates/dbx-core/src/schema/mod.rs:2541-2554 | crates/dbx-core/src/schema/mod.rs:7211-7225 | crates/dbx-core/src/schema/mod.rs:8031-8045 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (14 lines × 4) REDACTED:247 — REDACTED:247-260 | agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:483-496 | agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:658-671 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:442-455 — 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.
  • Duplicated block (14 lines × 4) agents/drivers/cassandra-go/metadata.go:544 — agents/drivers/cassandra-go/metadata.go:544-557 | agents/drivers/iotdb/metadata.go:494-507 | REDACTED:1767-1780 | agents/drivers/vastbase-go/vastbase_metadata.go:1098-1111 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/cassandra-go/metadata.go:544` 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 (14 lines × 4) agents/drivers/etcd-go/auth.go:229 — agents/drivers/etcd-go/auth.go:229-242 | agents/drivers/etcd-go/auth.go:267-280 | agents/drivers/etcd2-go/auth.go:104-117 | agents/drivers/etcd2-go/auth.go:149-162 — 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×4
  • Duplicated block (11–12 lines × 2) crates/dbx-ai-provider/src/ai_claude_code_cli.rs:356 — crates/dbx-ai-provider/src/ai_claude_code_cli.rs:356-367 | crates/dbx-ai-provider/src/ai_codebuddy_cli.rs:453-463 — before extracting anything, compare `crates/dbx-ai-provider/src/ai_claude_code_cli.rs` and `crates/dbx-ai-provider/src/ai_codebuddy_cli.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (11–12 lines × 2) REDACTED:4862 — REDACTED:4862-4872 | REDACTED:5043-5054 — both copies are in the same file, so extract the 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–12 lines × 2) agents/drivers/gbase8s/src/main/java/com/dbx/agent/gbase8s/Gbase8sAgent.java:175 — agents/drivers/gbase8s/src/main/java/com/dbx/agent/gbase8s/Gbase8sAgent.java:175-185 | agents/drivers/gbase8s/src/main/java/com/dbx/agent/gbase8s/Gbase8sAgent.java:374-385 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/gbase8s/src/main/java/com/dbx/agent/gbase8s/Gbase8sAgent.java:175` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 (11–12 lines × 2) REDACTED:1636 — REDACTED:1636-1647 | agents/drivers/vastbase-go/vastbase_metadata.go:1029-1039 — `REDACTED` and `agents/drivers/vastbase-go/vastbase_metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 71 separate duplicated blocks between them, totalling at least 1426 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1636` 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 (10 lines × 4) · ×4
  • Duplicated block (10 lines × 4) REDACTED:966 — REDACTED:966-975 | REDACTED:1046-1055 | REDACTED:1061-1070 | REDACTED:1185-1194 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (10 lines × 4) crates/dbx-sql-schema/src/schema_diff.rs:3822 — crates/dbx-sql-schema/src/schema_diff.rs:3822-3831 | crates/dbx-sql-schema/src/schema_diff.rs:3874-3883 | crates/dbx-sql-schema/src/schema_diff.rs:4013-4022 | crates/dbx-sql-schema/src/schema_diff.rs:4060-4069 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (10 lines × 4) agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java:209 — agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java:209-218 | REDACTED:978-987 | agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:341-350 | agents/drivers/trino/src/main/java/com/dbx/agent/trino/TrinoAgent.java:243-252 — before extracting anything, compare `agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java` and `agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 4) agents/drivers/etcd-go/main.go:437 — agents/drivers/etcd-go/main.go:437-446 | agents/drivers/etcd2-go/main.go:404-413 | REDACTED:5323-5332 | REDACTED:5930-5939 — `agents/drivers/etcd-go/main.go` and `agents/drivers/etcd2-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 19 separate duplicated blocks between them, totalling at least 278 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: the declarations holding them bind `string` to `s *etcdSession) handle(method` in one and `s *etcd2Session) handle(method` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (8 lines × 6) · ×4
  • Duplicated block (8 lines × 6) crates/dbx-core/src/query/redis_ops.rs:115 — crates/dbx-core/src/query/redis_ops.rs:115-122 | crates/dbx-core/src/query/redis_ops.rs:145-152 | crates/dbx-core/src/query/redis_ops.rs:174-181 | crates/dbx-core/src/query/redis_ops.rs:202-209 | crates/dbx-core/src/query/redis_ops.rs:305-312 | crates/dbx-core/src/query/redis_ops.rs:337-344 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 6) crates/dbx-mcp/src/server.rs:1190 — crates/dbx-mcp/src/server.rs:1190-1197 | crates/dbx-mcp/src/server.rs:1227-1234 | crates/dbx-mcp/src/server.rs:1251-1258 | crates/dbx-mcp/src/server.rs:1282-1289 | crates/dbx-mcp/src/server.rs:2492-2499 | crates/dbx-mcp/src/server.rs:2727-2734 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 6) agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:261 — agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:261-268 | agents/drivers/ignite/src/main/java/com/dbx/agent/ignite/IgniteAgent.java:102-109 | agents/drivers/ignite3/src/main/java/com/dbx/agent/ignite3/Ignite3Agent.java:116-123 | agents/drivers/kylin/src/main/java/com/dbx/agent/kylin/KylinAgent.java:81-88 | agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:258-265 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:261-268 — before extracting anything, compare `agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java` and `agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 131 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:261` 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 × 6) agents/drivers/cassandra-go/main.go:244 — agents/drivers/cassandra-go/main.go:244-251 | agents/drivers/iotdb/main.go:245-252 | agents/drivers/kingbase-go/main.go:288-295 | agents/drivers/neo4j-go/main.go:265-272 | REDACTED:746-753 | agents/drivers/vastbase-go/main.go:310-317 — `agents/drivers/cassandra-go/main.go` and `agents/drivers/iotdb/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 30 separate duplicated blocks between them, totalling at least 389 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (7 lines × 5) · ×4
  • Duplicated block (7 lines × 5) REDACTED:4951 — REDACTED:4951-4957 | REDACTED:5773-5779 | REDACTED:5805-5811 | REDACTED:5835-5841 | REDACTED:5863-5869 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (7 lines × 5) crates/dbx-core/src/schema/mod.rs:1024 — crates/dbx-core/src/schema/mod.rs:1024-1032 | crates/dbx-core/src/schema/mod.rs:1048-1056 | crates/dbx-core/src/schema/mod.rs:1062-1068 | crates/dbx-core/src/schema/mod.rs:1079-1085 | crates/dbx-core/src/schema/mod.rs:1097-1103 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (7 lines × 5) crates/dbx-driver-sqlserver/src/sqlserver.rs:1668 — crates/dbx-driver-sqlserver/src/sqlserver.rs:1668-1674 | crates/dbx-driver-sqlserver/src/sqlserver.rs:1682-1688 | crates/dbx-sql-data/src/query_result_sql.rs:1820-1826 | crates/dbx-sql-data/src/query_result_sql.rs:1840-1846 | crates/dbx-sql-data/src/query_result_sql.rs:2247-2253 — before extracting anything, compare `crates/dbx-driver-sqlserver/src/sqlserver.rs` and `crates/dbx-sql-data/src/query_result_sql.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 5) crates/dbx-mcp/src/server.rs:2027 — crates/dbx-mcp/src/server.rs:2027-2033 | crates/dbx-mcp/src/server.rs:2266-2272 | crates/dbx-mcp/src/server.rs:2760-2766 | crates/dbx-mcp/src/server.rs:2836-2842 | crates/dbx-mcp/src/server.rs:2865-2871 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (9 lines × 7) · ×4
  • Duplicated block (9 lines × 7) crates/dbx-ai-provider/src/ai_claude_code_cli.rs:177 — crates/dbx-ai-provider/src/ai_claude_code_cli.rs:177-185 | crates/dbx-ai-provider/src/ai_codebuddy_cli.rs:257-265 | crates/dbx-ai-provider/src/ai_codex_cli.rs:478-486 | crates/dbx-ai-provider/src/ai_cursor_cli.rs:148-156 | crates/dbx-ai-provider/src/ai_grok_cli.rs:227-235 | crates/dbx-ai-provider/src/ai_opencode_cli.rs:121-129 | crates/dbx-ai-provider/src/ai_qoder_cli.rs:109-117 — before extracting anything, compare `crates/dbx-ai-provider/src/ai_claude_code_cli.rs` and `crates/dbx-ai-provider/src/ai_codebuddy_cli.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 7) crates/dbx-web/src/routes/consul.rs:14 — crates/dbx-web/src/routes/consul.rs:14-22 | crates/dbx-web/src/routes/document_store.rs:35-43 | crates/dbx-web/src/routes/etcd.rs:16-24 | crates/dbx-web/src/routes/hbase.rs:15-23 | crates/dbx-web/src/routes/mongo.rs:49-57 | crates/dbx-web/src/routes/redis.rs:17-25 | crates/dbx-web/src/routes/zookeeper.rs:14-22 — before extracting anything, compare `crates/dbx-web/src/routes/document_store.rs` and `crates/dbx-web/src/routes/mongo.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 7) agents/drivers/argo-go/main.go:198 — agents/drivers/argo-go/main.go:198-206 | agents/drivers/cassandra-go/main.go:196-204 | agents/drivers/hive-go/main.go:198-206 | agents/drivers/iotdb/main.go:202-210 | agents/drivers/kingbase-go/main.go:250-258 | agents/drivers/neo4j-go/main.go:223-231 | agents/drivers/vastbase-go/main.go:267-275 — `agents/drivers/argo-go/main.go` and `agents/drivers/cassandra-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 276 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `string` to `runtimeServer *runtimeServer) dispatch(method` in one and `r *runtimeServer) dispatch(method` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `agents/drivers/kingbase-go/main.go:259` calls `newServer`, `dispatch` and `agents/drivers/argo-go/main.go:207` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 7) agents/drivers/argo-go/main.go:392 — agents/drivers/argo-go/main.go:392-400 | agents/drivers/cassandra-go/main.go:328-336 | agents/drivers/hive-go/main.go:392-400 | agents/drivers/iotdb/main.go:330-338 | agents/drivers/kingbase-go/main.go:376-384 | agents/drivers/neo4j-go/main.go:425-433 | agents/drivers/vastbase-go/main.go:407-415 — `agents/drivers/argo-go/main.go` and `agents/drivers/cassandra-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 276 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/main.go:392` 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 first that the copies are not typed on the same thing: the declarations holding them bind `string` to `server *server) dispatch(method` in one and `s *server) dispatch(method` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `agents/drivers/cassandra-go/main.go:327` calls `handshakeResult` and `agents/drivers/argo-go/main.go:391` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (29 lines × 2) · ×4
  • Duplicated block (29 lines × 2) agents/drivers/cache/src/main/java/com/dbx/agent/cache/CacheAgent.java:98 — agents/drivers/cache/src/main/java/com/dbx/agent/cache/CacheAgent.java:98-126 | agents/drivers/iris/src/main/java/com/dbx/agent/iris/IrisAgent.java:108-136 — before extracting anything, compare `agents/drivers/cache/src/main/java/com/dbx/agent/cache/CacheAgent.java` and `agents/drivers/iris/src/main/java/com/dbx/agent/iris/IrisAgent.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/cache/src/main/java/com/dbx/agent/cache/CacheAgent.java:98` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `agents/drivers/iris/src/main/java/com/dbx/agent/iris/IrisAgent.java:137` calls `hasPrimaryKey`, `markPrimaryKeys`, `irisPrimaryKeys` and `agents/drivers/cache/src/main/java/com/dbx/agent/cache/CacheAgent.java:127` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (29 lines × 2) agents/drivers/argo-go/config.go:386 — agents/drivers/argo-go/config.go:386-414 | agents/drivers/hive-go/config.go:392-420 — `agents/drivers/argo-go/config.go` and `agents/drivers/hive-go/config.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 1107 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (29 lines × 2) agents/drivers/argo-go/config.go:1168 — agents/drivers/argo-go/config.go:1168-1196 | agents/drivers/hive-go/config.go:1199-1227 — `agents/drivers/argo-go/config.go` and `agents/drivers/hive-go/config.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 1107 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (29 lines × 2) REDACTED:177 — REDACTED:177-205 | agents/drivers/vastbase-go/vastbase_metadata.go:112-140 — `REDACTED` and `agents/drivers/vastbase-go/vastbase_metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 71 separate duplicated blocks between them, totalling at least 1426 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (43 lines × 2) · ×4
  • Duplicated block (43 lines × 2) agents/drivers/argo-go/config.go:641 — agents/drivers/argo-go/config.go:641-683 | agents/drivers/hive-go/config.go:647-689 — `agents/drivers/argo-go/config.go` and `agents/drivers/hive-go/config.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 1107 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/config.go:641` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (43 lines × 2) agents/drivers/argo-go/config.go:754 — agents/drivers/argo-go/config.go:754-796 | agents/drivers/hive-go/config.go:785-827 — `agents/drivers/argo-go/config.go` and `agents/drivers/hive-go/config.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 1107 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (43 lines × 2) agents/drivers/argo-go/connector.go:28 — agents/drivers/argo-go/connector.go:28-70 | agents/drivers/hive-go/connector.go:28-70 — `agents/drivers/argo-go/connector.go` and `agents/drivers/hive-go/connector.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 121 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/connector.go:28` 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 (43 lines × 2) agents/drivers/kingbase-go/main.go:62 — agents/drivers/kingbase-go/main.go:62-104 | agents/drivers/vastbase-go/main.go:56-98 — `agents/drivers/kingbase-go/main.go` and `agents/drivers/vastbase-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 50 separate duplicated blocks between them, totalling at least 708 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/kingbase-go/main.go:62` 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 (34 lines × 2) · ×4
  • Duplicated block (34 lines × 2) agents/drivers/argo-go/metadata.go:297 — agents/drivers/argo-go/metadata.go:297-330 | agents/drivers/hive-go/metadata.go:303-336 — `agents/drivers/argo-go/metadata.go` and `agents/drivers/hive-go/metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 946 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/metadata.go:297` 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 (34 lines × 2) agents/drivers/argo-go/protocol_error.go:37 — agents/drivers/argo-go/protocol_error.go:37-70 | agents/drivers/hive-go/protocol_error.go:37-70 — `agents/drivers/argo-go/protocol_error.go` and `agents/drivers/hive-go/protocol_error.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 136 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/protocol_error.go:37` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (34 lines × 2) agents/drivers/argo-go/query.go:181 — agents/drivers/argo-go/query.go:181-214 | agents/drivers/hive-go/query.go:181-214 — `agents/drivers/argo-go/query.go` and `agents/drivers/hive-go/query.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 20 separate duplicated blocks between them, totalling at least 444 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (34 lines × 2) agents/drivers/argo-go/bench/functional_probe.py:92 — agents/drivers/argo-go/bench/functional_probe.py:92-125 | agents/drivers/hive-go/bench/functional_probe.py:92-125 — before extracting anything, compare `agents/drivers/argo-go/bench/functional_probe.py` and `agents/drivers/hive-go/bench/functional_probe.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 155 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×4
  • Outbound HTTP without resilience agents/drivers/gbase8s/src/main/java/com/dbx/agent/gbase8s/Gbase8sAgent.java:156 — `.openConnection(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. 4 of the 26 files that make outbound calls are unbounded; the first 4 are listed.
  • Outbound HTTP without resilience agents/drivers/sqlserver-legacy/src/main/java/com/dbx/agent/sqlserverlegacy/SqlServerLegacyAgent.java:93 — `.openConnection(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience crates/dbx-core/src/persistence/cloud_sync.rs:1784 — `Client::builder()` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience crates/dbx-driver-agent/src/agent_manager.rs:1290 — `reqwest::get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
R7 · Dead Code · Dead file (~8 LoC) · ×4
  • Dead file (~8 LoC) apps/desktop/src/components/ui/context-menu/ContextMenuRadioGroup.vue — no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (apps/desktop/src/components/ui/context-menu/index.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
  • Dead file (~8 LoC) apps/desktop/src/components/ui/context-menu/ContextMenuSub.vue — no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (apps/desktop/src/components/ui/context-menu/index.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
  • Dead file (~8 LoC) apps/desktop/src/components/ui/sheet/Sheet.vue — no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (apps/desktop/src/components/ui/sheet/index.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
  • Dead file (~8 LoC) apps/desktop/src/components/ui/sheet/index.ts — no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
AC1 · Text alternatives · <canvas> without a text alternative · ×3
  • <canvas> without a text alternative apps/desktop/src/components/grid/DataGridCellDetailDialog.vue:198 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
  • <canvas> without a text alternative apps/desktop/src/components/grid/DataGridCellDetailPanel.vue:175 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
  • <canvas> without a text alternative docs/components/landing/Starfield.tsx:192 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
AC3 · Page structure · Page without a main landmark · ×3
  • Page without a main landmark apps/desktop/index.html:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark dbx-er-diagram-architecture.html:3 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark docs/app/(root)/layout.tsx:34 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
AC3 · Page structure · Data table has no header cells · ×3
  • Data table has no header cells apps/desktop/src/components/admin/MySqlDashboard.vue:247 — A <table> with data cells but no <th> gives assistive technology no way to associate cells with their headers. Mark the header row/column cells as <th> (with a scope).
  • Data table has no header cells apps/desktop/src/components/redis/RedisDashboard.vue:510 — A <table> with data cells but no <th> gives assistive technology no way to associate cells with their headers. Mark the header row/column cells as <th> (with a scope).
  • Data table has no header cells apps/desktop/src/components/solr/SolrAdmin.vue:718 — A <table> with data cells but no <th> gives assistive technology no way to associate cells with their headers. Mark the header row/column cells as <th> (with a scope).
D1 · Cyclomatic Complexity · dbx_sql_dialect · ×3
  • dbx_sql_dialect::sql_dialect::type_rewrite::rewrite_cross_dialect_to_sqlserver (cyclomatic 68) crates/dbx-sql-dialect/src/sql_dialect/type_rewrite.rs:211 — dbx_sql_dialect::sql_dialect::type_rewrite::rewrite_cross_dialect_to_sqlserver has cyclomatic complexity 68 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • dbx_sql_dialect::sql_dialect::table_select::build_table_data_select_sql_with_database (cyclomatic 36) crates/dbx-sql-dialect/src/sql_dialect/table_select.rs:193 — dbx_sql_dialect::sql_dialect::table_select::build_table_data_select_sql_with_database has cyclomatic complexity 36 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • dbx_sql_dialect::sql_dialect::table_select::large_value_preview_kind (cyclomatic 16) crates/dbx-sql-dialect/src/sql_dialect/table_select.rs:49 — dbx_sql_dialect::sql_dialect::table_select::large_value_preview_kind has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · dbx_plugin_runtime · ×3
  • dbx_plugin_runtime::plugins::manifest::validate_contributions (cyclomatic 65) crates/dbx-plugin-runtime/src/plugins/manifest.rs:1322 — dbx_plugin_runtime::plugins::manifest::validate_contributions has cyclomatic complexity 65 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • dbx_plugin_runtime::plugins::manifest::validate_form_fields (cyclomatic 24) crates/dbx-plugin-runtime/src/plugins/manifest.rs:1854 — dbx_plugin_runtime::plugins::manifest::validate_form_fields 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.
  • dbx_plugin_runtime::plugins::marketplace::validate_and_resolve_catalog (cyclomatic 19) crates/dbx-plugin-runtime/src/plugins/marketplace.rs:589 — dbx_plugin_runtime::plugins::marketplace::validate_and_resolve_catalog 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 · DbxMcpServer · ×3
  • DbxMcpServer::execute_batch_request (cyclomatic 47) crates/dbx-mcp/src/server.rs:1649 — DbxMcpServer::execute_batch_request 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.
  • DbxMcpServer::execute_query (cyclomatic 44) crates/dbx-mcp/src/server.rs:1324 — DbxMcpServer::execute_query 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.
  • DbxMcpServer::execute_redis_command (cyclomatic 19) crates/dbx-mcp/src/server.rs:2261 — DbxMcpServer::execute_redis_command has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · Storage · ×3
  • Storage::inspect_data_migration (cyclomatic 39) REDACTED:1448 — Storage::inspect_data_migration has cyclomatic complexity 39 (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.
  • Storage::load_connections (cyclomatic 17) REDACTED:6443 — Storage::load_connections has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • Storage::cleanup_migration_backups (cyclomatic 16) REDACTED:1790 — Storage::cleanup_migration_backups has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · server.completionAssistantSearch (cyclomatic 18) · ×3
  • server.completionAssistantSearch (cyclomatic 18) agents/drivers/cassandra-go/metadata.go:536 — server.completionAssistantSearch 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.
  • server.completionAssistantSearch (cyclomatic 18) REDACTED:1759 — server.completionAssistantSearch 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.
  • server.completionAssistantSearch (cyclomatic 18) agents/drivers/vastbase-go/vastbase_metadata.go:1090 — server.completionAssistantSearch 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.
D12 · Dependency Hygiene · Dependency pinned to a stale untagged commit · ×3
  • Dependency pinned to a stale untagged commit: github.com/jcmturner/krb5test — Direct dependency `github.com/jcmturner/krb5test` is required at `v0.0.0-20201230140143-102e4b78cdb8` in REDACTED — a pseudo-version, which pins an UNTAGGED commit from 2020-12-30, 5.7 years ago. The pin itself is exact, so this is not a reproducibility defect, and it is not a claim that the module is unmaintained. What it says is that this repository tracks no RELEASE of `github.com/jcmturner/krb5test` and has not moved this requirement in 5.7 years: every fix the module has published since that commit — including any security fix — is absent from this build, whether the module went quiet or moved on without you. Check whether `github.com/jcmturner/krb5test` now publishes tagged releases and move the requirement to one; if it publishes none, re-pin to a current commit.
  • Dependency pinned to a stale untagged commit: github.com/jcmturner/krb5test — Direct dependency `github.com/jcmturner/krb5test` is required at `v0.0.0-20201230140143-102e4b78cdb8` in agents/drivers/hive-go/go.mod — a pseudo-version, which pins an UNTAGGED commit from 2020-12-30, 5.7 years ago. The pin itself is exact, so this is not a reproducibility defect, and it is not a claim that the module is unmaintained. What it says is that this repository tracks no RELEASE of `github.com/jcmturner/krb5test` and has not moved this requirement in 5.7 years: every fix the module has published since that commit — including any security fix — is absent from this build, whether the module went quiet or moved on without you. Check whether `github.com/jcmturner/krb5test` now publishes tagged releases and move the requirement to one; if it publishes none, re-pin to a current commit.
  • Dependency pinned to a stale untagged commit: gitea.com/kingbase/gokb — Direct dependency `gitea.com/kingbase/gokb` is required at `v0.0.0-20201021123113-29bd62a876c3` in REDACTED — a pseudo-version, which pins an UNTAGGED commit from 2020-10-21, 5.9 years ago. The pin itself is exact, so this is not a reproducibility defect, and it is not a claim that the module is unmaintained. What it says is that this repository tracks no RELEASE of `gitea.com/kingbase/gokb` and has not moved this requirement in 5.9 years: every fix the module has published since that commit — including any security fix — is absent from this build, whether the module went quiet or moved on without you. Check whether `gitea.com/kingbase/gokb` now publishes tagged releases and move the requirement to one; if it publishes none, re-pin to a current commit.
D17 · Explicit Debt · TodoComment · ×3
  • TodoComment agents/go-common/go-gssapi/krb5/krb5_test.go:7 — // TODO: testing this stuff really needs a KDC or a mock — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment agents/go-common/go-gssapi/krb5/krb5.go:1102 — // TODO: fix GenerateEncryptionKey at some point to cope with different — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/dbx-ai-provider/src/ai.rs:865 — /// TODO(Agens, tracked by #8144 and #8658): Remove `is_agens_endpoint` and all
D2 · Cognitive Complexity · dbx_types · ×3
  • dbx_types::models::connection::normalize_postgres_url_params (cognitive 38) crates/dbx-types/src/models/connection.rs:2180 — dbx_types::models::connection::normalize_postgres_url_params has cognitive complexity 38 (threshold 15). Drivers by points: if/else 20 (30 pts), boolean chains 4, match/switch 1 (3 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_types::models::connection::normalize_mysql_url_params (cognitive 19) crates/dbx-types/src/models/connection.rs:1912 — dbx_types::models::connection::normalize_mysql_url_params has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 6, match/switch 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
  • dbx_types::models::connection::migrate_legacy_transport_layers (cognitive 18) crates/dbx-types/src/models/connection.rs:777 — dbx_types::models::connection::migrate_legacy_transport_layers has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dbx_plugin_cli · ×3
  • dbx_plugin_cli::dev::build_config (cognitive 37) plugins/sdk/cli/src/dev.rs:52 — dbx_plugin_cli::dev::build_config has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (30 pts), boolean chains 3, match/switch 2 (3 pts), loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_plugin_cli::create_project (cognitive 17) plugins/sdk/cli/src/lib.rs:797 — dbx_plugin_cli::create_project has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 2, match/switch 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.
  • dbx_plugin_cli::package_project (cognitive 17) plugins/sdk/cli/src/lib.rs:866 — dbx_plugin_cli::package_project has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), match/switch 2 (3 pts), loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server.completionAssistantSearch (cognitive 37) · ×3
  • server.completionAssistantSearch (cognitive 37) agents/drivers/cassandra-go/metadata.go:536 — server.completionAssistantSearch has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (27 pts), loops 3 (7 pts), boolean chains 3 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • server.completionAssistantSearch (cognitive 37) REDACTED:1759 — server.completionAssistantSearch has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • server.completionAssistantSearch (cognitive 37) agents/drivers/vastbase-go/vastbase_metadata.go:1090 — server.completionAssistantSearch has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dbx_driver_support · ×3
  • dbx_driver_support::execution::await_stream_with_progress_timeout (cognitive 19) crates/dbx-driver-support/src/execution.rs:125 — dbx_driver_support::execution::await_stream_with_progress_timeout has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 5 (13 pts), if/else 3 (5 pts), loops 1 (nesting depth added 10). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • dbx_driver_support::ssh_config::apply_host_entry (cognitive 17) crates/dbx-driver-support/src/ssh_config.rs:132 — dbx_driver_support::ssh_config::apply_host_entry has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_driver_support::db::parse_connect_timeout_with_fallback (cognitive 16) crates/dbx-driver-support/src/db.rs:162 — dbx_driver_support::db::parse_connect_timeout_with_fallback has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtimeServer.dispatch (cognitive 17) · ×3
  • runtimeServer.dispatch (cognitive 17) agents/drivers/iotdb/main.go:179 — runtimeServer.dispatch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • runtimeServer.dispatch (cognitive 17) agents/drivers/neo4j-go/main.go:200 — runtimeServer.dispatch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • runtimeServer.dispatch (cognitive 17) REDACTED:667 — runtimeServer.dispatch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Medium advisory (unsound) · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (17–18 lines × 2) · ×3
  • Duplicated block (17–18 lines × 2) agents/drivers/duckdb/src/sql.rs:177 — agents/drivers/duckdb/src/sql.rs:177-194 | crates/dbx-drivers/src/db/duckdb_sql.rs:215-231 — before extracting anything, compare `agents/drivers/duckdb/src/sql.rs` and `crates/dbx-drivers/src/db/duckdb_sql.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 147 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (17–18 lines × 2) REDACTED:3862 — REDACTED:3862-3878 | REDACTED:3974-3991 — both copies are in the same file, so extract the 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–18 lines × 2) crates/dbx-drivers/src/db/rqlite_driver.rs:308 — crates/dbx-drivers/src/db/rqlite_driver.rs:308-325 | crates/dbx-drivers/src/db/turso_driver.rs:381-397 — before extracting anything, compare `crates/dbx-drivers/src/db/rqlite_driver.rs` and `crates/dbx-drivers/src/db/turso_driver.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 203 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×3
  • Duplicated block (16–17 lines × 2) crates/dbx-core/src/admin/consul/blocking.rs:142 — crates/dbx-core/src/admin/consul/blocking.rs:142-158 | crates/dbx-core/src/admin/consul/blocking.rs:196-211 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16–17 lines × 2) REDACTED:1631 — REDACTED:1631-1647 | REDACTED:1862-1877 — both copies are in the same file, so extract the 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–17 lines × 2) REDACTED:4526 — REDACTED:4526-4542 | REDACTED:8326-8341 — both copies are in the same file, so extract the 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 (16 lines × 3) · ×3
  • Duplicated block (16 lines × 3) crates/dbx-mcp/src/server.rs:2536 — crates/dbx-mcp/src/server.rs:2536-2551 | crates/dbx-mcp/src/server.rs:2593-2608 | crates/dbx-mcp/src/server.rs:2655-2670 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (16 lines × 3) agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java:207 — agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java:207-222 | agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:339-354 | agents/drivers/trino/src/main/java/com/dbx/agent/trino/TrinoAgent.java:241-256 — before extracting anything, compare `agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java` and `agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java:207` 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 (16 lines × 3) agents/drivers/cassandra-go/metadata.go:543 — agents/drivers/cassandra-go/metadata.go:543-558 | REDACTED:1766-1781 | agents/drivers/vastbase-go/vastbase_metadata.go:1097-1112 — 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 `agents/drivers/cassandra-go/metadata.go:543` 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 (13–15 lines × 3) · ×3
  • Duplicated block (13–15 lines × 3) REDACTED:2820 — REDACTED:2820-2832 | src-tauri/src/commands/connection.rs:1447-1461 | src-tauri/src/commands/connection.rs:1937-1949 — before extracting anything, compare `REDACTED` and `src-tauri/src/commands/connection.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 247 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (13–15 lines × 3) REDACTED:2836 — REDACTED:2836-2848 | src-tauri/src/commands/connection.rs:1475-1489 | src-tauri/src/commands/connection.rs:1963-1975 — before extracting anything, compare `REDACTED` and `src-tauri/src/commands/connection.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 247 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (13–15 lines × 3) REDACTED:2852 — REDACTED:2852-2864 | src-tauri/src/commands/connection.rs:1492-1506 | src-tauri/src/commands/connection.rs:1979-1991 — before extracting anything, compare `REDACTED` and `src-tauri/src/commands/connection.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 247 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×3
  • Duplicated block (13–14 lines × 2) crates/dbx-core/src/admin/nacos/service.rs:34 — crates/dbx-core/src/admin/nacos/service.rs:34-47 | crates/dbx-core/src/admin/nacos/service.rs:569-581 — both copies are in the same file, so extract the 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–14 lines × 2) crates/dbx-driver-mysql/src/mysql.rs:2978 — crates/dbx-driver-mysql/src/mysql.rs:2978-2990 | crates/dbx-types/src/models/connection.rs:1938-1951 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (13–14 lines × 2) agents/common/src/main/java/com/dbx/agent/JdbcExecutor.java:221 — agents/common/src/main/java/com/dbx/agent/JdbcExecutor.java:221-234 | agents/common/src/main/java/com/dbx/agent/JdbcExecutor.java:465-477 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (13 lines × 4) · ×3
  • Duplicated block (13 lines × 4) src-tauri/src/commands/mcp_bridge.rs:1882 — src-tauri/src/commands/mcp_bridge.rs:1882-1894 | src-tauri/src/commands/mcp_bridge.rs:1910-1922 | src-tauri/src/commands/mcp_bridge.rs:2313-2325 | src-tauri/src/commands/mcp_bridge.rs:2369-2381 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (13 lines × 4) agents/drivers/cassandra-go/main.go:349 — agents/drivers/cassandra-go/main.go:349-361 | agents/drivers/iotdb/main.go:352-364 | agents/drivers/kingbase-go/main.go:398-410 | agents/drivers/vastbase-go/main.go:429-441 — `agents/drivers/cassandra-go/main.go` and `agents/drivers/iotdb/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 30 separate duplicated blocks between them, totalling at least 389 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/cassandra-go/main.go:349` 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 (13 lines × 4) agents/drivers/argo-go/main.go:477 — agents/drivers/argo-go/main.go:477-489 | agents/drivers/cassandra-go/main.go:407-419 | agents/drivers/hive-go/main.go:477-489 | agents/drivers/iotdb/main.go:398-410 — `agents/drivers/argo-go/main.go` and `agents/drivers/cassandra-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 276 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: the declarations holding them bind `string` to `server *server) dispatch(method` in one and `s *server) dispatch(method` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×3
  • Duplicated block (12–13 lines × 2) REDACTED:4117 — REDACTED:4117-4129 | REDACTED:4270-4281 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12–13 lines × 2) REDACTED:1537 — REDACTED:1537-1548 | REDACTED:1645-1657 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1537` 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 (12–13 lines × 2) REDACTED:1048 — REDACTED:1048-1060 | REDACTED:1118-1129 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1048` 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 (10–12 lines × 2) · ×3
  • Duplicated block (10–12 lines × 2) crates/dbx-core/src/admin/nacos/batch.rs:297 — crates/dbx-core/src/admin/nacos/batch.rs:297-308 | crates/dbx-core/src/admin/nacos/http.rs:1153-1162 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (10–12 lines × 2) src-tauri/src/commands/connection.rs:1874 — src-tauri/src/commands/connection.rs:1874-1885 | src-tauri/src/commands/connection.rs:2172-2181 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10–12 lines × 2) REDACTED:713 — REDACTED:713-722 | REDACTED:761-772 — both copies are in the same file, so extract the 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 × 4) · ×3
  • Duplicated block (11 lines × 4) REDACTED:4587 — REDACTED:4587-4598 | REDACTED:5297-5308 | REDACTED:5628-5639 | REDACTED:8975-8985 — 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.
  • Duplicated block (11 lines × 4) agents/drivers/cassandra-go/main.go:222 — agents/drivers/cassandra-go/main.go:222-232 | agents/drivers/etcd-go/main.go:236-246 | agents/drivers/etcd2-go/main.go:206-216 | agents/drivers/vastbase-go/main.go:288-298 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/cassandra-go/main.go:222` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (11 lines × 4) REDACTED:4408 — REDACTED:4408-4418 | REDACTED:4950-4960 | REDACTED:4986-4996 | REDACTED:5017-5027 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:4408` 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 (8–9 lines × 3) · ×3
  • Duplicated block (8–9 lines × 3) crates/dbx-drivers/src/db/sqlite.rs:1595 — crates/dbx-drivers/src/db/sqlite.rs:1595-1602 | crates/dbx-drivers/src/db/sqlite.rs:2609-2617 | crates/dbx-drivers/src/db/sqlite.rs:2682-2690 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8–9 lines × 3) crates/dbx-web/src/routes/database_export.rs:185 — crates/dbx-web/src/routes/database_export.rs:185-192 | crates/dbx-web/src/routes/query_result_export.rs:170-178 | crates/dbx-web/src/routes/table_export.rs:158-166 — before extracting anything, compare `crates/dbx-web/src/routes/query_result_export.rs` and `crates/dbx-web/src/routes/table_export.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8–9 lines × 3) agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:326 — agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:326-333 | agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:647-654 | agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:1059-1067 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:326` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:645` calls `catalogRelation` and `agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:1059` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (4–7 lines × 3) · ×3
  • Duplicated block (4–7 lines × 3) REDACTED:1720 — REDACTED:1720-1726 | REDACTED:1844-1850 | crates/dbx-sql-data/src/data_grid_tdengine_sql.rs:245-248 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (4–7 lines × 3) crates/dbx-web/src/routes/mcp_policy.rs:388 — crates/dbx-web/src/routes/mcp_policy.rs:388-394 | crates/dbx-web/src/routes/mcp_policy.rs:420-423 | crates/dbx-web/src/routes/mcp_policy.rs:461-467 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (4–7 lines × 3) crates/dbx-ai-provider/src/ai_cli_agent.rs:685 — crates/dbx-ai-provider/src/ai_cli_agent.rs:685-691 | crates/dbx-ai-provider/src/ai_cli_agent.rs:813-816 | crates/dbx-ai-provider/src/ai_cli_agent.rs:945-951 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (5 lines × 5) · ×3
  • Duplicated block (5 lines × 5) REDACTED:4329 — REDACTED:4329-4333 | REDACTED:5076-5080 | REDACTED:5099-5103 | REDACTED:5122-5126 | REDACTED:5153-5157 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (5 lines × 5) agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:565 — agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:565-569 | REDACTED:3014-3018 | agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:435-439 | agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:498-502 | agents/drivers/sqlserver-legacy/src/main/java/com/dbx/agent/sqlserverlegacy/SqlServerLegacyAgent.java:389-393 — there are 5 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:565` 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 (5 lines × 5) REDACTED:2050 — REDACTED:2050-2054 | REDACTED:2873-2877 | REDACTED:3014-3018 | agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:435-439 | agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:498-502 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2050` 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 (6 lines × 5) · ×3
  • Duplicated block (6 lines × 5) crates/dbx-ai-provider/src/ai_claude_code_cli.rs:139 — crates/dbx-ai-provider/src/ai_claude_code_cli.rs:139-144 | crates/dbx-ai-provider/src/ai_codebuddy_cli.rs:219-224 | crates/dbx-ai-provider/src/ai_codex_cli.rs:226-231 | crates/dbx-ai-provider/src/ai_grok_cli.rs:189-194 | crates/dbx-ai-provider/src/ai_qoder_cli.rs:71-76 — before extracting anything, compare `crates/dbx-ai-provider/src/ai_claude_code_cli.rs` and `crates/dbx-ai-provider/src/ai_codebuddy_cli.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 5) crates/dbx-ai-provider/src/ai_claude_code_cli.rs:166 — crates/dbx-ai-provider/src/ai_claude_code_cli.rs:166-171 | crates/dbx-ai-provider/src/ai_codebuddy_cli.rs:246-251 | crates/dbx-ai-provider/src/ai_codex_cli.rs:247-252 | crates/dbx-ai-provider/src/ai_grok_cli.rs:216-221 | crates/dbx-ai-provider/src/ai_qoder_cli.rs:98-103 — before extracting anything, compare `crates/dbx-ai-provider/src/ai_claude_code_cli.rs` and `crates/dbx-ai-provider/src/ai_codebuddy_cli.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 5) REDACTED:2335 — REDACTED:2335-2340 | REDACTED:2357-2362 | REDACTED:2402-2407 | REDACTED:3889-3894 | REDACTED:3904-3909 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2335` 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 × 6) · ×3
  • Duplicated block (11 lines × 6) agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:435 — agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:435-445 | REDACTED:227-237 | agents/drivers/gbase8s/src/main/java/com/dbx/agent/gbase8s/Gbase8sAgent.java:1120-1130 | agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:467-477 | agents/drivers/informix/src/main/java/com/dbx/agent/informix/InformixAgent.java:574-584 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:426-436 — before extracting anything, compare `agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java` and `agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 98 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 6) agents/drivers/argo-go/main.go:419 — agents/drivers/argo-go/main.go:419-429 | agents/drivers/cassandra-go/main.go:349-359 | agents/drivers/hive-go/main.go:419-429 | agents/drivers/iotdb/main.go:352-362 | agents/drivers/kingbase-go/main.go:398-408 | agents/drivers/vastbase-go/main.go:429-439 — `agents/drivers/argo-go/main.go` and `agents/drivers/cassandra-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 276 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/main.go:419` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `agents/drivers/cassandra-go/main.go:360` calls `listIndexes`, `stringParam` and `agents/drivers/argo-go/main.go:430` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 6) agents/drivers/argo-go/protocol_error.go:35 — agents/drivers/argo-go/protocol_error.go:35-45 | agents/drivers/cassandra-go/protocol_error.go:33-43 | agents/drivers/hive-go/protocol_error.go:35-45 | agents/drivers/iotdb/protocol_error.go:34-44 | agents/drivers/neo4j-go/protocol_error.go:39-49 | agents/drivers/vastbase-go/protocol_error.go:34-44 — `agents/drivers/argo-go/protocol_error.go` and `agents/drivers/cassandra-go/protocol_error.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 56 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (50 lines × 2) · ×3
  • Duplicated block (50 lines × 2) REDACTED:21 — REDACTED:21-70 | REDACTED:21-70 — `REDACTED` and `REDACTED` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 25 separate duplicated blocks between them, totalling at least 473 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (50 lines × 2) REDACTED:770 — REDACTED:770-819 | agents/drivers/vastbase-go/vastbase_metadata.go:629-678 — `REDACTED` and `agents/drivers/vastbase-go/vastbase_metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 71 separate duplicated blocks between them, totalling at least 1426 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:770` 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 (50 lines × 2) REDACTED:414 — REDACTED:414-463 | REDACTED:414-463 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 397 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (38 lines × 2) · ×3
  • Duplicated block (38 lines × 2) agents/drivers/argo-go/config.go:25 — agents/drivers/argo-go/config.go:25-62 | agents/drivers/hive-go/config.go:28-65 — `agents/drivers/argo-go/config.go` and `agents/drivers/hive-go/config.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 1107 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/config.go:25` 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 (38 lines × 2) agents/drivers/argo-go/metadata.go:815 — agents/drivers/argo-go/metadata.go:815-852 | agents/drivers/hive-go/metadata.go:826-863 — `agents/drivers/argo-go/metadata.go` and `agents/drivers/hive-go/metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 946 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (38 lines × 2) agents/drivers/argo-go/query.go:298 — agents/drivers/argo-go/query.go:298-335 | agents/drivers/hive-go/query.go:298-335 — `agents/drivers/argo-go/query.go` and `agents/drivers/hive-go/query.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 20 separate duplicated blocks between them, totalling at least 444 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/query.go:298` 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (33 lines × 2) · ×3
  • Duplicated block (33 lines × 2) agents/drivers/argo-go/config.go:528 — agents/drivers/argo-go/config.go:528-560 | agents/drivers/hive-go/config.go:534-566 — `agents/drivers/argo-go/config.go` and `agents/drivers/hive-go/config.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 1107 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (33 lines × 2) agents/drivers/argo-go/metadata.go:87 — agents/drivers/argo-go/metadata.go:87-119 | agents/drivers/hive-go/metadata.go:87-119 — `agents/drivers/argo-go/metadata.go` and `agents/drivers/hive-go/metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 946 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (33 lines × 2) agents/drivers/etcd-go/main.go:400 — agents/drivers/etcd-go/main.go:400-432 | agents/drivers/etcd2-go/main.go:354-386 — `agents/drivers/etcd-go/main.go` and `agents/drivers/etcd2-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 19 separate duplicated blocks between them, totalling at least 278 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/etcd-go/main.go:400` 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 first that the copies are not typed on the same thing: the declarations holding them bind `string` to `s *etcdSession) handle(method` in one and `s *etcd2Session) handle(method` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `agents/drivers/etcd2-go/main.go:387` calls `isEtcd3OnlyMethod` and `agents/drivers/etcd-go/main.go:433` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D1 · Cyclomatic Complexity · ConnectionConfig · ×2
  • ConnectionConfig::connection_url_with_host (cyclomatic 95) crates/dbx-types/src/models/connection.rs:1228 — ConnectionConfig::connection_url_with_host has cyclomatic complexity 95 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • ConnectionConfig::redacted_connection_url_with_host (cyclomatic 84) crates/dbx-types/src/models/connection.rs:1061 — ConnectionConfig::redacted_connection_url_with_host has cyclomatic complexity 84 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · main.applyHiveParameters (cyclomatic 48) · ×2
  • main.applyHiveParameters (cyclomatic 48) agents/drivers/argo-go/config.go:527 — main.applyHiveParameters has cyclomatic complexity 48 (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.
  • main.applyHiveParameters (cyclomatic 48) agents/drivers/hive-go/config.go:533 — main.applyHiveParameters has cyclomatic complexity 48 (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 · BackupService · ×2
  • BackupService::export_job (cyclomatic 40) crates/dbx-core/src/scheduled_backup/engine.rs:152 — BackupService::export_job has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • BackupService::command (cyclomatic 16) crates/dbx-core/src/scheduled_backup/service.rs:50 — BackupService::command has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · MqttClient · ×2
  • MqttClient::spawn_v4_event_loop (cyclomatic 33) crates/dbx-core/src/admin/mqtt/client.rs:429 — MqttClient::spawn_v4_event_loop has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (MqttClient::spawn_v5_event_loop) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • MqttClient::spawn_v5_event_loop (cyclomatic 33) crates/dbx-core/src/admin/mqtt/client.rs:547 — MqttClient::spawn_v5_event_loop has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (MqttClient::spawn_v4_event_loop) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · main.buildTLSConfig (cyclomatic 29) · ×2
  • main.buildTLSConfig (cyclomatic 29) agents/drivers/argo-go/config.go:1041 — main.buildTLSConfig 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.
  • main.buildTLSConfig (cyclomatic 29) agents/drivers/hive-go/config.go:1072 — main.buildTLSConfig 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 · dbx_types · ×2
  • dbx_types::models::connection::normalize_postgres_url_params (cyclomatic 27) crates/dbx-types/src/models/connection.rs:2180 — dbx_types::models::connection::normalize_postgres_url_params 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.
  • dbx_types::models::connection::normalize_mysql_url_params (cyclomatic 20) crates/dbx-types/src/models/connection.rs:1912 — dbx_types::models::connection::normalize_mysql_url_params 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 · server.getTypeDetails (cyclomatic 25) · ×2
  • server.getTypeDetails (cyclomatic 25) REDACTED:733 — server.getTypeDetails has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • server.getTypeDetails (cyclomatic 25) agents/drivers/vastbase-go/vastbase_metadata.go:592 — server.getTypeDetails has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · main.finalizeKerberosConfig (cyclomatic 24) · ×2
  • main.finalizeKerberosConfig (cyclomatic 24) agents/drivers/argo-go/config.go:903 — main.finalizeKerberosConfig 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.
  • main.finalizeKerberosConfig (cyclomatic 24) agents/drivers/hive-go/config.go:934 — main.finalizeKerberosConfig 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 · dbx_mcp · ×2
  • dbx_mcp::transaction::handle_command (cyclomatic 23) crates/dbx-mcp/src/transaction.rs:503 — dbx_mcp::transaction::handle_command has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • dbx_mcp::server::validate_transaction_sql_shape (cyclomatic 18) crates/dbx-mcp/src/server.rs:4262 — dbx_mcp::server::validate_transaction_sql_shape 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 · server.listTables (cyclomatic 23) · ×2
  • server.listTables (cyclomatic 23) agents/drivers/argo-go/metadata.go:296 — server.listTables 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.
  • server.listTables (cyclomatic 23) agents/drivers/hive-go/metadata.go:302 — server.listTables 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 · dbx_driver_redis · ×2
  • dbx_driver_redis::scan_keys_batch_inner (cyclomatic 21) crates/dbx-driver-redis/src/lib.rs:2456 — dbx_driver_redis::scan_keys_batch_inner 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.
  • dbx_driver_redis::parse_command_argv (cyclomatic 18) crates/dbx-driver-redis/src/lib.rs:1913 — dbx_driver_redis::parse_command_argv 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 · zooKeeperDiscovery.Endpoints (cyclomatic 21) · ×2
  • zooKeeperDiscovery.Endpoints (cyclomatic 21) REDACTED:95 — zooKeeperDiscovery.Endpoints 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.
  • zooKeeperDiscovery.Endpoints (cyclomatic 21) REDACTED:95 — zooKeeperDiscovery.Endpoints 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 · main.splitNativeDSNFields (cyclomatic 20) · ×2
  • main.splitNativeDSNFields (cyclomatic 20) agents/drivers/kingbase-go/main.go:1279 — main.splitNativeDSNFields 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.
  • main.splitNativeDSNFields (cyclomatic 20) agents/drivers/vastbase-go/main.go:1242 — main.splitNativeDSNFields 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. This is NOT this file's highest cyclomatic complexity: server.dispatch (cyclomatic 33) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · runtimeServer.dispatch (cyclomatic 19) · ×2
  • runtimeServer.dispatch (cyclomatic 19) agents/drivers/cassandra-go/main.go:173 — runtimeServer.dispatch 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. This is NOT this file's highest cyclomatic complexity: server.dispatch (cyclomatic 27) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • runtimeServer.dispatch (cyclomatic 19) agents/drivers/vastbase-go/main.go:233 — runtimeServer.dispatch 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. This is NOT this file's highest cyclomatic complexity: server.dispatch (cyclomatic 33) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · main.parseHiveConnectionString (cyclomatic 18) · ×2
  • main.parseHiveConnectionString (cyclomatic 18) agents/drivers/argo-go/config.go:295 — main.parseHiveConnectionString 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.
  • main.parseHiveConnectionString (cyclomatic 18) agents/drivers/hive-go/config.go:301 — main.parseHiveConnectionString has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · main.loadTrustStore (cyclomatic 17) · ×2
  • main.loadTrustStore (cyclomatic 17) agents/drivers/argo-go/zookeeper_tls.go:60 — main.loadTrustStore 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.
  • main.loadTrustStore (cyclomatic 17) agents/drivers/hive-go/zookeeper_tls.go:60 — main.loadTrustStore 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 · runtimeServer.dispatch (cyclomatic 17) · ×2
  • runtimeServer.dispatch (cyclomatic 17) agents/drivers/kingbase-go/main.go:221 — runtimeServer.dispatch 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.
  • runtimeServer.dispatch (cyclomatic 17) REDACTED:775 — runtimeServer.dispatch has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: main.normalizeValueWithType (cyclomatic 18) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D2 · Cognitive Complexity · SqlStatementSplitter · ×2
  • SqlStatementSplitter::push_chunk_with_control (cognitive 161) crates/dbx-sql-core/src/sql.rs:436 — SqlStatementSplitter::push_chunk_with_control has cognitive complexity 161 (threshold 15). Drivers by points: if/else 41 (129 pts), boolean chains 20, loops 3 (10 pts), match/switch 1 (2 pts) (nesting depth added 96). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • SqlStatementSplitter::finish_with_control (cognitive 18) crates/dbx-sql-core/src/sql.rs:680 — SqlStatementSplitter::finish_with_control has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MqttClient · ×2
  • MqttClient::spawn_v4_event_loop (cognitive 74) crates/dbx-core/src/admin/mqtt/client.rs:429 — MqttClient::spawn_v4_event_loop has cognitive complexity 74 (threshold 15). Drivers by points: if/else 16 (64 pts), match/switch 3 (9 pts), loops 1 (nesting depth added 54). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (MqttClient::spawn_v5_event_loop) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • MqttClient::spawn_v5_event_loop (cognitive 74) crates/dbx-core/src/admin/mqtt/client.rs:547 — MqttClient::spawn_v5_event_loop has cognitive complexity 74 (threshold 15). Drivers by points: if/else 16 (64 pts), match/switch 3 (9 pts), loops 1 (nesting depth added 54). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (MqttClient::spawn_v4_event_loop) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · ConnectionConfig · ×2
  • ConnectionConfig::connection_url_with_host (cognitive 71) crates/dbx-types/src/models/connection.rs:1228 — ConnectionConfig::connection_url_with_host has cognitive complexity 71 (threshold 15). Drivers by points: if/else 42 (65 pts), boolean chains 5, match/switch 1 (nesting depth added 23). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • ConnectionConfig::redacted_connection_url_with_host (cognitive 47) crates/dbx-types/src/models/connection.rs:1061 — ConnectionConfig::redacted_connection_url_with_host has cognitive complexity 47 (threshold 15). Drivers by points: if/else 27 (44 pts), boolean chains 2, match/switch 1 (nesting depth added 17). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · main.applyHiveParameters (cognitive 55) · ×2
  • main.applyHiveParameters (cognitive 55) agents/drivers/argo-go/config.go:527 — main.applyHiveParameters has cognitive complexity 55 (threshold 15). Drivers by points: if/else 33 (43 pts), boolean chains 12 (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.
  • main.applyHiveParameters (cognitive 55) agents/drivers/hive-go/config.go:533 — main.applyHiveParameters has cognitive complexity 55 (threshold 15). Drivers by points: if/else 33 (43 pts), boolean chains 12 (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.
D2 · Cognitive Complexity · createMockHost · ×2
  • createMockHost::bridge (cognitive 47) plugins/sdk/dev-host/server.mjs:267 — createMockHost::bridge has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (24 pts), boolean chains 16, ternaries 2 (4 pts), other 2, match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • createMockHost::api (cognitive 16) plugins/sdk/dev-host/server.mjs:345 — createMockHost::api has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.buildTLSConfig (cognitive 39) · ×2
  • main.buildTLSConfig (cognitive 39) agents/drivers/argo-go/config.go:1041 — main.buildTLSConfig has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18 (29 pts), boolean chains 8, loops 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • main.buildTLSConfig (cognitive 39) agents/drivers/hive-go/config.go:1072 — main.buildTLSConfig has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18 (29 pts), boolean chains 8, loops 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.loadTrustStore (cognitive 36) · ×2
  • main.loadTrustStore (cognitive 36) agents/drivers/argo-go/zookeeper_tls.go:60 — main.loadTrustStore has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (26 pts), loops 2 (6 pts), match/switch 2 (4 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • main.loadTrustStore (cognitive 36) agents/drivers/hive-go/zookeeper_tls.go:60 — main.loadTrustStore has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (26 pts), loops 2 (6 pts), match/switch 2 (4 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · zooKeeperDiscovery.Endpoints (cognitive 36) · ×2
  • zooKeeperDiscovery.Endpoints (cognitive 36) REDACTED:95 — zooKeeperDiscovery.Endpoints has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (30 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • zooKeeperDiscovery.Endpoints (cognitive 36) REDACTED:95 — zooKeeperDiscovery.Endpoints has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (30 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dbx_cli · ×2
  • dbx_cli::run_query (cognitive 35) crates/dbx-cli/src/main.rs:302 — dbx_cli::run_query has cognitive complexity 35 (threshold 15). Drivers by points: if/else 20 (23 pts), boolean chains 9, match/switch 1 (3 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • dbx_cli::run_context (cognitive 18) crates/dbx-cli/src/main.rs:406 — dbx_cli::run_context has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, loops 3 (4 pts), 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.
D2 · Cognitive Complexity · main.splitNativeDSNFields (cognitive 34) · ×2
  • main.splitNativeDSNFields (cognitive 34) agents/drivers/kingbase-go/main.go:1279 — main.splitNativeDSNFields has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 6 (11 pts), boolean chains 6 (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.
  • main.splitNativeDSNFields (cognitive 34) agents/drivers/vastbase-go/main.go:1242 — main.splitNativeDSNFields has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 6 (11 pts), boolean chains 6 (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 · dbx_tdengine_driver · ×2
  • dbx_tdengine_driver::runtime::run (cognitive 32) agents/drivers/tdengine/src/runtime.rs:67 — dbx_tdengine_driver::runtime::run has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 4 (11 pts), loops 5 (8 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_tdengine_driver::runtime::error_response (cognitive 17) agents/drivers/tdengine/src/runtime.rs:455 — dbx_tdengine_driver::runtime::error_response has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 5 (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 · server.listTables (cognitive 32) · ×2
  • server.listTables (cognitive 32) agents/drivers/argo-go/metadata.go:296 — server.listTables has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 6, loops 4 (6 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • server.listTables (cognitive 32) agents/drivers/hive-go/metadata.go:302 — server.listTables has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 6, loops 4 (6 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.parseHiveConnectionString (cognitive 30) · ×2
  • main.parseHiveConnectionString (cognitive 30) agents/drivers/argo-go/config.go:295 — main.parseHiveConnectionString has cognitive complexity 30 (threshold 15). Drivers by points: if/else 18 (27 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • main.parseHiveConnectionString (cognitive 30) agents/drivers/hive-go/config.go:301 — main.parseHiveConnectionString has cognitive complexity 30 (threshold 15). Drivers by points: if/else 18 (27 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.loadClientKeyStore (cognitive 29) · ×2
  • main.loadClientKeyStore (cognitive 29) agents/drivers/argo-go/zookeeper_tls.go:119 — main.loadClientKeyStore has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 3 (7 pts), match/switch 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.
  • main.loadClientKeyStore (cognitive 29) agents/drivers/hive-go/zookeeper_tls.go:119 — main.loadClientKeyStore has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 3 (7 pts), match/switch 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 · dbx_mcp · ×2
  • dbx_mcp::transaction::handle_command (cognitive 27) crates/dbx-mcp/src/transaction.rs:503 — dbx_mcp::transaction::handle_command has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 7 (10 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dbx_mcp::server::validate_transaction_sql_shape (cognitive 18) crates/dbx-mcp/src/server.rs:4262 — dbx_mcp::server::validate_transaction_sql_shape has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, loops 1 (2 pts), match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server.executeStatements (cognitive 27) · ×2
  • server.executeStatements (cognitive 27) agents/drivers/argo-go/query.go:297 — server.executeStatements has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 2 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • server.executeStatements (cognitive 27) agents/drivers/hive-go/query.go:297 — server.executeStatements has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 2 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · discoveryConnector.Connect (cognitive 23) · ×2
  • discoveryConnector.Connect (cognitive 23) agents/drivers/argo-go/connector.go:131 — discoveryConnector.Connect has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (6 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • discoveryConnector.Connect (cognitive 23) agents/drivers/hive-go/connector.go:131 — discoveryConnector.Connect has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (6 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dbx_plugin_packager · ×2
  • dbx_plugin_packager::run_package_cli (cognitive 22) plugins/sdk/packager/src/main.rs:80 — dbx_plugin_packager::run_package_cli has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (18 pts), loops 2, match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
  • dbx_plugin_packager::validate_unsigned_candidate (cognitive 21) plugins/sdk/packager/src/main.rs:316 — dbx_plugin_packager::validate_unsigned_candidate has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (19 pts), loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.finalizeKerberosConfig (cognitive 22) · ×2
  • main.finalizeKerberosConfig (cognitive 22) agents/drivers/argo-go/config.go:903 — main.finalizeKerberosConfig has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 5 (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.
  • main.finalizeKerberosConfig (cognitive 22) agents/drivers/hive-go/config.go:934 — main.finalizeKerberosConfig has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 5 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · server.getTypeDetails (cognitive 21) · ×2
  • server.getTypeDetails (cognitive 21) REDACTED:733 — server.getTypeDetails has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 2, match/switch 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.
  • server.getTypeDetails (cognitive 21) agents/drivers/vastbase-go/vastbase_metadata.go:592 — server.getTypeDetails has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 2, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · main.nativeConnectionStringSSLMode (cognitive 20) · ×2
  • main.nativeConnectionStringSSLMode (cognitive 20) agents/drivers/kingbase-go/main.go:1160 — main.nativeConnectionStringSSLMode has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • main.nativeConnectionStringSSLMode (cognitive 20) agents/drivers/vastbase-go/main.go:1161 — main.nativeConnectionStringSSLMode has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server.customTypeRangeAttributes (cognitive 20) · ×2
  • server.customTypeRangeAttributes (cognitive 20) REDACTED:951 — server.customTypeRangeAttributes has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15 (20 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • server.customTypeRangeAttributes (cognitive 20) agents/drivers/vastbase-go/vastbase_metadata.go:810 — server.customTypeRangeAttributes has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15 (20 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.parseHiveAssignments (cognitive 19) · ×2
  • main.parseHiveAssignments (cognitive 19) agents/drivers/argo-go/config.go:420 — main.parseHiveAssignments has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 1, loops 1 (nesting depth added 8). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • main.parseHiveAssignments (cognitive 19) agents/drivers/hive-go/config.go:426 — main.parseHiveAssignments has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 1, loops 1 (nesting depth added 8). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtimeServer.dispatch (cognitive 19) · ×2
  • runtimeServer.dispatch (cognitive 19) agents/drivers/cassandra-go/main.go:173 — runtimeServer.dispatch has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • runtimeServer.dispatch (cognitive 19) agents/drivers/vastbase-go/main.go:233 — runtimeServer.dispatch has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · GitDiffScanner · ×2
  • GitDiffScanner::parse_diff_output (cognitive 18) crates/dbx-sql-schema/src/sql_parser/git.rs:117 — GitDiffScanner::parse_diff_output has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • GitDiffScanner::build_sql_filter (cognitive 17) crates/dbx-sql-schema/src/sql_parser/git.rs:89 — GitDiffScanner::build_sql_filter has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.applyKerberosJAASFile (cognitive 17) · ×2
  • main.applyKerberosJAASFile (cognitive 17) agents/drivers/argo-go/config.go:958 — main.applyKerberosJAASFile has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • main.applyKerberosJAASFile (cognitive 17) agents/drivers/hive-go/config.go:989 — main.applyKerberosJAASFile has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server.completionAssistantSearch (cognitive 17) · ×2
  • server.completionAssistantSearch (cognitive 17) agents/drivers/argo-go/metadata.go:814 — server.completionAssistantSearch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • server.completionAssistantSearch (cognitive 17) agents/drivers/hive-go/metadata.go:825 — server.completionAssistantSearch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.parseHiveServerRegistration (cognitive 16) · ×2
  • main.parseHiveServerRegistration (cognitive 16) REDACTED:218 — main.parseHiveServerRegistration has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • main.parseHiveServerRegistration (cognitive 16) REDACTED:218 — main.parseHiveServerRegistration has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server.listObjects (cognitive 16) · ×2
  • server.listObjects (cognitive 16) agents/drivers/argo-go/metadata.go:435 — server.listObjects has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • server.listObjects (cognitive 16) agents/drivers/hive-go/metadata.go:441 — server.listObjects has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · protocolZooKeeperClient.authenticateSASL (cognitive 16) · ×2
  • protocolZooKeeperClient.authenticateSASL (cognitive 16) REDACTED:193 — protocolZooKeeperClient.authenticateSASL has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 1 (nesting depth added 7). Of this number, 14 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • protocolZooKeeperClient.authenticateSASL (cognitive 16) REDACTED:193 — protocolZooKeeperClient.authenticateSASL has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 1 (nesting depth added 7). Of this number, 14 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D4 · Code Duplication · Near-duplicate member pair (23 shared lines) · ×2
  • Near-duplicate member pair (23 shared lines) REDACTED:1157 — REDACTED:1157-1186 | REDACTED:1261-1290 — These two members are variants of one another: 23 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
  • Near-duplicate member pair (23 shared lines) REDACTED:140 — REDACTED:140-216 | agents/drivers/vastbase-go/bench/agent_compare.go:216-272 — These two members are variants of one another: 23 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×2
  • Edited copy of a member (16 corresponding lines) crates/dbx-core/src/query/mongo_ops.rs:1458 — crates/dbx-core/src/query/mongo_ops.rs:1458-1476 | crates/dbx-mcp/src/backend.rs:2650-2666 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) crates/dbx-driver-agent/src/agent_driver.rs:2085 — crates/dbx-driver-agent/src/agent_driver.rs:2085-2104 | crates/dbx-driver-agent/src/agent_driver.rs:2124-2140 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Members sharing a duplicated core (9 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (9 members, 50+ identical tokens) crates/dbx-driver-elasticsearch/src/lib.rs:730 — crates/dbx-driver-elasticsearch/src/lib.rs:730-744 | crates/dbx-driver-elasticsearch/src/lib.rs:983-997 | crates/dbx-driver-elasticsearch/src/lib.rs:999-1012 | crates/dbx-driver-elasticsearch/src/lib.rs:1501-1519 | crates/dbx-driver-elasticsearch/src/lib.rs:1539-1547 | crates/dbx-driver-elasticsearch/src/lib.rs:1586-1604 | crates/dbx-driver-elasticsearch/src/lib.rs:1886-1900 | crates/dbx-driver-elasticsearch/src/lib.rs:1908-1920 | crates/dbx-driver-elasticsearch/src/lib.rs:1972-1982 — These 9 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 9 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 9 times.
  • Members sharing a duplicated core (9 members, 50+ identical tokens) agents/common/src/main/java/com/dbx/agent/BaseDatabaseAgent.java:10 — agents/common/src/main/java/com/dbx/agent/BaseDatabaseAgent.java:10-16 | agents/common/src/main/java/com/dbx/agent/DatabaseAgent.java:59-65 | agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:205-242 | agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:150-168 | agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:126-145 | agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:244-265 | agents/drivers/informix/src/main/java/com/dbx/agent/informix/InformixAgent.java:278-289 | agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:134-155 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:128-147 — These 9 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 9 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 9 times.
D4 · Code Duplication · Members sharing a duplicated core (8 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (8 members, 50+ identical tokens) crates/dbx-ai-provider/src/ai.rs:3761 — crates/dbx-ai-provider/src/ai.rs:3761-3856 | crates/dbx-ai-provider/src/ai.rs:3864-3993 | crates/dbx-ai-provider/src/ai.rs:4001-4085 | crates/dbx-ai-provider/src/ai.rs:4093-4177 | crates/dbx-ai-provider/src/ai.rs:4293-4501 | crates/dbx-ai-provider/src/ai.rs:4511-4688 | crates/dbx-ai-provider/src/ai.rs:4697-4840 | crates/dbx-ai-provider/src/ai.rs:4954-5051 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
  • Members sharing a duplicated core (8 members, 50+ identical tokens) agents/drivers/argo-go/metadata.go:16 — agents/drivers/argo-go/metadata.go:16-73 | agents/drivers/cassandra-go/metadata.go:12-58 | agents/drivers/hive-go/metadata.go:16-73 | agents/drivers/iotdb/metadata.go:14-65 | REDACTED:61-163 | agents/drivers/neo4j-go/metadata.go:13-98 | agents/drivers/vastbase-go/vastbase_metadata.go:17-98 | REDACTED:405-507 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
D4 · Code Duplication · Duplicated block (49 lines × 2) · ×2
  • Duplicated block (49 lines × 2) crates/dbx-driver-mysql/src/mysql.rs:5464 — crates/dbx-driver-mysql/src/mysql.rs:5464-5512 | crates/dbx-driver-mysql/src/mysql.rs:5813-5861 — both copies are in the same file, so extract the 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 (49 lines × 2) REDACTED:952 — REDACTED:952-1000 | agents/drivers/vastbase-go/vastbase_metadata.go:811-859 — `REDACTED` and `agents/drivers/vastbase-go/vastbase_metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 71 separate duplicated blocks between them, totalling at least 1426 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (18–21 lines × 2) · ×2
  • Duplicated block (18–21 lines × 2) crates/dbx-mcp/src/server.rs:1491 — crates/dbx-mcp/src/server.rs:1491-1511 | crates/dbx-mcp/src/server.rs:1809-1826 — both copies are in the same file, so extract the 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 (18–21 lines × 2) crates/dbx-sql-data/src/query_result_sql.rs:1067 — crates/dbx-sql-data/src/query_result_sql.rs:1067-1084 | crates/dbx-sql-data/src/query_result_sql.rs:2318-2338 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (20 lines × 3) · ×2
  • Duplicated block (20 lines × 3) REDACTED:1284 — REDACTED:1284-1303 | REDACTED:1487-1506 | REDACTED:1767-1786 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (20 lines × 3) REDACTED:1403 — REDACTED:1403-1422 | REDACTED:1687-1706 | REDACTED:1892-1911 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×2
  • Duplicated block (15–16 lines × 2) crates/dbx-ai-provider/src/ai_claude_code_cli.rs:422 — crates/dbx-ai-provider/src/ai_claude_code_cli.rs:422-437 | crates/dbx-ai-provider/src/ai_codebuddy_cli.rs:712-726 — before extracting anything, compare `crates/dbx-ai-provider/src/ai_claude_code_cli.rs` and `crates/dbx-ai-provider/src/ai_codebuddy_cli.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (15–16 lines × 2) crates/dbx-driver-elasticsearch/src/lib.rs:2361 — crates/dbx-driver-elasticsearch/src/lib.rs:2361-2375 | crates/dbx-driver-elasticsearch/src/lib.rs:2389-2404 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×2
  • Duplicated block (15 lines × 3) REDACTED:2902 — REDACTED:2902-2916 | src-tauri/src/commands/connection.rs:1535-1549 | src-tauri/src/commands/connection.rs:2019-2033 — before extracting anything, compare `REDACTED` and `src-tauri/src/commands/connection.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 247 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 3) crates/dbx-mcp/src/server.rs:2112 — crates/dbx-mcp/src/server.rs:2112-2126 | crates/dbx-mcp/src/server.rs:2155-2169 | crates/dbx-mcp/src/server.rs:2195-2209 — 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 (12–15 lines × 2) · ×2
  • Duplicated block (12–15 lines × 2) crates/dbx-driver-agent/src/agent_driver.rs:2088 — crates/dbx-driver-agent/src/agent_driver.rs:2088-2102 | crates/dbx-driver-agent/src/agent_driver.rs:2127-2138 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12–15 lines × 2) agents/drivers/sqlserver-legacy/src/main/java/com/dbx/agent/sqlserverlegacy/SqlServerLegacyAgent.java:502 — agents/drivers/sqlserver-legacy/src/main/java/com/dbx/agent/sqlserverlegacy/SqlServerLegacyAgent.java:502-516 | agents/drivers/yashandb/src/main/java/com/dbx/agent/yashandb/YashandbAgent.java:119-130 — 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 `agents/drivers/sqlserver-legacy/src/main/java/com/dbx/agent/sqlserverlegacy/SqlServerLegacyAgent.java:502` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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–14 lines × 2) · ×2
  • Duplicated block (11–14 lines × 2) crates/dbx-driver-mysql/src/mysql.rs:5239 — crates/dbx-driver-mysql/src/mysql.rs:5239-5249 | crates/dbx-driver-mysql/src/mysql.rs:5275-5288 — both copies are in the same file, so extract the 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–14 lines × 2) REDACTED:851 — REDACTED:851-864 | REDACTED:887-897 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:851` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (11–12 lines × 4) · ×2
  • Duplicated block (11–12 lines × 4) REDACTED:1418 — REDACTED:1418-1428 | REDACTED:1702-1712 | REDACTED:1907-1917 | REDACTED:2108-2119 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (11–12 lines × 4) agents/drivers/cassandra-go/protocol_error.go:73 — agents/drivers/cassandra-go/protocol_error.go:73-84 | agents/drivers/iotdb/protocol_error.go:60-70 | agents/drivers/neo4j-go/protocol_error.go:72-83 | agents/drivers/vastbase-go/protocol_error.go:71-82 — `agents/drivers/cassandra-go/protocol_error.go` and `agents/drivers/iotdb/protocol_error.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 53 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/cassandra-go/protocol_error.go:73` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (10–11 lines × 3) · ×2
  • Duplicated block (10–11 lines × 3) crates/dbx-ai-provider/src/ai_codex_cli.rs:404 — crates/dbx-ai-provider/src/ai_codex_cli.rs:404-414 | crates/dbx-ai-provider/src/ai_pi_agent_cli.rs:386-396 | src-tauri/src/commands/mcp.rs:1550-1559 — before extracting anything, compare `crates/dbx-ai-provider/src/ai_codex_cli.rs` and `crates/dbx-ai-provider/src/ai_pi_agent_cli.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (10–11 lines × 3) agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:237 — agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:237-247 | agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:417-426 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:238-248 — before extracting anything, compare `agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java` and `agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 145 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:237` 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 (7–9 lines × 2) · ×2
  • Duplicated block (7–9 lines × 2) crates/dbx-core/src/persistence/cloud_sync.rs:2967 — crates/dbx-core/src/persistence/cloud_sync.rs:2967-2975 | crates/dbx-core/src/persistence/cloud_sync.rs:2987-2993 — both copies are in the same file, so extract the 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–9 lines × 2) crates/dbx-types/src/models/connection.rs:2322 — crates/dbx-types/src/models/connection.rs:2322-2328 | crates/dbx-types/src/models/connection.rs:2342-2350 — both copies are in the same file, so extract the 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–8 lines × 3) · ×2
  • Duplicated block (7–8 lines × 3) REDACTED:6264 — REDACTED:6264-6271 | REDACTED:6294-6300 | REDACTED:6324-6331 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (7–8 lines × 3) agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:416 — agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:416-423 | agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:552-559 | agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:643-649 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:561` calls `catalogRelation` and `agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:425` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (6–8 lines × 2) · ×2
  • Duplicated block (6–8 lines × 2) REDACTED:2345 — REDACTED:2345-2352 | REDACTED:4564-4569 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6–8 lines × 2) crates/dbx-formats/src/temporal_format.rs:237 — crates/dbx-formats/src/temporal_format.rs:237-244 | crates/dbx-formats/src/temporal_format.rs:266-271 — both copies are in the same file, so extract the 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 × 6) · ×2
  • Duplicated block (7 lines × 6) agents/drivers/duckdb/src/sql.rs:239 — agents/drivers/duckdb/src/sql.rs:239-245 | agents/drivers/duckdb/src/sql.rs:403-409 | REDACTED:2045-2051 | crates/dbx-driver-mysql/src/mysql.rs:6726-6732 | crates/dbx-driver-mysql/src/mysql.rs:6902-6908 | crates/dbx-driver-sqlserver/src/sqlserver.rs:3971-3977 — there are 6 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (7 lines × 6) agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:219 — agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:219-225 | agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:233-239 | agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:136-142 | agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:256-262 | agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:146-152 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:138-144 — there are 6 copies across 5 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:256` 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 (6–7 lines × 4) · ×2
  • Duplicated block (6–7 lines × 4) crates/dbx-core/src/connection/jdbc.rs:815 — crates/dbx-core/src/connection/jdbc.rs:815-821 | crates/dbx-core/src/connection/jdbc.rs:887-892 | crates/dbx-core/src/connection/jdbc.rs:967-972 | crates/dbx-plugin-runtime/src/plugins.rs:194-200 — 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.
  • Duplicated block (6–7 lines × 4) agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java:133 — agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java:133-138 | agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:72-78 | agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:142-148 | agents/drivers/trino/src/main/java/com/dbx/agent/trino/TrinoAgent.java:73-79 — before extracting anything, compare `agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java` and `agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java:133` 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–7 lines × 2) · ×2
  • Duplicated block (6–7 lines × 2) crates/dbx-core/src/safety/production_safety.rs:150 — crates/dbx-core/src/safety/production_safety.rs:150-156 | crates/dbx-core/src/safety/production_safety.rs:169-174 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6–7 lines × 2) REDACTED:2616 — REDACTED:2616-2621 | agents/drivers/vastbase-go/vastbase_metadata.go:1837-1843 — `REDACTED` and `agents/drivers/vastbase-go/vastbase_metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 71 separate duplicated blocks between them, totalling at least 1426 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2616` 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 (3–6 lines × 3) · ×2
  • Duplicated block (3–6 lines × 3) crates/dbx-web/src/routes/plugins.rs:234 — crates/dbx-web/src/routes/plugins.rs:234-236 | crates/dbx-web/src/routes/plugins.rs:301-306 | crates/dbx-web/src/routes/plugins.rs:320-325 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (3–6 lines × 3) crates/dbx-web/src/routes/database_export.rs:175 — crates/dbx-web/src/routes/database_export.rs:175-177 | crates/dbx-web/src/routes/query_result_export.rs:162-167 | crates/dbx-web/src/routes/table_export.rs:148-153 — before extracting anything, compare `crates/dbx-web/src/routes/query_result_export.rs` and `crates/dbx-web/src/routes/table_export.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (46 lines × 2) · ×2
  • Duplicated block (46 lines × 2) REDACTED:8009 — REDACTED:8009-8054 | REDACTED:8253-8325 — both copies are in the same file, so extract the 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 (46 lines × 2) agents/drivers/kingbase-go/main.go:1280 — agents/drivers/kingbase-go/main.go:1280-1325 | agents/drivers/vastbase-go/main.go:1243-1288 — `agents/drivers/kingbase-go/main.go` and `agents/drivers/vastbase-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 50 separate duplicated blocks between them, totalling at least 708 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (25 lines × 3) · ×2
  • Duplicated block (25 lines × 3) agents/common/src/main/java/com/dbx/agent/AbstractJdbcAgent.java:639 — agents/common/src/main/java/com/dbx/agent/AbstractJdbcAgent.java:639-663 | agents/common/src/main/java/com/dbx/agent/JdbcExecutor.java:609-633 | agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:415-439 — 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 `agents/common/src/main/java/com/dbx/agent/AbstractJdbcAgent.java:639` 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 (25 lines × 3) agents/drivers/cassandra-go/metadata.go:28 — agents/drivers/cassandra-go/metadata.go:28-52 | agents/drivers/iotdb/metadata.go:35-59 | agents/drivers/neo4j-go/metadata.go:30-54 — 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 `agents/drivers/cassandra-go/metadata.go:28` 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 (9–14 lines × 3) · ×2
  • Duplicated block (9–14 lines × 3) agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:70 — agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:70-78 | agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:182-195 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:72-80 — before extracting anything, compare `agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java` and `agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 145 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:70` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:179` calls `resolveSchema` and `agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:69` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9–14 lines × 3) agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:315 — agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:315-323 | agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:200-213 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:193-201 — before extracting anything, compare `agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java` and `agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 101 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:315` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 × 6) · ×2
  • Duplicated block (13 lines × 6) agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:172 — agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:172-184 | agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:149-161 | agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:269-281 | agents/drivers/informix/src/main/java/com/dbx/agent/informix/InformixAgent.java:293-305 | agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:159-171 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:151-163 — before extracting anything, compare `agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java` and `agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 98 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 6) agents/drivers/argo-go/main.go:191 — agents/drivers/argo-go/main.go:191-203 | agents/drivers/cassandra-go/main.go:189-201 | agents/drivers/hive-go/main.go:191-203 | agents/drivers/iotdb/main.go:195-207 | agents/drivers/kingbase-go/main.go:243-255 | agents/drivers/neo4j-go/main.go:216-228 — `agents/drivers/argo-go/main.go` and `agents/drivers/cassandra-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 276 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/main.go:191` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. Note first that the copies are not typed on the same thing: the declarations holding them bind `string` to `runtimeServer *runtimeServer) dispatch(method` in one and `r *runtimeServer) dispatch(method` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (8–9 lines × 4) · ×2
  • Duplicated block (8–9 lines × 4) agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:428 — agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:428-435 | agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:257-265 | agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:255-262 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:257-265 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:428` 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–9 lines × 4) agents/drivers/argo-go/main.go:443 — agents/drivers/argo-go/main.go:443-451 | agents/drivers/hive-go/main.go:443-451 | agents/drivers/kingbase-go/main.go:431-438 | agents/drivers/vastbase-go/main.go:456-463 — `agents/drivers/argo-go/main.go` and `agents/drivers/hive-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 43 separate duplicated blocks between them, totalling at least 699 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/main.go:443` 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 first that the copies are not typed on the same thing: the declarations holding them bind `string` to `server *server) dispatch(method` in one and `s *server) dispatch(method` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (8 lines × 5) · ×2
  • Duplicated block (8 lines × 5) agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java:35 — agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java:35-42 | agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:44-51 | agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:39-46 | agents/drivers/spark/src/main/java/com/dbx/agent/spark/SparkAgent.java:96-103 | agents/drivers/trino/src/main/java/com/dbx/agent/trino/TrinoAgent.java:42-49 — before extracting anything, compare `agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java` and `agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java:35` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:47` calls `sort`, `comparing` and `agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java:43` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 5) agents/drivers/cassandra-go/metadata.go:596 — agents/drivers/cassandra-go/metadata.go:596-603 | agents/drivers/iotdb/metadata.go:553-560 | agents/drivers/kingbase-go/main.go:1710-1717 | agents/drivers/neo4j-go/metadata.go:311-318 | agents/drivers/vastbase-go/main.go:1388-1395 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times.
D4 · Code Duplication · Duplicated block (6–8 lines × 5) · ×2
  • Duplicated block (6–8 lines × 5) agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:187 — agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:187-194 | agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:164-169 | agents/drivers/informix/src/main/java/com/dbx/agent/informix/InformixAgent.java:308-313 | agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:174-179 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:166-171 — before extracting anything, compare `agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java` and `agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 98 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:187` 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 (6–8 lines × 5) agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:188 — agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:188-195 | agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:165-170 | agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:289-294 | agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:175-180 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:167-172 — before extracting anything, compare `agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java` and `agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 98 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:188` 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 (5 lines × 6) · ×2
  • Duplicated block (5 lines × 6) agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:428 — agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:428-432 | agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:565-569 | agents/drivers/oceanbase-oracle/src/main/java/com/dbx/agent/oceanbaseoracle/OceanBaseOracleAgent.java:1005-1009 | agents/drivers/oceanbase-oracle/src/main/java/com/dbx/agent/oceanbaseoracle/OceanBaseOracleAgent.java:1060-1064 | agents/drivers/oceanbase-oracle/src/main/java/com/dbx/agent/oceanbaseoracle/OceanBaseOracleAgent.java:1239-1243 | agents/drivers/sqlserver-legacy/src/main/java/com/dbx/agent/sqlserverlegacy/SqlServerLegacyAgent.java:389-393 — there are 6 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:428` 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 (5 lines × 6) REDACTED:1730 — REDACTED:1730-1734 | REDACTED:1979-1983 | REDACTED:2049-2053 | REDACTED:2872-2876 | REDACTED:3013-3017 | agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:273-277 — there are 6 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 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1730` 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 (9 lines × 6) · ×2
  • Duplicated block (9 lines × 6) agents/common/src/main/java/com/dbx/agent/BaseDatabaseAgent.java:131 — agents/common/src/main/java/com/dbx/agent/BaseDatabaseAgent.java:131-139 | agents/common/src/main/java/com/dbx/agent/BatchExecutor.java:140-148 | agents/common/src/main/java/com/dbx/agent/DatabaseAgent.java:339-347 | agents/common/src/main/java/com/dbx/agent/JdbcExecutor.java:1027-1035 | agents/common/src/main/java/com/dbx/agent/StandardJdbcMetadata.java:757-765 | agents/common/src/main/java/com/dbx/agent/TransactionExecutor.java:124-132 — before extracting anything, compare `agents/common/src/main/java/com/dbx/agent/BaseDatabaseAgent.java` and `agents/common/src/main/java/com/dbx/agent/DatabaseAgent.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `agents/common/src/main/java/com/dbx/agent/TransactionExecutor.java:135` calls `run` and `agents/common/src/main/java/com/dbx/agent/BatchExecutor.java:150` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 6) agents/drivers/argo-go/main.go:467 — agents/drivers/argo-go/main.go:467-475 | agents/drivers/hive-go/main.go:467-475 | agents/drivers/iotdb/main.go:388-396 | agents/drivers/kingbase-go/main.go:462-470 | agents/drivers/neo4j-go/main.go:484-492 | agents/drivers/vastbase-go/main.go:481-489 — `agents/drivers/argo-go/main.go` and `agents/drivers/hive-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 43 separate duplicated blocks between them, totalling at least 699 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/main.go:467` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `string` to `server *server) dispatch(method` in one and `s *server) dispatch(method` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (73 lines × 2) · ×2
  • Duplicated block (73 lines × 2) agents/drivers/argo-go/config.go:68 — agents/drivers/argo-go/config.go:68-140 | agents/drivers/hive-go/config.go:71-143 — `agents/drivers/argo-go/config.go` and `agents/drivers/hive-go/config.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 1107 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (73 lines × 2) agents/drivers/argo-go/bench/kdc_fixture/main.go:27 — agents/drivers/argo-go/bench/kdc_fixture/main.go:27-99 | agents/drivers/hive-go/bench/kdc_fixture/main.go:27-99 — before extracting anything, compare `agents/drivers/argo-go/bench/kdc_fixture/main.go` and `agents/drivers/hive-go/bench/kdc_fixture/main.go` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (56 lines × 2) · ×2
  • Duplicated block (56 lines × 2) agents/drivers/argo-go/config.go:296 — agents/drivers/argo-go/config.go:296-351 | agents/drivers/hive-go/config.go:302-357 — `agents/drivers/argo-go/config.go` and `agents/drivers/hive-go/config.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 1107 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/config.go:296` 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 (56 lines × 2) agents/drivers/argo-go/metadata.go:378 — agents/drivers/argo-go/metadata.go:378-433 | agents/drivers/hive-go/metadata.go:384-439 — `agents/drivers/argo-go/metadata.go` and `agents/drivers/hive-go/metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 946 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (55 lines × 2) · ×2
  • Duplicated block (55 lines × 2) agents/drivers/argo-go/query.go:27 — agents/drivers/argo-go/query.go:27-81 | agents/drivers/hive-go/query.go:27-81 — `agents/drivers/argo-go/query.go` and `agents/drivers/hive-go/query.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 20 separate duplicated blocks between them, totalling at least 444 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (55 lines × 2) REDACTED:482 — REDACTED:482-536 | agents/drivers/vastbase-go/vastbase_metadata.go:341-395 — `REDACTED` and `agents/drivers/vastbase-go/vastbase_metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 71 separate duplicated blocks between them, totalling at least 1426 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (52 lines × 2) · ×2
  • Duplicated block (52 lines × 2) agents/drivers/argo-go/metadata.go:16 — agents/drivers/argo-go/metadata.go:16-67 | agents/drivers/hive-go/metadata.go:16-67 — `agents/drivers/argo-go/metadata.go` and `agents/drivers/hive-go/metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 946 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/metadata.go:16` 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 (52 lines × 2) agents/drivers/argo-go/bench/functional_probe.py:37 — agents/drivers/argo-go/bench/functional_probe.py:37-88 | agents/drivers/hive-go/bench/functional_probe.py:37-88 — before extracting anything, compare `agents/drivers/argo-go/bench/functional_probe.py` and `agents/drivers/hive-go/bench/functional_probe.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 155 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (51 lines × 2) · ×2
  • Duplicated block (51 lines × 2) agents/drivers/argo-go/config.go:904 — agents/drivers/argo-go/config.go:904-954 | agents/drivers/hive-go/config.go:935-985 — `agents/drivers/argo-go/config.go` and `agents/drivers/hive-go/config.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 1107 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (51 lines × 2) agents/drivers/etcd-go/main.go:200 — agents/drivers/etcd-go/main.go:200-250 | agents/drivers/etcd2-go/main.go:170-220 — `agents/drivers/etcd-go/main.go` and `agents/drivers/etcd2-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 19 separate duplicated blocks between them, totalling at least 278 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (39 lines × 2) · ×2
  • Duplicated block (39 lines × 2) REDACTED:142 — REDACTED:142-180 | REDACTED:142-180 — `REDACTED` and `REDACTED` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 25 separate duplicated blocks between them, totalling at least 473 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (39 lines × 2) REDACTED:298 — REDACTED:298-336 | REDACTED:298-336 — `REDACTED` and `REDACTED` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 25 separate duplicated blocks between them, totalling at least 473 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (35 lines × 2) · ×2
  • Duplicated block (35 lines × 2) REDACTED:126 — REDACTED:126-160 | agents/drivers/vastbase-go/vastbase_metadata.go:53-87 — `REDACTED` and `agents/drivers/vastbase-go/vastbase_metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 71 separate duplicated blocks between them, totalling at least 1426 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:126` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (35 lines × 2) REDACTED:734 — REDACTED:734-768 | agents/drivers/vastbase-go/vastbase_metadata.go:593-627 — `REDACTED` and `agents/drivers/vastbase-go/vastbase_metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 71 separate duplicated blocks between them, totalling at least 1426 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×2
  • Duplicated block (25 lines × 2) agents/drivers/cassandra-go/main.go:245 — agents/drivers/cassandra-go/main.go:245-269 | agents/drivers/neo4j-go/main.go:266-290 — `agents/drivers/cassandra-go/main.go` and `agents/drivers/neo4j-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 21 separate duplicated blocks between them, totalling at least 285 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/cassandra-go/main.go:245` 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (25 lines × 2) REDACTED:925 — REDACTED:925-949 | REDACTED:1152-1176 — 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 (18 lines × 4) · ×2
  • Duplicated block (18 lines × 4) agents/drivers/argo-go/main.go:202 — agents/drivers/argo-go/main.go:202-219 | agents/drivers/cassandra-go/main.go:200-217 | agents/drivers/hive-go/main.go:202-219 | agents/drivers/iotdb/main.go:206-223 — `agents/drivers/argo-go/main.go` and `agents/drivers/cassandra-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 276 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/main.go:202` 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 first that the copies are not typed on the same thing: the declarations holding them bind `string` to `runtimeServer *runtimeServer) dispatch(method` in one and `r *runtimeServer) dispatch(method` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (18 lines × 4) agents/drivers/argo-go/main.go:451 — agents/drivers/argo-go/main.go:451-468 | agents/drivers/cassandra-go/main.go:379-396 | agents/drivers/hive-go/main.go:451-468 | agents/drivers/iotdb/main.go:372-389 — `agents/drivers/argo-go/main.go` and `agents/drivers/cassandra-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 276 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/main.go:451` 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 (18 lines × 3) · ×2
  • Duplicated block (18 lines × 3) agents/drivers/kingbase-go/main.go:450 — agents/drivers/kingbase-go/main.go:450-467 | agents/drivers/neo4j-go/main.go:472-489 | agents/drivers/vastbase-go/main.go:469-486 — `agents/drivers/kingbase-go/main.go` and `agents/drivers/neo4j-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 253 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (18 lines × 3) agents/drivers/argo-go/protocol_error.go:15 — agents/drivers/argo-go/protocol_error.go:15-32 | agents/drivers/hive-go/protocol_error.go:15-32 | agents/drivers/iotdb/protocol_error.go:14-31 — `agents/drivers/argo-go/protocol_error.go` and `agents/drivers/hive-go/protocol_error.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 136 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (11 lines × 8) · ×2
  • Duplicated block (11 lines × 8) agents/drivers/argo-go/main.go:179 — agents/drivers/argo-go/main.go:179-189 | agents/drivers/cassandra-go/main.go:177-187 | agents/drivers/hive-go/main.go:179-189 | agents/drivers/iotdb/main.go:183-193 | agents/drivers/kingbase-go/main.go:231-241 | agents/drivers/neo4j-go/main.go:204-214 | agents/drivers/vastbase-go/main.go:243-253 | REDACTED:783-793 — `agents/drivers/argo-go/main.go` and `agents/drivers/cassandra-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 276 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/main.go:179` 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 first that the copies are not typed on the same thing: the declarations holding them bind `string` to `runtimeServer *runtimeServer) dispatch(method` in one and `r *runtimeServer) dispatch(method` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (11 lines × 8) agents/drivers/argo-go/metadata.go:75 — agents/drivers/argo-go/metadata.go:75-85 | agents/drivers/cassandra-go/metadata.go:60-70 | agents/drivers/hive-go/metadata.go:75-85 | agents/drivers/iotdb/metadata.go:67-77 | REDACTED:165-175 | REDACTED:493-503 | agents/drivers/vastbase-go/vastbase_metadata.go:100-110 | REDACTED:509-519 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 8 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 8 times.
D4 · Code Duplication · Duplicated block (7 lines × 7) · ×2
  • Duplicated block (7 lines × 7) agents/drivers/argo-go/main.go:456 — agents/drivers/argo-go/main.go:456-462 | agents/drivers/cassandra-go/main.go:384-390 | agents/drivers/hive-go/main.go:456-462 | agents/drivers/iotdb/main.go:377-383 | agents/drivers/kingbase-go/main.go:451-457 | agents/drivers/neo4j-go/main.go:473-479 | agents/drivers/vastbase-go/main.go:470-476 — `agents/drivers/argo-go/main.go` and `agents/drivers/cassandra-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 276 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 7) agents/drivers/cassandra-go/main.go:243 — agents/drivers/cassandra-go/main.go:243-249 | agents/drivers/iotdb/main.go:244-250 | agents/drivers/kingbase-go/main.go:287-293 | agents/drivers/neo4j-go/main.go:264-270 | REDACTED:745-751 | agents/drivers/vastbase-go/main.go:309-315 | REDACTED:848-854 — `agents/drivers/cassandra-go/main.go` and `agents/drivers/iotdb/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 30 separate duplicated blocks between them, totalling at least 389 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/cassandra-go/main.go:243` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17 lines × 3) · ×2
  • Duplicated block (17 lines × 3) agents/drivers/cassandra-go/protocol_error.go:14 — agents/drivers/cassandra-go/protocol_error.go:14-30 | agents/drivers/neo4j-go/protocol_error.go:16-32 | agents/drivers/vastbase-go/protocol_error.go:15-31 — `agents/drivers/cassandra-go/protocol_error.go` and `agents/drivers/neo4j-go/protocol_error.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 98 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `agents/drivers/neo4j-go/protocol_error.go:34` calls `errorResponse`, `classifyRPCError` and `agents/drivers/cassandra-go/protocol_error.go:32` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (17 lines × 3) REDACTED:132 — REDACTED:132-148 | agents/drivers/cassandra-go/bench/agent_compare.py:104-120 | REDACTED:132-148 — before extracting anything, compare `REDACTED` and `agents/drivers/cassandra-go/bench/agent_compare.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
R10 · Code Duplication · Duplicated block with local edits (49 matched lines × 2 locations) · ×2
  • Duplicated block with local edits (49 matched lines × 2 locations) apps/desktop/src/components/plugins/PluginFileManager.vue:190 — apps/desktop/src/components/plugins/PluginFileManager.vue:190 · apps/desktop/src/composables/usePluginShortcutHeight.ts:61 — the two spans are one implementation copied and then locally edited — 344 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
  • Duplicated block with local edits (49 matched lines × 2 locations) apps/desktop/src/stores/savedSqlStore.ts:810 — apps/desktop/src/stores/savedSqlStore.ts:810 · apps/desktop/src/stores/transferTaskStore.ts:352 — the two spans are one implementation copied and then locally edited — 599 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (48 lines × 2 locations) · ×2
  • Duplicated block (48 lines × 2 locations) apps/desktop/src/components/diff/SchemaDiffDeployStep.vue:249 — apps/desktop/src/components/diff/SchemaDiffDeployStep.vue:249 · apps/desktop/src/components/diff/SchemaDiffObjectTree.vue:43 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
  • Duplicated block (48 lines × 2 locations) apps/desktop/src/lib/backend/tauri.ts:314 — apps/desktop/src/lib/backend/tauri.ts:314 · apps/desktop/src/stores/settingsStore.ts:67 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
R10 · Code Duplication · Duplicated block (46 lines × 2 locations) · ×2
  • Duplicated block (46 lines × 2 locations) apps/desktop/src/lib/backend/http.ts:2449 — apps/desktop/src/lib/backend/http.ts:2449 · apps/desktop/src/lib/backend/tauri.ts:441 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
  • Duplicated block (46 lines × 2 locations) apps/desktop/src/lib/backend/http.ts:3274 — apps/desktop/src/lib/backend/http.ts:3274 · apps/desktop/src/lib/backend/http.ts:3331 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (44 lines × 2 locations) · ×2
  • Duplicated block (44 lines × 2 locations) apps/desktop/src/components/transfer/DataTransferDialog.vue:505 — apps/desktop/src/components/transfer/DataTransferDialog.vue:505 · apps/desktop/src/components/transfer/DataTransferDialog.vue:572 — both copies are in the same file, so extract the 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 (44 lines × 2 locations) apps/desktop/src/lib/sql/sqlParameters.ts:1702 — apps/desktop/src/lib/sql/sqlParameters.ts:1702 · apps/desktop/src/lib/sql/sqlVariables.ts:317 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (43 lines × 2 locations) · ×2
  • Duplicated block (43 lines × 2 locations) apps/desktop/src/components/admin/ProcessListPanel.vue:347 — apps/desktop/src/components/admin/ProcessListPanel.vue:347 · apps/desktop/src/components/admin/ProcessListPanel.vue:403 — both copies are in the same file, so extract the 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 (43 lines × 2 locations) apps/desktop/src/components/sidebar/SidebarTreeItemDialogs.vue:90 — apps/desktop/src/components/sidebar/SidebarTreeItemDialogs.vue:90 · REDACTED:5358 — the 2 copies are spread across 2 files, and what repeats is a LIST OF ENTRIES rather than behaviour — the same entries written out more than once. Extract them into one shared, exported constant and spread that constant into each site, rather than into a function the sites call: a list like this often lives in declarative metadata (a decorator's options object, a static configuration table) that a build step must be able to read statically, where a function call is not allowed. Adding an entry to one copy and not the other is the failure this prevents.
R10 · Code Duplication · Duplicated block (40 lines × 2 locations) · ×2
  • Duplicated block (40 lines × 2 locations) apps/desktop/src/lib/backend/tauri.ts:5956 — apps/desktop/src/lib/backend/tauri.ts:5956 · apps/desktop/src/lib/backend/tauri.ts:6001 — both copies are in the same file, so extract the 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 (40 lines × 2 locations) apps/desktop/src/stores/queryStore.ts:2169 — apps/desktop/src/stores/queryStore.ts:2169 · apps/desktop/src/stores/queryStore.ts:2276 — all 2 copies are in the same file, and what repeats is a LIST OF ENTRIES rather than behaviour — the same entries written out more than once. Extract them into one shared, exported constant and spread that constant into each site, rather than into a function the sites call: a list like this often lives in declarative metadata (a decorator's options object, a static configuration table) that a build step must be able to read statically, where a function call is not allowed. Adding an entry to one copy and not the other is the failure this prevents.
R7 · Dead Code · Dead file (~24 LoC) · ×2
  • Dead file (~24 LoC) apps/desktop/src/components/ui/context-menu/ContextMenuCheckboxItem.vue — no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (apps/desktop/src/components/ui/context-menu/index.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
  • Dead file (~24 LoC) apps/desktop/src/components/ui/context-menu/ContextMenuRadioItem.vue — no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (apps/desktop/src/components/ui/context-menu/index.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~14 LoC) · ×2
  • Dead file (~14 LoC) apps/desktop/src/components/ui/context-menu/ContextMenuSubTrigger.vue — no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (apps/desktop/src/components/ui/context-menu/index.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
  • Dead file (~14 LoC) apps/desktop/src/components/ui/context-menu/index.ts — no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~7 LoC) · ×2
  • Dead file (~7 LoC) apps/desktop/src/components/ui/context-menu/ContextMenuShortcut.vue — no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (apps/desktop/src/components/ui/context-menu/index.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
  • Dead file (~7 LoC) apps/desktop/src/lib/history/historyActions.ts — no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
AC3 · Page structure · Empty <h3> heading · ×1
  • Empty <h3> heading apps/desktop/src/components/diagram/DiagramInspector.vue:420 — An empty heading appears in the document outline announced with no text. Give the heading text, or remove it if it's decorative.
AC3 · Page structure · Heading level jumps from h2 to h4 · ×1
  • Heading level jumps from h2 to h4 dbx-er-diagram-architecture.html:699 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
AC7 · A11y enforcement · Accessibility enforcement below the top rung · ×1
  • Accessibility enforcement below the top rung — No accessibility enforcement found — no a11y linter (eslint-plugin-vuejs-accessibility) and no axe/pa11y/Lighthouse in tests or CI. Start with the linter to catch issues at author time. What was searched, so you can tell an absence from a miss: the 563 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
D1 · Cyclomatic Complexity · connectionStore.useConnectionStore (cyclomatic 2238) · ×1
  • connectionStore.useConnectionStore (cyclomatic 2238) apps/desktop/src/stores/connectionStore.ts:441 — connectionStore.useConnectionStore has cyclomatic complexity 2238 (threshold 15). Of this number, 1692 points are the body's own statements and 546 belong to 119 function literals inside it that branch. 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 · queryStore.useQueryStore (cyclomatic 2109) · ×1
  • queryStore.useQueryStore (cyclomatic 2109) apps/desktop/src/stores/queryStore.ts:1025 — queryStore.useQueryStore has cyclomatic complexity 2109 (threshold 15). Of this number, 1785 points are the body's own statements and 324 belong to 110 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · useQueryEditorCompletion.useQueryEditorCompletion (cyclomatic 531) · ×1
  • useQueryEditorCompletion.useQueryEditorCompletion (cyclomatic 531) apps/desktop/src/components/editor/useQueryEditorCompletion.ts:78 — useQueryEditorCompletion.useQueryEditorCompletion has cyclomatic complexity 531 (threshold 15). Of this number, 472 points are the body's own statements and 59 belong to 21 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · useDataGridEditor.useDataGridEditor (cyclomatic 531) · ×1
  • useDataGridEditor.useDataGridEditor (cyclomatic 531) apps/desktop/src/composables/useDataGridEditor.ts:248 — useDataGridEditor.useDataGridEditor has cyclomatic complexity 531 (threshold 15). Of this number, 482 points are the body's own statements and 49 belong to 28 function literals inside it that branch. 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 · useDataGridExport.useDataGridExport (cyclomatic 375) · ×1
  • useDataGridExport.useDataGridExport (cyclomatic 375) apps/desktop/src/composables/useDataGridExport.ts:175 — useDataGridExport.useDataGridExport has cyclomatic complexity 375 (threshold 15). Of this number, 205 points are the body's own statements and 170 belong to 48 function literals inside it that branch. 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 · settingsStore.useSettingsStore (cyclomatic 337) · ×1
  • settingsStore.useSettingsStore (cyclomatic 337) apps/desktop/src/stores/settingsStore.ts:2000 — settingsStore.useSettingsStore has cyclomatic complexity 337 (threshold 15). Of this number, 288 points are the body's own statements and 49 belong to 10 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · server.createMockHost (cyclomatic 264) · ×1
  • server.createMockHost (cyclomatic 264) plugins/sdk/dev-host/server.mjs:77 — server.createMockHost has cyclomatic complexity 264 (threshold 15). Of this number, 117 points are the body's own statements and 147 belong to 30 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · useSidebarDatabaseSpecificMutationRuntime.useSidebarDatabaseSpecificMutationRuntime (cyclomatic 252) · ×1
  • useSidebarDatabaseSpecificMutationRuntime.useSidebarDatabaseSpecificMutationRuntime (cyclomatic 252) apps/desktop/src/composables/useSidebarDatabaseSpecificMutationRuntime.ts:113 — useSidebarDatabaseSpecificMutationRuntime.useSidebarDatabaseSpecificMutationRuntime has cyclomatic complexity 252 (threshold 15). Of this number, 215 points are the body's own statements and 37 belong to 16 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · savedSqlStore.useSavedSqlStore (cyclomatic 228) · ×1
  • savedSqlStore.useSavedSqlStore (cyclomatic 228) apps/desktop/src/stores/savedSqlStore.ts:175 — savedSqlStore.useSavedSqlStore has cyclomatic complexity 228 (threshold 15). Of this number, 125 points are the body's own statements and 103 belong to 38 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · useSqlExecution.useSqlExecution (cyclomatic 198) · ×1
  • useSqlExecution.useSqlExecution (cyclomatic 198) apps/desktop/src/composables/useSqlExecution.ts:153 — useSqlExecution.useSqlExecution has cyclomatic complexity 198 (threshold 15). Of this number, 179 points are the body's own statements and 19 belong to 11 function literals inside it that branch. 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 · useDataGridActions.useDataGridActions (cyclomatic 185) · ×1
  • useDataGridActions.useDataGridActions (cyclomatic 185) apps/desktop/src/composables/useDataGridActions.ts:45 — useDataGridActions.useDataGridActions has cyclomatic complexity 185 (threshold 15). Of this number, 166 points are the body's own statements and 19 belong to 10 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · useQuickOpen.useQuickOpen (cyclomatic 183) · ×1
  • useQuickOpen.useQuickOpen (cyclomatic 183) apps/desktop/src/composables/useQuickOpen.ts:285 — useQuickOpen.useQuickOpen has cyclomatic complexity 183 (threshold 15). Of this number, 125 points are the body's own statements and 58 belong to 16 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · useDataGridSelection.useDataGridSelection (cyclomatic 160) · ×1
  • useDataGridSelection.useDataGridSelection (cyclomatic 160) apps/desktop/src/composables/useDataGridSelection.ts:52 — useDataGridSelection.useDataGridSelection has cyclomatic complexity 160 (threshold 15). Of this number, 128 points are the body's own statements and 32 belong to 9 function literals inside it that branch. 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 · useQueryEditorCompletionMetadata.useQueryEditorCompletionMetadata (cyclomatic 151) · ×1
  • useQueryEditorCompletionMetadata.useQueryEditorCompletionMetadata (cyclomatic 151) apps/desktop/src/components/editor/useQueryEditorCompletionMetadata.ts:43 — useQueryEditorCompletionMetadata.useQueryEditorCompletionMetadata has cyclomatic complexity 151 (threshold 15). Of this number, 134 points are the body's own statements and 17 belong to 7 function literals inside it that branch. 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 · useDataGridExtractor.useDataGridExtractor (cyclomatic 148) · ×1
  • useDataGridExtractor.useDataGridExtractor (cyclomatic 148) apps/desktop/src/composables/useDataGridExtractor.ts:82 — useDataGridExtractor.useDataGridExtractor has cyclomatic complexity 148 (threshold 15). Of this number, 129 points are the body's own statements and 19 belong to 11 function literals inside it that branch. 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 · useQueryEditorDiagnostics.useQueryEditorDiagnostics (cyclomatic 146) · ×1
  • useQueryEditorDiagnostics.useQueryEditorDiagnostics (cyclomatic 146) apps/desktop/src/components/editor/useQueryEditorDiagnostics.ts:79 — useQueryEditorDiagnostics.useQueryEditorDiagnostics has cyclomatic complexity 146 (threshold 15). Of this number, 137 points are the body's own statements and 9 belong to 8 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · canvasDataGridRenderer.drawCanvasDataGrid (cyclomatic 134) · ×1
  • canvasDataGridRenderer.drawCanvasDataGrid (cyclomatic 134) apps/desktop/src/lib/dataGrid/canvasDataGridRenderer.ts:330 — canvasDataGridRenderer.drawCanvasDataGrid has cyclomatic complexity 134 (threshold 15). Of this number, 68 points are the body's own statements and 66 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · useSidebarTreeExportRuntime.useSidebarTreeExportRuntime (cyclomatic 133) · ×1
  • useSidebarTreeExportRuntime.useSidebarTreeExportRuntime (cyclomatic 133) apps/desktop/src/composables/useSidebarTreeExportRuntime.ts:106 — useSidebarTreeExportRuntime.useSidebarTreeExportRuntime has cyclomatic complexity 133 (threshold 15). Of this number, 120 points are the body's own statements and 13 belong to 6 function literals inside it that branch. 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 · useAppUpdater.useAppUpdater (cyclomatic 131) · ×1
  • useAppUpdater.useAppUpdater (cyclomatic 131) apps/desktop/src/composables/useAppUpdater.ts:131 — useAppUpdater.useAppUpdater has cyclomatic complexity 131 (threshold 15). Of this number, 102 points are the body's own statements and 29 belong to 7 function literals inside it that branch. 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 · useQueryEditorBatchSelection.useQueryEditorBatchSelection (cyclomatic 130) · ×1
  • useQueryEditorBatchSelection.useQueryEditorBatchSelection (cyclomatic 130) apps/desktop/src/components/editor/useQueryEditorBatchSelection.ts:52 — useQueryEditorBatchSelection.useQueryEditorBatchSelection has cyclomatic complexity 130 (threshold 15). Of this number, 109 points are the body's own statements and 21 belong to 8 function literals inside it that branch. 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 · useSidebarConnectionMutationRuntime.useSidebarConnectionMutationRuntime (cyclomatic 129) · ×1
  • useSidebarConnectionMutationRuntime.useSidebarConnectionMutationRuntime (cyclomatic 129) apps/desktop/src/composables/useSidebarConnectionMutationRuntime.ts:34 — useSidebarConnectionMutationRuntime.useSidebarConnectionMutationRuntime has cyclomatic complexity 129 (threshold 15). Of this number, 99 points are the body's own statements and 30 belong to 12 function literals inside it that branch. 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 · useDataGridLargeValues.useDataGridLargeValues (cyclomatic 124) · ×1
  • useDataGridLargeValues.useDataGridLargeValues (cyclomatic 124) apps/desktop/src/composables/useDataGridLargeValues.ts:89 — useDataGridLargeValues.useDataGridLargeValues has cyclomatic complexity 124 (threshold 15). Of this number, 116 points are the body's own statements and 8 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · transferTaskStore.useTransferTaskStore (cyclomatic 124) · ×1
  • transferTaskStore.useTransferTaskStore (cyclomatic 124) apps/desktop/src/stores/transferTaskStore.ts:136 — transferTaskStore.useTransferTaskStore has cyclomatic complexity 124 (threshold 15). Of this number, 60 points are the body's own statements and 64 belong to 21 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · useDataGridColumnFormatter.useDataGridColumnFormatter (cyclomatic 121) · ×1
  • useDataGridColumnFormatter.useDataGridColumnFormatter (cyclomatic 121) apps/desktop/src/composables/useDataGridColumnFormatter.ts:76 — useDataGridColumnFormatter.useDataGridColumnFormatter has cyclomatic complexity 121 (threshold 15). Of this number, 118 points are the body's own statements and 3 belong to 3 function literals inside it that branch. 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 · useQueryEditorObjectNavigation.useQueryEditorObjectNavigation (cyclomatic 107) · ×1
  • useQueryEditorObjectNavigation.useQueryEditorObjectNavigation (cyclomatic 107) apps/desktop/src/components/editor/useQueryEditorObjectNavigation.ts:37 — useQueryEditorObjectNavigation.useQueryEditorObjectNavigation has cyclomatic complexity 107 (threshold 15). Of this number, 28 points are the body's own statements and 79 belong to 6 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · settingsStore.normalizeEditorSettings (cyclomatic 105) · ×1
  • settingsStore.normalizeEditorSettings (cyclomatic 105) apps/desktop/src/stores/settingsStore.ts:1636 — settingsStore.normalizeEditorSettings has cyclomatic complexity 105 (threshold 15). Of this number, 99 points are the body's own statements and 6 belong to 4 function literals inside it that branch. 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 · dataGenerate.buildDefaultGeneratorParams (cyclomatic 102) · ×1
  • dataGenerate.buildDefaultGeneratorParams (cyclomatic 102) apps/desktop/src/lib/dataGrid/dataGenerate.ts:1257 — dataGenerate.buildDefaultGeneratorParams has cyclomatic complexity 102 (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 · sqlStatementRanges.splitSqlStatementRanges (cyclomatic 101) · ×1
  • sqlStatementRanges.splitSqlStatementRanges (cyclomatic 101) apps/desktop/src/lib/sql/sqlStatementRanges.ts:333 — sqlStatementRanges.splitSqlStatementRanges has cyclomatic complexity 101 (threshold 15). Of this number, 87 points are the body's own statements and 14 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · queryEditorSqlExtensions.configureQueryEditorSqlExtensions (cyclomatic 101) · ×1
  • queryEditorSqlExtensions.configureQueryEditorSqlExtensions (cyclomatic 101) apps/desktop/src/components/editor/queryEditorSqlExtensions.ts:57 — queryEditorSqlExtensions.configureQueryEditorSqlExtensions has cyclomatic complexity 101 (threshold 15). Of this number, 34 points are the body's own statements and 67 belong to 13 function literals inside it that branch. 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 · PluginHostBridge.dispatch (cyclomatic 101) · ×1
  • PluginHostBridge.dispatch (cyclomatic 101) REDACTED:537 — PluginHostBridge.dispatch has cyclomatic complexity 101 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sqlFormatter.compressSqlText (cyclomatic 91) · ×1
  • sqlFormatter.compressSqlText (cyclomatic 91) apps/desktop/src/lib/sql/sqlFormatter.ts:734 — sqlFormatter.compressSqlText has cyclomatic complexity 91 (threshold 15). Of this number, 65 points are the body's own statements and 26 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · treeNodeIcon.getTreeNodeIconInfo (cyclomatic 89) · ×1
  • treeNodeIcon.getTreeNodeIconInfo (cyclomatic 89) apps/desktop/src/lib/sidebar/treeNodeIcon.ts:10 — treeNodeIcon.getTreeNodeIconInfo has cyclomatic complexity 89 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · useDataGridColumnLayout.useDataGridColumnLayout (cyclomatic 88) · ×1
  • useDataGridColumnLayout.useDataGridColumnLayout (cyclomatic 88) apps/desktop/src/composables/useDataGridColumnLayout.ts:487 — useDataGridColumnLayout.useDataGridColumnLayout has cyclomatic complexity 88 (threshold 15). Of this number, 77 points are the body's own statements and 11 belong to 4 function literals inside it that branch. 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 · useExportTracker.useExportTracker (cyclomatic 87) · ×1
  • useExportTracker.useExportTracker (cyclomatic 87) apps/desktop/src/composables/useExportTracker.ts:394 — useExportTracker.useExportTracker has cyclomatic complexity 87 (threshold 15). Of this number, 78 points are the body's own statements and 9 belong to 4 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · useQueryEditorHover.useQueryEditorHover (cyclomatic 85) · ×1
  • useQueryEditorHover.useQueryEditorHover (cyclomatic 85) apps/desktop/src/components/editor/useQueryEditorHover.ts:36 — useQueryEditorHover.useQueryEditorHover has cyclomatic complexity 85 (threshold 15). Of this number, 72 points are the body's own statements and 13 belong to 8 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · useDataGridConditionEditor.useDataGridConditionEditor (cyclomatic 83) · ×1
  • useDataGridConditionEditor.useDataGridConditionEditor (cyclomatic 83) REDACTED:201 — useDataGridConditionEditor.useDataGridConditionEditor has cyclomatic complexity 83 (threshold 15). Of this number, 78 points are the body's own statements and 5 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · useSidebarDataOpenRuntime.useSidebarDataOpenRuntime (cyclomatic 81) · ×1
  • useSidebarDataOpenRuntime.useSidebarDataOpenRuntime (cyclomatic 81) apps/desktop/src/composables/useSidebarDataOpenRuntime.ts:28 — useSidebarDataOpenRuntime.useSidebarDataOpenRuntime has cyclomatic complexity 81 (threshold 15). Of this number, 68 points are the body's own statements and 13 belong to 5 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · main.applyCassandraURLParams (cyclomatic 79) · ×1
  • main.applyCassandraURLParams (cyclomatic 79) agents/drivers/cassandra-go/config.go:167 — main.applyCassandraURLParams has cyclomatic complexity 79 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · mongoShellCommand.parseMongoWriteCommand (cyclomatic 78) · ×1
  • mongoShellCommand.parseMongoWriteCommand (cyclomatic 78) apps/desktop/src/lib/mongo/mongoShellCommand.ts:830 — mongoShellCommand.parseMongoWriteCommand has cyclomatic complexity 78 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SqlCompletionProvider.build (cyclomatic 76) · ×1
  • SqlCompletionProvider.build (cyclomatic 76) REDACTED:1673 — SqlCompletionProvider.build has cyclomatic complexity 76 (threshold 15). Of this number, 75 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · useSidebarTableMutationRuntime.useSidebarTableMutationRuntime (cyclomatic 75) · ×1
  • useSidebarTableMutationRuntime.useSidebarTableMutationRuntime (cyclomatic 75) apps/desktop/src/composables/useSidebarTableMutationRuntime.ts:62 — useSidebarTableMutationRuntime.useSidebarTableMutationRuntime has cyclomatic complexity 75 (threshold 15). Of this number, 53 points are the body's own statements and 22 belong to 14 function literals inside it that branch. 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 · useDataGridColumnFilters.useDataGridColumnFilters (cyclomatic 74) · ×1
  • useDataGridColumnFilters.useDataGridColumnFilters (cyclomatic 74) apps/desktop/src/composables/useDataGridColumnFilters.ts:64 — useDataGridColumnFilters.useDataGridColumnFilters has cyclomatic complexity 74 (threshold 15). Of this number, 48 points are the body's own statements and 26 belong to 14 function literals inside it that branch. 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 · sqlCompletion.getFunctionDescriptions (cyclomatic 74) · ×1
  • sqlCompletion.getFunctionDescriptions (cyclomatic 74) REDACTED:857 — sqlCompletion.getFunctionDescriptions has cyclomatic complexity 74 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · MysqlDumpBinaryLiteralNormalizer · ×1
  • MysqlDumpBinaryLiteralNormalizer::normalize (cyclomatic 67) REDACTED:1412 — MysqlDumpBinaryLiteralNormalizer::normalize 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 · SqlStatementSplitter · ×1
  • SqlStatementSplitter::push_chunk_with_control (cyclomatic 66) crates/dbx-sql-core/src/sql.rs:436 — SqlStatementSplitter::push_chunk_with_control has cyclomatic complexity 66 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sqlParameters.findSqlParameterOccurrences (cyclomatic 66) · ×1
  • sqlParameters.findSqlParameterOccurrences (cyclomatic 66) apps/desktop/src/lib/sql/sqlParameters.ts:377 — sqlParameters.findSqlParameterOccurrences has cyclomatic complexity 66 (threshold 15). Of this number, 65 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · useDialogSources.useDialogSources (cyclomatic 65) · ×1
  • useDialogSources.useDialogSources (cyclomatic 65) apps/desktop/src/composables/useDialogSources.ts:145 — useDialogSources.useDialogSources has cyclomatic complexity 65 (threshold 15). Of this number, 45 points are the body's own statements and 20 belong to 19 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sqlFormatter.maskStringAndCommentSpans (cyclomatic 65) · ×1
  • sqlFormatter.maskStringAndCommentSpans (cyclomatic 65) apps/desktop/src/lib/sql/sqlFormatter.ts:448 — sqlFormatter.maskStringAndCommentSpans has cyclomatic complexity 65 (threshold 15). Of this number, 56 points are the body's own statements and 9 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · useMultiDbTargetSelection.useMultiDbTargetSelection (cyclomatic 64) · ×1
  • useMultiDbTargetSelection.useMultiDbTargetSelection (cyclomatic 64) apps/desktop/src/composables/useMultiDbTargetSelection.ts:46 — useMultiDbTargetSelection.useMultiDbTargetSelection has cyclomatic complexity 64 (threshold 15). Of this number, 59 points are the body's own statements and 5 belong to 4 function literals inside it that branch. 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 · gohive.innerConnect (cyclomatic 63) · ×1
  • gohive.innerConnect (cyclomatic 63) REDACTED:373 — gohive.innerConnect has cyclomatic complexity 63 (threshold 15). Of this number, 60 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · database-env.validateRecipe (cyclomatic 63) · ×1
  • database-env.validateRecipe (cyclomatic 63) scripts/database-env.mjs:247 — database-env.validateRecipe has cyclomatic complexity 63 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · openTabsPersistence.serializeOpenTabs (cyclomatic 62) · ×1
  • openTabsPersistence.serializeOpenTabs (cyclomatic 62) apps/desktop/src/lib/app/openTabsPersistence.ts:168 — openTabsPersistence.serializeOpenTabs has cyclomatic complexity 62 (threshold 15). Most of this is not in the body itself: 1 of the 62 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 169, 223). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · sidebarActiveTabTarget.matchesTarget (cyclomatic 62) · ×1
  • sidebarActiveTabTarget.matchesTarget (cyclomatic 62) apps/desktop/src/lib/sidebar/sidebarActiveTabTarget.ts:256 — sidebarActiveTabTarget.matchesTarget has cyclomatic complexity 62 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · tableImport.importDataTypeForDatabase (cyclomatic 62) · ×1
  • tableImport.importDataTypeForDatabase (cyclomatic 62) apps/desktop/src/lib/table/tableImport.ts:253 — tableImport.importDataTypeForDatabase has cyclomatic complexity 62 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · doltVersionControl.layoutDoltCommitGraph (cyclomatic 60) · ×1
  • doltVersionControl.layoutDoltCommitGraph (cyclomatic 60) apps/desktop/src/lib/dolt/doltVersionControl.ts:467 — doltVersionControl.layoutDoltCommitGraph has cyclomatic complexity 60 (threshold 15). Of this number, 39 points are the body's own statements and 21 belong to 7 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sqlCompletion.getSqlCompletionContext (cyclomatic 60) · ×1
  • sqlCompletion.getSqlCompletionContext (cyclomatic 60) REDACTED:2499 — sqlCompletion.getSqlCompletionContext has cyclomatic complexity 60 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · useSidebarTreeToolRuntime.useSidebarTreeToolRuntime (cyclomatic 59) · ×1
  • useSidebarTreeToolRuntime.useSidebarTreeToolRuntime (cyclomatic 59) apps/desktop/src/composables/useSidebarTreeToolRuntime.ts:18 — useSidebarTreeToolRuntime.useSidebarTreeToolRuntime has cyclomatic complexity 59 (threshold 15). Of this number, 57 points are the body's own statements and 2 belong to one function literal inside it that branches. 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 · tabPresentation.tabDisplayTitle (cyclomatic 59) · ×1
  • tabPresentation.tabDisplayTitle (cyclomatic 59) apps/desktop/src/lib/tabs/tabPresentation.ts:191 — tabPresentation.tabDisplayTitle has cyclomatic complexity 59 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · useComponentUpdates.useComponentUpdates (cyclomatic 58) · ×1
  • useComponentUpdates.useComponentUpdates (cyclomatic 58) apps/desktop/src/composables/useComponentUpdates.ts:49 — useComponentUpdates.useComponentUpdates has cyclomatic complexity 58 (threshold 15). Of this number, 32 points are the body's own statements and 26 belong to 5 function literals inside it that branch. 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 · useDataGridTableMetadataLoaders.useDataGridTableMetadataLoaders (cyclomatic 58) · ×1
  • useDataGridTableMetadataLoaders.useDataGridTableMetadataLoaders (cyclomatic 58) apps/desktop/src/composables/useDataGridTableMetadataLoaders.ts:83 — useDataGridTableMetadataLoaders.useDataGridTableMetadataLoaders has cyclomatic complexity 58 (threshold 15). Of this number, 52 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · tokens.tokenizeSqlSemantic (cyclomatic 58) · ×1
  • tokens.tokenizeSqlSemantic (cyclomatic 58) apps/desktop/src/lib/sql/semantic/tokens.ts:106 — tokens.tokenizeSqlSemantic has cyclomatic complexity 58 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · useDataGridSearch.useDataGridSearch (cyclomatic 56) · ×1
  • useDataGridSearch.useDataGridSearch (cyclomatic 56) apps/desktop/src/composables/useDataGridSearch.ts:38 — useDataGridSearch.useDataGridSearch has cyclomatic complexity 56 (threshold 15). Of this number, 28 points are the body's own statements and 28 belong to 7 function literals inside it that branch. 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 · connectionUrl.parseConnectionUrl (cyclomatic 56) · ×1
  • connectionUrl.parseConnectionUrl (cyclomatic 56) REDACTED:695 — connectionUrl.parseConnectionUrl has cyclomatic complexity 56 (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 · dataGenerate.generateValue (cyclomatic 56) · ×1
  • dataGenerate.generateValue (cyclomatic 56) apps/desktop/src/lib/dataGrid/dataGenerate.ts:1608 — dataGenerate.generateValue 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 · server.dispatch (cyclomatic 55) · ×1
  • server.dispatch (cyclomatic 55) REDACTED:1053 — server.dispatch has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · mongoShellCommand.diagnoseMongoCommand (cyclomatic 55) · ×1
  • mongoShellCommand.diagnoseMongoCommand (cyclomatic 55) apps/desktop/src/lib/mongo/mongoShellCommand.ts:127 — mongoShellCommand.diagnoseMongoCommand has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · schemaDiff.convertToSchemaDiffObjects (cyclomatic 55) · ×1
  • schemaDiff.convertToSchemaDiffObjects (cyclomatic 55) apps/desktop/src/lib/schema/schemaDiff.ts:641 — schemaDiff.convertToSchemaDiffObjects has cyclomatic complexity 55 (threshold 15). Of this number, 44 points are the body's own statements and 11 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · schemaDiff.setSchemaDiffObjectSelectedWithDependencies (cyclomatic 55) · ×1
  • schemaDiff.setSchemaDiffObjectSelectedWithDependencies (cyclomatic 55) apps/desktop/src/lib/schema/schemaDiff.ts:1152 — schemaDiff.setSchemaDiffObjectSelectedWithDependencies has cyclomatic complexity 55 (threshold 15). Most of this is not in the body itself: 3 of the 55 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1158, 1176, 1169). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · useQueryEditorCompletionKeys.useQueryEditorCompletionKeys (cyclomatic 54) · ×1
  • useQueryEditorCompletionKeys.useQueryEditorCompletionKeys (cyclomatic 54) apps/desktop/src/components/editor/useQueryEditorCompletionKeys.ts:25 — useQueryEditorCompletionKeys.useQueryEditorCompletionKeys has cyclomatic complexity 54 (threshold 15). Of this number, 42 points are the body's own statements and 12 belong to 3 function literals inside it that branch. 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 · useMultiDbExecution.useMultiDbExecution (cyclomatic 54) · ×1
  • useMultiDbExecution.useMultiDbExecution (cyclomatic 54) apps/desktop/src/composables/useMultiDbExecution.ts:67 — useMultiDbExecution.useMultiDbExecution has cyclomatic complexity 54 (threshold 15). Of this number, 53 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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 · useQueryEditorTextActions.useQueryEditorTextActions (cyclomatic 53) · ×1
  • useQueryEditorTextActions.useQueryEditorTextActions (cyclomatic 53) apps/desktop/src/components/editor/useQueryEditorTextActions.ts:29 — useQueryEditorTextActions.useQueryEditorTextActions has cyclomatic complexity 53 (threshold 15). Of this number, 51 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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 · useDataGridCellDetailEdit.useDataGridCellDetailEdit (cyclomatic 53) · ×1
  • useDataGridCellDetailEdit.useDataGridCellDetailEdit (cyclomatic 53) apps/desktop/src/composables/useDataGridCellDetailEdit.ts:34 — useDataGridCellDetailEdit.useDataGridCellDetailEdit has cyclomatic complexity 53 (threshold 15). Of this number, 41 points are the body's own statements and 12 belong to 7 function literals inside it that branch. 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 · useNavigationTargets.openTableTarget (cyclomatic 53) · ×1
  • useNavigationTargets.openTableTarget (cyclomatic 53) apps/desktop/src/composables/useNavigationTargets.ts:55 — useNavigationTargets.openTableTarget has cyclomatic complexity 53 (threshold 15). Of this number, 50 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · aliasHighlights.sqlAliasHighlightGroups (cyclomatic 53) · ×1
  • aliasHighlights.sqlAliasHighlightGroups (cyclomatic 53) apps/desktop/src/lib/sql/semantic/aliasHighlights.ts:34 — aliasHighlights.sqlAliasHighlightGroups has cyclomatic complexity 53 (threshold 15). Of this number, 49 points are the body's own statements and 4 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · createMockHost · ×1
  • createMockHost::bridge (cyclomatic 53) plugins/sdk/dev-host/server.mjs:267 — createMockHost::bridge has cyclomatic complexity 53 (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 · sqlStatementRanges.topLevelSoftStatementLineStarts (cyclomatic 52) · ×1
  • sqlStatementRanges.topLevelSoftStatementLineStarts (cyclomatic 52) apps/desktop/src/lib/sql/sqlStatementRanges.ts:1056 — sqlStatementRanges.topLevelSoftStatementLineStarts has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · useQueryEditorDocumentState.useQueryEditorDocumentState (cyclomatic 52) · ×1
  • useQueryEditorDocumentState.useQueryEditorDocumentState (cyclomatic 52) apps/desktop/src/components/editor/useQueryEditorDocumentState.ts:43 — useQueryEditorDocumentState.useQueryEditorDocumentState has cyclomatic complexity 52 (threshold 15). Of this number, 38 points are the body's own statements and 14 belong to 6 function literals inside it that branch. 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 · connectionUrlBuilder.buildSpecialJdbcUrl (cyclomatic 51) · ×1
  • connectionUrlBuilder.buildSpecialJdbcUrl (cyclomatic 51) apps/desktop/src/lib/connection/connectionUrlBuilder.ts:300 — connectionUrlBuilder.buildSpecialJdbcUrl has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sidebarLayoutMonitor.createSidebarLayoutMonitor (cyclomatic 51) · ×1
  • sidebarLayoutMonitor.createSidebarLayoutMonitor (cyclomatic 51) apps/desktop/src/lib/sidebar/sidebarLayoutMonitor.ts:639 — sidebarLayoutMonitor.createSidebarLayoutMonitor has cyclomatic complexity 51 (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 · cursor.fetchOne (cyclomatic 50) · ×1
  • cursor.fetchOne (cyclomatic 50) REDACTED:1117 — cursor.fetchOne 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 · useCellDetailEditor.useCellDetailEditor (cyclomatic 50) · ×1
  • useCellDetailEditor.useCellDetailEditor (cyclomatic 50) apps/desktop/src/composables/useCellDetailEditor.ts:74 — useCellDetailEditor.useCellDetailEditor has cyclomatic complexity 50 (threshold 15). Of this number, 33 points are the body's own statements and 17 belong to 7 function literals inside it that branch. 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 · installBridge (cyclomatic 50) · ×1
  • installBridge (cyclomatic 50) REDACTED:2 — installBridge has cyclomatic complexity 50 (threshold 15). Most of this is not in the body itself: 1 of the 50 points is its own statement and the rest belongs to 42 function items inside it that branch ((anonymous), stream::start::onEvent, applyTheme, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · useQueryEditorPointer.useQueryEditorPointer (cyclomatic 49) · ×1
  • useQueryEditorPointer.useQueryEditorPointer (cyclomatic 49) apps/desktop/src/components/editor/useQueryEditorPointer.ts:24 — useQueryEditorPointer.useQueryEditorPointer has cyclomatic complexity 49 (threshold 15). Of this number, 30 points are the body's own statements and 19 belong to 7 function literals inside it that branch. 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 · useExternalSqlFileChanges.useExternalSqlFileChanges (cyclomatic 49) · ×1
  • useExternalSqlFileChanges.useExternalSqlFileChanges (cyclomatic 49) apps/desktop/src/composables/useExternalSqlFileChanges.ts:66 — useExternalSqlFileChanges.useExternalSqlFileChanges has cyclomatic complexity 49 (threshold 15). Of this number, 45 points are the body's own statements and 4 belong to 3 function literals inside it that branch. 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 · schemaDiff.injectColumnRenameSql (cyclomatic 49) · ×1
  • schemaDiff.injectColumnRenameSql (cyclomatic 49) apps/desktop/src/lib/schema/schemaDiff.ts:980 — schemaDiff.injectColumnRenameSql has cyclomatic complexity 49 (threshold 15). Of this number, 45 points are the body's own statements and 4 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · useDataGridColumnLayout.useDataGridColumnLayoutState (cyclomatic 48) · ×1
  • useDataGridColumnLayout.useDataGridColumnLayoutState (cyclomatic 48) apps/desktop/src/composables/useDataGridColumnLayout.ts:107 — useDataGridColumnLayout.useDataGridColumnLayoutState has cyclomatic complexity 48 (threshold 15). Of this number, 41 points are the body's own statements and 7 belong to 5 function literals inside it that branch. 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 · tableSelectSql.qualifiedTableName (cyclomatic 48) · ×1
  • tableSelectSql.qualifiedTableName (cyclomatic 48) apps/desktop/src/lib/table/tableSelectSql.ts:203 — tableSelectSql.qualifiedTableName has cyclomatic complexity 48 (threshold 15). Of this number, 46 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sync-connection-types.validateDescriptor (cyclomatic 46) · ×1
  • sync-connection-types.validateDescriptor (cyclomatic 46) scripts/sync-connection-types.mjs:108 — sync-connection-types.validateDescriptor has cyclomatic complexity 46 (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 · JsonRpcServer.dispatch (cyclomatic 45) · ×1
  • JsonRpcServer.dispatch (cyclomatic 45) agents/common/src/main/java/com/dbx/agent/JsonRpcServer.java:183 — JsonRpcServer.dispatch has cyclomatic complexity 45 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · main.applyJavaDriverHOCON (cyclomatic 45) · ×1
  • main.applyJavaDriverHOCON (cyclomatic 45) agents/drivers/cassandra-go/config_file.go:49 — main.applyJavaDriverHOCON has cyclomatic complexity 45 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · cellValueTransform.transformCellValue (cyclomatic 45) · ×1
  • cellValueTransform.transformCellValue (cyclomatic 45) apps/desktop/src/lib/dataGrid/cellValueTransform.ts:31 — cellValueTransform.transformCellValue has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RedisKeyGroupIndex.project (cyclomatic 45) · ×1
  • RedisKeyGroupIndex.project (cyclomatic 45) apps/desktop/src/lib/redis/redisKeyGroupIndex.ts:124 — RedisKeyGroupIndex.project has cyclomatic complexity 45 (threshold 15). Of this number, 27 points are the body's own statements and 18 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · redisKeyTree.buildRedisKeySnapshotCooperatively (cyclomatic 45) · ×1
  • redisKeyTree.buildRedisKeySnapshotCooperatively (cyclomatic 45) apps/desktop/src/lib/redis/redisKeyTree.ts:303 — redisKeyTree.buildRedisKeySnapshotCooperatively has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · mongoFormatter.formatMongoShellText (cyclomatic 44) · ×1
  • mongoFormatter.formatMongoShellText (cyclomatic 44) apps/desktop/src/lib/mongo/mongoFormatter.ts:20 — mongoFormatter.formatMongoShellText 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 · tableTree.buildGroupedObjectTreeNodes (cyclomatic 44) · ×1
  • tableTree.buildGroupedObjectTreeNodes (cyclomatic 44) apps/desktop/src/lib/table/tableTree.ts:870 — tableTree.buildGroupedObjectTreeNodes has cyclomatic complexity 44 (threshold 15). Of this number, 17 points are the body's own statements and 27 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · IssueSubmissionClient.IssueSubmissionClient (cyclomatic 44) · ×1
  • IssueSubmissionClient.IssueSubmissionClient (cyclomatic 44) docs/components/issues/IssueSubmissionClient.tsx:168 — IssueSubmissionClient.IssueSubmissionClient has cyclomatic complexity 44 (threshold 15). Of this number, 40 points are the body's own statements and 4 belong to 4 function literals inside it that branch. 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 · sqlStatementRanges.topLevelWordsInRange (cyclomatic 43) · ×1
  • sqlStatementRanges.topLevelWordsInRange (cyclomatic 43) apps/desktop/src/lib/sql/sqlStatementRanges.ts:1310 — sqlStatementRanges.topLevelWordsInRange 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 · frontendPlugin.buildPluginConnectionConfig (cyclomatic 43) · ×1
  • frontendPlugin.buildPluginConnectionConfig (cyclomatic 43) apps/desktop/src/lib/plugins/frontendPlugin.ts:258 — frontendPlugin.buildPluginConnectionConfig has cyclomatic complexity 43 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · TableRestoreFilter · ×1
  • TableRestoreFilter::classify (cyclomatic 42) REDACTED:67 — TableRestoreFilter::classify 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 · server.dispatch (cyclomatic 42) · ×1
  • server.dispatch (cyclomatic 42) REDACTED:848 — server.dispatch has cyclomatic complexity 42 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · usePluginShortcutSort.usePluginShortcutSort (cyclomatic 42) · ×1
  • usePluginShortcutSort.usePluginShortcutSort (cyclomatic 42) apps/desktop/src/composables/usePluginShortcutSort.ts:14 — usePluginShortcutSort.usePluginShortcutSort has cyclomatic complexity 42 (threshold 15). Of this number, 37 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · documentStoreProvider.buildDocumentFilterCondition (cyclomatic 42) · ×1
  • documentStoreProvider.buildDocumentFilterCondition (cyclomatic 42) apps/desktop/src/lib/app/documentStoreProvider.ts:538 — documentStoreProvider.buildDocumentFilterCondition has cyclomatic complexity 42 (threshold 15). Of this number, 41 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sqlCompletion.getSqlLexicalContext (cyclomatic 42) · ×1
  • sqlCompletion.getSqlLexicalContext (cyclomatic 42) REDACTED:2084 — sqlCompletion.getSqlLexicalContext 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 · PluginDetailClient.PluginDetailClient (cyclomatic 42) · ×1
  • PluginDetailClient.PluginDetailClient (cyclomatic 42) docs/app/[lang]/plugins/[id]/PluginDetailClient.tsx:107 — PluginDetailClient.PluginDetailClient has cyclomatic complexity 42 (threshold 15). Of this number, 24 points are the body's own statements and 18 belong to 9 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · main.parseWKBGeometry (cyclomatic 41) · ×1
  • main.parseWKBGeometry (cyclomatic 41) agents/drivers/vastbase-go/spatial.go:413 — main.parseWKBGeometry 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 · sqlStatementRanges.splitStatementRangeAtSoftStarts (cyclomatic 41) · ×1
  • sqlStatementRanges.splitStatementRangeAtSoftStarts (cyclomatic 41) apps/desktop/src/lib/sql/sqlStatementRanges.ts:766 — sqlStatementRanges.splitStatementRangeAtSoftStarts 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 · sqlStatementRanges.oraclePlSqlBlockEnd (cyclomatic 41) · ×1
  • sqlStatementRanges.oraclePlSqlBlockEnd (cyclomatic 41) apps/desktop/src/lib/sql/sqlStatementRanges.ts:2241 — sqlStatementRanges.oraclePlSqlBlockEnd 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 · dataGridPaintTheme.resolveDataGridPaintTheme (cyclomatic 41) · ×1
  • dataGridPaintTheme.resolveDataGridPaintTheme (cyclomatic 41) apps/desktop/src/lib/dataGrid/dataGridPaintTheme.ts:261 — dataGridPaintTheme.resolveDataGridPaintTheme 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 · EwkbWktDecoder.parseGeometry (cyclomatic 40) · ×1
  • EwkbWktDecoder.parseGeometry (cyclomatic 40) agents/common/src/main/java/com/dbx/agent/EwkbWktDecoder.java:300 — EwkbWktDecoder.parseGeometry has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cursor.rowMap (cyclomatic 40) · ×1
  • cursor.rowMap (cyclomatic 40) REDACTED:927 — cursor.rowMap has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · useDataGridColumnResize.useDataGridColumnResize (cyclomatic 40) · ×1
  • useDataGridColumnResize.useDataGridColumnResize (cyclomatic 40) apps/desktop/src/composables/useDataGridColumnResize.ts:50 — useDataGridColumnResize.useDataGridColumnResize has cyclomatic complexity 40 (threshold 15). Of this number, 28 points are the body's own statements and 12 belong to 7 function literals inside it that branch. 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 · settingsStore.normalizeMcpGlobalPolicy (cyclomatic 40) · ×1
  • settingsStore.normalizeMcpGlobalPolicy (cyclomatic 40) apps/desktop/src/stores/settingsStore.ts:172 — settingsStore.normalizeMcpGlobalPolicy has cyclomatic complexity 40 (threshold 15). Most of this is not in the body itself: 11 of the 40 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 177, 183, 214, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · ddlDisplay.collectDdlStatementNameTargets (cyclomatic 39) · ×1
  • ddlDisplay.collectDdlStatementNameTargets (cyclomatic 39) apps/desktop/src/lib/sql/ddlDisplay.ts:205 — ddlDisplay.collectDdlStatementNameTargets has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · insertValueHints.selectProjectionStarts (cyclomatic 39) · ×1
  • insertValueHints.selectProjectionStarts (cyclomatic 39) apps/desktop/src/lib/sql/insertValueHints.ts:222 — insertValueHints.selectProjectionStarts has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · server.buildCustomTypeDDL (cyclomatic 38) · ×1
  • server.buildCustomTypeDDL (cyclomatic 38) REDACTED:1058 — server.buildCustomTypeDDL has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · main.buildCustomTypeDDL (cyclomatic 38) · ×1
  • main.buildCustomTypeDDL (cyclomatic 38) agents/drivers/vastbase-go/vastbase_metadata.go:917 — main.buildCustomTypeDDL has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · dataGenerate.findGeneratorKey (cyclomatic 38) · ×1
  • dataGenerate.findGeneratorKey (cyclomatic 38) apps/desktop/src/lib/dataGrid/dataGenerate.ts:1197 — dataGenerate.findGeneratorKey has cyclomatic complexity 38 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · DriversClient.DriversClient (cyclomatic 38) · ×1
  • DriversClient.DriversClient (cyclomatic 38) docs/app/[lang]/drivers/DriversClient.tsx:137 — DriversClient.DriversClient has cyclomatic complexity 38 (threshold 15). Of this number, 27 points are the body's own statements and 11 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · startDevelopment (cyclomatic 38) · ×1
  • startDevelopment (cyclomatic 38) plugins/sdk/dev-host/runtime.mjs:39 — startDevelopment has cyclomatic complexity 38 (threshold 15). Most of this is not in the body itself: 13 of the 38 points are its own statements and the rest belongs to 20 function items inside it that branch (spawnCommand, (anonymous), run, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · etcdSession.history (cyclomatic 37) · ×1
  • etcdSession.history (cyclomatic 37) agents/drivers/etcd-go/history.go:39 — etcdSession.history has cyclomatic complexity 37 (threshold 15). Of this number, 22 points are the body's own statements and 15 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · server.dispatch (cyclomatic 37) · ×1
  • server.dispatch (cyclomatic 37) agents/drivers/kingbase-go/main.go:356 — server.dispatch has cyclomatic complexity 37 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · sqlStatementRanges.trimRangeEndBeforeNextBoundary (cyclomatic 37) · ×1
  • sqlStatementRanges.trimRangeEndBeforeNextBoundary (cyclomatic 37) apps/desktop/src/lib/sql/sqlStatementRanges.ts:1660 — sqlStatementRanges.trimRangeEndBeforeNextBoundary has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sqlIntentionActions.buildQualifierActions (cyclomatic 37) · ×1
  • sqlIntentionActions.buildQualifierActions (cyclomatic 37) apps/desktop/src/lib/editor/sqlIntentionActions.ts:562 — sqlIntentionActions.buildQualifierActions has cyclomatic complexity 37 (threshold 15). Of this number, 36 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · kvValueFormat.validateKvValue (cyclomatic 37) · ×1
  • kvValueFormat.validateKvValue (cyclomatic 37) apps/desktop/src/lib/kv/kvValueFormat.ts:33 — kvValueFormat.validateKvValue has cyclomatic complexity 37 (threshold 15). Of this number, 29 points are the body's own statements and 8 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · settingsTransfer.parseSettingsTransferFile (cyclomatic 37) · ×1
  • settingsTransfer.parseSettingsTransferFile (cyclomatic 37) apps/desktop/src/lib/settings/settingsTransfer.ts:488 — settingsTransfer.parseSettingsTransferFile has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sidebarActiveTabTarget.activeTabSidebarTarget (cyclomatic 37) · ×1
  • sidebarActiveTabTarget.activeTabSidebarTarget (cyclomatic 37) apps/desktop/src/lib/sidebar/sidebarActiveTabTarget.ts:110 — sidebarActiveTabTarget.activeTabSidebarTarget has cyclomatic complexity 37 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · model.buildCursorIntent (cyclomatic 37) · ×1
  • model.buildCursorIntent (cyclomatic 37) apps/desktop/src/lib/sql/semantic/model.ts:974 — model.buildCursorIntent has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · main.sqlRequiresSessionAffinity (cyclomatic 36) · ×1
  • main.sqlRequiresSessionAffinity (cyclomatic 36) agents/drivers/vastbase-go/connection_state.go:47 — main.sqlRequiresSessionAffinity 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 · useScheduledDatabaseBackups.useScheduledDatabaseBackups (cyclomatic 36) · ×1
  • useScheduledDatabaseBackups.useScheduledDatabaseBackups (cyclomatic 36) apps/desktop/src/composables/useScheduledDatabaseBackups.ts:22 — useScheduledDatabaseBackups.useScheduledDatabaseBackups has cyclomatic complexity 36 (threshold 15). Of this number, 28 points are the body's own statements and 8 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · mongoShellCommand.mongoTopLevelCommandLineStarts (cyclomatic 36) · ×1
  • mongoShellCommand.mongoTopLevelCommandLineStarts (cyclomatic 36) apps/desktop/src/lib/mongo/mongoShellCommand.ts:1469 — mongoShellCommand.mongoTopLevelCommandLineStarts 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 · completion.sqlCompletionContextFromSemantic (cyclomatic 36) · ×1
  • completion.sqlCompletionContextFromSemantic (cyclomatic 36) apps/desktop/src/lib/sql/semantic/completion.ts:337 — completion.sqlCompletionContextFromSemantic has cyclomatic complexity 36 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · sqlFormatter.protectDuckDbPrefixAliasSeparators (cyclomatic 36) · ×1
  • sqlFormatter.protectDuckDbPrefixAliasSeparators (cyclomatic 36) apps/desktop/src/lib/sql/sqlFormatter.ts:232 — sqlFormatter.protectDuckDbPrefixAliasSeparators 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 · useSchemaDiffConfig.useSchemaDiffConfig (cyclomatic 35) · ×1
  • useSchemaDiffConfig.useSchemaDiffConfig (cyclomatic 35) apps/desktop/src/composables/useSchemaDiffConfig.ts:67 — useSchemaDiffConfig.useSchemaDiffConfig has cyclomatic complexity 35 (threshold 15). Of this number, 30 points are the body's own statements and 5 belong to one function literal inside it that branches. 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 · columnFormatter.normalizeColumnFormatter (cyclomatic 35) · ×1
  • columnFormatter.normalizeColumnFormatter (cyclomatic 35) apps/desktop/src/lib/dataGrid/columnFormatter.ts:234 — columnFormatter.normalizeColumnFormatter 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 · navicatImport.parseConnection (cyclomatic 35) · ×1
  • navicatImport.parseConnection (cyclomatic 35) apps/desktop/src/lib/imports/navicatImport.ts:283 — navicatImport.parseConnection has cyclomatic complexity 35 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · main.parseConnectionConfig (cyclomatic 34) · ×1
  • main.parseConnectionConfig (cyclomatic 34) agents/drivers/iotdb/driver.go:86 — main.parseConnectionConfig 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 · hoverTableSql.normalizeAlignedSqlWhitespace (cyclomatic 34) · ×1
  • hoverTableSql.normalizeAlignedSqlWhitespace (cyclomatic 34) apps/desktop/src/lib/editor/hoverTableSql.ts:163 — hoverTableSql.normalizeAlignedSqlWhitespace 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 · sqlCompletion.buildObjectItems (cyclomatic 34) · ×1
  • sqlCompletion.buildObjectItems (cyclomatic 34) REDACTED:4168 — sqlCompletion.buildObjectItems has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 5 of the 34 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 4175, 4174). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · sqlCompletion.buildComparisonValueItems (cyclomatic 34) · ×1
  • sqlCompletion.buildComparisonValueItems (cyclomatic 34) REDACTED:4539 — sqlCompletion.buildComparisonValueItems 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 · sqlCompletion.singularTableName (cyclomatic 34) · ×1
  • sqlCompletion.singularTableName (cyclomatic 34) REDACTED:5359 — sqlCompletion.singularTableName 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 · sqlParameters.collectComplexTypeFieldSeparatorsInDeclaration (cyclomatic 34) · ×1
  • sqlParameters.collectComplexTypeFieldSeparatorsInDeclaration (cyclomatic 34) apps/desktop/src/lib/sql/sqlParameters.ts:1090 — sqlParameters.collectComplexTypeFieldSeparatorsInDeclaration 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 · DialectYaml · ×1
  • DialectYaml::build_capability_flags (cyclomatic 33) REDACTED:539 — DialectYaml::build_capability_flags has cyclomatic complexity 33 (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 · sqlStatementRanges.mysqlRoutineTokens (cyclomatic 33) · ×1
  • sqlStatementRanges.mysqlRoutineTokens (cyclomatic 33) apps/desktop/src/lib/sql/sqlStatementRanges.ts:1993 — sqlStatementRanges.mysqlRoutineTokens has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · errorUtils.isBackendError (cyclomatic 33) · ×1
  • errorUtils.isBackendError (cyclomatic 33) apps/desktop/src/lib/backend/errorUtils.ts:128 — errorUtils.isBackendError has cyclomatic complexity 33 (threshold 15). Of this number, 30 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · connectionDeepLink.parseConnectionDeepLinkUpdate (cyclomatic 33) · ×1
  • connectionDeepLink.parseConnectionDeepLinkUpdate (cyclomatic 33) apps/desktop/src/lib/connection/connectionDeepLink.ts:81 — connectionDeepLink.parseConnectionDeepLinkUpdate has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sidebarSearchTree.mergeSidebarRegexIndexScopes (cyclomatic 33) · ×1
  • sidebarSearchTree.mergeSidebarRegexIndexScopes (cyclomatic 33) apps/desktop/src/lib/sidebar/sidebarSearchTree.ts:242 — sidebarSearchTree.mergeSidebarRegexIndexScopes has cyclomatic complexity 33 (threshold 15). Of this number, 23 points are the body's own statements and 10 belong to 6 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · insertValueHints.stepLexState (cyclomatic 33) · ×1
  • insertValueHints.stepLexState (cyclomatic 33) apps/desktop/src/lib/sql/insertValueHints.ts:426 — insertValueHints.stepLexState has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · tableStructureEditorState.parseExtraToColumnExtra (cyclomatic 33) · ×1
  • tableStructureEditorState.parseExtraToColumnExtra (cyclomatic 33) apps/desktop/src/lib/table/tableStructureEditorState.ts:803 — tableStructureEditorState.parseExtraToColumnExtra has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · tabPresentation.tabIconClass (cyclomatic 33) · ×1
  • tabPresentation.tabIconClass (cyclomatic 33) apps/desktop/src/lib/tabs/tabPresentation.ts:686 — tabPresentation.tabIconClass has cyclomatic complexity 33 (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 · historyStore.useHistoryStore (cyclomatic 33) · ×1
  • historyStore.useHistoryStore (cyclomatic 33) apps/desktop/src/stores/historyStore.ts:23 — historyStore.useHistoryStore has cyclomatic complexity 33 (threshold 15). Of this number, 31 points are the body's own statements and 2 belong to one function literal inside it that branches. 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 · registerDbxMcpBridge (cyclomatic 33) · ×1
  • registerDbxMcpBridge (cyclomatic 33) crates/dbx-ai-provider/assets/pi-mcp-bridge.mjs:47 — registerDbxMcpBridge has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 11 of the 33 points are its own statements and the rest belongs to 18 function items inside it that branch ((anonymous), execute, (anonymous), …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · DependencyGraph · ×1
  • DependencyGraph::build_with_functions_and_options (cyclomatic 32) crates/dbx-sql-schema/src/schema_diff.rs:657 — DependencyGraph::build_with_functions_and_options 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 · server.listConstraints (cyclomatic 32) · ×1
  • server.listConstraints (cyclomatic 32) REDACTED:2354 — server.listConstraints 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 · verify-schema-objects.main (cyclomatic 32) · ×1
  • verify-schema-objects.main (cyclomatic 32) REDACTED:10 — verify-schema-objects.main has cyclomatic complexity 32 (threshold 15). Of this number, 20 points are the body's own statements and 12 belong to 7 function literals inside it that branch. 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 · usePluginShortcutHeight.usePluginShortcutHeight (cyclomatic 32) · ×1
  • usePluginShortcutHeight.usePluginShortcutHeight (cyclomatic 32) apps/desktop/src/composables/usePluginShortcutHeight.ts:5 — usePluginShortcutHeight.usePluginShortcutHeight has cyclomatic complexity 32 (threshold 15). Of this number, 24 points are the body's own statements and 8 belong to one function literal inside it that branches. 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 · useTauriEvents.useTauriEvents (cyclomatic 32) · ×1
  • useTauriEvents.useTauriEvents (cyclomatic 32) apps/desktop/src/composables/useTauriEvents.ts:6 — useTauriEvents.useTauriEvents has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 1 of the 32 points is its own statement and the rest belongs to 11 function literals inside it that branch (lines 41, 87, 64, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · jdbcProperties.parseJdbcProperties (cyclomatic 32) · ×1
  • jdbcProperties.parseJdbcProperties (cyclomatic 32) apps/desktop/src/lib/connection/jdbcProperties.ts:39 — jdbcProperties.parseJdbcProperties 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 · dataGridConditionHighlight.tokenizeDataGridCondition (cyclomatic 32) · ×1
  • dataGridConditionHighlight.tokenizeDataGridCondition (cyclomatic 32) apps/desktop/src/lib/dataGrid/dataGridConditionHighlight.ts:51 — dataGridConditionHighlight.tokenizeDataGridCondition has cyclomatic complexity 32 (threshold 15). Of this number, 30 points are the body's own statements and 2 belong to one function literal inside it that branches. 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 · codemirrorSqlDialect.createDbxCodeMirrorSqlDialect (cyclomatic 32) · ×1
  • codemirrorSqlDialect.createDbxCodeMirrorSqlDialect (cyclomatic 32) apps/desktop/src/lib/editor/codemirrorSqlDialect.ts:355 — codemirrorSqlDialect.createDbxCodeMirrorSqlDialect 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 · semanticSelectionRanges.createSemanticSelectionRangeIndex (cyclomatic 32) · ×1
  • semanticSelectionRanges.createSemanticSelectionRangeIndex (cyclomatic 32) apps/desktop/src/lib/editor/semanticSelectionRanges.ts:60 — semanticSelectionRanges.createSemanticSelectionRangeIndex has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 6 of the 32 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 125, 103, 69, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · sqlParameters.collectDuckDbStructFieldSeparators (cyclomatic 32) · ×1
  • sqlParameters.collectDuckDbStructFieldSeparators (cyclomatic 32) apps/desktop/src/lib/sql/sqlParameters.ts:777 — sqlParameters.collectDuckDbStructFieldSeparators 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 · seo.auditPages (cyclomatic 32) · ×1
  • seo.auditPages (cyclomatic 32) docs/scripts/seo.mjs:84 — seo.auditPages 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 · json.shellConstructorToExtendedJson (cyclomatic 32) · ×1
  • json.shellConstructorToExtendedJson (cyclomatic 32) REDACTED:633 — json.shellConstructorToExtendedJson 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 · validateRecord (cyclomatic 32) · ×1
  • validateRecord (cyclomatic 32) plugins/sdk/dev-host/connections.mjs:13 — validateRecord has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · main.applyHOCONAuthentication (cyclomatic 31) · ×1
  • main.applyHOCONAuthentication (cyclomatic 31) agents/drivers/cassandra-go/config_file.go:169 — main.applyHOCONAuthentication has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · server.listConstraints (cyclomatic 31) · ×1
  • server.listConstraints (cyclomatic 31) agents/drivers/vastbase-go/vastbase_metadata.go:1524 — server.listConstraints 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 · xuguWKBReader.geometry (cyclomatic 31) · ×1
  • xuguWKBReader.geometry (cyclomatic 31) agents/drivers/xugu/spatial.go:322 — xuguWKBReader.geometry 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 · Tablet.SetValueAt (cyclomatic 31) · ×1
  • Tablet.SetValueAt (cyclomatic 31) agents/go-common/iotdb-client-go/client/tablet.go:124 — Tablet.SetValueAt has cyclomatic complexity 31 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · sqlIntentionActions.tokenizeSelectionIdentifiers (cyclomatic 31) · ×1
  • sqlIntentionActions.tokenizeSelectionIdentifiers (cyclomatic 31) apps/desktop/src/lib/editor/sqlIntentionActions.ts:292 — sqlIntentionActions.tokenizeSelectionIdentifiers 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 · schemaDiff.stripSqlCommentsAndStringLiterals (cyclomatic 31) · ×1
  • schemaDiff.stripSqlCommentsAndStringLiterals (cyclomatic 31) apps/desktop/src/lib/schema/schemaDiff.ts:462 — schemaDiff.stripSqlCommentsAndStringLiterals 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 · sqlCompletion.buildColumnItems (cyclomatic 31) · ×1
  • sqlCompletion.buildColumnItems (cyclomatic 31) REDACTED:4886 — sqlCompletion.buildColumnItems has cyclomatic complexity 31 (threshold 15). Of this number, 25 points are the body's own statements and 6 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sqlParameters.collectSelectAssignmentVariables (cyclomatic 31) · ×1
  • sqlParameters.collectSelectAssignmentVariables (cyclomatic 31) apps/desktop/src/lib/sql/sqlParameters.ts:1384 — sqlParameters.collectSelectAssignmentVariables 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 · DdlBuilder.buildTableDdl (cyclomatic 30) · ×1
  • DdlBuilder.buildTableDdl (cyclomatic 30) agents/common/src/main/java/com/dbx/agent/DdlBuilder.java:77 — DdlBuilder.buildTableDdl 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 · server.getObjectSourceForRelation (cyclomatic 30) · ×1
  • server.getObjectSourceForRelation (cyclomatic 30) REDACTED:2608 — server.getObjectSourceForRelation has cyclomatic complexity 30 (threshold 15). Of this number, 29 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · main.openClient (cyclomatic 30) · ×1
  • main.openClient (cyclomatic 30) agents/drivers/zookeeper/connection.go:150 — main.openClient 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 · useDataGridScrollbars.useDataGridScrollbars (cyclomatic 30) · ×1
  • useDataGridScrollbars.useDataGridScrollbars (cyclomatic 30) apps/desktop/src/composables/useDataGridScrollbars.ts:32 — useDataGridScrollbars.useDataGridScrollbars has cyclomatic complexity 30 (threshold 15). Of this number, 26 points are the body's own statements and 4 belong to 4 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ai.buildModePromptLines (cyclomatic 30) · ×1
  • ai.buildModePromptLines (cyclomatic 30) apps/desktop/src/lib/ai/ai.ts:613 — ai.buildModePromptLines 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 · ai.buildAiContext (cyclomatic 30) · ×1
  • ai.buildAiContext (cyclomatic 30) apps/desktop/src/lib/ai/ai.ts:821 — ai.buildAiContext has cyclomatic complexity 30 (threshold 15). Of this number, 27 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · dbeaverImport.buildConnection (cyclomatic 30) · ×1
  • dbeaverImport.buildConnection (cyclomatic 30) apps/desktop/src/lib/imports/dbeaverImport.ts:242 — dbeaverImport.buildConnection has cyclomatic complexity 30 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · sqlCompletion.collectSqlServerLocalVariables (cyclomatic 30) · ×1
  • sqlCompletion.collectSqlServerLocalVariables (cyclomatic 30) REDACTED:2635 — sqlCompletion.collectSqlServerLocalVariables has cyclomatic complexity 30 (threshold 15). Of this number, 29 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · tabPresentation.tabTooltipLines (cyclomatic 30) · ×1
  • tabPresentation.tabTooltipLines (cyclomatic 30) apps/desktop/src/lib/tabs/tabPresentation.ts:292 — tabPresentation.tabTooltipLines has cyclomatic complexity 30 (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 · migrationStore.useMigrationStore (cyclomatic 30) · ×1
  • migrationStore.useMigrationStore (cyclomatic 30) apps/desktop/src/stores/migrationStore.ts:8 — migrationStore.useMigrationStore has cyclomatic complexity 30 (threshold 15). Of this number, 19 points are the body's own statements and 11 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · IssueSubmissionLimiter.fetch (cyclomatic 30) · ×1
  • IssueSubmissionLimiter.fetch (cyclomatic 30) docs/worker.ts:539 — IssueSubmissionLimiter.fetch has cyclomatic complexity 30 (threshold 15). Of this number, 20 points are the body's own statements and 10 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PluginManifest · ×1
  • PluginManifest::compatibility (cyclomatic 29) crates/dbx-plugin-runtime/src/plugins/manifest.rs:1058 — PluginManifest::compatibility 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 · kerberosConfig.finalize (cyclomatic 29) · ×1
  • kerberosConfig.finalize (cyclomatic 29) agents/drivers/cassandra-go/kerberos.go:89 — kerberosConfig.finalize 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 · useDataGridCanvasRuntime.useDataGridCanvasRuntime (cyclomatic 29) · ×1
  • useDataGridCanvasRuntime.useDataGridCanvasRuntime (cyclomatic 29) apps/desktop/src/composables/useDataGridCanvasRuntime.ts:55 — useDataGridCanvasRuntime.useDataGridCanvasRuntime has cyclomatic complexity 29 (threshold 15). Of this number, 24 points are the body's own statements and 5 belong to 4 function literals inside it that branch. 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 · useSchemaDiffSession.runSchemaDiffSession (cyclomatic 29) · ×1
  • useSchemaDiffSession.runSchemaDiffSession (cyclomatic 29) apps/desktop/src/composables/useSchemaDiffSession.ts:115 — useSchemaDiffSession.runSchemaDiffSession has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · dataGridCellCoercion.parsePostgresArrayText (cyclomatic 29) · ×1
  • dataGridCellCoercion.parsePostgresArrayText (cyclomatic 29) apps/desktop/src/lib/dataGrid/dataGridCellCoercion.ts:347 — dataGridCellCoercion.parsePostgresArrayText 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 · sqlSemanticSelectionRanges.collectSqlRanges (cyclomatic 29) · ×1
  • sqlSemanticSelectionRanges.collectSqlRanges (cyclomatic 29) apps/desktop/src/lib/editor/sqlSemanticSelectionRanges.ts:331 — sqlSemanticSelectionRanges.collectSqlRanges has cyclomatic complexity 29 (threshold 15). Of this number, 25 points are the body's own statements and 4 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · mongoShellCommand.splitMongoSemicolonSeparatedSegments (cyclomatic 29) · ×1
  • mongoShellCommand.splitMongoSemicolonSeparatedSegments (cyclomatic 29) apps/desktop/src/lib/mongo/mongoShellCommand.ts:1373 — mongoShellCommand.splitMongoSemicolonSeparatedSegments 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 · sqlCompletion.parsePostgresRegclassPrefix (cyclomatic 29) · ×1
  • sqlCompletion.parsePostgresRegclassPrefix (cyclomatic 29) REDACTED:2011 — sqlCompletion.parsePostgresRegclassPrefix 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 · sqlParameters.collectTriggerPseudoRecordFieldStarts (cyclomatic 29) · ×1
  • sqlParameters.collectTriggerPseudoRecordFieldStarts (cyclomatic 29) apps/desktop/src/lib/sql/sqlParameters.ts:877 — sqlParameters.collectTriggerPseudoRecordFieldStarts 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 · main.parseConnectionConfig (cyclomatic 28) · ×1
  • main.parseConnectionConfig (cyclomatic 28) agents/drivers/hive-go/config.go:145 — main.parseConnectionConfig 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 · SPNEGORoundTripper.RoundTrip (cyclomatic 28) · ×1
  • SPNEGORoundTripper.RoundTrip (cyclomatic 28) agents/go-common/gosasl/http_spnego.go:73 — SPNEGORoundTripper.RoundTrip 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 · ddlStorage.stripOracleStorageAttributes (cyclomatic 28) · ×1
  • ddlStorage.stripOracleStorageAttributes (cyclomatic 28) apps/desktop/src/lib/sql/ddlStorage.ts:213 — ddlStorage.stripOracleStorageAttributes 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 · useNavigationTargets.useNavigationTargets (cyclomatic 28) · ×1
  • useNavigationTargets.useNavigationTargets (cyclomatic 28) apps/desktop/src/composables/useNavigationTargets.ts:340 — useNavigationTargets.useNavigationTargets has cyclomatic complexity 28 (threshold 15). Of this number, 21 points are the body's own statements and 7 belong to one function literal inside it that branches. 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 · aiMessageRender.createAiMessageRenderer (cyclomatic 28) · ×1
  • aiMessageRender.createAiMessageRenderer (cyclomatic 28) apps/desktop/src/lib/ai/aiMessageRender.ts:92 — aiMessageRender.createAiMessageRenderer has cyclomatic complexity 28 (threshold 15). Of this number, 24 points are the body's own statements and 4 belong to 2 function literals inside it that branch. 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 · connectionPickerTree.buildConnectionPickerRows (cyclomatic 28) · ×1
  • connectionPickerTree.buildConnectionPickerRows (cyclomatic 28) apps/desktop/src/lib/connection/connectionPickerTree.ts:47 — connectionPickerTree.buildConnectionPickerRows has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 9 of the 28 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 54, 100, 89). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · codemirrorCurrentStatementFrameLayer.currentStatementFrameRect (cyclomatic 28) · ×1
  • codemirrorCurrentStatementFrameLayer.currentStatementFrameRect (cyclomatic 28) apps/desktop/src/lib/editor/codemirrorCurrentStatementFrameLayer.ts:70 — codemirrorCurrentStatementFrameLayer.currentStatementFrameRect 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 · mongoCompletion.scanMongoCallArguments (cyclomatic 28) · ×1
  • mongoCompletion.scanMongoCallArguments (cyclomatic 28) REDACTED:601 — mongoCompletion.scanMongoCallArguments 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 · mongoShellCommand.validateBulkWriteOperations (cyclomatic 28) · ×1
  • mongoShellCommand.validateBulkWriteOperations (cyclomatic 28) apps/desktop/src/lib/mongo/mongoShellCommand.ts:1800 — mongoShellCommand.validateBulkWriteOperations has cyclomatic complexity 28 (threshold 15). Of this number, 26 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · nacosAdmin.normalizeNacosEndpoint (cyclomatic 28) · ×1
  • nacosAdmin.normalizeNacosEndpoint (cyclomatic 28) apps/desktop/src/lib/nacos/nacosAdmin.ts:129 — nacosAdmin.normalizeNacosEndpoint 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 · redisKeyGrouping.compileRedisGroupGlob (cyclomatic 28) · ×1
  • redisKeyGrouping.compileRedisGroupGlob (cyclomatic 28) apps/desktop/src/lib/redis/redisKeyGrouping.ts:42 — redisKeyGrouping.compileRedisGroupGlob has cyclomatic complexity 28 (threshold 15). Of this number, 16 points are the body's own statements and 12 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sidebarNodeOrdering.orderSidebarTreeChildrenForParent (cyclomatic 28) · ×1
  • sidebarNodeOrdering.orderSidebarTreeChildrenForParent (cyclomatic 28) apps/desktop/src/lib/sidebar/sidebarNodeOrdering.ts:51 — sidebarNodeOrdering.orderSidebarTreeChildrenForParent has cyclomatic complexity 28 (threshold 15). Of this number, 21 points are the body's own statements and 7 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · tableSelectSql.quoteTableIdentifier (cyclomatic 28) · ×1
  • tableSelectSql.quoteTableIdentifier (cyclomatic 28) apps/desktop/src/lib/table/tableSelectSql.ts:93 — tableSelectSql.quoteTableIdentifier has cyclomatic complexity 28 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · tableTree.buildSimpleObjectTreeNodes (cyclomatic 28) · ×1
  • tableTree.buildSimpleObjectTreeNodes (cyclomatic 28) apps/desktop/src/lib/table/tableTree.ts:652 — tableTree.buildSimpleObjectTreeNodes 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 · tableVGroup.normalizeTableVGroupLayout (cyclomatic 28) · ×1
  • tableVGroup.normalizeTableVGroupLayout (cyclomatic 28) apps/desktop/src/lib/table/tableVGroup.ts:599 — tableVGroup.normalizeTableVGroupLayout has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 13 of the 28 points are its own statements and the rest belongs to one function literal inside it that branches (line 617). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · dbx_cli · ×1
  • dbx_cli::run_query (cyclomatic 27) crates/dbx-cli/src/main.rs:302 — dbx_cli::run_query has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DbxJdbcPlugin.listObjects (cyclomatic 27) · ×1
  • DbxJdbcPlugin.listObjects (cyclomatic 27) REDACTED:2179 — DbxJdbcPlugin.listObjects 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. This is NOT this file's highest cyclomatic complexity: DbxJdbcPlugin.handle (cyclomatic 32) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · main.parseConnectionConfig (cyclomatic 27) · ×1
  • main.parseConnectionConfig (cyclomatic 27) agents/drivers/argo-go/config.go:142 — main.parseConnectionConfig 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 · etcdSession.leaseList (cyclomatic 27) · ×1
  • etcdSession.leaseList (cyclomatic 27) agents/drivers/etcd-go/lease.go:38 — etcdSession.leaseList has cyclomatic complexity 27 (threshold 15). Of this number, 25 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · main.convertObjectKeyedInt64Map (cyclomatic 27) · ×1
  • main.convertObjectKeyedInt64Map (cyclomatic 27) REDACTED:403 — main.convertObjectKeyedInt64Map 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 · useDataGenerateSession.streamInsertTable (cyclomatic 27) · ×1
  • useDataGenerateSession.streamInsertTable (cyclomatic 27) apps/desktop/src/composables/useDataGenerateSession.ts:161 — useDataGenerateSession.streamInsertTable has cyclomatic complexity 27 (threshold 15). Of this number, 16 points are the body's own statements and 11 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · dataGridColumnType.resolveDataGridTypeVisualKind (cyclomatic 27) · ×1
  • dataGridColumnType.resolveDataGridTypeVisualKind (cyclomatic 27) apps/desktop/src/lib/dataGrid/dataGridColumnType.ts:304 — dataGridColumnType.resolveDataGridTypeVisualKind has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · dataGridSelectionPersistence.captureDataGridSelection (cyclomatic 27) · ×1
  • dataGridSelectionPersistence.captureDataGridSelection (cyclomatic 27) apps/desktop/src/lib/dataGrid/dataGridSelectionPersistence.ts:134 — dataGridSelectionPersistence.captureDataGridSelection has cyclomatic complexity 27 (threshold 15). Of this number, 22 points are the body's own statements and 5 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · databaseAuthorizationPlan.buildGrantAuthorizationPlan (cyclomatic 27) · ×1
  • databaseAuthorizationPlan.buildGrantAuthorizationPlan (cyclomatic 27) apps/desktop/src/lib/database/databaseAuthorizationPlan.ts:273 — databaseAuthorizationPlan.buildGrantAuthorizationPlan 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 · dataDictionaryExportTask.startDataDictionaryExport (cyclomatic 27) · ×1
  • dataDictionaryExportTask.startDataDictionaryExport (cyclomatic 27) apps/desktop/src/lib/docs/dataDictionaryExportTask.ts:36 — dataDictionaryExportTask.startDataDictionaryExport has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 2 of the 27 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 43, 91, 67, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · codemirrorSqlAliasHighlights.createSqlAliasHighlights (cyclomatic 27) · ×1
  • codemirrorSqlAliasHighlights.createSqlAliasHighlights (cyclomatic 27) apps/desktop/src/lib/editor/codemirrorSqlAliasHighlights.ts:11 — codemirrorSqlAliasHighlights.createSqlAliasHighlights has cyclomatic complexity 27 (threshold 15). Of this number, 24 points are the body's own statements and 3 belong to 3 function literals inside it that branch. 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 · shortcutDisplay.shortcutKeyLabel (cyclomatic 27) · ×1
  • shortcutDisplay.shortcutKeyLabel (cyclomatic 27) apps/desktop/src/lib/editor/shortcutDisplay.ts:66 — shortcutDisplay.shortcutKeyLabel has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · nacosConfigValidation.validateHtml (cyclomatic 27) · ×1
  • nacosConfigValidation.validateHtml (cyclomatic 27) apps/desktop/src/lib/nacos/nacosConfigValidation.ts:108 — nacosConfigValidation.validateHtml 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 · sidebarSearchTree.filterSidebarTreeWithMatcher (cyclomatic 27) · ×1
  • sidebarSearchTree.filterSidebarTreeWithMatcher (cyclomatic 27) apps/desktop/src/lib/sidebar/sidebarSearchTree.ts:366 — sidebarSearchTree.filterSidebarTreeWithMatcher has cyclomatic complexity 27 (threshold 15). Of this number, 23 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · solrAdmin.buildSolrQuery (cyclomatic 27) · ×1
  • solrAdmin.buildSolrQuery (cyclomatic 27) apps/desktop/src/lib/solr/solrAdmin.ts:302 — solrAdmin.buildSolrQuery has cyclomatic complexity 27 (threshold 15). Of this number, 23 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sqlCompletion.scanCteDefinitions (cyclomatic 27) · ×1
  • sqlCompletion.scanCteDefinitions (cyclomatic 27) REDACTED:3699 — sqlCompletion.scanCteDefinitions 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 · database-env.main (cyclomatic 27) · ×1
  • database-env.main (cyclomatic 27) scripts/database-env.mjs:526 — database-env.main has cyclomatic complexity 27 (threshold 15). Of this number, 26 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · main.renderXuguTableDDL (cyclomatic 26) · ×1
  • main.renderXuguTableDDL (cyclomatic 26) REDACTED:4745 — main.renderXuguTableDDL has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · main.renderXuguPartitionDDL (cyclomatic 26) · ×1
  • main.renderXuguPartitionDDL (cyclomatic 26) REDACTED:4949 — main.renderXuguPartitionDDL has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · main.classifyRPCError (cyclomatic 26) · ×1
  • main.classifyRPCError (cyclomatic 26) agents/drivers/xugu/protocol_error.go:48 — main.classifyRPCError 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 · useTabScroll.useTabScroll (cyclomatic 26) · ×1
  • useTabScroll.useTabScroll (cyclomatic 26) apps/desktop/src/composables/useTabScroll.ts:4 — useTabScroll.useTabScroll has cyclomatic complexity 26 (threshold 15). Of this number, 22 points are the body's own statements and 4 belong to 2 function literals inside it that branch. 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 · index.localeFromLanguageTag (cyclomatic 26) · ×1
  • index.localeFromLanguageTag (cyclomatic 26) apps/desktop/src/i18n/index.ts:36 — index.localeFromLanguageTag has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · openTabsPersistence.restoreOpenTabsArray (cyclomatic 26) · ×1
  • openTabsPersistence.restoreOpenTabsArray (cyclomatic 26) apps/desktop/src/lib/app/openTabsPersistence.ts:254 — openTabsPersistence.restoreOpenTabsArray has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 7 of the 26 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 267, 260, 271). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · errorUtils.normalizeBackendErrorAtDepth (cyclomatic 26) · ×1
  • errorUtils.normalizeBackendErrorAtDepth (cyclomatic 26) apps/desktop/src/lib/backend/errorUtils.ts:204 — errorUtils.normalizeBackendErrorAtDepth 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 · dbAdminSql.buildDuplicateTableStructurePlan (cyclomatic 26) · ×1
  • dbAdminSql.buildDuplicateTableStructurePlan (cyclomatic 26) apps/desktop/src/lib/database/dbAdminSql.ts:244 — dbAdminSql.buildDuplicateTableStructurePlan has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · elk-layout.extractHierarchicalLayoutResult (cyclomatic 26) · ×1
  • elk-layout.extractHierarchicalLayoutResult (cyclomatic 26) apps/desktop/src/lib/diagram/elk-layout.ts:321 — elk-layout.extractHierarchicalLayoutResult has cyclomatic complexity 26 (threshold 15). Of this number, 17 points are the body's own statements and 9 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · influxDbV1Delete.resolveInfluxDbV1DeleteTarget (cyclomatic 26) · ×1
  • influxDbV1Delete.resolveInfluxDbV1DeleteTarget (cyclomatic 26) apps/desktop/src/lib/influxdb/influxDbV1Delete.ts:84 — influxDbV1Delete.resolveInfluxDbV1DeleteTarget 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 · sqlAnalysis.analyzeEditableQueryEditability (cyclomatic 26) · ×1
  • sqlAnalysis.analyzeEditableQueryEditability (cyclomatic 26) apps/desktop/src/lib/sql/sqlAnalysis.ts:233 — sqlAnalysis.analyzeEditableQueryEditability has cyclomatic complexity 26 (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 · sqlCompletion.activeSingleQuotedLiteralStart (cyclomatic 26) · ×1
  • sqlCompletion.activeSingleQuotedLiteralStart (cyclomatic 26) REDACTED:1950 — sqlCompletion.activeSingleQuotedLiteralStart 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 · sqlCompletion.extractReferencedTables (cyclomatic 26) · ×1
  • sqlCompletion.extractReferencedTables (cyclomatic 26) REDACTED:3414 — sqlCompletion.extractReferencedTables 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 · sqlParameters.collectNativeSqlServerParameters (cyclomatic 26) · ×1
  • sqlParameters.collectNativeSqlServerParameters (cyclomatic 26) apps/desktop/src/lib/sql/sqlParameters.ts:1226 — sqlParameters.collectNativeSqlServerParameters 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 · server.requireAiRecommendationUpdate (cyclomatic 26) · ×1
  • server.requireAiRecommendationUpdate (cyclomatic 26) plugins/sdk/dev-host/server.mjs:47 — server.requireAiRecommendationUpdate has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · DbxJdbcPlugin.readValue (cyclomatic 25) · ×1
  • DbxJdbcPlugin.readValue (cyclomatic 25) REDACTED:4299 — DbxJdbcPlugin.readValue has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: DbxJdbcPlugin.handle (cyclomatic 32) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · etcdSession.put (cyclomatic 25) · ×1
  • etcdSession.put (cyclomatic 25) agents/drivers/etcd-go/kv.go:229 — etcdSession.put has cyclomatic complexity 25 (threshold 15). Of this number, 18 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · main.parseSingleOracleTableRef (cyclomatic 25) · ×1
  • main.parseSingleOracleTableRef (cyclomatic 25) REDACTED:4507 — main.parseSingleOracleTableRef 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 · ddlStorage.stripOceanBaseOracleStorageOptions (cyclomatic 25) · ×1
  • ddlStorage.stripOceanBaseOracleStorageOptions (cyclomatic 25) apps/desktop/src/lib/sql/ddlStorage.ts:88 — ddlStorage.stripOceanBaseOracleStorageOptions 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 · sqlStatementRanges.skipBalancedParens (cyclomatic 25) · ×1
  • sqlStatementRanges.skipBalancedParens (cyclomatic 25) apps/desktop/src/lib/sql/sqlStatementRanges.ts:1558 — sqlStatementRanges.skipBalancedParens 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 · sqlStatementRanges.oraclePlSqlTokens (cyclomatic 25) · ×1
  • sqlStatementRanges.oraclePlSqlTokens (cyclomatic 25) apps/desktop/src/lib/sql/sqlStatementRanges.ts:2351 — sqlStatementRanges.oraclePlSqlTokens 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 · useFileDrop.useFileDrop (cyclomatic 25) · ×1
  • useFileDrop.useFileDrop (cyclomatic 25) apps/desktop/src/composables/useFileDrop.ts:23 — useFileDrop.useFileDrop has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 3 of the 25 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 47, 124, 138). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · connectionUrl.urlParamsRequireTls (cyclomatic 25) · ×1
  • connectionUrl.urlParamsRequireTls (cyclomatic 25) REDACTED:380 — connectionUrl.urlParamsRequireTls has cyclomatic complexity 25 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · dataGridForeignKeyDisplay.createForeignKeyDisplayRequestCoordinator (cyclomatic 25) · ×1
  • dataGridForeignKeyDisplay.createForeignKeyDisplayRequestCoordinator (cyclomatic 25) apps/desktop/src/lib/dataGrid/dataGridForeignKeyDisplay.ts:39 — dataGridForeignKeyDisplay.createForeignKeyDisplayRequestCoordinator has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 8 of the 25 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 60, 71, 49, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · dataGridSelectionPersistence.restoreDataGridSelection (cyclomatic 25) · ×1
  • dataGridSelectionPersistence.restoreDataGridSelection (cyclomatic 25) apps/desktop/src/lib/dataGrid/dataGridSelectionPersistence.ts:200 — dataGridSelectionPersistence.restoreDataGridSelection has cyclomatic complexity 25 (threshold 15). Of this number, 21 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · explainPlan.parseDamengExplainText (cyclomatic 25) · ×1
  • explainPlan.parseDamengExplainText (cyclomatic 25) apps/desktop/src/lib/diagram/explainPlan.ts:75 — explainPlan.parseDamengExplainText 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 · queryEditorTableDrop.parseTableReferencePayload (cyclomatic 25) · ×1
  • queryEditorTableDrop.parseTableReferencePayload (cyclomatic 25) apps/desktop/src/lib/editor/queryEditorTableDrop.ts:193 — queryEditorTableDrop.parseTableReferencePayload has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · sqlSemanticSelectionRanges.collectExpressionSection (cyclomatic 25) · ×1
  • sqlSemanticSelectionRanges.collectExpressionSection (cyclomatic 25) apps/desktop/src/lib/editor/sqlSemanticSelectionRanges.ts:247 — sqlSemanticSelectionRanges.collectExpressionSection has cyclomatic complexity 25 (threshold 15). Of this number, 23 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · diagnostics.isSqlServerGoSeparatorLine (cyclomatic 25) · ×1
  • diagnostics.isSqlServerGoSeparatorLine (cyclomatic 25) apps/desktop/src/lib/sql/semantic/diagnostics.ts:165 — diagnostics.isSqlServerGoSeparatorLine has cyclomatic complexity 25 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · model.sqlSemanticTableNameSpans (cyclomatic 25) · ×1
  • model.sqlSemanticTableNameSpans (cyclomatic 25) apps/desktop/src/lib/sql/semantic/model.ts:155 — model.sqlSemanticTableNameSpans 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 · model.cteBodyProjectionShape (cyclomatic 25) · ×1
  • model.cteBodyProjectionShape (cyclomatic 25) apps/desktop/src/lib/sql/semantic/model.ts:274 — model.cteBodyProjectionShape 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 · sqlCompletion.scanSelectListContext (cyclomatic 25) · ×1
  • sqlCompletion.scanSelectListContext (cyclomatic 25) REDACTED:2896 — sqlCompletion.scanSelectListContext 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 · sqlCompletion.buildTableItems (cyclomatic 25) · ×1
  • sqlCompletion.buildTableItems (cyclomatic 25) REDACTED:4031 — sqlCompletion.buildTableItems has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 1 of the 25 points is its own statement and the rest belongs to one function literal inside it that branches (line 4048). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · transferTaskStore.normalizeTask (cyclomatic 25) · ×1
  • transferTaskStore.normalizeTask (cyclomatic 25) apps/desktop/src/stores/transferTaskStore.ts:63 — transferTaskStore.normalizeTask has cyclomatic complexity 25 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · PluginPackageInstaller · ×1
  • PluginPackageInstaller::install_bytes_locked (cyclomatic 24) crates/dbx-plugin-runtime/src/plugins/installer.rs:514 — PluginPackageInstaller::install_bytes_locked 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 · Analyzer · ×1
  • Analyzer::visit_expr (cyclomatic 24) crates/dbx-sql-core/src/sql_analysis.rs:1305 — Analyzer::visit_expr has cyclomatic complexity 24 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · cassandraConfig.finalize (cyclomatic 24) · ×1
  • cassandraConfig.finalize (cyclomatic 24) agents/drivers/cassandra-go/config.go:452 — cassandraConfig.finalize 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 · main.rewriteOracleSelectItems (cyclomatic 24) · ×1
  • main.rewriteOracleSelectItems (cyclomatic 24) REDACTED:4623 — main.rewriteOracleSelectItems 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 · useQueryEditorTableDrop.useQueryEditorTableDrop (cyclomatic 24) · ×1
  • useQueryEditorTableDrop.useQueryEditorTableDrop (cyclomatic 24) apps/desktop/src/components/editor/useQueryEditorTableDrop.ts:29 — useQueryEditorTableDrop.useQueryEditorTableDrop has cyclomatic complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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 · documentStoreProvider.parseMongoFilterValueAs (cyclomatic 24) · ×1
  • documentStoreProvider.parseMongoFilterValueAs (cyclomatic 24) apps/desktop/src/lib/app/documentStoreProvider.ts:896 — documentStoreProvider.parseMongoFilterValueAs 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 · safeJsonFormat.myersDiff (cyclomatic 24) · ×1
  • safeJsonFormat.myersDiff (cyclomatic 24) apps/desktop/src/lib/common/safeJsonFormat.ts:301 — safeJsonFormat.myersDiff has cyclomatic complexity 24 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · xmlFormat.parseXmlDocument (cyclomatic 24) · ×1
  • xmlFormat.parseXmlDocument (cyclomatic 24) apps/desktop/src/lib/common/xmlFormat.ts:37 — xmlFormat.parseXmlDocument has cyclomatic complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · agentTarget.consulAgentWriteBlockedReason (cyclomatic 24) · ×1
  • agentTarget.consulAgentWriteBlockedReason (cyclomatic 24) apps/desktop/src/lib/consul/agentTarget.ts:39 — agentTarget.consulAgentWriteBlockedReason has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · elasticsearchCompletion.inspectJsonBody (cyclomatic 24) · ×1
  • elasticsearchCompletion.inspectJsonBody (cyclomatic 24) apps/desktop/src/lib/elasticsearch/elasticsearchCompletion.ts:461 — elasticsearchCompletion.inspectJsonBody 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 · gridSnapshot.renderGridSnapshotHtml (cyclomatic 24) · ×1
  • gridSnapshot.renderGridSnapshotHtml (cyclomatic 24) apps/desktop/src/lib/gridSnapshot/gridSnapshot.ts:128 — gridSnapshot.renderGridSnapshotHtml has cyclomatic complexity 24 (threshold 15). Of this number, 13 points are the body's own statements and 11 belong to 3 function literals inside it that branch. 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 · sidebarLayoutMonitor.detectLayoutAnomalies (cyclomatic 24) · ×1
  • sidebarLayoutMonitor.detectLayoutAnomalies (cyclomatic 24) apps/desktop/src/lib/sidebar/sidebarLayoutMonitor.ts:443 — sidebarLayoutMonitor.detectLayoutAnomalies has cyclomatic complexity 24 (threshold 15). Of this number, 22 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · model.parseRowSourcesAtDepth (cyclomatic 24) · ×1
  • model.parseRowSourcesAtDepth (cyclomatic 24) apps/desktop/src/lib/sql/semantic/model.ts:705 — model.parseRowSourcesAtDepth 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 · sqlAnalysis.analyzeSelectStructureForDisplay (cyclomatic 24) · ×1
  • sqlAnalysis.analyzeSelectStructureForDisplay (cyclomatic 24) apps/desktop/src/lib/sql/sqlAnalysis.ts:316 — sqlAnalysis.analyzeSelectStructureForDisplay 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 · sqlCompletion.maskSqlLiteralsAndComments (cyclomatic 24) · ×1
  • sqlCompletion.maskSqlLiteralsAndComments (cyclomatic 24) REDACTED:3364 — sqlCompletion.maskSqlLiteralsAndComments has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · queryStore.appendQueryResultSegment (cyclomatic 24) · ×1
  • queryStore.appendQueryResultSegment (cyclomatic 24) apps/desktop/src/stores/queryStore.ts:316 — queryStore.appendQueryResultSegment has cyclomatic complexity 24 (threshold 15). Of this number, 20 points are the body's own statements and 4 belong to one function literal inside it that branches. 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 · TdengineDriver · ×1
  • TdengineDriver::completion_assistant_search (cyclomatic 23) agents/drivers/tdengine/src/driver.rs:232 — TdengineDriver::completion_assistant_search 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 · SqlScanner · ×1
  • SqlScanner::step (cyclomatic 23) crates/dbx-sql-core/src/sql.rs:2039 — SqlScanner::step 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 · OraclePlSqlBlock · ×1
  • OraclePlSqlBlock::is_complete (cyclomatic 23) crates/dbx-sql-core/src/sql.rs:2604 — OraclePlSqlBlock::is_complete 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 · DbxJdbcPlugin.stripCommentsAndLiterals (cyclomatic 23) · ×1
  • DbxJdbcPlugin.stripCommentsAndLiterals (cyclomatic 23) REDACTED:1854 — DbxJdbcPlugin.stripCommentsAndLiterals 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. This is NOT this file's highest cyclomatic complexity: DbxJdbcPlugin.handle (cyclomatic 32) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · EwkbWktDecoder.geometryToWkt (cyclomatic 23) · ×1
  • EwkbWktDecoder.geometryToWkt (cyclomatic 23) agents/common/src/main/java/com/dbx/agent/EwkbWktDecoder.java:489 — EwkbWktDecoder.geometryToWkt 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 · main.renderCQLValue (cyclomatic 23) · ×1
  • main.renderCQLValue (cyclomatic 23) agents/drivers/cassandra-go/values.go:39 — main.renderCQLValue has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · main.pumpLongPollWatch (cyclomatic 23) · ×1
  • main.pumpLongPollWatch (cyclomatic 23) agents/drivers/etcd2-go/watch.go:273 — main.pumpLongPollWatch 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 · etcd2Session.put (cyclomatic 23) · ×1
  • etcd2Session.put (cyclomatic 23) agents/drivers/etcd2-go/kv.go:178 — etcd2Session.put 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 · proxyManager.rewriteJSON (cyclomatic 23) · ×1
  • proxyManager.rewriteJSON (cyclomatic 23) REDACTED:462 — proxyManager.rewriteJSON 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 · main.isQuerySQL (cyclomatic 23) · ×1
  • main.isQuerySQL (cyclomatic 23) agents/drivers/vastbase-go/main.go:1416 — main.isQuerySQL has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This is NOT this file's highest cyclomatic complexity: server.dispatch (cyclomatic 33) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · main.renderXuguIndexPartitionDDL (cyclomatic 23) · ×1
  • main.renderXuguIndexPartitionDDL (cyclomatic 23) REDACTED:5219 — main.renderXuguIndexPartitionDDL 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 · queryEditorHoverContent.createQueryEditorHoverContent (cyclomatic 23) · ×1
  • queryEditorHoverContent.createQueryEditorHoverContent (cyclomatic 23) apps/desktop/src/components/editor/queryEditorHoverContent.ts:16 — queryEditorHoverContent.createQueryEditorHoverContent has cyclomatic complexity 23 (threshold 15). Of this number, 13 points are the body's own statements and 10 belong to 6 function literals inside it that branch. 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 · useQueryEditorStatementBoundaries.useQueryEditorStatementBoundaries (cyclomatic 23) · ×1
  • useQueryEditorStatementBoundaries.useQueryEditorStatementBoundaries (cyclomatic 23) apps/desktop/src/components/editor/useQueryEditorStatementBoundaries.ts:28 — useQueryEditorStatementBoundaries.useQueryEditorStatementBoundaries has cyclomatic complexity 23 (threshold 15). Of this number, 16 points are the body's own statements and 7 belong to 3 function literals inside it that branch. 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 · useQueryEditorIntentions.useQueryEditorIntentions (cyclomatic 23) · ×1
  • useQueryEditorIntentions.useQueryEditorIntentions (cyclomatic 23) apps/desktop/src/components/editor/useQueryEditorIntentions.ts:24 — useQueryEditorIntentions.useQueryEditorIntentions has cyclomatic complexity 23 (threshold 15). Of this number, 18 points are the body's own statements and 5 belong to 2 function literals inside it that branch. 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 · useVerticalOverlayScrollbar.useVerticalOverlayScrollbar (cyclomatic 23) · ×1
  • useVerticalOverlayScrollbar.useVerticalOverlayScrollbar (cyclomatic 23) apps/desktop/src/composables/useVerticalOverlayScrollbar.ts:18 — useVerticalOverlayScrollbar.useVerticalOverlayScrollbar has cyclomatic complexity 23 (threshold 15). Of this number, 17 points are the body's own statements and 6 belong to 3 function literals inside it that branch. 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 · aiGenerationStatus.applyStatusEvent (cyclomatic 23) · ×1
  • aiGenerationStatus.applyStatusEvent (cyclomatic 23) apps/desktop/src/lib/ai/aiGenerationStatus.ts:102 — aiGenerationStatus.applyStatusEvent has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · aiIntentRouter.routeByRulesUnchecked (cyclomatic 23) · ×1
  • aiIntentRouter.routeByRulesUnchecked (cyclomatic 23) apps/desktop/src/lib/ai/aiIntentRouter.ts:220 — aiIntentRouter.routeByRulesUnchecked 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 · documentStoreProvider.rewriteUnsafeIntegerTokens (cyclomatic 23) · ×1
  • documentStoreProvider.rewriteUnsafeIntegerTokens (cyclomatic 23) apps/desktop/src/lib/app/documentStoreProvider.ts:755 — documentStoreProvider.rewriteUnsafeIntegerTokens 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 · connectionConfigTransfer.prepareConnectionConfigImport (cyclomatic 23) · ×1
  • connectionConfigTransfer.prepareConnectionConfigImport (cyclomatic 23) apps/desktop/src/lib/connection/connectionConfigTransfer.ts:183 — connectionConfigTransfer.prepareConnectionConfigImport has cyclomatic complexity 23 (threshold 15). Of this number, 20 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · dataGridCopyExtractor.validateDataGridExtractorOptions (cyclomatic 23) · ×1
  • dataGridCopyExtractor.validateDataGridExtractorOptions (cyclomatic 23) apps/desktop/src/lib/dataGrid/dataGridCopyExtractor.ts:203 — dataGridCopyExtractor.validateDataGridExtractorOptions 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 · databaseAuthorizationPlan.buildCreateUserAuthorizationPlan (cyclomatic 23) · ×1
  • databaseAuthorizationPlan.buildCreateUserAuthorizationPlan (cyclomatic 23) apps/desktop/src/lib/database/databaseAuthorizationPlan.ts:166 — databaseAuthorizationPlan.buildCreateUserAuthorizationPlan 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 · shortcutRegistry.normalizeShortcutSettings (cyclomatic 23) · ×1
  • shortcutRegistry.normalizeShortcutSettings (cyclomatic 23) apps/desktop/src/lib/editor/shortcutRegistry.ts:682 — shortcutRegistry.normalizeShortcutSettings has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 11 of the 23 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 685, 726, 741). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · mongoShellCommand.parseMongoCommand (cyclomatic 23) · ×1
  • mongoShellCommand.parseMongoCommand (cyclomatic 23) apps/desktop/src/lib/mongo/mongoShellCommand.ts:959 — mongoShellCommand.parseMongoCommand has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 9 of the 23 points are its own statements and the rest belongs to 14 function literals inside it that branch (lines 971, 975, 979, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · redisKeyTree.sortRedisTreeLevelCooperatively (cyclomatic 23) · ×1
  • redisKeyTree.sortRedisTreeLevelCooperatively (cyclomatic 23) apps/desktop/src/lib/redis/redisKeyTree.ts:212 — redisKeyTree.sortRedisTreeLevelCooperatively has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · treeNodeClick.treeNodeRowDoubleClickAction (cyclomatic 23) · ×1
  • treeNodeClick.treeNodeRowDoubleClickAction (cyclomatic 23) apps/desktop/src/lib/sidebar/treeNodeClick.ts:160 — treeNodeClick.treeNodeRowDoubleClickAction 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 · ddlDisplay.findCreateTableBody (cyclomatic 23) · ×1
  • ddlDisplay.findCreateTableBody (cyclomatic 23) apps/desktop/src/lib/sql/ddlDisplay.ts:391 — ddlDisplay.findCreateTableBody has cyclomatic complexity 23 (threshold 15). Of this number, 19 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · insertValueHints.parseInsertClause (cyclomatic 23) · ×1
  • insertValueHints.parseInsertClause (cyclomatic 23) apps/desktop/src/lib/sql/insertValueHints.ts:295 — insertValueHints.parseInsertClause 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 · completion.sqlSemanticSelectStarIsOnlyProjection (cyclomatic 23) · ×1
  • completion.sqlSemanticSelectStarIsOnlyProjection (cyclomatic 23) apps/desktop/src/lib/sql/semantic/completion.ts:77 — completion.sqlSemanticSelectStarIsOnlyProjection has cyclomatic complexity 23 (threshold 15). Of this number, 16 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · model.parseCteSources (cyclomatic 23) · ×1
  • model.parseCteSources (cyclomatic 23) apps/desktop/src/lib/sql/semantic/model.ts:400 — model.parseCteSources has cyclomatic complexity 23 (threshold 15). Of this number, 21 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sqlCompletion.buildJoinConditionItemsForPair (cyclomatic 23) · ×1
  • sqlCompletion.buildJoinConditionItemsForPair (cyclomatic 23) REDACTED:5178 — sqlCompletion.buildJoinConditionItemsForPair has cyclomatic complexity 23 (threshold 15). Of this number, 17 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sqlParameters.isPostgresQuestionMarkOperator (cyclomatic 23) · ×1
  • sqlParameters.isPostgresQuestionMarkOperator (cyclomatic 23) apps/desktop/src/lib/sql/sqlParameters.ts:733 — sqlParameters.isPostgresQuestionMarkOperator has cyclomatic complexity 23 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · sqlVariables.replaceReferences (cyclomatic 23) · ×1
  • sqlVariables.replaceReferences (cyclomatic 23) apps/desktop/src/lib/sql/sqlVariables.ts:203 — sqlVariables.replaceReferences 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 · routineParameters.tokenizeXuguRoutineDefinition (cyclomatic 23) · ×1
  • routineParameters.tokenizeXuguRoutineDefinition (cyclomatic 23) apps/desktop/src/lib/table/routineParameters.ts:188 — routineParameters.tokenizeXuguRoutineDefinition 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 · tableSelectSql.sqlCteVisibilities (cyclomatic 23) · ×1
  • tableSelectSql.sqlCteVisibilities (cyclomatic 23) apps/desktop/src/lib/table/tableSelectSql.ts:316 — tableSelectSql.sqlCteVisibilities 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. This is NOT this file's highest cyclomatic complexity: tableSelectSql.requiresIdentifierQuote (cyclomatic 27) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · tableTree.mergeTableTreePageChildren (cyclomatic 23) · ×1
  • tableTree.mergeTableTreePageChildren (cyclomatic 23) apps/desktop/src/lib/table/tableTree.ts:430 — tableTree.mergeTableTreePageChildren has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 10 of the 23 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 510, 440, 455, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · tableVGroup.findTableVGroupContainerNode (cyclomatic 23) · ×1
  • tableVGroup.findTableVGroupContainerNode (cyclomatic 23) apps/desktop/src/lib/table/tableVGroup.ts:557 — tableVGroup.findTableVGroupContainerNode has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 9 of the 23 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 566, 558, 588). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · dbx_plugin_cli · ×1
  • dbx_plugin_cli::dev::build_config (cyclomatic 22) plugins/sdk/cli/src/dev.rs:52 — dbx_plugin_cli::dev::build_config 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 · DbxJdbcPlugin.getExplainInfo (cyclomatic 22) · ×1
  • DbxJdbcPlugin.getExplainInfo (cyclomatic 22) REDACTED:1475 — DbxJdbcPlugin.getExplainInfo 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. This is NOT this file's highest cyclomatic complexity: DbxJdbcPlugin.handle (cyclomatic 32) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · KafkaAgent.brokerEndpoints (cyclomatic 22) · ×1
  • KafkaAgent.brokerEndpoints (cyclomatic 22) agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:425 — KafkaAgent.brokerEndpoints 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. This is NOT this file's highest cyclomatic complexity: KafkaAgent.dispatch (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · main.readOracleTNSAliases (cyclomatic 22) · ×1
  • main.readOracleTNSAliases (cyclomatic 22) agents/drivers/oracle-go/tns.go:102 — main.readOracleTNSAliases has cyclomatic complexity 22 (threshold 15). Of this number, 18 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · server.listObjects (cyclomatic 22) · ×1
  • server.listObjects (cyclomatic 22) REDACTED:2213 — server.listObjects has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · gohive.ParseDSN (cyclomatic 22) · ×1
  • gohive.ParseDSN (cyclomatic 22) agents/go-common/gohive/dsn.go:27 — gohive.ParseDSN has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · sqlStatementRanges.statementRangeAtCursor (cyclomatic 22) · ×1
  • sqlStatementRanges.statementRangeAtCursor (cyclomatic 22) apps/desktop/src/lib/sql/sqlStatementRanges.ts:674 — sqlStatementRanges.statementRangeAtCursor 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 · useDataGridDistinctValueLoader.useDataGridDistinctValueLoader (cyclomatic 22) · ×1
  • useDataGridDistinctValueLoader.useDataGridDistinctValueLoader (cyclomatic 22) apps/desktop/src/composables/useDataGridDistinctValueLoader.ts:61 — useDataGridDistinctValueLoader.useDataGridDistinctValueLoader has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · useQuickOpen.matchQuickOpenText (cyclomatic 22) · ×1
  • useQuickOpen.matchQuickOpenText (cyclomatic 22) apps/desktop/src/composables/useQuickOpen.ts:176 — useQuickOpen.matchQuickOpenText 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 · documentStoreProvider.translateFieldFilterToElasticsearchQuery (cyclomatic 22) · ×1
  • documentStoreProvider.translateFieldFilterToElasticsearchQuery (cyclomatic 22) apps/desktop/src/lib/app/documentStoreProvider.ts:1027 — documentStoreProvider.translateFieldFilterToElasticsearchQuery 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 · connectionUrlBuilder.connectionUrlCopyFormats (cyclomatic 22) · ×1
  • connectionUrlBuilder.connectionUrlCopyFormats (cyclomatic 22) apps/desktop/src/lib/connection/connectionUrlBuilder.ts:475 — connectionUrlBuilder.connectionUrlCopyFormats has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · dataGridContextMenu.createDataGridColumnContextMenuItems (cyclomatic 22) · ×1
  • dataGridContextMenu.createDataGridColumnContextMenuItems (cyclomatic 22) apps/desktop/src/lib/dataGrid/dataGridContextMenu.ts:73 — dataGridContextMenu.createDataGridColumnContextMenuItems 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 · productionSafety.sqlTargetSafetyText (cyclomatic 22) · ×1
  • productionSafety.sqlTargetSafetyText (cyclomatic 22) REDACTED:261 — productionSafety.sqlTargetSafetyText 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 · layer-store.useLayerStore (cyclomatic 22) · ×1
  • layer-store.useLayerStore (cyclomatic 22) apps/desktop/src/lib/diagram/layer-store.ts:35 — layer-store.useLayerStore has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · keyboardShortcuts.matchesModifierOnlyShortcut (cyclomatic 22) · ×1
  • keyboardShortcuts.matchesModifierOnlyShortcut (cyclomatic 22) apps/desktop/src/lib/editor/keyboardShortcuts.ts:128 — keyboardShortcuts.matchesModifierOnlyShortcut has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · datagripImport.parseJdbcUrl (cyclomatic 22) · ×1
  • datagripImport.parseJdbcUrl (cyclomatic 22) apps/desktop/src/lib/imports/datagripImport.ts:133 — datagripImport.parseJdbcUrl 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 · mongoShellCommand.parseMongoFindCommand (cyclomatic 22) · ×1
  • mongoShellCommand.parseMongoFindCommand (cyclomatic 22) apps/desktop/src/lib/mongo/mongoShellCommand.ts:373 — mongoShellCommand.parseMongoFindCommand has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · redisKeyGrouping.validateRedisKeyGrouping (cyclomatic 22) · ×1
  • redisKeyGrouping.validateRedisKeyGrouping (cyclomatic 22) apps/desktop/src/lib/redis/redisKeyGrouping.ts:22 — redisKeyGrouping.validateRedisKeyGrouping has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 8 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 27). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · sqlCompletion.currentLineBlockEnd (cyclomatic 22) · ×1
  • sqlCompletion.currentLineBlockEnd (cyclomatic 22) REDACTED:2302 — sqlCompletion.currentLineBlockEnd 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 · sqlCompletion.parseTrailingIdentifierContext (cyclomatic 22) · ×1
  • sqlCompletion.parseTrailingIdentifierContext (cyclomatic 22) REDACTED:2758 — sqlCompletion.parseTrailingIdentifierContext 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 · sqlCompletion.buildForeignKeyRelatedTableItems (cyclomatic 22) · ×1
  • sqlCompletion.buildForeignKeyRelatedTableItems (cyclomatic 22) REDACTED:4079 — sqlCompletion.buildForeignKeyRelatedTableItems has cyclomatic complexity 22 (threshold 15). Of this number, 12 points are the body's own statements and 10 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sqlRisk.sqlSafetyText (cyclomatic 22) · ×1
  • sqlRisk.sqlSafetyText (cyclomatic 22) apps/desktop/src/lib/sql/sqlRisk.ts:152 — sqlRisk.sqlSafetyText 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 · sqlVariables.readValueEnd (cyclomatic 22) · ×1
  • sqlVariables.readValueEnd (cyclomatic 22) apps/desktop/src/lib/sql/sqlVariables.ts:164 — sqlVariables.readValueEnd 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 · tableStructureEditorState.isDataTypeLengthDisabled (cyclomatic 22) · ×1
  • tableStructureEditorState.isDataTypeLengthDisabled (cyclomatic 22) apps/desktop/src/lib/table/tableStructureEditorState.ts:1657 — tableStructureEditorState.isDataTypeLengthDisabled has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · tabPresentation.tabModeLabel (cyclomatic 22) · ×1
  • tabPresentation.tabModeLabel (cyclomatic 22) apps/desktop/src/lib/tabs/tabPresentation.ts:647 — tabPresentation.tabModeLabel has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · tabUiState.sanitizeValue (cyclomatic 22) · ×1
  • tabUiState.sanitizeValue (cyclomatic 22) apps/desktop/src/lib/tabs/tabUiState.ts:72 — tabUiState.sanitizeValue has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · sync-connection-types.loadConnectionProfiles (cyclomatic 22) · ×1
  • sync-connection-types.loadConnectionProfiles (cyclomatic 22) scripts/sync-connection-types.mjs:153 — sync-connection-types.loadConnectionProfiles has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 7 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 164). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · RuntimeConfig · ×1
  • RuntimeConfig::from_environment_and_args (cyclomatic 21) crates/dbx-mcp/src/runtime.rs:43 — RuntimeConfig::from_environment_and_args 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 · dbx_plugin_packager · ×1
  • dbx_plugin_packager::run_package_cli (cyclomatic 21) plugins/sdk/packager/src/main.rs:80 — dbx_plugin_packager::run_package_cli 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 · TranswarpAgent.getColumns (cyclomatic 21) · ×1
  • TranswarpAgent.getColumns (cyclomatic 21) REDACTED:199 — TranswarpAgent.getColumns 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 · KafkaAgent.getConsumerGroupSnapshot (cyclomatic 21) · ×1
  • KafkaAgent.getConsumerGroupSnapshot (cyclomatic 21) agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:1192 — KafkaAgent.getConsumerGroupSnapshot 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. This is NOT this file's highest cyclomatic complexity: KafkaAgent.dispatch (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · KafkaAgent.listConsumerGroups (cyclomatic 21) · ×1
  • KafkaAgent.listConsumerGroups (cyclomatic 21) agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:1011 — KafkaAgent.listConsumerGroups 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. This is NOT this file's highest cyclomatic complexity: KafkaAgent.dispatch (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · cassandraConfig.clusterConfig (cyclomatic 21) · ×1
  • cassandraConfig.clusterConfig (cyclomatic 21) agents/drivers/cassandra-go/config.go:364 — cassandraConfig.clusterConfig 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 · etcd2Session.status (cyclomatic 21) · ×1
  • etcd2Session.status (cyclomatic 21) agents/drivers/etcd2-go/status.go:14 — etcd2Session.status 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 · server.completionAssistantSearch (cyclomatic 21) · ×1
  • server.completionAssistantSearch (cyclomatic 21) agents/drivers/iotdb/metadata.go:486 — server.completionAssistantSearch 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 · main.hasTopLevelSQLKeyword (cyclomatic 21) · ×1
  • main.hasTopLevelSQLKeyword (cyclomatic 21) agents/drivers/kingbase-go/main.go:1799 — main.hasTopLevelSQLKeyword 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 · main.skipSQLParenthesized (cyclomatic 21) · ×1
  • main.skipSQLParenthesized (cyclomatic 21) agents/drivers/kingbase-go/main.go:1893 — main.skipSQLParenthesized 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 · server.getTablePartitioning (cyclomatic 21) · ×1
  • server.getTablePartitioning (cyclomatic 21) REDACTED:1169 — server.getTablePartitioning 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 · server.completionAssistantTables (cyclomatic 21) · ×1
  • server.completionAssistantTables (cyclomatic 21) REDACTED:1953 — server.completionAssistantTables 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 · main.convertObjectKeyedMap (cyclomatic 21) · ×1
  • main.convertObjectKeyedMap (cyclomatic 21) REDACTED:336 — main.convertObjectKeyedMap 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 · server.completionAssistantSearchTypeMembers (cyclomatic 21) · ×1
  • server.completionAssistantSearchTypeMembers (cyclomatic 21) agents/drivers/xugu/type_members.go:163 — server.completionAssistantSearchTypeMembers 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 · krb5.newInitiatorClient (cyclomatic 21) · ×1
  • krb5.newInitiatorClient (cyclomatic 21) agents/go-common/go-gssapi/krb5/krb5.go:807 — krb5.newInitiatorClient 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 · client.valuesToBytes (cyclomatic 21) · ×1
  • client.valuesToBytes (cyclomatic 21) agents/go-common/iotdb-client-go/client/session.go:1131 — client.valuesToBytes has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · ddlStorage.oracleStorageClauseEnd (cyclomatic 21) · ×1
  • ddlStorage.oracleStorageClauseEnd (cyclomatic 21) apps/desktop/src/lib/sql/ddlStorage.ts:170 — ddlStorage.oracleStorageClauseEnd 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 · useDataGridCellDetail.useDataGridCellDetail (cyclomatic 21) · ×1
  • useDataGridCellDetail.useDataGridCellDetail (cyclomatic 21) apps/desktop/src/composables/useDataGridCellDetail.ts:8 — useDataGridCellDetail.useDataGridCellDetail has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 34, 49, 26, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · usePluginShortcuts.usePluginShortcuts (cyclomatic 21) · ×1
  • usePluginShortcuts.usePluginShortcuts (cyclomatic 21) apps/desktop/src/composables/usePluginShortcuts.ts:11 — usePluginShortcuts.usePluginShortcuts 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 · databaseAuthorizationPlan.databaseAuthorizationsFromTableGrants (cyclomatic 21) · ×1
  • databaseAuthorizationPlan.databaseAuthorizationsFromTableGrants (cyclomatic 21) apps/desktop/src/lib/database/databaseAuthorizationPlan.ts:123 — databaseAuthorizationPlan.databaseAuthorizationsFromTableGrants has cyclomatic complexity 21 (threshold 15). Of this number, 17 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · databaseAuthorizationPlan.postgresDatabaseAuthorizationSteps (cyclomatic 21) · ×1
  • databaseAuthorizationPlan.postgresDatabaseAuthorizationSteps (cyclomatic 21) apps/desktop/src/lib/database/databaseAuthorizationPlan.ts:438 — databaseAuthorizationPlan.postgresDatabaseAuthorizationSteps has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sqlExecutionTargetRegistry.createProvider (cyclomatic 21) · ×1
  • sqlExecutionTargetRegistry.createProvider (cyclomatic 21) apps/desktop/src/lib/database/sqlExecutionTargetRegistry.ts:65 — sqlExecutionTargetRegistry.createProvider has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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 · explainPlan.parseOracleExplainText (cyclomatic 21) · ×1
  • explainPlan.parseOracleExplainText (cyclomatic 21) apps/desktop/src/lib/diagram/explainPlan.ts:161 — explainPlan.parseOracleExplainText has cyclomatic complexity 21 (threshold 15). Of this number, 19 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · explainPlan.parseDamengPlanLine (cyclomatic 21) · ×1
  • explainPlan.parseDamengPlanLine (cyclomatic 21) apps/desktop/src/lib/diagram/explainPlan.ts:298 — explainPlan.parseDamengPlanLine 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 · explainPlan.buildDamengTree (cyclomatic 21) · ×1
  • explainPlan.buildDamengTree (cyclomatic 21) apps/desktop/src/lib/diagram/explainPlan.ts:701 — explainPlan.buildDamengTree has cyclomatic complexity 21 (threshold 15). Of this number, 19 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · hoverTableSql.parseColumnLine (cyclomatic 21) · ×1
  • hoverTableSql.parseColumnLine (cyclomatic 21) apps/desktop/src/lib/editor/hoverTableSql.ts:549 — hoverTableSql.parseColumnLine 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 · schemaTreeCache.decodeTableSearchIndexManifest (cyclomatic 21) · ×1
  • schemaTreeCache.decodeTableSearchIndexManifest (cyclomatic 21) apps/desktop/src/lib/metadata/schemaTreeCache.ts:37 — schemaTreeCache.decodeTableSearchIndexManifest has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 5 of the 21 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 42, 50). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · javaSerialized.normalizeJavaSerializedValue (cyclomatic 21) · ×1
  • javaSerialized.normalizeJavaSerializedValue (cyclomatic 21) apps/desktop/src/lib/redis/codec/javaSerialized.ts:392 — javaSerialized.normalizeJavaSerializedValue 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 · settingsTransfer.isSqlShortcutActionItem (cyclomatic 21) · ×1
  • settingsTransfer.isSqlShortcutActionItem (cyclomatic 21) apps/desktop/src/lib/settings/settingsTransfer.ts:379 — settingsTransfer.isSqlShortcutActionItem 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 · sqlServerQueryWrapping.topLevelSqlTokens (cyclomatic 21) · ×1
  • sqlServerQueryWrapping.topLevelSqlTokens (cyclomatic 21) apps/desktop/src/lib/sql/sqlServerQueryWrapping.ts:32 — sqlServerQueryWrapping.topLevelSqlTokens 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 · settingsStore.inferAiProviderFromConfig (cyclomatic 21) · ×1
  • settingsStore.inferAiProviderFromConfig (cyclomatic 21) apps/desktop/src/stores/settingsStore.ts:661 — settingsStore.inferAiProviderFromConfig has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · start (cyclomatic 21) · ×1
  • start (cyclomatic 21) plugins/sdk/dev-host/sidecar.mjs:99 — start has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 8 of the 21 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 111, 157, 144, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · SshConfigLoader · ×1
  • SshConfigLoader::parse_lines (cyclomatic 20) crates/dbx-driver-support/src/ssh_config.rs:212 — SshConfigLoader::parse_lines 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 · ExpressionCompiler · ×1
  • ExpressionCompiler::field_condition (cyclomatic 20) crates/dbx-drivers/src/db/dynamodb_driver.rs:218 — ExpressionCompiler::field_condition has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · MongoAgent.parseDropIndexesValue (cyclomatic 20) · ×1
  • MongoAgent.parseDropIndexesValue (cyclomatic 20) agents/drivers/mongodb/src/main/java/com/dbx/agent/mongodb/MongoAgent.java:1501 — MongoAgent.parseDropIndexesValue 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. This is NOT this file's highest cyclomatic complexity: MongoAgent.dispatch (cyclomatic 35) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · KafkaAgent.applySecurityProperties (cyclomatic 20) · ×1
  • KafkaAgent.applySecurityProperties (cyclomatic 20) agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:515 — KafkaAgent.applySecurityProperties 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. This is NOT this file's highest cyclomatic complexity: KafkaAgent.dispatch (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · DamengAgent.getExplainInfo (cyclomatic 20) · ×1
  • DamengAgent.getExplainInfo (cyclomatic 20) REDACTED:3173 — DamengAgent.getExplainInfo has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This is NOT this file's highest cyclomatic complexity: DamengAgent.resultValue (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · main.legacyMaterializedViewOptions (cyclomatic 20) · ×1
  • main.legacyMaterializedViewOptions (cyclomatic 20) agents/drivers/cassandra-go/materialized_view.go:183 — main.legacyMaterializedViewOptions 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 · main.parseKingbasePartitionBound (cyclomatic 20) · ×1
  • main.parseKingbasePartitionBound (cyclomatic 20) REDACTED:1471 — main.parseKingbasePartitionBound 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 · server.completionAssistantSearch (cyclomatic 20) · ×1
  • server.completionAssistantSearch (cyclomatic 20) agents/drivers/neo4j-go/metadata.go:241 — server.completionAssistantSearch 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 · server.getColumns (cyclomatic 20) · ×1
  • server.getColumns (cyclomatic 20) REDACTED:2752 — server.getColumns 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 · cursor.fetchOneDriver (cyclomatic 20) · ×1
  • cursor.fetchOneDriver (cyclomatic 20) REDACTED:1047 — cursor.fetchOneDriver 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 · IoTDBRpcDataSet.getStringByTsBlockColumnIndexAndDataType (cyclomatic 20) · ×1
  • IoTDBRpcDataSet.getStringByTsBlockColumnIndexAndDataType (cyclomatic 20) agents/go-common/iotdb-client-go/client/rpcdataset.go:606 — IoTDBRpcDataSet.getStringByTsBlockColumnIndexAndDataType 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 · aiPluginConversation.createPluginAiConversation (cyclomatic 20) · ×1
  • aiPluginConversation.createPluginAiConversation (cyclomatic 20) apps/desktop/src/lib/ai/aiPluginConversation.ts:27 — aiPluginConversation.createPluginAiConversation has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · connectionUrl.parseZooKeeperUrl (cyclomatic 20) · ×1
  • connectionUrl.parseZooKeeperUrl (cyclomatic 20) REDACTED:236 — connectionUrl.parseZooKeeperUrl has cyclomatic complexity 20 (threshold 15). Of this number, 11 points are the body's own statements and 9 belong to one function literal inside it that branches. 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 · geometryPreview.drawGroups (cyclomatic 20) · ×1
  • geometryPreview.drawGroups (cyclomatic 20) apps/desktop/src/lib/dataGrid/geometryPreview.ts:135 — geometryPreview.drawGroups has cyclomatic complexity 20 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · erDiagram.buildDiagramJoinSql (cyclomatic 20) · ×1
  • erDiagram.buildDiagramJoinSql (cyclomatic 20) apps/desktop/src/lib/diagram/erDiagram.ts:371 — erDiagram.buildDiagramJoinSql has cyclomatic complexity 20 (threshold 15). Of this number, 11 points are the body's own statements and 9 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · keyboardShortcuts.matchesShortcut (cyclomatic 20) · ×1
  • keyboardShortcuts.matchesShortcut (cyclomatic 20) apps/desktop/src/lib/editor/keyboardShortcuts.ts:142 — keyboardShortcuts.matchesShortcut 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 · diagramSvgExport.buildTableDiagramSvg (cyclomatic 20) · ×1
  • diagramSvgExport.buildTableDiagramSvg (cyclomatic 20) apps/desktop/src/lib/export/diagramSvgExport.ts:245 — diagramSvgExport.buildTableDiagramSvg has cyclomatic complexity 20 (threshold 15). Of this number, 16 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · mongoDocumentValues.parseMongoDocumentInputValue (cyclomatic 20) · ×1
  • mongoDocumentValues.parseMongoDocumentInputValue (cyclomatic 20) apps/desktop/src/lib/mongo/mongoDocumentValues.ts:109 — mongoDocumentValues.parseMongoDocumentInputValue 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 · mongoDocumentValues.formatMongoShellLiteral (cyclomatic 20) · ×1
  • mongoDocumentValues.formatMongoShellLiteral (cyclomatic 20) apps/desktop/src/lib/mongo/mongoDocumentValues.ts:420 — mongoDocumentValues.formatMongoShellLiteral 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 · mqConsoleDefaults.resolveAvailableMqTabs (cyclomatic 20) · ×1
  • mqConsoleDefaults.resolveAvailableMqTabs (cyclomatic 20) apps/desktop/src/lib/mq/mqConsoleDefaults.ts:163 — mqConsoleDefaults.resolveAvailableMqTabs 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 · sqlCompletion.prepareSqlCompletionReplacement (cyclomatic 20) · ×1
  • sqlCompletion.prepareSqlCompletionReplacement (cyclomatic 20) REDACTED:1546 — sqlCompletion.prepareSqlCompletionReplacement has cyclomatic complexity 20 (threshold 15). Of this number, 10 points are the body's own statements and 10 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · sqlCompletion.maskSqlForStructureScan (cyclomatic 20) · ×1
  • sqlCompletion.maskSqlForStructureScan (cyclomatic 20) REDACTED:2249 — sqlCompletion.maskSqlForStructureScan 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 · sqlCompletion.buildCompositeHeuristicJoinConditionItems (cyclomatic 20) · ×1
  • sqlCompletion.buildCompositeHeuristicJoinConditionItems (cyclomatic 20) REDACTED:5262 — sqlCompletion.buildCompositeHeuristicJoinConditionItems has cyclomatic complexity 20 (threshold 15). Of this number, 17 points are the body's own statements and 3 belong to one function literal inside it that branches. 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 · sqlNavigation.matchSqlObject (cyclomatic 20) · ×1
  • sqlNavigation.matchSqlObject (cyclomatic 20) apps/desktop/src/lib/sql/sqlNavigation.ts:709 — sqlNavigation.matchSqlObject has cyclomatic complexity 20 (threshold 15). Of this number, 11 points are the body's own statements and 9 belong to 6 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · sqlVariables.collectDeclarations (cyclomatic 20) · ×1
  • sqlVariables.collectDeclarations (cyclomatic 20) apps/desktop/src/lib/sql/sqlVariables.ts:66 — sqlVariables.collectDeclarations 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 · objectRenameSql.supportsObjectRename (cyclomatic 20) · ×1
  • objectRenameSql.supportsObjectRename (cyclomatic 20) apps/desktop/src/lib/table/objectRenameSql.ts:19 — objectRenameSql.supportsObjectRename has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · routineParameters.parseXuguRoutineParameter (cyclomatic 20) · ×1
  • routineParameters.parseXuguRoutineParameter (cyclomatic 20) apps/desktop/src/lib/table/routineParameters.ts:293 — routineParameters.parseXuguRoutineParameter 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 · queryStore.annotateQueryResultSources (cyclomatic 20) · ×1
  • queryStore.annotateQueryResultSources (cyclomatic 20) apps/desktop/src/stores/queryStore.ts:419 — queryStore.annotateQueryResultSources 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 · readOnlyUnlockStore.useReadOnlyUnlockStore (cyclomatic 20) · ×1
  • readOnlyUnlockStore.useReadOnlyUnlockStore (cyclomatic 20) apps/desktop/src/stores/readOnlyUnlockStore.ts:33 — readOnlyUnlockStore.useReadOnlyUnlockStore has cyclomatic complexity 20 (threshold 15). Of this number, 17 points are the body's own statements and 3 belong to 2 function literals inside it that branch. 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 · RouteProgress.RouteProgress (cyclomatic 20) · ×1
  • RouteProgress.RouteProgress (cyclomatic 20) docs/components/RouteProgress.tsx:11 — RouteProgress.RouteProgress has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 74, 65, 17, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · ContributorsExperience.ContributorsExperience (cyclomatic 20) · ×1
  • ContributorsExperience.ContributorsExperience (cyclomatic 20) docs/components/contributors/ContributorsExperience.tsx:190 — ContributorsExperience.ContributorsExperience has cyclomatic complexity 20 (threshold 15). Of this number, 14 points are the body's own statements and 6 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · json.hasUnclosedMongoDelimiters (cyclomatic 20) · ×1
  • json.hasUnclosedMongoDelimiters (cyclomatic 20) REDACTED:305 — json.hasUnclosedMongoDelimiters 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 · DuckDbWorkerRuntime · ×1
  • DuckDbWorkerRuntime::handle_request (cyclomatic 19) agents/drivers/duckdb/src/runtime.rs:295 — DuckDbWorkerRuntime::handle_request has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · MongoAgent.bulkWriteModel (cyclomatic 19) · ×1
  • MongoAgent.bulkWriteModel (cyclomatic 19) agents/drivers/mongodb/src/main/java/com/dbx/agent/mongodb/MongoAgent.java:2073 — MongoAgent.bulkWriteModel 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. This is NOT this file's highest cyclomatic complexity: MongoAgent.dispatch (cyclomatic 35) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · DamengAgent.queryConstrainedTables (cyclomatic 19) · ×1
  • DamengAgent.queryConstrainedTables (cyclomatic 19) REDACTED:577 — DamengAgent.queryConstrainedTables 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. This is NOT this file's highest cyclomatic complexity: DamengAgent.resultValue (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · EwkbWktDecoder.tryParseHex (cyclomatic 19) · ×1
  • EwkbWktDecoder.tryParseHex (cyclomatic 19) agents/common/src/main/java/com/dbx/agent/EwkbWktDecoder.java:238 — EwkbWktDecoder.tryParseHex has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · etcdSession.status (cyclomatic 19) · ×1
  • etcdSession.status (cyclomatic 19) agents/drivers/etcd-go/status.go:12 — etcdSession.status 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 · etcd2Session.rename (cyclomatic 19) · ×1
  • etcd2Session.rename (cyclomatic 19) agents/drivers/etcd2-go/kv.go:286 — etcd2Session.rename 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 · main.splitTopLevelCommas (cyclomatic 19) · ×1
  • main.splitTopLevelCommas (cyclomatic 19) REDACTED:1600 — main.splitTopLevelCommas has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · server.queryRowsWithOracleValueRewriteIfNeeded (cyclomatic 19) · ×1
  • server.queryRowsWithOracleValueRewriteIfNeeded (cyclomatic 19) REDACTED:4213 — server.queryRowsWithOracleValueRewriteIfNeeded 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 · rocketMQAgent.listACLs (cyclomatic 19) · ×1
  • rocketMQAgent.listACLs (cyclomatic 19) agents/drivers/rocketmq/acl.go:30 — rocketMQAgent.listACLs 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 · rocketMQAgent.listProducers (cyclomatic 19) · ×1
  • rocketMQAgent.listProducers (cyclomatic 19) REDACTED:27 — rocketMQAgent.listProducers 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 · rocketMQAgent.listTopics (cyclomatic 19) · ×1
  • rocketMQAgent.listTopics (cyclomatic 19) REDACTED:32 — rocketMQAgent.listTopics 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 · wkbGeometry.wkt (cyclomatic 19) · ×1
  • wkbGeometry.wkt (cyclomatic 19) agents/drivers/vastbase-go/spatial.go:218 — wkbGeometry.wkt 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 · main.parseXuguObjectTypeMethod (cyclomatic 19) · ×1
  • main.parseXuguObjectTypeMethod (cyclomatic 19) agents/drivers/xugu/type_members.go:324 — main.parseXuguObjectTypeMethod 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 · verify-partition-ddl.main (cyclomatic 19) · ×1
  • verify-partition-ddl.main (cyclomatic 19) agents/drivers/oceanbase-oracle/scripts/verify-partition-ddl.ts:10 — verify-partition-ddl.main has cyclomatic complexity 19 (threshold 15). Of this number, 12 points are the body's own statements and 7 belong to 5 function literals inside it that branch. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · useDataGridFilterBuilder.useDataGridFilterBuilder (cyclomatic 19) · ×1
  • useDataGridFilterBuilder.useDataGridFilterBuilder (cyclomatic 19) apps/desktop/src/composables/useDataGridFilterBuilder.ts:72 — useDataGridFilterBuilder.useDataGridFilterBuilder has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 6 of the 19 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 97, 117, 81, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · useResultViewUpdateTiming.useResultViewUpdateTiming (cyclomatic 19) · ×1
  • useResultViewUpdateTiming.useResultViewUpdateTiming (cyclomatic 19) apps/desktop/src/composables/useResultViewUpdateTiming.ts:6 — useResultViewUpdateTiming.useResultViewUpdateTiming has cyclomatic complexity 19 (threshold 15). Of this number, 13 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ai.buildSystemPrompt (cyclomatic 19) · ×1
  • ai.buildSystemPrompt (cyclomatic 19) apps/desktop/src/lib/ai/ai.ts:337 — ai.buildSystemPrompt 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 · columnFormatter.normalizeForeignKeyDisplayFilter (cyclomatic 19) · ×1
  • columnFormatter.normalizeForeignKeyDisplayFilter (cyclomatic 19) apps/desktop/src/lib/dataGrid/columnFormatter.ts:308 — columnFormatter.normalizeForeignKeyDisplayFilter has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · dataGridCellCoercion.coerceDataGridCellValue (cyclomatic 19) · ×1
  • dataGridCellCoercion.coerceDataGridCellValue (cyclomatic 19) apps/desktop/src/lib/dataGrid/dataGridCellCoercion.ts:25 — dataGridCellCoercion.coerceDataGridCellValue 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 · dataGridColumnFilter.unwrapOuterParentheses (cyclomatic 19) · ×1
  • dataGridColumnFilter.unwrapOuterParentheses (cyclomatic 19) apps/desktop/src/lib/dataGrid/dataGridColumnFilter.ts:85 — dataGridColumnFilter.unwrapOuterParentheses 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 · dataGridCopyExtractor.normalizeDataGridExtractorOptions (cyclomatic 19) · ×1
  • dataGridCopyExtractor.normalizeDataGridExtractorOptions (cyclomatic 19) apps/desktop/src/lib/dataGrid/dataGridCopyExtractor.ts:161 — dataGridCopyExtractor.normalizeDataGridExtractorOptions has cyclomatic complexity 19 (threshold 15). Of this number, 16 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · geometryMapPreview.buildGeometryMapFeatureCollection (cyclomatic 19) · ×1
  • geometryMapPreview.buildGeometryMapFeatureCollection (cyclomatic 19) apps/desktop/src/lib/dataGrid/geometryMapPreview.ts:44 — geometryMapPreview.buildGeometryMapFeatureCollection 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 · keyboardShortcuts.eventToShortcut (cyclomatic 19) · ×1
  • keyboardShortcuts.eventToShortcut (cyclomatic 19) apps/desktop/src/lib/editor/keyboardShortcuts.ts:94 — keyboardShortcuts.eventToShortcut 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 · sqlHoverSearch.createHoverSearch (cyclomatic 19) · ×1
  • sqlHoverSearch.createHoverSearch (cyclomatic 19) apps/desktop/src/lib/editor/sqlHoverSearch.ts:145 — sqlHoverSearch.createHoverSearch has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 213, 189, 181). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · datagripImport.parseDbForestGroupPaths (cyclomatic 19) · ×1
  • datagripImport.parseDbForestGroupPaths (cyclomatic 19) apps/desktop/src/lib/imports/datagripImport.ts:345 — datagripImport.parseDbForestGroupPaths has cyclomatic complexity 19 (threshold 15). Of this number, 14 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · mongoConnectionOptions.mongodbAuthFailureHint (cyclomatic 19) · ×1
  • mongoConnectionOptions.mongodbAuthFailureHint (cyclomatic 19) apps/desktop/src/lib/mongo/mongoConnectionOptions.ts:57 — mongoConnectionOptions.mongodbAuthFailureHint 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 · pluginHostBridge.requirePluginAiRecommendationUpdate (cyclomatic 19) · ×1
  • pluginHostBridge.requirePluginAiRecommendationUpdate (cyclomatic 19) REDACTED:1456 — pluginHostBridge.requirePluginAiRecommendationUpdate has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 1462). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · pluginShortcuts.normalizePluginShortcutSettings (cyclomatic 19) · ×1
  • pluginShortcuts.normalizePluginShortcutSettings (cyclomatic 19) apps/desktop/src/lib/plugins/pluginShortcuts.ts:15 — pluginShortcuts.normalizePluginShortcutSettings has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · redisCommandDocs.commandKeySpecs (cyclomatic 19) · ×1
  • redisCommandDocs.commandKeySpecs (cyclomatic 19) apps/desktop/src/lib/redis/redisCommandDocs.ts:126 — redisCommandDocs.commandKeySpecs 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 · redisCompletion.argumentTokenItems (cyclomatic 19) · ×1
  • redisCompletion.argumentTokenItems (cyclomatic 19) apps/desktop/src/lib/redis/redisCompletion.ts:389 — redisCompletion.argumentTokenItems has cyclomatic complexity 19 (threshold 15). Of this number, 14 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · mongoCollectionMutation.buildMongoCreateIndexRequest (cyclomatic 19) · ×1
  • mongoCollectionMutation.buildMongoCreateIndexRequest (cyclomatic 19) apps/desktop/src/lib/sidebar/mongoCollectionMutation.ts:156 — mongoCollectionMutation.buildMongoCreateIndexRequest has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. 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 · treeNodeClick.treeNodeRowAction (cyclomatic 19) · ×1
  • treeNodeClick.treeNodeRowAction (cyclomatic 19) apps/desktop/src/lib/sidebar/treeNodeClick.ts:134 — treeNodeClick.treeNodeRowAction 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 · ddlDisplay.applyDdlDatabaseQualifier (cyclomatic 19) · ×1
  • ddlDisplay.applyDdlDatabaseQualifier (cyclomatic 19) apps/desktop/src/lib/sql/ddlDisplay.ts:345 — ddlDisplay.applyDdlDatabaseQualifier 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 · identifierSearch.identifierMatchScore (cyclomatic 19) · ×1
  • identifierSearch.identifierMatchScore (cyclomatic 19) apps/desktop/src/lib/sql/identifierSearch.ts:7 — identifierSearch.identifierMatchScore 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 · mysqlRoutineSyntaxDiagnostics.tokenizeMysqlRoutineSql (cyclomatic 19) · ×1
  • mysqlRoutineSyntaxDiagnostics.tokenizeMysqlRoutineSql (cyclomatic 19) apps/desktop/src/lib/sql/mysqlRoutineSyntaxDiagnostics.ts:138 — mysqlRoutineSyntaxDiagnostics.tokenizeMysqlRoutineSql 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 · cteNavigation.findCteColumnResolution (cyclomatic 19) · ×1
  • cteNavigation.findCteColumnResolution (cyclomatic 19) apps/desktop/src/lib/sql/semantic/cteNavigation.ts:118 — cteNavigation.findCteColumnResolution 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 · diagnostics.buildSqlSemanticDiagnostics (cyclomatic 19) · ×1
  • diagnostics.buildSqlSemanticDiagnostics (cyclomatic 19) apps/desktop/src/lib/sql/semantic/diagnostics.ts:266 — diagnostics.buildSqlSemanticDiagnostics 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 · sqlCompletion.splitQualifiedNameRawParts (cyclomatic 19) · ×1
  • sqlCompletion.splitQualifiedNameRawParts (cyclomatic 19) REDACTED:3869 — sqlCompletion.splitQualifiedNameRawParts 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 · sqlCompletion.computeMatchScore (cyclomatic 19) · ×1
  • sqlCompletion.computeMatchScore (cyclomatic 19) REDACTED:5691 — sqlCompletion.computeMatchScore 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 · sqlParameters.collectSetStatementVariables (cyclomatic 19) · ×1
  • sqlParameters.collectSetStatementVariables (cyclomatic 19) apps/desktop/src/lib/sql/sqlParameters.ts:1344 — sqlParameters.collectSetStatementVariables 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. This shape REPEATS in the file: one other method here (sqlParameters.collectExecNamedArgumentStarts) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · sqlParameters.collectExecNamedArgumentStarts (cyclomatic 19) · ×1
  • sqlParameters.collectExecNamedArgumentStarts (cyclomatic 19) apps/desktop/src/lib/sql/sqlParameters.ts:1498 — sqlParameters.collectExecNamedArgumentStarts 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. This shape REPEATS in the file: one other method here (sqlParameters.collectSetStatementVariables) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · tableVGroup.reorderTableVGroupEntry (cyclomatic 19) · ×1
  • tableVGroup.reorderTableVGroupEntry (cyclomatic 19) apps/desktop/src/lib/table/tableVGroup.ts:230 — tableVGroup.reorderTableVGroupEntry has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 260, 234, 233). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · worker.handleInstallBeacon (cyclomatic 19) · ×1
  • worker.handleInstallBeacon (cyclomatic 19) deploy/plugin-stats-worker/worker.ts:251 — worker.handleInstallBeacon 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 · InstallTabs.InstallTabs (cyclomatic 19) · ×1
  • InstallTabs.InstallTabs (cyclomatic 19) docs/components/landing/InstallTabs.tsx:231 — InstallTabs.InstallTabs has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 7 of the 19 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 324, 241, 250, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · diagnostics.redact (cyclomatic 19) · ×1
  • diagnostics.redact (cyclomatic 19) plugins/sdk/dev-host/diagnostics.mjs:5 — diagnostics.redact 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 · redact · ×1
  • redact::visit (cyclomatic 19) plugins/sdk/dev-host/diagnostics.mjs:9 — redact::visit 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 · MongoAgent.collationOrNull (cyclomatic 18) · ×1
  • MongoAgent.collationOrNull (cyclomatic 18) agents/drivers/mongodb/src/main/java/com/dbx/agent/mongodb/MongoAgent.java:917 — MongoAgent.collationOrNull 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. This is NOT this file's highest cyclomatic complexity: MongoAgent.dispatch (cyclomatic 35) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · H2DriverVersion.select (cyclomatic 18) · ×1
  • H2DriverVersion.select (cyclomatic 18) agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2DriverVersion.java:41 — H2DriverVersion.select has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · PhysicalConnectionBudget.wrap (cyclomatic 18) · ×1
  • PhysicalConnectionBudget.wrap (cyclomatic 18) agents/common/src/main/java/com/dbx/agent/JdbcConnectionPoolRegistry.java:1688 — PhysicalConnectionBudget.wrap has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · main.materializedViewDDLFromCatalog (cyclomatic 18) · ×1
  • main.materializedViewDDLFromCatalog (cyclomatic 18) agents/drivers/cassandra-go/materialized_view.go:253 — main.materializedViewDDLFromCatalog has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · main.takeParenGroup (cyclomatic 18) · ×1
  • main.takeParenGroup (cyclomatic 18) REDACTED:1558 — main.takeParenGroup 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 · server.listObjects (cyclomatic 18) · ×1
  • server.listObjects (cyclomatic 18) REDACTED:1635 — server.listObjects has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · server.getObjectSource (cyclomatic 18) · ×1
  • server.getObjectSource (cyclomatic 18) REDACTED:3196 — server.getObjectSource 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 · useDataGenerateSession.runDataGenerateSession (cyclomatic 18) · ×1
  • useDataGenerateSession.runDataGenerateSession (cyclomatic 18) apps/desktop/src/composables/useDataGenerateSession.ts:265 — useDataGenerateSession.runDataGenerateSession 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 · scheduledDatabaseBackup.normalizeDatabaseBackupSchedule (cyclomatic 18) · ×1
  • scheduledDatabaseBackup.normalizeDatabaseBackupSchedule (cyclomatic 18) apps/desktop/src/lib/backup/scheduledDatabaseBackup.ts:234 — scheduledDatabaseBackup.normalizeDatabaseBackupSchedule 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 · safeJsonFormat.decodeJsonSource (cyclomatic 18) · ×1
  • safeJsonFormat.decodeJsonSource (cyclomatic 18) apps/desktop/src/lib/common/safeJsonFormat.ts:127 — safeJsonFormat.decodeJsonSource has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · agentDriverInstallHint.agentDriverInstallKey (cyclomatic 18) · ×1
  • agentDriverInstallHint.agentDriverInstallKey (cyclomatic 18) apps/desktop/src/lib/connection/agentDriverInstallHint.ts:34 — agentDriverInstallHint.agentDriverInstallKey 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 · ltr-auto-layout.orderTablesByConnectivity (cyclomatic 18) · ×1
  • ltr-auto-layout.orderTablesByConnectivity (cyclomatic 18) apps/desktop/src/lib/diagram/ltr-auto-layout.ts:40 — ltr-auto-layout.orderTablesByConnectivity has cyclomatic complexity 18 (threshold 15). Of this number, 12 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · kvValueFormat.detectKvValueFormat (cyclomatic 18) · ×1
  • kvValueFormat.detectKvValueFormat (cyclomatic 18) apps/desktop/src/lib/kv/kvValueFormat.ts:17 — kvValueFormat.detectKvValueFormat 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 · mongoShellCommand.mongoCommentAwareBodyEnd (cyclomatic 18) · ×1
  • mongoShellCommand.mongoCommentAwareBodyEnd (cyclomatic 18) apps/desktop/src/lib/mongo/mongoShellCommand.ts:1556 — mongoShellCommand.mongoCommentAwareBodyEnd 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 · mongoSyntaxDiagnostics.describeMongoWriteRisk (cyclomatic 18) · ×1
  • mongoSyntaxDiagnostics.describeMongoWriteRisk (cyclomatic 18) apps/desktop/src/lib/mongo/mongoSyntaxDiagnostics.ts:76 — mongoSyntaxDiagnostics.describeMongoWriteRisk 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 · nacosConfigValidation.closeImplicitHtmlTags (cyclomatic 18) · ×1
  • nacosConfigValidation.closeImplicitHtmlTags (cyclomatic 18) apps/desktop/src/lib/nacos/nacosConfigValidation.ts:95 — nacosConfigValidation.closeImplicitHtmlTags 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 · pluginShortcuts.collectPluginShortcuts (cyclomatic 18) · ×1
  • pluginShortcuts.collectPluginShortcuts (cyclomatic 18) apps/desktop/src/lib/plugins/pluginShortcuts.ts:64 — pluginShortcuts.collectPluginShortcuts has cyclomatic complexity 18 (threshold 15). Of this number, 9 points are the body's own statements and 9 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · redisCommandDocs.mapEntries (cyclomatic 18) · ×1
  • redisCommandDocs.mapEntries (cyclomatic 18) apps/desktop/src/lib/redis/redisCommandDocs.ts:37 — redisCommandDocs.mapEntries 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 · redisCommandDocs.commandArguments (cyclomatic 18) · ×1
  • redisCommandDocs.commandArguments (cyclomatic 18) apps/desktop/src/lib/redis/redisCommandDocs.ts:97 — redisCommandDocs.commandArguments has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · redisCommandTokenizer.tokenizeRedisLine (cyclomatic 18) · ×1
  • redisCommandTokenizer.tokenizeRedisLine (cyclomatic 18) apps/desktop/src/lib/redis/redisCommandTokenizer.ts:28 — redisCommandTokenizer.tokenizeRedisLine has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · schemaDiffTableMapping.reconcileSchemaDiffTableMappings (cyclomatic 18) · ×1
  • schemaDiffTableMapping.reconcileSchemaDiffTableMappings (cyclomatic 18) apps/desktop/src/lib/schema/schemaDiffTableMapping.ts:47 — schemaDiffTableMapping.reconcileSchemaDiffTableMappings has cyclomatic complexity 18 (threshold 15). Of this number, 15 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ddlDisplay.findColumnAttributePositions (cyclomatic 18) · ×1
  • ddlDisplay.findColumnAttributePositions (cyclomatic 18) apps/desktop/src/lib/sql/ddlDisplay.ts:425 — ddlDisplay.findColumnAttributePositions has cyclomatic complexity 18 (threshold 15). Of this number, 13 points are the body's own statements and 5 belong to 4 function literals inside it that branch. 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 · editableQueryHiddenKeys.appendSelectProjections (cyclomatic 18) · ×1
  • editableQueryHiddenKeys.appendSelectProjections (cyclomatic 18) apps/desktop/src/lib/sql/editableQueryHiddenKeys.ts:45 — editableQueryHiddenKeys.appendSelectProjections has cyclomatic complexity 18 (threshold 15). Of this number, 13 points are the body's own statements and 5 belong to 2 function literals inside it that branch. 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 · sqlCompletion.isStandaloneSelectWildcard (cyclomatic 18) · ×1
  • sqlCompletion.isStandaloneSelectWildcard (cyclomatic 18) REDACTED:1526 — sqlCompletion.isStandaloneSelectWildcard has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · sqlCompletion.splitRoutineSignatureParameters (cyclomatic 18) · ×1
  • sqlCompletion.splitRoutineSignatureParameters (cyclomatic 18) REDACTED:4211 — sqlCompletion.splitRoutineSignatureParameters 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 · sqlParameters.findMatchingXmlTagClose (cyclomatic 18) · ×1
  • sqlParameters.findMatchingXmlTagClose (cyclomatic 18) apps/desktop/src/lib/sql/sqlParameters.ts:661 — sqlParameters.findMatchingXmlTagClose 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 · sqlParameters.collectDeclareStatementVariables (cyclomatic 18) · ×1
  • sqlParameters.collectDeclareStatementVariables (cyclomatic 18) apps/desktop/src/lib/sql/sqlParameters.ts:1304 — sqlParameters.collectDeclareStatementVariables 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 · sqlParameters.collectRoutineDefinitionVariables (cyclomatic 18) · ×1
  • sqlParameters.collectRoutineDefinitionVariables (cyclomatic 18) apps/desktop/src/lib/sql/sqlParameters.ts:1458 — sqlParameters.collectRoutineDefinitionVariables 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 · sqlFormatter.formatSqlText (cyclomatic 18) · ×1
  • sqlFormatter.formatSqlText (cyclomatic 18) apps/desktop/src/lib/sql/sqlFormatter.ts:333 — sqlFormatter.formatSqlText has cyclomatic complexity 18 (threshold 15). Of this number, 12 points are the body's own statements and 6 belong to 3 function literals inside it that branch. 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. This is NOT this file's highest cyclomatic complexity: sqlFormatter.sqlFormatDialectForDbType (cyclomatic 22) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · objectBrowserRows.groupObjectBrowserRows (cyclomatic 18) · ×1
  • objectBrowserRows.groupObjectBrowserRows (cyclomatic 18) apps/desktop/src/lib/table/objectBrowserRows.ts:261 — objectBrowserRows.groupObjectBrowserRows has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 8 of the 18 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 296, 288, 302). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · pgPartitionPresentation.splitPgPartitionBoundValues (cyclomatic 18) · ×1
  • pgPartitionPresentation.splitPgPartitionBoundValues (cyclomatic 18) apps/desktop/src/lib/table/pgPartitionPresentation.ts:89 — pgPartitionPresentation.splitPgPartitionBoundValues 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 · postgresDataTypeHelp.gaussdbMTypeDisplayName (cyclomatic 18) · ×1
  • postgresDataTypeHelp.gaussdbMTypeDisplayName (cyclomatic 18) apps/desktop/src/lib/table/postgresDataTypeHelp.ts:164 — postgresDataTypeHelp.gaussdbMTypeDisplayName 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 · routineParameters.sqlServerParameterDeclarationType (cyclomatic 18) · ×1
  • routineParameters.sqlServerParameterDeclarationType (cyclomatic 18) apps/desktop/src/lib/table/routineParameters.ts:452 — routineParameters.sqlServerParameterDeclarationType 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 · tableStructureEditorState.isWrappedByOuterParens (cyclomatic 18) · ×1
  • tableStructureEditorState.isWrappedByOuterParens (cyclomatic 18) apps/desktop/src/lib/table/tableStructureEditorState.ts:934 — tableStructureEditorState.isWrappedByOuterParens 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. This is NOT this file's highest cyclomatic complexity: tableStructureEditorState.isTemporalPrecisionType (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · tableStructureEditorState.columnDataTypeForEditor (cyclomatic 18) · ×1
  • tableStructureEditorState.columnDataTypeForEditor (cyclomatic 18) apps/desktop/src/lib/table/tableStructureEditorState.ts:997 — tableStructureEditorState.columnDataTypeForEditor 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. This is NOT this file's highest cyclomatic complexity: tableStructureEditorState.isTemporalPrecisionType (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · tableTree.coalesceXuguPackageObjects (cyclomatic 18) · ×1
  • tableTree.coalesceXuguPackageObjects (cyclomatic 18) apps/desktop/src/lib/table/tableTree.ts:590 — tableTree.coalesceXuguPackageObjects has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · tabPresentation.statementExecutionMarkers (cyclomatic 18) · ×1
  • tabPresentation.statementExecutionMarkers (cyclomatic 18) apps/desktop/src/lib/tabs/tabPresentation.ts:423 — tabPresentation.statementExecutionMarkers has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · json.readMongoRegexLiteral (cyclomatic 18) · ×1
  • json.readMongoRegexLiteral (cyclomatic 18) REDACTED:46 — json.readMongoRegexLiteral 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 · json.splitTopLevel (cyclomatic 18) · ×1
  • json.splitTopLevel (cyclomatic 18) REDACTED:225 — json.splitTopLevel 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 · Diagnostics.query (cyclomatic 18) · ×1
  • Diagnostics.query (cyclomatic 18) plugins/sdk/dev-host/diagnostics.mjs:70 — Diagnostics.query has cyclomatic complexity 18 (threshold 15). Of this number, 12 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · McpGlobalPolicy · ×1
  • McpGlobalPolicy::normalized (cyclomatic 17) REDACTED:647 — McpGlobalPolicy::normalized 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 · DbxJdbcPlugin.appendInceptorRoutinesFromSystemTables (cyclomatic 17) · ×1
  • DbxJdbcPlugin.appendInceptorRoutinesFromSystemTables (cyclomatic 17) REDACTED:2293 — DbxJdbcPlugin.appendInceptorRoutinesFromSystemTables has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: DbxJdbcPlugin.handle (cyclomatic 32) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · SqlServerLegacyAgent.shouldFallbackToJtds (cyclomatic 17) · ×1
  • SqlServerLegacyAgent.shouldFallbackToJtds (cyclomatic 17) agents/drivers/sqlserver-legacy/src/main/java/com/dbx/agent/sqlserverlegacy/SqlServerLegacyAgent.java:206 — SqlServerLegacyAgent.shouldFallbackToJtds 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 · MongoAgent.applyAggregateOptions (cyclomatic 17) · ×1
  • MongoAgent.applyAggregateOptions (cyclomatic 17) agents/drivers/mongodb/src/main/java/com/dbx/agent/mongodb/MongoAgent.java:676 — MongoAgent.applyAggregateOptions has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: MongoAgent.dispatch (cyclomatic 35) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · PoolEntry.borrow (cyclomatic 17) · ×1
  • PoolEntry.borrow (cyclomatic 17) agents/common/src/main/java/com/dbx/agent/JdbcConnectionPoolRegistry.java:578 — PoolEntry.borrow 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 · dbx_tunnel.run_worker (cyclomatic 17) · ×1
  • dbx_tunnel.run_worker (cyclomatic 17) deploy/dbx_tunnel.php:147 — dbx_tunnel.run_worker 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 · etcdSession.readableKeyRanges (cyclomatic 17) · ×1
  • etcdSession.readableKeyRanges (cyclomatic 17) agents/drivers/etcd-go/auth.go:39 — etcdSession.readableKeyRanges 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 · server.getTableDialectDDL (cyclomatic 17) · ×1
  • server.getTableDialectDDL (cyclomatic 17) agents/drivers/iotdb/metadata.go:438 — server.getTableDialectDDL 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 · server.listForeignKeysFromCatalog (cyclomatic 17) · ×1
  • server.listForeignKeysFromCatalog (cyclomatic 17) REDACTED:2250 — server.listForeignKeysFromCatalog 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 · server.listTriggerDefinitionsFor (cyclomatic 17) · ×1
  • server.listTriggerDefinitionsFor (cyclomatic 17) REDACTED:2837 — server.listTriggerDefinitionsFor has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · main.oracleColumnTypeDDL (cyclomatic 17) · ×1
  • main.oracleColumnTypeDDL (cyclomatic 17) REDACTED:3530 — main.oracleColumnTypeDDL has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · main.oracleFullPassthroughInnerSelectRange (cyclomatic 17) · ×1
  • main.oracleFullPassthroughInnerSelectRange (cyclomatic 17) REDACTED:4361 — main.oracleFullPassthroughInnerSelectRange has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · server.listConstraints (cyclomatic 17) · ×1
  • server.listConstraints (cyclomatic 17) REDACTED:2779 — server.listConstraints has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · main.paginateManagementArray (cyclomatic 17) · ×1
  • main.paginateManagementArray (cyclomatic 17) REDACTED:318 — main.paginateManagementArray has cyclomatic complexity 17 (threshold 15). Of this number, 12 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · server.peekMessages (cyclomatic 17) · ×1
  • server.peekMessages (cyclomatic 17) agents/drivers/rabbitmq/operations.go:1160 — server.peekMessages 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 · rocketMQAgent.viewMessage (cyclomatic 17) · ×1
  • rocketMQAgent.viewMessage (cyclomatic 17) REDACTED:149 — rocketMQAgent.viewMessage 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 · server.listTablespaces (cyclomatic 17) · ×1
  • server.listTablespaces (cyclomatic 17) REDACTED:1763 — server.listTablespaces has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: main.normalizeValueWithType (cyclomatic 18) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · server.listPrefix (cyclomatic 17) · ×1
  • server.listPrefix (cyclomatic 17) agents/drivers/zookeeper/operations.go:268 — server.listPrefix has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · gosasl.parseChallenge (cyclomatic 17) · ×1
  • gosasl.parseChallenge (cyclomatic 17) REDACTED:198 — gosasl.parseChallenge 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 · client.NewIoTDBRpcDataSet (cyclomatic 17) · ×1
  • client.NewIoTDBRpcDataSet (cyclomatic 17) agents/go-common/iotdb-client-go/client/rpcdataset.go:56 — client.NewIoTDBRpcDataSet 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 · sqlStatementRanges.sapHanaScriptBlockIsComplete (cyclomatic 17) · ×1
  • sqlStatementRanges.sapHanaScriptBlockIsComplete (cyclomatic 17) apps/desktop/src/lib/sql/sqlStatementRanges.ts:2209 — sqlStatementRanges.sapHanaScriptBlockIsComplete 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 · useQueryEditorExecution.useQueryEditorExecution (cyclomatic 17) · ×1
  • useQueryEditorExecution.useQueryEditorExecution (cyclomatic 17) apps/desktop/src/components/editor/useQueryEditorExecution.ts:29 — useQueryEditorExecution.useQueryEditorExecution has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · useQueryEditorLayout.useQueryEditorLayout (cyclomatic 17) · ×1
  • useQueryEditorLayout.useQueryEditorLayout (cyclomatic 17) apps/desktop/src/components/editor/useQueryEditorLayout.ts:5 — useQueryEditorLayout.useQueryEditorLayout has cyclomatic complexity 17 (threshold 15). Of this number, 12 points are the body's own statements and 5 belong to one function literal inside it that branches. 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 · transferStrategy.createTransferSubmission (cyclomatic 17) · ×1
  • transferStrategy.createTransferSubmission (cyclomatic 17) apps/desktop/src/components/transfer/transferStrategy.ts:50 — transferStrategy.createTransferSubmission 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 · useAppUpdater.compareParsedUpdateVersions (cyclomatic 17) · ×1
  • useAppUpdater.compareParsedUpdateVersions (cyclomatic 17) apps/desktop/src/composables/useAppUpdater.ts:49 — useAppUpdater.compareParsedUpdateVersions 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 · ai.formatSchema (cyclomatic 17) · ×1
  • ai.formatSchema (cyclomatic 17) apps/desktop/src/lib/ai/ai.ts:731 — ai.formatSchema has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 735). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · scheduledDatabaseBackup.normalizeDatabaseBackupRun (cyclomatic 17) · ×1
  • scheduledDatabaseBackup.normalizeDatabaseBackupRun (cyclomatic 17) apps/desktop/src/lib/backup/scheduledDatabaseBackup.ts:314 — scheduledDatabaseBackup.normalizeDatabaseBackupRun has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · JsonSourceScanner.readNumberToken (cyclomatic 17) · ×1
  • JsonSourceScanner.readNumberToken (cyclomatic 17) apps/desktop/src/lib/common/safeJsonFormat.ts:532 — JsonSourceScanner.readNumberToken has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · sessionModel.normalizeConsulSession (cyclomatic 17) · ×1
  • sessionModel.normalizeConsulSession (cyclomatic 17) apps/desktop/src/lib/consul/sessionModel.ts:5 — sessionModel.normalizeConsulSession has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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 · codemirrorSqlBlockFolding.computeBlockFoldRanges (cyclomatic 17) · ×1
  • codemirrorSqlBlockFolding.computeBlockFoldRanges (cyclomatic 17) apps/desktop/src/lib/editor/codemirrorSqlBlockFolding.ts:164 — codemirrorSqlBlockFolding.computeBlockFoldRanges 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 · editorThemes.resolveEditorTheme (cyclomatic 17) · ×1
  • editorThemes.resolveEditorTheme (cyclomatic 17) apps/desktop/src/lib/editor/editorThemes.ts:682 — editorThemes.resolveEditorTheme has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: editorThemes.loadEditorTheme (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · elasticsearchJsonResponse.elasticsearchJsonResponseForResult (cyclomatic 17) · ×1
  • elasticsearchJsonResponse.elasticsearchJsonResponseForResult (cyclomatic 17) apps/desktop/src/lib/elasticsearch/elasticsearchJsonResponse.ts:16 — elasticsearchJsonResponse.elasticsearchJsonResponseForResult has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · datagripImport.mergeFragments (cyclomatic 17) · ×1
  • datagripImport.mergeFragments (cyclomatic 17) apps/desktop/src/lib/imports/datagripImport.ts:398 — datagripImport.mergeFragments has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · dbeaverImport.parseJdbcUrl (cyclomatic 17) · ×1
  • dbeaverImport.parseJdbcUrl (cyclomatic 17) apps/desktop/src/lib/imports/dbeaverImport.ts:148 — dbeaverImport.parseJdbcUrl has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · objectMetadataCache.loadObjectMetadataFacet (cyclomatic 17) · ×1
  • objectMetadataCache.loadObjectMetadataFacet (cyclomatic 17) apps/desktop/src/lib/metadata/objectMetadataCache.ts:124 — objectMetadataCache.loadObjectMetadataFacet has cyclomatic complexity 17 (threshold 15). Of this number, 12 points are the body's own statements and 5 belong to 2 function literals inside it that branch. 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 · tableMetadataCache.loadTableMetadata (cyclomatic 17) · ×1
  • tableMetadataCache.loadTableMetadata (cyclomatic 17) apps/desktop/src/lib/metadata/tableMetadataCache.ts:302 — tableMetadataCache.loadTableMetadata has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · pluginData.unwrapVueProxies (cyclomatic 17) · ×1
  • pluginData.unwrapVueProxies (cyclomatic 17) apps/desktop/src/lib/plugins/pluginData.ts:62 — pluginData.unwrapVueProxies has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · pluginHostBridge.requirePluginDataQueryRequest (cyclomatic 17) · ×1
  • pluginHostBridge.requirePluginDataQueryRequest (cyclomatic 17) REDACTED:1414 — pluginHostBridge.requirePluginDataQueryRequest 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 · savedSqlDatabaseTree.withDatabaseSavedSqlRoot (cyclomatic 17) · ×1
  • savedSqlDatabaseTree.withDatabaseSavedSqlRoot (cyclomatic 17) apps/desktop/src/lib/savedSql/savedSqlDatabaseTree.ts:85 — savedSqlDatabaseTree.withDatabaseSavedSqlRoot has cyclomatic complexity 17 (threshold 15). Of this number, 12 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · sidebarSearch.matchSidebarLabelWithRegex (cyclomatic 17) · ×1
  • sidebarSearch.matchSidebarLabelWithRegex (cyclomatic 17) apps/desktop/src/lib/sidebar/sidebarSearch.ts:143 — sidebarSearch.matchSidebarLabelWithRegex has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · sidebarTreeArrowNavigation.sidebarTreeArrowAction (cyclomatic 17) · ×1
  • sidebarTreeArrowNavigation.sidebarTreeArrowAction (cyclomatic 17) apps/desktop/src/lib/sidebar/sidebarTreeArrowNavigation.ts:16 — sidebarTreeArrowNavigation.sidebarTreeArrowAction 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 · xuguTypeMembers.buildXuguTypeMemberNodes (cyclomatic 17) · ×1
  • xuguTypeMembers.buildXuguTypeMemberNodes (cyclomatic 17) apps/desktop/src/lib/sidebar/xuguTypeMembers.ts:12 — xuguTypeMembers.buildXuguTypeMemberNodes 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 · soqlCompletion.fieldItems (cyclomatic 17) · ×1
  • soqlCompletion.fieldItems (cyclomatic 17) apps/desktop/src/lib/soql/soqlCompletion.ts:420 — soqlCompletion.fieldItems 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 · soqlCompletion.valueItems (cyclomatic 17) · ×1
  • soqlCompletion.valueItems (cyclomatic 17) apps/desktop/src/lib/soql/soqlCompletion.ts:456 — soqlCompletion.valueItems has cyclomatic complexity 17 (threshold 15). Of this number, 11 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · executableStatementRangeCache.executableStartAfterLeadingDirective (cyclomatic 17) · ×1
  • executableStatementRangeCache.executableStartAfterLeadingDirective (cyclomatic 17) apps/desktop/src/lib/sql/executableStatementRangeCache.ts:95 — executableStatementRangeCache.executableStartAfterLeadingDirective 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 · executableStatementRangeCache.executableStatementRangeAtCursor (cyclomatic 17) · ×1
  • executableStatementRangeCache.executableStatementRangeAtCursor (cyclomatic 17) apps/desktop/src/lib/sql/executableStatementRangeCache.ts:135 — executableStatementRangeCache.executableStatementRangeAtCursor 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 · primitives.renderInline (cyclomatic 17) · ×1
  • primitives.renderInline (cyclomatic 17) apps/desktop/src/lib/sql/layout/primitives.ts:337 — primitives.renderInline 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 · diagnostics.leadingUnquotedSqlKeywords (cyclomatic 17) · ×1
  • diagnostics.leadingUnquotedSqlKeywords (cyclomatic 17) apps/desktop/src/lib/sql/semantic/diagnostics.ts:86 — diagnostics.leadingUnquotedSqlKeywords 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 · model.trailingIdentifier (cyclomatic 17) · ×1
  • model.trailingIdentifier (cyclomatic 17) apps/desktop/src/lib/sql/semantic/model.ts:845 — model.trailingIdentifier has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · references.resolveSqlSemanticNavigationTarget (cyclomatic 17) · ×1
  • references.resolveSqlSemanticNavigationTarget (cyclomatic 17) apps/desktop/src/lib/sql/semantic/references.ts:136 — references.resolveSqlSemanticNavigationTarget has cyclomatic complexity 17 (threshold 15). Of this number, 12 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · sqlAnalysis.parseSelectColumns (cyclomatic 17) · ×1
  • sqlAnalysis.parseSelectColumns (cyclomatic 17) apps/desktop/src/lib/sql/sqlAnalysis.ts:414 — sqlAnalysis.parseSelectColumns 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 · sqlAnalysis.findTopLevelKeyword (cyclomatic 17) · ×1
  • sqlAnalysis.findTopLevelKeyword (cyclomatic 17) apps/desktop/src/lib/sql/sqlAnalysis.ts:831 — sqlAnalysis.findTopLevelKeyword 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 · sqlCompletion.objectMatchesCompletionContext (cyclomatic 17) · ×1
  • sqlCompletion.objectMatchesCompletionContext (cyclomatic 17) REDACTED:4279 — sqlCompletion.objectMatchesCompletionContext 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 · sqlParameters.decodeMyBatisXmlComparisonEntities (cyclomatic 17) · ×1
  • sqlParameters.decodeMyBatisXmlComparisonEntities (cyclomatic 17) apps/desktop/src/lib/sql/sqlParameters.ts:317 — sqlParameters.decodeMyBatisXmlComparisonEntities 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 · sqlNavigation.resolveSqlObjectNavigationIdentity (cyclomatic 17) · ×1
  • sqlNavigation.resolveSqlObjectNavigationIdentity (cyclomatic 17) apps/desktop/src/lib/sql/sqlNavigation.ts:493 — sqlNavigation.resolveSqlObjectNavigationIdentity has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · routineParameters.routineParametersQuery (cyclomatic 17) · ×1
  • routineParameters.routineParametersQuery (cyclomatic 17) apps/desktop/src/lib/table/routineParameters.ts:42 — routineParameters.routineParametersQuery has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · routineParameters.xuguFunctionReturnType (cyclomatic 17) · ×1
  • routineParameters.xuguFunctionReturnType (cyclomatic 17) apps/desktop/src/lib/table/routineParameters.ts:341 — routineParameters.xuguFunctionReturnType 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 · tableTree.mergeTableInfosIntoObjects (cyclomatic 17) · ×1
  • tableTree.mergeTableInfosIntoObjects (cyclomatic 17) apps/desktop/src/lib/table/tableTree.ts:241 — tableTree.mergeTableInfosIntoObjects has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · editorToolbarLayout.resolveNextEditorToolbarTier (cyclomatic 17) · ×1
  • editorToolbarLayout.resolveNextEditorToolbarTier (cyclomatic 17) apps/desktop/src/lib/tabs/editorToolbarLayout.ts:49 — editorToolbarLayout.resolveNextEditorToolbarTier has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · tabPresentation.resultRunSourceLabel (cyclomatic 17) · ×1
  • tabPresentation.resultRunSourceLabel (cyclomatic 17) apps/desktop/src/lib/tabs/tabPresentation.ts:511 — tabPresentation.resultRunSourceLabel 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 · settingsStore.normalizeSqlShortcuts (cyclomatic 17) · ×1
  • settingsStore.normalizeSqlShortcuts (cyclomatic 17) apps/desktop/src/stores/settingsStore.ts:1566 — settingsStore.normalizeSqlShortcuts 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 · i18n.localizeManifest (cyclomatic 17) · ×1
  • i18n.localizeManifest (cyclomatic 17) plugins/sdk/dev-host/ui/i18n.js:98 — i18n.localizeManifest has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · NacosOpenApiAdmin · ×1
  • NacosOpenApiAdmin::test_connection (cyclomatic 16) crates/dbx-core/src/admin/nacos/http.rs:1771 — NacosOpenApiAdmin::test_connection has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DegradationChain · ×1
  • DegradationChain::decide (cyclomatic 16) REDACTED:1335 — DegradationChain::decide 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 · AgentDriverClient · ×1
  • AgentDriverClient::call_typed_with_timeout_and_cancel (cyclomatic 16) crates/dbx-driver-agent/src/agent_driver.rs:1760 — AgentDriverClient::call_typed_with_timeout_and_cancel has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: AgentMethod::as_str (cyclomatic 43) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · DbxJdbcPlugin.oracleListObjects (cyclomatic 16) · ×1
  • DbxJdbcPlugin.oracleListObjects (cyclomatic 16) REDACTED:3814 — DbxJdbcPlugin.oracleListObjects 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. This is NOT this file's highest cyclomatic complexity: DbxJdbcPlugin.handle (cyclomatic 32) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · SpannerAgent.completionAssistantSearch (cyclomatic 16) · ×1
  • SpannerAgent.completionAssistantSearch (cyclomatic 16) agents/drivers/spanner/src/main/java/com/dbx/agent/spanner/SpannerAgent.java:344 — SpannerAgent.completionAssistantSearch 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 · OceanBaseOracleAgent.formatDataType (cyclomatic 16) · ×1
  • OceanBaseOracleAgent.formatDataType (cyclomatic 16) agents/drivers/oceanbase-oracle/src/main/java/com/dbx/agent/oceanbaseoracle/OceanBaseOracleAgent.java:1438 — OceanBaseOracleAgent.formatDataType 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 · KafkaAgent.peekMessages (cyclomatic 16) · ×1
  • KafkaAgent.peekMessages (cyclomatic 16) agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:1623 — KafkaAgent.peekMessages 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. This is NOT this file's highest cyclomatic complexity: KafkaAgent.dispatch (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · DamengAgent.buildCatalogObjectSource (cyclomatic 16) · ×1
  • DamengAgent.buildCatalogObjectSource (cyclomatic 16) REDACTED:1447 — DamengAgent.buildCatalogObjectSource has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: DamengAgent.resultValue (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · DamengAgent.splitTableDdlDefinitions (cyclomatic 16) · ×1
  • DamengAgent.splitTableDdlDefinitions (cyclomatic 16) REDACTED:2126 — DamengAgent.splitTableDdlDefinitions 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. This is NOT this file's highest cyclomatic complexity: DamengAgent.resultValue (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · AbstractJdbcAgent.finishPooledRequest (cyclomatic 16) · ×1
  • AbstractJdbcAgent.finishPooledRequest (cyclomatic 16) agents/common/src/main/java/com/dbx/agent/AbstractJdbcAgent.java:389 — AbstractJdbcAgent.finishPooledRequest has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ConnectionFactoryDataSource.getConnection (cyclomatic 16) · ×1
  • ConnectionFactoryDataSource.getConnection (cyclomatic 16) agents/common/src/main/java/com/dbx/agent/JdbcConnectionPoolRegistry.java:788 — ConnectionFactoryDataSource.getConnection 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 · MultiSessionJsonRpcServer.handleRequest (cyclomatic 16) · ×1
  • MultiSessionJsonRpcServer.handleRequest (cyclomatic 16) agents/common/src/main/java/com/dbx/agent/MultiSessionJsonRpcServer.java:129 — MultiSessionJsonRpcServer.handleRequest 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 · main.parseCassandraConfig (cyclomatic 16) · ×1
  • main.parseCassandraConfig (cyclomatic 16) agents/drivers/cassandra-go/config.go:54 — main.parseCassandraConfig has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · main.applyNativeHOCON (cyclomatic 16) · ×1
  • main.applyNativeHOCON (cyclomatic 16) agents/drivers/cassandra-go/config_file.go:288 — main.applyNativeHOCON has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · etcdSession.listReadableRanges (cyclomatic 16) · ×1
  • etcdSession.listReadableRanges (cyclomatic 16) agents/drivers/etcd-go/kv.go:118 — etcdSession.listReadableRanges 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 · main.rewriteNativeConnectionStringSSLMode (cyclomatic 16) · ×1
  • main.rewriteNativeConnectionStringSSLMode (cyclomatic 16) agents/drivers/kingbase-go/main.go:1203 — main.rewriteNativeConnectionStringSSLMode 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 · main.withTerminalKeyword (cyclomatic 16) · ×1
  • main.withTerminalKeyword (cyclomatic 16) agents/drivers/kingbase-go/main.go:1743 — main.withTerminalKeyword 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 · main.normalizeNestedValue (cyclomatic 16) · ×1
  • main.normalizeNestedValue (cyclomatic 16) agents/drivers/neo4j-go/query.go:309 — main.normalizeNestedValue has cyclomatic complexity 16 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This is NOT this file's highest cyclomatic complexity: main.neo4jTypeName (cyclomatic 18) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · main.oracleExplainPlanBindParams (cyclomatic 16) · ×1
  • main.oracleExplainPlanBindParams (cyclomatic 16) REDACTED:3689 — main.oracleExplainPlanBindParams 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 · main.rewriteNestedOracleSelects (cyclomatic 16) · ×1
  • main.rewriteNestedOracleSelects (cyclomatic 16) REDACTED:4403 — main.rewriteNestedOracleSelects 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 · main.splitTopLevelSQLList (cyclomatic 16) · ×1
  • main.splitTopLevelSQLList (cyclomatic 16) REDACTED:4945 — main.splitTopLevelSQLList 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 · main.sanitizeSessionStateSQL (cyclomatic 16) · ×1
  • main.sanitizeSessionStateSQL (cyclomatic 16) agents/drivers/vastbase-go/connection_state.go:122 — main.sanitizeSessionStateSQL 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 · server.listObjects (cyclomatic 16) · ×1
  • server.listObjects (cyclomatic 16) agents/drivers/vastbase-go/vastbase_metadata.go:1028 — server.listObjects has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · server.put (cyclomatic 16) · ×1
  • server.put (cyclomatic 16) agents/drivers/zookeeper/operations.go:89 — server.put 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 · semver.recursivePreReleaseCompare (cyclomatic 16) · ×1
  • semver.recursivePreReleaseCompare (cyclomatic 16) agents/go-common/go-semver/semver.go:207 — semver.recursivePreReleaseCompare has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · dbxpluginsdk.validProtocolName (cyclomatic 16) · ×1
  • dbxpluginsdk.validProtocolName (cyclomatic 16) plugins/sdk/go/dbx-plugin-sdk/sdk.go:392 — dbxpluginsdk.validProtocolName has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · sqlStatementRanges.nextSqlWordToken (cyclomatic 16) · ×1
  • sqlStatementRanges.nextSqlWordToken (cyclomatic 16) apps/desktop/src/lib/sql/sqlStatementRanges.ts:1492 — sqlStatementRanges.nextSqlWordToken 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 · sqlStatementRanges.advanceMysqlRoutineBlockCompleteness (cyclomatic 16) · ×1
  • sqlStatementRanges.advanceMysqlRoutineBlockCompleteness (cyclomatic 16) apps/desktop/src/lib/sql/sqlStatementRanges.ts:1931 — sqlStatementRanges.advanceMysqlRoutineBlockCompleteness has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · build_offline_jdbc_payload.validateAndCopyBundle (cyclomatic 16) · ×1
  • build_offline_jdbc_payload.validateAndCopyBundle (cyclomatic 16) agents/scripts/build_offline_jdbc_payload.mjs:82 — build_offline_jdbc_payload.validateAndCopyBundle has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ai.buildBasePromptLines (cyclomatic 16) · ×1
  • ai.buildBasePromptLines (cyclomatic 16) apps/desktop/src/lib/ai/ai.ts:493 — ai.buildBasePromptLines has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · aiAgentStepPresentation.upsertAgentStep (cyclomatic 16) · ×1
  • aiAgentStepPresentation.upsertAgentStep (cyclomatic 16) apps/desktop/src/lib/ai/aiAgentStepPresentation.ts:66 — aiAgentStepPresentation.upsertAgentStep has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · documentStoreProvider.buildElasticsearchRuleQuery (cyclomatic 16) · ×1
  • documentStoreProvider.buildElasticsearchRuleQuery (cyclomatic 16) apps/desktop/src/lib/app/documentStoreProvider.ts:489 — documentStoreProvider.buildElasticsearchRuleQuery has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · connectionDeepLink.parseConnectionDeepLink (cyclomatic 16) · ×1
  • connectionDeepLink.parseConnectionDeepLink (cyclomatic 16) apps/desktop/src/lib/connection/connectionDeepLink.ts:273 — connectionDeepLink.parseConnectionDeepLink has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to one function literal inside it that branches. 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 · connectionUrl.parseJdbcSqlServerUrl (cyclomatic 16) · ×1
  • connectionUrl.parseJdbcSqlServerUrl (cyclomatic 16) REDACTED:463 — connectionUrl.parseJdbcSqlServerUrl has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · columnFormatter.parseIoTDBTimestampEditorValue (cyclomatic 16) · ×1
  • columnFormatter.parseIoTDBTimestampEditorValue (cyclomatic 16) apps/desktop/src/lib/dataGrid/columnFormatter.ts:383 — columnFormatter.parseIoTDBTimestampEditorValue has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · dataGenerate.generatePhone (cyclomatic 16) · ×1
  • dataGenerate.generatePhone (cyclomatic 16) apps/desktop/src/lib/dataGrid/dataGenerate.ts:947 — dataGenerate.generatePhone has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · dataGridColumnFilter.splitTopLevelAnd (cyclomatic 16) · ×1
  • dataGridColumnFilter.splitTopLevelAnd (cyclomatic 16) apps/desktop/src/lib/dataGrid/dataGridColumnFilter.ts:121 — dataGridColumnFilter.splitTopLevelAnd 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 · dataGridSort.compareDataGridValues (cyclomatic 16) · ×1
  • dataGridSort.compareDataGridValues (cyclomatic 16) apps/desktop/src/lib/dataGrid/dataGridSort.ts:93 — dataGridSort.compareDataGridValues 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 · geometryPreview.tokenize (cyclomatic 16) · ×1
  • geometryPreview.tokenize (cyclomatic 16) apps/desktop/src/lib/dataGrid/geometryPreview.ts:14 — geometryPreview.tokenize 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 · joinedRowChanges.joinedRowChanges (cyclomatic 16) · ×1
  • joinedRowChanges.joinedRowChanges (cyclomatic 16) apps/desktop/src/lib/dataGrid/joinedRowChanges.ts:54 — joinedRowChanges.joinedRowChanges has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · productionSafety.referencedDatabases (cyclomatic 16) · ×1
  • productionSafety.referencedDatabases (cyclomatic 16) REDACTED:145 — productionSafety.referencedDatabases 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 · sqlIntentionActions.buildBatchQualifyActions (cyclomatic 16) · ×1
  • sqlIntentionActions.buildBatchQualifyActions (cyclomatic 16) apps/desktop/src/lib/editor/sqlIntentionActions.ts:199 — sqlIntentionActions.buildBatchQualifyActions 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 · sqlIntentionActions.resolveNavigationTarget (cyclomatic 16) · ×1
  • sqlIntentionActions.resolveNavigationTarget (cyclomatic 16) apps/desktop/src/lib/editor/sqlIntentionActions.ts:749 — sqlIntentionActions.resolveNavigationTarget has cyclomatic complexity 16 (threshold 15). Of this number, 11 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · elasticsearchCompletion.flattenElasticsearchMappingFields (cyclomatic 16) · ×1
  • elasticsearchCompletion.flattenElasticsearchMappingFields (cyclomatic 16) apps/desktop/src/lib/elasticsearch/elasticsearchCompletion.ts:232 — elasticsearchCompletion.flattenElasticsearchMappingFields 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 · datagripImport.inferProfile (cyclomatic 16) · ×1
  • datagripImport.inferProfile (cyclomatic 16) apps/desktop/src/lib/imports/datagripImport.ts:243 — datagripImport.inferProfile has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · influxDbV1Delete.validRfc3339Timestamp (cyclomatic 16) · ×1
  • influxDbV1Delete.validRfc3339Timestamp (cyclomatic 16) apps/desktop/src/lib/influxdb/influxDbV1Delete.ts:145 — influxDbV1Delete.validRfc3339Timestamp has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · mongoCompletion.classifyFilter (cyclomatic 16) · ×1
  • mongoCompletion.classifyFilter (cyclomatic 16) REDACTED:710 — mongoCompletion.classifyFilter 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. This is NOT this file's highest cyclomatic complexity: mongoCompletion.buildMongoCompletionItemsFromContext (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · mongoCompletion.skipMongoStringOrComment (cyclomatic 16) · ×1
  • mongoCompletion.skipMongoStringOrComment (cyclomatic 16) REDACTED:1249 — mongoCompletion.skipMongoStringOrComment 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. This is NOT this file's highest cyclomatic complexity: mongoCompletion.buildMongoCompletionItemsFromContext (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · mongoShellCommand.mongoFilterContainsOpaqueLogic (cyclomatic 16) · ×1
  • mongoShellCommand.mongoFilterContainsOpaqueLogic (cyclomatic 16) apps/desktop/src/lib/mongo/mongoShellCommand.ts:1887 — mongoShellCommand.mongoFilterContainsOpaqueLogic has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to one function literal inside it that branches (line 1888). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · mongoShellCommand.mongoPureFieldPredicate (cyclomatic 16) · ×1
  • mongoShellCommand.mongoPureFieldPredicate (cyclomatic 16) apps/desktop/src/lib/mongo/mongoShellCommand.ts:1922 — mongoShellCommand.mongoPureFieldPredicate has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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 · mongoShellCommand.mongoFilterObjectIsUnbounded (cyclomatic 16) · ×1
  • mongoShellCommand.mongoFilterObjectIsUnbounded (cyclomatic 16) apps/desktop/src/lib/mongo/mongoShellCommand.ts:2001 — mongoShellCommand.mongoFilterObjectIsUnbounded has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 2006). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · pluginData.snapshotValue (cyclomatic 16) · ×1
  • pluginData.snapshotValue (cyclomatic 16) apps/desktop/src/lib/plugins/pluginData.ts:30 — pluginData.snapshotValue has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · frontendPlugin.pluginConnectionFormValues (cyclomatic 16) · ×1
  • frontendPlugin.pluginConnectionFormValues (cyclomatic 16) apps/desktop/src/lib/plugins/frontendPlugin.ts:240 — frontendPlugin.pluginConnectionFormValues 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 · pluginMarketplace.comparePrerelease (cyclomatic 16) · ×1
  • pluginMarketplace.comparePrerelease (cyclomatic 16) apps/desktop/src/lib/plugins/pluginMarketplace.ts:233 — pluginMarketplace.comparePrerelease 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 · redisCommandTable.firstRedisArgvUpper (cyclomatic 16) · ×1
  • redisCommandTable.firstRedisArgvUpper (cyclomatic 16) apps/desktop/src/lib/redis/redisCommandTable.ts:463 — redisCommandTable.firstRedisArgvUpper 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 · redisCompletion.argumentGrammar (cyclomatic 16) · ×1
  • redisCompletion.argumentGrammar (cyclomatic 16) apps/desktop/src/lib/redis/redisCompletion.ts:323 — redisCompletion.argumentGrammar has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 341, 334, 332, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · schemaDiff.selectSchemaDiffInput (cyclomatic 16) · ×1
  • schemaDiff.selectSchemaDiffInput (cyclomatic 16) apps/desktop/src/lib/schema/schemaDiff.ts:832 — schemaDiff.selectSchemaDiffInput has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 839, 874, 835). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · sidebarDatabaseStorage.applySidebarTableStorage (cyclomatic 16) · ×1
  • sidebarDatabaseStorage.applySidebarTableStorage (cyclomatic 16) apps/desktop/src/lib/sidebar/sidebarDatabaseStorage.ts:50 — sidebarDatabaseStorage.applySidebarTableStorage has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 54, 52). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · sidebarLayout.reorderEntry (cyclomatic 16) · ×1
  • sidebarLayout.reorderEntry (cyclomatic 16) apps/desktop/src/lib/sidebar/sidebarLayout.ts:476 — sidebarLayout.reorderEntry has cyclomatic complexity 16 (threshold 15). Of this number, 8 points are the body's own statements and 8 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · aggregateCombinators.buildCombinatorSequences (cyclomatic 16) · ×1
  • aggregateCombinators.buildCombinatorSequences (cyclomatic 16) apps/desktop/src/lib/sql/clickhouse/aggregateCombinators.ts:10 — aggregateCombinators.buildCombinatorSequences 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 · sqlAnalysis.parseTableSourceAt (cyclomatic 16) · ×1
  • sqlAnalysis.parseTableSourceAt (cyclomatic 16) apps/desktop/src/lib/sql/sqlAnalysis.ts:659 — sqlAnalysis.parseTableSourceAt has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · sqlAnalysisWorker.createSqlAnalysisWorker (cyclomatic 16) · ×1
  • sqlAnalysisWorker.createSqlAnalysisWorker (cyclomatic 16) apps/desktop/src/lib/sql/sqlAnalysisWorker.ts:7 — sqlAnalysisWorker.createSqlAnalysisWorker has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 belong to 3 function literals inside it that branch. 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 · sqlCompletion.shouldAutoOpenSqlCompletion (cyclomatic 16) · ×1
  • sqlCompletion.shouldAutoOpenSqlCompletion (cyclomatic 16) REDACTED:1821 — sqlCompletion.shouldAutoOpenSqlCompletion has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · sqlCompletion.parseTrailingIdentifierPart (cyclomatic 16) · ×1
  • sqlCompletion.parseTrailingIdentifierPart (cyclomatic 16) REDACTED:2808 — sqlCompletion.parseTrailingIdentifierPart 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 · sqlCompletion.buildSelectAllColumnItems (cyclomatic 16) · ×1
  • sqlCompletion.buildSelectAllColumnItems (cyclomatic 16) REDACTED:4426 — sqlCompletion.buildSelectAllColumnItems 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 · sqlCompletion.completionColumnPrefixCandidates (cyclomatic 16) · ×1
  • sqlCompletion.completionColumnPrefixCandidates (cyclomatic 16) REDACTED:4825 — sqlCompletion.completionColumnPrefixCandidates 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 · sqlParameters.collectComplexTypeFieldSeparators (cyclomatic 16) · ×1
  • sqlParameters.collectComplexTypeFieldSeparators (cyclomatic 16) apps/desktop/src/lib/sql/sqlParameters.ts:1035 — sqlParameters.collectComplexTypeFieldSeparators 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 · sqlServerActivityTraceRuntime.pollEvents (cyclomatic 16) · ×1
  • sqlServerActivityTraceRuntime.pollEvents (cyclomatic 16) apps/desktop/src/lib/sqlserver/sqlServerActivityTraceRuntime.ts:230 — sqlServerActivityTraceRuntime.pollEvents has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 240, 249, 256). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · tableDataExport.fetchTableDataForExport (cyclomatic 16) · ×1
  • tableDataExport.fetchTableDataForExport (cyclomatic 16) apps/desktop/src/lib/table/tableDataExport.ts:28 — tableDataExport.fetchTableDataForExport 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 · settingsStore.normalizeTabGroupCustomizations (cyclomatic 16) · ×1
  • settingsStore.normalizeTabGroupCustomizations (cyclomatic 16) apps/desktop/src/stores/settingsStore.ts:1364 — settingsStore.normalizeTabGroupCustomizations 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 · sqlExecutionTargetGroupStore.useSqlExecutionTargetGroupStore (cyclomatic 16) · ×1
  • sqlExecutionTargetGroupStore.useSqlExecutionTargetGroupStore (cyclomatic 16) apps/desktop/src/stores/sqlExecutionTargetGroupStore.ts:80 — sqlExecutionTargetGroupStore.useSqlExecutionTargetGroupStore has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to 3 function literals inside it that branch. 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 · platformDetection.detectPlatformId (cyclomatic 16) · ×1
  • platformDetection.detectPlatformId (cyclomatic 16) docs/lib/platformDetection.ts:22 — platformDetection.detectPlatformId 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.
D10 · Test Quality · No assertions · ×1
  • No assertions: keeps structure and table-info scrollbars visible without OKLab color mixing apps/desktop/src/styles/__tests__/legacyWebviewFallback.spec.ts:398 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
D12 · Dependency Hygiene · No REDACTED committed (plugins/sdk/cli/templates/go/backend/go.mod) · ×1
  • No REDACTED committed (plugins/sdk/cli/templates/go/backend/go.mod) — plugins/sdk/cli/templates/go/backend/go.mod requires 1 module(s) but no `REDACTED` is committed beside it, so nothing records the expected checksum of the code this module builds against — `go build` accepts whatever the module proxy serves, and two builds of this commit are not guaranteed to be the same build. Run `go mod tidy` and commit the resulting `REDACTED`.
D2 · Cognitive Complexity · connectionStore.useConnectionStore (cognitive 2555) · ×1
  • connectionStore.useConnectionStore (cognitive 2555) apps/desktop/src/stores/connectionStore.ts:441 — connectionStore.useConnectionStore has cognitive complexity 2555 (threshold 15). Drivers by points: if/else 1103 (1461 pts), boolean chains 536, ternaries 241 (309 pts), loops 112 (126 pts), error handling 82 (120 pts), match/switch 2 (3 pts) (nesting depth added 479). Of this number, 1837 points are the body's own statements and 718 belong to 119 function literals inside it that branch. 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 · queryStore.useQueryStore (cognitive 2396) · ×1
  • queryStore.useQueryStore (cognitive 2396) apps/desktop/src/stores/queryStore.ts:1025 — queryStore.useQueryStore has cognitive complexity 2396 (threshold 15). Drivers by points: if/else 903 (1322 pts), boolean chains 573, ternaries 220 (351 pts), loops 59 (77 pts), error handling 39 (70 pts), match/switch 1 (3 pts) (nesting depth added 601). Of this number, 2116 points are the body's own statements and 280 belong to 110 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useDataGridEditor.useDataGridEditor (cognitive 635) · ×1
  • useDataGridEditor.useDataGridEditor (cognitive 635) apps/desktop/src/composables/useDataGridEditor.ts:248 — useDataGridEditor.useDataGridEditor has cognitive complexity 635 (threshold 15). Drivers by points: if/else 313 (416 pts), boolean chains 107, ternaries 44 (52 pts), loops 22 (31 pts), error handling 17 (29 pts) (nesting depth added 132). Of this number, 580 points are the body's own statements and 55 belong to 28 function literals inside it that branch. 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 · useQueryEditorCompletion.useQueryEditorCompletion (cognitive 599) · ×1
  • useQueryEditorCompletion.useQueryEditorCompletion (cognitive 599) apps/desktop/src/components/editor/useQueryEditorCompletion.ts:78 — useQueryEditorCompletion.useQueryEditorCompletion has cognitive complexity 599 (threshold 15). Drivers by points: if/else 210 (316 pts), boolean chains 149, ternaries 54 (96 pts), error handling 15 (29 pts), loops 6 (9 pts) (nesting depth added 165). Of this number, 535 points are the body's own statements and 64 belong to 21 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useDataGridExport.useDataGridExport (cognitive 381) · ×1
  • useDataGridExport.useDataGridExport (cognitive 381) apps/desktop/src/composables/useDataGridExport.ts:175 — useDataGridExport.useDataGridExport has cognitive complexity 381 (threshold 15). Drivers by points: if/else 136 (162 pts), boolean chains 101, ternaries 80 (95 pts), error handling 19 (20 pts), loops 3 (nesting depth added 42). Of this number, 209 points are the body's own statements and 172 belong to 48 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · settingsStore.useSettingsStore (cognitive 334) · ×1
  • settingsStore.useSettingsStore (cognitive 334) apps/desktop/src/stores/settingsStore.ts:2000 — settingsStore.useSettingsStore has cognitive complexity 334 (threshold 15). Drivers by points: if/else 248 (275 pts), boolean chains 39, loops 8 (11 pts), error handling 5, ternaries 4 (nesting depth added 30). Of this number, 283 points are the body's own statements and 51 belong to 10 function literals inside it that branch. 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 · server.createMockHost (cognitive 267) · ×1
  • server.createMockHost (cognitive 267) plugins/sdk/dev-host/server.mjs:77 — server.createMockHost has cognitive complexity 267 (threshold 15). Drivers by points: if/else 82 (132 pts), boolean chains 71, ternaries 20 (31 pts), loops 14 (18 pts), error handling 11 (13 pts), match/switch 2 (nesting depth added 67). Of this number, 111 points are the body's own statements and 156 belong to 30 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useSqlExecution.useSqlExecution (cognitive 239) · ×1
  • useSqlExecution.useSqlExecution (cognitive 239) apps/desktop/src/composables/useSqlExecution.ts:153 — useSqlExecution.useSqlExecution has cognitive complexity 239 (threshold 15). Drivers by points: if/else 109 (143 pts), ternaries 32 (45 pts), boolean chains 38, error handling 5 (7 pts), loops 3 (6 pts) (nesting depth added 52). Of this number, 216 points are the body's own statements and 23 belong to 11 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useDataGridActions.useDataGridActions (cognitive 238) · ×1
  • useDataGridActions.useDataGridActions (cognitive 238) apps/desktop/src/composables/useDataGridActions.ts:45 — useDataGridActions.useDataGridActions has cognitive complexity 238 (threshold 15). Drivers by points: if/else 65 (119 pts), ternaries 37 (65 pts), boolean chains 43, error handling 3 (8 pts), loops 1 (3 pts) (nesting depth added 89). Of this number, 218 points are the body's own statements and 20 belong to 10 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useQuickOpen.useQuickOpen (cognitive 237) · ×1
  • useQuickOpen.useQuickOpen (cognitive 237) apps/desktop/src/composables/useQuickOpen.ts:285 — useQuickOpen.useQuickOpen has cognitive complexity 237 (threshold 15). Drivers by points: if/else 82 (127 pts), boolean chains 49, ternaries 15 (34 pts), loops 17 (21 pts), error handling 5 (6 pts) (nesting depth added 69). Of this number, 174 points are the body's own statements and 63 belong to 16 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · canvasDataGridRenderer.drawCanvasDataGrid (cognitive 233) · ×1
  • canvasDataGridRenderer.drawCanvasDataGrid (cognitive 233) apps/desktop/src/lib/dataGrid/canvasDataGridRenderer.ts:330 — canvasDataGridRenderer.drawCanvasDataGrid has cognitive complexity 233 (threshold 15). Drivers by points: ternaries 34 (120 pts), if/else 35 (70 pts), boolean chains 34, loops 5 (9 pts) (nesting depth added 125). Of this number, 132 points are the body's own statements and 101 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · savedSqlStore.useSavedSqlStore (cognitive 219) · ×1
  • savedSqlStore.useSavedSqlStore (cognitive 219) apps/desktop/src/stores/savedSqlStore.ts:175 — savedSqlStore.useSavedSqlStore has cognitive complexity 219 (threshold 15). Drivers by points: boolean chains 100, if/else 65 (76 pts), ternaries 18 (24 pts), loops 11 (12 pts), error handling 5 (7 pts) (nesting depth added 20). Of this number, 129 points are the body's own statements and 90 belong to 38 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · useSidebarDatabaseSpecificMutationRuntime.useSidebarDatabaseSpecificMutationRuntime (cognitive 203) · ×1
  • useSidebarDatabaseSpecificMutationRuntime.useSidebarDatabaseSpecificMutationRuntime (cognitive 203) apps/desktop/src/composables/useSidebarDatabaseSpecificMutationRuntime.ts:113 — useSidebarDatabaseSpecificMutationRuntime.useSidebarDatabaseSpecificMutationRuntime has cognitive complexity 203 (threshold 15). Drivers by points: boolean chains 85, if/else 79 (82 pts), error handling 16 (19 pts), ternaries 15 (16 pts), match/switch 1 (nesting depth added 7). Of this number, 162 points are the body's own statements and 41 belong to 16 function literals inside it that branch. 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 · useDataGridSelection.useDataGridSelection (cognitive 182) · ×1
  • useDataGridSelection.useDataGridSelection (cognitive 182) apps/desktop/src/composables/useDataGridSelection.ts:52 — useDataGridSelection.useDataGridSelection has cognitive complexity 182 (threshold 15). Drivers by points: if/else 103 (128 pts), boolean chains 32, loops 7 (11 pts), ternaries 10 (11 pts) (nesting depth added 30). Of this number, 140 points are the body's own statements and 42 belong to 9 function literals inside it that branch. 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 · useQueryEditorDiagnostics.useQueryEditorDiagnostics (cognitive 175) · ×1
  • useQueryEditorDiagnostics.useQueryEditorDiagnostics (cognitive 175) apps/desktop/src/components/editor/useQueryEditorDiagnostics.ts:79 — useQueryEditorDiagnostics.useQueryEditorDiagnostics has cognitive complexity 175 (threshold 15). Drivers by points: if/else 66 (95 pts), boolean chains 35, ternaries 16 (24 pts), loops 11 (14 pts), error handling 4 (7 pts) (nesting depth added 43). Of this number, 165 points are the body's own statements and 10 belong to 8 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlStatementRanges.splitSqlStatementRanges (cognitive 172) · ×1
  • sqlStatementRanges.splitSqlStatementRanges (cognitive 172) apps/desktop/src/lib/sql/sqlStatementRanges.ts:333 — sqlStatementRanges.splitSqlStatementRanges has cognitive complexity 172 (threshold 15). Drivers by points: if/else 54 (136 pts), boolean chains 25, loops 2 (6 pts), ternaries 2 (5 pts) (nesting depth added 89). Of this number, 161 points are the body's own statements and 11 belong to 4 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · cursor.fetchOne (cognitive 170) · ×1
  • cursor.fetchOne (cognitive 170) REDACTED:1117 — cursor.fetchOne has cognitive complexity 170 (threshold 15). Drivers by points: if/else 64 (169 pts), loops 1 (nesting depth added 105). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · useDataGridExtractor.useDataGridExtractor (cognitive 161) · ×1
  • useDataGridExtractor.useDataGridExtractor (cognitive 161) apps/desktop/src/composables/useDataGridExtractor.ts:82 — useDataGridExtractor.useDataGridExtractor has cognitive complexity 161 (threshold 15). Drivers by points: if/else 57 (73 pts), boolean chains 57, ternaries 19 (26 pts), loops 2 (3 pts), error handling 2 (nesting depth added 24). Of this number, 139 points are the body's own statements and 22 belong to 11 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · useSidebarTreeExportRuntime.useSidebarTreeExportRuntime (cognitive 152) · ×1
  • useSidebarTreeExportRuntime.useSidebarTreeExportRuntime (cognitive 152) apps/desktop/src/composables/useSidebarTreeExportRuntime.ts:106 — useSidebarTreeExportRuntime.useSidebarTreeExportRuntime has cognitive complexity 152 (threshold 15). Drivers by points: if/else 66 (83 pts), ternaries 21 (24 pts), boolean chains 23, loops 8 (12 pts), error handling 9 (10 pts) (nesting depth added 25). Of this number, 137 points are the body's own statements and 15 belong to 6 function literals inside it that branch. 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 · PluginHostBridge.dispatch (cognitive 152) · ×1
  • PluginHostBridge.dispatch (cognitive 152) REDACTED:537 — PluginHostBridge.dispatch has cognitive complexity 152 (threshold 15). Drivers by points: if/else 77 (121 pts), ternaries 11 (22 pts), boolean chains 7, error handling 1 (2 pts) (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlFormatter.compressSqlText (cognitive 152) · ×1
  • sqlFormatter.compressSqlText (cognitive 152) apps/desktop/src/lib/sql/sqlFormatter.ts:734 — sqlFormatter.compressSqlText has cognitive complexity 152 (threshold 15). Drivers by points: if/else 33 (88 pts), boolean chains 29, loops 10 (22 pts), ternaries 4 (13 pts) (nesting depth added 76). Of this number, 132 points are the body's own statements and 20 belong to 5 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useQueryEditorCompletionMetadata.useQueryEditorCompletionMetadata (cognitive 139) · ×1
  • useQueryEditorCompletionMetadata.useQueryEditorCompletionMetadata (cognitive 139) apps/desktop/src/components/editor/useQueryEditorCompletionMetadata.ts:43 — useQueryEditorCompletionMetadata.useQueryEditorCompletionMetadata has cognitive complexity 139 (threshold 15). Drivers by points: if/else 68 (83 pts), boolean chains 32, ternaries 13 (15 pts), loops 5 (6 pts), error handling 2 (3 pts) (nesting depth added 19). Of this number, 126 points are the body's own statements and 13 belong to 7 function literals inside it that branch. 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 · useQueryEditorObjectNavigation.useQueryEditorObjectNavigation (cognitive 137) · ×1
  • useQueryEditorObjectNavigation.useQueryEditorObjectNavigation (cognitive 137) apps/desktop/src/components/editor/useQueryEditorObjectNavigation.ts:37 — useQueryEditorObjectNavigation.useQueryEditorObjectNavigation has cognitive complexity 137 (threshold 15). Drivers by points: if/else 50 (84 pts), boolean chains 31, ternaries 10 (13 pts), error handling 3 (6 pts), loops 2 (3 pts) (nesting depth added 41). Of this number, 25 points are the body's own statements and 112 belong to 6 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useAppUpdater.useAppUpdater (cognitive 136) · ×1
  • useAppUpdater.useAppUpdater (cognitive 136) apps/desktop/src/composables/useAppUpdater.ts:131 — useAppUpdater.useAppUpdater has cognitive complexity 136 (threshold 15). Drivers by points: if/else 67 (86 pts), boolean chains 38, error handling 8 (10 pts), ternaries 1 (2 pts) (nesting depth added 22). Of this number, 108 points are the body's own statements and 28 belong to 7 function literals inside it that branch. 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 · useDataGridLargeValues.useDataGridLargeValues (cognitive 126) · ×1
  • useDataGridLargeValues.useDataGridLargeValues (cognitive 126) apps/desktop/src/composables/useDataGridLargeValues.ts:89 — useDataGridLargeValues.useDataGridLargeValues has cognitive complexity 126 (threshold 15). Drivers by points: if/else 50 (71 pts), boolean chains 26, loops 12 (16 pts), ternaries 6 (9 pts), error handling 4 (nesting depth added 28). Of this number, 117 points are the body's own statements and 9 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MysqlDumpBinaryLiteralNormalizer · ×1
  • MysqlDumpBinaryLiteralNormalizer::normalize (cognitive 123) REDACTED:1412 — MysqlDumpBinaryLiteralNormalizer::normalize has cognitive complexity 123 (threshold 15). Drivers by points: if/else 36 (91 pts), boolean chains 13, match/switch 4 (13 pts), loops 2 (6 pts) (nesting depth added 68). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useQueryEditorBatchSelection.useQueryEditorBatchSelection (cognitive 120) · ×1
  • useQueryEditorBatchSelection.useQueryEditorBatchSelection (cognitive 120) apps/desktop/src/components/editor/useQueryEditorBatchSelection.ts:52 — useQueryEditorBatchSelection.useQueryEditorBatchSelection has cognitive complexity 120 (threshold 15). Drivers by points: if/else 71 (75 pts), boolean chains 35, ternaries 7 (8 pts), loops 2 (nesting depth added 5). Of this number, 104 points are the body's own statements and 16 belong to 8 function literals inside it that branch. 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 · gohive.innerConnect (cognitive 119) · ×1
  • gohive.innerConnect (cognitive 119) REDACTED:373 — gohive.innerConnect has cognitive complexity 119 (threshold 15). Drivers by points: if/else 63 (116 pts), boolean chains 3 (nesting depth added 53). Of this number, 114 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useSidebarConnectionMutationRuntime.useSidebarConnectionMutationRuntime (cognitive 117) · ×1
  • useSidebarConnectionMutationRuntime.useSidebarConnectionMutationRuntime (cognitive 117) apps/desktop/src/composables/useSidebarConnectionMutationRuntime.ts:34 — useSidebarConnectionMutationRuntime.useSidebarConnectionMutationRuntime has cognitive complexity 117 (threshold 15). Drivers by points: boolean chains 40, if/else 39 (40 pts), ternaries 16 (17 pts), error handling 13, loops 7 (nesting depth added 2). Of this number, 96 points are the body's own statements and 21 belong to 12 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · doltVersionControl.layoutDoltCommitGraph (cognitive 117) · ×1
  • doltVersionControl.layoutDoltCommitGraph (cognitive 117) apps/desktop/src/lib/dolt/doltVersionControl.ts:467 — doltVersionControl.layoutDoltCommitGraph has cognitive complexity 117 (threshold 15). Drivers by points: if/else 27 (68 pts), loops 10 (19 pts), boolean chains 16, ternaries 6 (14 pts) (nesting depth added 58). Of this number, 64 points are the body's own statements and 53 belong to 7 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · transferTaskStore.useTransferTaskStore (cognitive 117) · ×1
  • transferTaskStore.useTransferTaskStore (cognitive 117) apps/desktop/src/stores/transferTaskStore.ts:136 — transferTaskStore.useTransferTaskStore has cognitive complexity 117 (threshold 15). Drivers by points: boolean chains 79, if/else 21 (23 pts), ternaries 10 (11 pts), loops 2 (3 pts), error handling 1 (nesting depth added 4). Of this number, 60 points are the body's own statements and 57 belong to 21 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · sqlFormatter.maskStringAndCommentSpans (cognitive 116) · ×1
  • sqlFormatter.maskStringAndCommentSpans (cognitive 116) apps/desktop/src/lib/sql/sqlFormatter.ts:448 — sqlFormatter.maskStringAndCommentSpans has cognitive complexity 116 (threshold 15). Drivers by points: if/else 27 (73 pts), boolean chains 22, loops 8 (20 pts), ternaries 1 (nesting depth added 58). Of this number, 108 points are the body's own statements and 8 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mongoShellCommand.parseMongoWriteCommand (cognitive 115) · ×1
  • mongoShellCommand.parseMongoWriteCommand (cognitive 115) apps/desktop/src/lib/mongo/mongoShellCommand.ts:830 — mongoShellCommand.parseMongoWriteCommand has cognitive complexity 115 (threshold 15). Drivers by points: if/else 38 (67 pts), ternaries 13 (27 pts), boolean chains 19, loops 2 (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useDataGridColumnFormatter.useDataGridColumnFormatter (cognitive 112) · ×1
  • useDataGridColumnFormatter.useDataGridColumnFormatter (cognitive 112) apps/desktop/src/composables/useDataGridColumnFormatter.ts:76 — useDataGridColumnFormatter.useDataGridColumnFormatter has cognitive complexity 112 (threshold 15). Drivers by points: if/else 55 (60 pts), boolean chains 34, ternaries 8 (11 pts), error handling 5, loops 2 (nesting depth added 8). Of this number, 109 points are the body's own statements and 3 belong to 3 function literals inside it that branch. 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 · dataGenerate.buildDefaultGeneratorParams (cognitive 111) · ×1
  • dataGenerate.buildDefaultGeneratorParams (cognitive 111) apps/desktop/src/lib/dataGrid/dataGenerate.ts:1257 — dataGenerate.buildDefaultGeneratorParams has cognitive complexity 111 (threshold 15). Drivers by points: if/else 72 (94 pts), boolean chains 17 (nesting depth added 22). 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 · schemaDiff.convertToSchemaDiffObjects (cognitive 109) · ×1
  • schemaDiff.convertToSchemaDiffObjects (cognitive 109) apps/desktop/src/lib/schema/schemaDiff.ts:641 — schemaDiff.convertToSchemaDiffObjects has cognitive complexity 109 (threshold 15). Drivers by points: ternaries 32 (77 pts), if/else 4 (13 pts), loops 7 (10 pts), boolean chains 9 (nesting depth added 57). Of this number, 78 points are the body's own statements and 31 belong to 5 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · settingsStore.normalizeEditorSettings (cognitive 107) · ×1
  • settingsStore.normalizeEditorSettings (cognitive 107) apps/desktop/src/stores/settingsStore.ts:1636 — settingsStore.normalizeEditorSettings has cognitive complexity 107 (threshold 15). Drivers by points: ternaries 76 (85 pts), boolean chains 21, if/else 1 (nesting depth added 9). Of this number, 100 points are the body's own statements and 7 belong to 4 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · useQueryEditorHover.useQueryEditorHover (cognitive 106) · ×1
  • useQueryEditorHover.useQueryEditorHover (cognitive 106) apps/desktop/src/components/editor/useQueryEditorHover.ts:36 — useQueryEditorHover.useQueryEditorHover has cognitive complexity 106 (threshold 15). Drivers by points: if/else 27 (44 pts), ternaries 20 (29 pts), boolean chains 19, error handling 6 (13 pts), loops 1 (nesting depth added 33). Of this number, 87 points are the body's own statements and 19 belong to 8 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useDataGridConditionEditor.useDataGridConditionEditor (cognitive 106) · ×1
  • useDataGridConditionEditor.useDataGridConditionEditor (cognitive 106) REDACTED:201 — useDataGridConditionEditor.useDataGridConditionEditor has cognitive complexity 106 (threshold 15). Drivers by points: if/else 35 (49 pts), ternaries 13 (29 pts), boolean chains 23, loops 2 (4 pts), error handling 1 (nesting depth added 32). Of this number, 101 points are the body's own statements and 5 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · schemaDiff.setSchemaDiffObjectSelectedWithDependencies (cognitive 99) · ×1
  • schemaDiff.setSchemaDiffObjectSelectedWithDependencies (cognitive 99) apps/desktop/src/lib/schema/schemaDiff.ts:1152 — schemaDiff.setSchemaDiffObjectSelectedWithDependencies has cognitive complexity 99 (threshold 15). Drivers by points: if/else 25 (60 pts), loops 6 (17 pts), boolean chains 14, ternaries 5 (8 pts) (nesting depth added 49). Most of this is not in the body itself: 2 of the 99 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1158, 1176, 1169). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · sqlStatementRanges.topLevelSoftStatementLineStarts (cognitive 98) · ×1
  • sqlStatementRanges.topLevelSoftStatementLineStarts (cognitive 98) apps/desktop/src/lib/sql/sqlStatementRanges.ts:1056 — sqlStatementRanges.topLevelSoftStatementLineStarts has cognitive complexity 98 (threshold 15). Drivers by points: if/else 34 (87 pts), boolean chains 9, loops 1, ternaries 1 (nesting depth added 53). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · redisKeyTree.buildRedisKeySnapshotCooperatively (cognitive 98) · ×1
  • redisKeyTree.buildRedisKeySnapshotCooperatively (cognitive 98) apps/desktop/src/lib/redis/redisKeyTree.ts:303 — redisKeyTree.buildRedisKeySnapshotCooperatively has cognitive complexity 98 (threshold 15). Drivers by points: if/else 23 (64 pts), loops 9 (20 pts), boolean chains 12, ternaries 2 (nesting depth added 52). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlStatementRanges.topLevelWordsInRange (cognitive 96) · ×1
  • sqlStatementRanges.topLevelWordsInRange (cognitive 96) apps/desktop/src/lib/sql/sqlStatementRanges.ts:1310 — sqlStatementRanges.topLevelWordsInRange has cognitive complexity 96 (threshold 15). Drivers by points: if/else 34 (89 pts), boolean chains 6, loops 1 (nesting depth added 55). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PluginDetailClient.PluginDetailClient (cognitive 94) · ×1
  • PluginDetailClient.PluginDetailClient (cognitive 94) docs/app/[lang]/plugins/[id]/PluginDetailClient.tsx:107 — PluginDetailClient.PluginDetailClient has cognitive complexity 94 (threshold 15). Drivers by points: ternaries 25 (78 pts), if/else 11, boolean chains 5 (nesting depth added 53). Of this number, 58 points are the body's own statements and 36 belong to 9 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · schemaDiff.injectColumnRenameSql (cognitive 92) · ×1
  • schemaDiff.injectColumnRenameSql (cognitive 92) apps/desktop/src/lib/schema/schemaDiff.ts:980 — schemaDiff.injectColumnRenameSql has cognitive complexity 92 (threshold 15). Drivers by points: if/else 16 (47 pts), loops 9 (22 pts), boolean chains 15, ternaries 2 (8 pts) (nesting depth added 50). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlParameters.findSqlParameterOccurrences (cognitive 89) · ×1
  • sqlParameters.findSqlParameterOccurrences (cognitive 89) apps/desktop/src/lib/sql/sqlParameters.ts:377 — sqlParameters.findSqlParameterOccurrences has cognitive complexity 89 (threshold 15). Drivers by points: if/else 27 (65 pts), boolean chains 19, ternaries 4, loops 1 (nesting depth added 38). Of this number, 88 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tokens.tokenizeSqlSemantic (cognitive 88) · ×1
  • tokens.tokenizeSqlSemantic (cognitive 88) apps/desktop/src/lib/sql/semantic/tokens.ts:106 — tokens.tokenizeSqlSemantic has cognitive complexity 88 (threshold 15). Drivers by points: if/else 20 (47 pts), boolean chains 19, loops 7 (19 pts), ternaries 1 (3 pts) (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cursor.rowMap (cognitive 87) · ×1
  • cursor.rowMap (cognitive 87) REDACTED:927 — cursor.rowMap has cognitive complexity 87 (threshold 15). Drivers by points: if/else 51 (84 pts), boolean chains 2, loops 1 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · aliasHighlights.sqlAliasHighlightGroups (cognitive 86) · ×1
  • aliasHighlights.sqlAliasHighlightGroups (cognitive 86) apps/desktop/src/lib/sql/semantic/aliasHighlights.ts:34 — aliasHighlights.sqlAliasHighlightGroups has cognitive complexity 86 (threshold 15). Drivers by points: if/else 22 (54 pts), loops 10 (16 pts), boolean chains 15, ternaries 1 (nesting depth added 38). Of this number, 83 points are the body's own statements and 3 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useDataGridColumnLayout.useDataGridColumnLayout (cognitive 84) · ×1
  • useDataGridColumnLayout.useDataGridColumnLayout (cognitive 84) apps/desktop/src/composables/useDataGridColumnLayout.ts:487 — useDataGridColumnLayout.useDataGridColumnLayout has cognitive complexity 84 (threshold 15). Drivers by points: if/else 52 (59 pts), boolean chains 18, ternaries 5, loops 2 (nesting depth added 7). Of this number, 75 points are the body's own statements and 9 belong to 4 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · useSidebarDataOpenRuntime.useSidebarDataOpenRuntime (cognitive 84) · ×1
  • useSidebarDataOpenRuntime.useSidebarDataOpenRuntime (cognitive 84) apps/desktop/src/composables/useSidebarDataOpenRuntime.ts:28 — useSidebarDataOpenRuntime.useSidebarDataOpenRuntime has cognitive complexity 84 (threshold 15). Drivers by points: if/else 33 (42 pts), boolean chains 22, ternaries 14 (18 pts), error handling 2 (nesting depth added 13). Of this number, 71 points are the body's own statements and 13 belong to 5 function literals inside it that branch. 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 · tabPresentation.tabDisplayTitle (cognitive 83) · ×1
  • tabPresentation.tabDisplayTitle (cognitive 83) apps/desktop/src/lib/tabs/tabPresentation.ts:191 — tabPresentation.tabDisplayTitle has cognitive complexity 83 (threshold 15). Drivers by points: if/else 43 (65 pts), ternaries 5 (10 pts), boolean chains 8 (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 · sqlStatementRanges.trimRangeEndBeforeNextBoundary (cognitive 81) · ×1
  • sqlStatementRanges.trimRangeEndBeforeNextBoundary (cognitive 81) apps/desktop/src/lib/sql/sqlStatementRanges.ts:1660 — sqlStatementRanges.trimRangeEndBeforeNextBoundary has cognitive complexity 81 (threshold 15). Drivers by points: if/else 29 (75 pts), boolean chains 5, loops 1 (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlStatementRanges.oraclePlSqlBlockEnd (cognitive 81) · ×1
  • sqlStatementRanges.oraclePlSqlBlockEnd (cognitive 81) apps/desktop/src/lib/sql/sqlStatementRanges.ts:2241 — sqlStatementRanges.oraclePlSqlBlockEnd has cognitive complexity 81 (threshold 15). Drivers by points: if/else 23 (55 pts), ternaries 5 (13 pts), boolean chains 12, loops 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 · database-env.validateRecipe (cognitive 81) · ×1
  • database-env.validateRecipe (cognitive 81) scripts/database-env.mjs:247 — database-env.validateRecipe has cognitive complexity 81 (threshold 15). Drivers by points: if/else 34 (56 pts), boolean chains 17, loops 4 (6 pts), ternaries 1 (2 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.applyCassandraURLParams (cognitive 80) · ×1
  • main.applyCassandraURLParams (cognitive 80) agents/drivers/cassandra-go/config.go:167 — main.applyCassandraURLParams has cognitive complexity 80 (threshold 15). Drivers by points: if/else 24 (71 pts), boolean chains 6, match/switch 1 (2 pts), loops 1 (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 · dataGenerate.generateValue (cognitive 80) · ×1
  • dataGenerate.generateValue (cognitive 80) apps/desktop/src/lib/dataGrid/dataGenerate.ts:1608 — dataGenerate.generateValue has cognitive complexity 80 (threshold 15). Drivers by points: if/else 33 (50 pts), ternaries 6 (13 pts), boolean chains 11, loops 2 (6 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mongoFormatter.formatMongoShellText (cognitive 79) · ×1
  • mongoFormatter.formatMongoShellText (cognitive 79) apps/desktop/src/lib/mongo/mongoFormatter.ts:20 — mongoFormatter.formatMongoShellText has cognitive complexity 79 (threshold 15). Drivers by points: if/else 27 (64 pts), boolean chains 13, loops 1, ternaries 1 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useDialogSources.useDialogSources (cognitive 78) · ×1
  • useDialogSources.useDialogSources (cognitive 78) apps/desktop/src/composables/useDialogSources.ts:145 — useDialogSources.useDialogSources has cognitive complexity 78 (threshold 15). Drivers by points: if/else 46 (66 pts), boolean chains 6, error handling 5, ternaries 1 (nesting depth added 20). Of this number, 40 points are the body's own statements and 38 belong to 19 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RedisKeyGroupIndex.project (cognitive 78) · ×1
  • RedisKeyGroupIndex.project (cognitive 78) apps/desktop/src/lib/redis/redisKeyGroupIndex.ts:124 — RedisKeyGroupIndex.project has cognitive complexity 78 (threshold 15). Drivers by points: if/else 22 (46 pts), loops 7 (14 pts), ternaries 8 (10 pts), boolean chains 8 (nesting depth added 33). Of this number, 55 points are the body's own statements and 23 belong to 5 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mongoShellCommand.diagnoseMongoCommand (cognitive 76) · ×1
  • mongoShellCommand.diagnoseMongoCommand (cognitive 76) apps/desktop/src/lib/mongo/mongoShellCommand.ts:127 — mongoShellCommand.diagnoseMongoCommand has cognitive complexity 76 (threshold 15). Drivers by points: if/else 26 (40 pts), ternaries 11 (22 pts), boolean chains 13, loops 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 · hoverTableSql.normalizeAlignedSqlWhitespace (cognitive 74) · ×1
  • hoverTableSql.normalizeAlignedSqlWhitespace (cognitive 74) apps/desktop/src/lib/editor/hoverTableSql.ts:163 — hoverTableSql.normalizeAlignedSqlWhitespace has cognitive complexity 74 (threshold 15). Drivers by points: if/else 23 (55 pts), loops 4 (10 pts), boolean chains 9 (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useMultiDbTargetSelection.useMultiDbTargetSelection (cognitive 73) · ×1
  • useMultiDbTargetSelection.useMultiDbTargetSelection (cognitive 73) apps/desktop/src/composables/useMultiDbTargetSelection.ts:46 — useMultiDbTargetSelection.useMultiDbTargetSelection has cognitive complexity 73 (threshold 15). Drivers by points: if/else 43 (52 pts), boolean chains 13, ternaries 4 (5 pts), error handling 3 (nesting depth added 10). Of this number, 67 points are the body's own statements and 6 belong to 4 function literals inside it that branch. 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 · sqlCompletion.getFunctionDescriptions (cognitive 73) · ×1
  • sqlCompletion.getFunctionDescriptions (cognitive 73) REDACTED:857 — sqlCompletion.getFunctionDescriptions has cognitive complexity 73 (threshold 15). Drivers by points: boolean chains 73. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · tableTree.buildGroupedObjectTreeNodes (cognitive 73) · ×1
  • tableTree.buildGroupedObjectTreeNodes (cognitive 73) apps/desktop/src/lib/table/tableTree.ts:870 — tableTree.buildGroupedObjectTreeNodes has cognitive complexity 73 (threshold 15). Drivers by points: ternaries 17 (48 pts), boolean chains 15, if/else 4 (8 pts), loops 2 (nesting depth added 35). Of this number, 21 points are the body's own statements and 52 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.renderXuguPartitionDDL (cognitive 72) · ×1
  • main.renderXuguPartitionDDL (cognitive 72) REDACTED:4949 — main.renderXuguPartitionDDL has cognitive complexity 72 (threshold 15). Drivers by points: if/else 21 (60 pts), loops 2 (8 pts), boolean chains 4 (nesting depth added 45). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SqlCompletionProvider.build (cognitive 72) · ×1
  • SqlCompletionProvider.build (cognitive 72) REDACTED:1673 — SqlCompletionProvider.build has cognitive complexity 72 (threshold 15). Drivers by points: if/else 29 (42 pts), boolean chains 21, ternaries 3 (7 pts), loops 1 (2 pts) (nesting depth added 18). Of this number, 71 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ai.buildModePromptLines (cognitive 71) · ×1
  • ai.buildModePromptLines (cognitive 71) apps/desktop/src/lib/ai/ai.ts:613 — ai.buildModePromptLines has cognitive complexity 71 (threshold 15). Drivers by points: ternaries 22 (61 pts), if/else 7 (10 pts) (nesting depth added 42). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · connectionUrlBuilder.buildSpecialJdbcUrl (cognitive 71) · ×1
  • connectionUrlBuilder.buildSpecialJdbcUrl (cognitive 71) apps/desktop/src/lib/connection/connectionUrlBuilder.ts:300 — connectionUrlBuilder.buildSpecialJdbcUrl has cognitive complexity 71 (threshold 15). Drivers by points: ternaries 22 (45 pts), if/else 7 (14 pts), boolean chains 11, match/switch 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 · sqlIntentionActions.buildQualifierActions (cognitive 71) · ×1
  • sqlIntentionActions.buildQualifierActions (cognitive 71) apps/desktop/src/lib/editor/sqlIntentionActions.ts:562 — sqlIntentionActions.buildQualifierActions has cognitive complexity 71 (threshold 15). Drivers by points: if/else 18 (40 pts), ternaries 5 (13 pts), loops 3 (10 pts), boolean chains 8 (nesting depth added 37). Of this number, 70 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · EwkbWktDecoder.parseGeometry (cognitive 70) · ×1
  • EwkbWktDecoder.parseGeometry (cognitive 70) agents/common/src/main/java/com/dbx/agent/EwkbWktDecoder.java:300 — EwkbWktDecoder.parseGeometry has cognitive complexity 70 (threshold 15). Drivers by points: if/else 21 (45 pts), loops 8 (17 pts), ternaries 2 (5 pts), boolean chains 2, match/switch 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 · useExportTracker.useExportTracker (cognitive 70) · ×1
  • useExportTracker.useExportTracker (cognitive 70) apps/desktop/src/composables/useExportTracker.ts:394 — useExportTracker.useExportTracker has cognitive complexity 70 (threshold 15). Drivers by points: if/else 36 (37 pts), boolean chains 29, error handling 3, loops 1 (nesting depth added 1). Of this number, 63 points are the body's own statements and 7 belong to 4 function literals inside it that branch. 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 · useDataGridColumnFilters.useDataGridColumnFilters (cognitive 68) · ×1
  • useDataGridColumnFilters.useDataGridColumnFilters (cognitive 68) apps/desktop/src/composables/useDataGridColumnFilters.ts:64 — useDataGridColumnFilters.useDataGridColumnFilters has cognitive complexity 68 (threshold 15). Drivers by points: if/else 38 (39 pts), boolean chains 17, ternaries 9 (10 pts), loops 1 (2 pts) (nesting depth added 3). Of this number, 47 points are the body's own statements and 21 belong to 14 function literals inside it that branch. 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 · useSidebarTableMutationRuntime.useSidebarTableMutationRuntime (cognitive 67) · ×1
  • useSidebarTableMutationRuntime.useSidebarTableMutationRuntime (cognitive 67) apps/desktop/src/composables/useSidebarTableMutationRuntime.ts:62 — useSidebarTableMutationRuntime.useSidebarTableMutationRuntime has cognitive complexity 67 (threshold 15). Drivers by points: boolean chains 32, if/else 22 (23 pts), ternaries 7, error handling 3, loops 2 (nesting depth added 1). Of this number, 53 points are the body's own statements and 14 belong to 14 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · TableRestoreFilter · ×1
  • TableRestoreFilter::classify (cognitive 66) REDACTED:67 — TableRestoreFilter::classify has cognitive complexity 66 (threshold 15). Drivers by points: if/else 30 (50 pts), boolean chains 11, loops 2 (5 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · openTabsPersistence.serializeOpenTabs (cognitive 66) · ×1
  • openTabsPersistence.serializeOpenTabs (cognitive 66) apps/desktop/src/lib/app/openTabsPersistence.ts:168 — openTabsPersistence.serializeOpenTabs has cognitive complexity 66 (threshold 15). Drivers by points: ternaries 50 (56 pts), boolean chains 10 (nesting depth added 6). Most of this is not in the body itself: 0 of the 66 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 169, 223). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · ddlDisplay.collectDdlStatementNameTargets (cognitive 66) · ×1
  • ddlDisplay.collectDdlStatementNameTargets (cognitive 66) apps/desktop/src/lib/sql/ddlDisplay.ts:205 — ddlDisplay.collectDdlStatementNameTargets has cognitive complexity 66 (threshold 15). Drivers by points: if/else 25 (51 pts), boolean chains 7, loops 3 (5 pts), ternaries 1 (3 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlCompletion.getSqlLexicalContext (cognitive 66) · ×1
  • sqlCompletion.getSqlLexicalContext (cognitive 66) REDACTED:2084 — sqlCompletion.getSqlLexicalContext has cognitive complexity 66 (threshold 15). Drivers by points: if/else 29 (54 pts), boolean chains 11, loops 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 · tableImport.importDataTypeForDatabase (cognitive 66) · ×1
  • tableImport.importDataTypeForDatabase (cognitive 66) apps/desktop/src/lib/table/tableImport.ts:253 — tableImport.importDataTypeForDatabase has cognitive complexity 66 (threshold 15). Drivers by points: if/else 25 (50 pts), boolean chains 15, match/switch 1 (nesting depth added 25). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · sqlStatementRanges.mysqlRoutineTokens (cognitive 65) · ×1
  • sqlStatementRanges.mysqlRoutineTokens (cognitive 65) apps/desktop/src/lib/sql/sqlStatementRanges.ts:1993 — sqlStatementRanges.mysqlRoutineTokens has cognitive complexity 65 (threshold 15). Drivers by points: if/else 23 (56 pts), boolean chains 8, loops 1 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · databaseAuthorizationPlan.buildGrantAuthorizationPlan (cognitive 64) · ×1
  • databaseAuthorizationPlan.buildGrantAuthorizationPlan (cognitive 64) apps/desktop/src/lib/database/databaseAuthorizationPlan.ts:273 — databaseAuthorizationPlan.buildGrantAuthorizationPlan has cognitive complexity 64 (threshold 15). Drivers by points: ternaries 13 (38 pts), if/else 8 (19 pts), loops 3 (6 pts), 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 · etcdSession.history (cognitive 63) · ×1
  • etcdSession.history (cognitive 63) agents/drivers/etcd-go/history.go:39 — etcdSession.history has cognitive complexity 63 (threshold 15). Drivers by points: if/else 29 (52 pts), boolean chains 5, loops 3 (4 pts), match/switch 2 (nesting depth added 24). Of this number, 27 points are the body's own statements and 36 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cellValueTransform.transformCellValue (cognitive 63) · ×1
  • cellValueTransform.transformCellValue (cognitive 63) apps/desktop/src/lib/dataGrid/cellValueTransform.ts:31 — cellValueTransform.transformCellValue has cognitive complexity 63 (threshold 15). Drivers by points: ternaries 12 (29 pts), if/else 12 (24 pts), boolean chains 6, error handling 2 (3 pts), match/switch 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 · connectionUrl.parseConnectionUrl (cognitive 62) · ×1
  • connectionUrl.parseConnectionUrl (cognitive 62) REDACTED:695 — connectionUrl.parseConnectionUrl has cognitive complexity 62 (threshold 15). Drivers by points: ternaries 22 (33 pts), if/else 16, boolean chains 12, error handling 1 (nesting depth added 11). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · main.parseWKBGeometry (cognitive 61) · ×1
  • main.parseWKBGeometry (cognitive 61) agents/drivers/vastbase-go/spatial.go:413 — main.parseWKBGeometry has cognitive complexity 61 (threshold 15). Drivers by points: if/else 19 (40 pts), loops 6 (12 pts), boolean chains 8, match/switch 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 · tableSelectSql.qualifiedTableName (cognitive 61) · ×1
  • tableSelectSql.qualifiedTableName (cognitive 61) apps/desktop/src/lib/table/tableSelectSql.ts:203 — tableSelectSql.qualifiedTableName has cognitive complexity 61 (threshold 15). Drivers by points: if/else 19 (31 pts), ternaries 8 (17 pts), boolean chains 13 (nesting depth added 21). Of this number, 59 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SPNEGORoundTripper.RoundTrip (cognitive 60) · ×1
  • SPNEGORoundTripper.RoundTrip (cognitive 60) agents/go-common/gosasl/http_spnego.go:73 — SPNEGORoundTripper.RoundTrip has cognitive complexity 60 (threshold 15). Drivers by points: if/else 23 (55 pts), boolean chains 4, loops 1 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · documentStoreProvider.rewriteUnsafeIntegerTokens (cognitive 60) · ×1
  • documentStoreProvider.rewriteUnsafeIntegerTokens (cognitive 60) apps/desktop/src/lib/app/documentStoreProvider.ts:755 — documentStoreProvider.rewriteUnsafeIntegerTokens has cognitive complexity 60 (threshold 15). Drivers by points: if/else 13 (36 pts), loops 5 (16 pts), boolean chains 4, error handling 1 (4 pts) (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · schemaDiff.stripSqlCommentsAndStringLiterals (cognitive 60) · ×1
  • schemaDiff.stripSqlCommentsAndStringLiterals (cognitive 60) apps/desktop/src/lib/schema/schemaDiff.ts:462 — schemaDiff.stripSqlCommentsAndStringLiterals has cognitive complexity 60 (threshold 15). Drivers by points: if/else 21 (46 pts), ternaries 2 (7 pts), boolean chains 6, loops 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · aggregateCombinators.buildCombinatorSequences (cognitive 60) · ×1
  • aggregateCombinators.buildCombinatorSequences (cognitive 60) apps/desktop/src/lib/sql/clickhouse/aggregateCombinators.ts:10 — aggregateCombinators.buildCombinatorSequences has cognitive complexity 60 (threshold 15). Drivers by points: if/else 8 (42 pts), loops 7 (18 pts) (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 · jdbcProperties.parseJdbcProperties (cognitive 59) · ×1
  • jdbcProperties.parseJdbcProperties (cognitive 59) apps/desktop/src/lib/connection/jdbcProperties.ts:39 — jdbcProperties.parseJdbcProperties has cognitive complexity 59 (threshold 15). Drivers by points: if/else 14 (32 pts), loops 7 (16 pts), boolean chains 8, ternaries 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 · server.buildCustomTypeDDL (cognitive 58) · ×1
  • server.buildCustomTypeDDL (cognitive 58) REDACTED:1058 — server.buildCustomTypeDDL has cognitive complexity 58 (threshold 15). Drivers by points: if/else 17 (37 pts), boolean chains 12, loops 4 (8 pts), match/switch 1 (nesting depth added 24). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · main.buildCustomTypeDDL (cognitive 58) · ×1
  • main.buildCustomTypeDDL (cognitive 58) agents/drivers/vastbase-go/vastbase_metadata.go:917 — main.buildCustomTypeDDL has cognitive complexity 58 (threshold 15). Drivers by points: if/else 17 (37 pts), boolean chains 12, loops 4 (8 pts), match/switch 1 (nesting depth added 24). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · useQueryEditorTextActions.useQueryEditorTextActions (cognitive 58) · ×1
  • useQueryEditorTextActions.useQueryEditorTextActions (cognitive 58) apps/desktop/src/components/editor/useQueryEditorTextActions.ts:29 — useQueryEditorTextActions.useQueryEditorTextActions has cognitive complexity 58 (threshold 15). Drivers by points: if/else 30, boolean chains 12, ternaries 4 (10 pts), error handling 5 (6 pts) (nesting depth added 7). Of this number, 56 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · main.rewriteOracleSelectItems (cognitive 57) · ×1
  • main.rewriteOracleSelectItems (cognitive 57) REDACTED:4623 — main.rewriteOracleSelectItems has cognitive complexity 57 (threshold 15). Drivers by points: if/else 16 (46 pts), boolean chains 6, loops 3 (5 pts) (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · useDataGridSearch.useDataGridSearch (cognitive 57) · ×1
  • useDataGridSearch.useDataGridSearch (cognitive 57) apps/desktop/src/composables/useDataGridSearch.ts:38 — useDataGridSearch.useDataGridSearch has cognitive complexity 57 (threshold 15). Drivers by points: if/else 29 (30 pts), ternaries 10 (14 pts), boolean chains 13 (nesting depth added 5). Of this number, 28 points are the body's own statements and 29 belong to 7 function literals inside it that branch. 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 · useFileDrop.useFileDrop (cognitive 57) · ×1
  • useFileDrop.useFileDrop (cognitive 57) apps/desktop/src/composables/useFileDrop.ts:23 — useFileDrop.useFileDrop has cognitive complexity 57 (threshold 15). Drivers by points: if/else 14 (32 pts), error handling 3 (11 pts), loops 3 (6 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 31). Most of this is not in the body itself: 4 of the 57 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 47, 124, 138). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · connectionPickerTree.buildConnectionPickerRows (cognitive 57) · ×1
  • connectionPickerTree.buildConnectionPickerRows (cognitive 57) apps/desktop/src/lib/connection/connectionPickerTree.ts:47 — connectionPickerTree.buildConnectionPickerRows has cognitive complexity 57 (threshold 15). Drivers by points: if/else 18 (46 pts), loops 5 (7 pts), boolean chains 4 (nesting depth added 30). Most of this is not in the body itself: 14 of the 57 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 54, 100, 89). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · sqlParameters.collectComplexTypeFieldSeparatorsInDeclaration (cognitive 57) · ×1
  • sqlParameters.collectComplexTypeFieldSeparatorsInDeclaration (cognitive 57) apps/desktop/src/lib/sql/sqlParameters.ts:1090 — sqlParameters.collectComplexTypeFieldSeparatorsInDeclaration has cognitive complexity 57 (threshold 15). Drivers by points: if/else 20 (48 pts), boolean chains 8, loops 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlFormatter.protectDuckDbPrefixAliasSeparators (cognitive 57) · ×1
  • sqlFormatter.protectDuckDbPrefixAliasSeparators (cognitive 57) apps/desktop/src/lib/sql/sqlFormatter.ts:232 — sqlFormatter.protectDuckDbPrefixAliasSeparators has cognitive complexity 57 (threshold 15). Drivers by points: if/else 12 (32 pts), boolean chains 11, loops 5 (11 pts), ternaries 2 (3 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useQueryEditorCompletionKeys.useQueryEditorCompletionKeys (cognitive 56) · ×1
  • useQueryEditorCompletionKeys.useQueryEditorCompletionKeys (cognitive 56) apps/desktop/src/components/editor/useQueryEditorCompletionKeys.ts:25 — useQueryEditorCompletionKeys.useQueryEditorCompletionKeys has cognitive complexity 56 (threshold 15). Drivers by points: if/else 35 (40 pts), boolean chains 14, ternaries 2 (nesting depth added 5). Of this number, 45 points are the body's own statements and 11 belong to 3 function literals inside it that branch. 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 · useNavigationTargets.openTableTarget (cognitive 56) · ×1
  • useNavigationTargets.openTableTarget (cognitive 56) apps/desktop/src/composables/useNavigationTargets.ts:55 — useNavigationTargets.openTableTarget has cognitive complexity 56 (threshold 15). Drivers by points: if/else 23 (31 pts), boolean chains 18, error handling 3 (4 pts), ternaries 2 (3 pts) (nesting depth added 10). Of this number, 54 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ai.buildAiContext (cognitive 56) · ×1
  • ai.buildAiContext (cognitive 56) apps/desktop/src/lib/ai/ai.ts:821 — ai.buildAiContext has cognitive complexity 56 (threshold 15). Drivers by points: if/else 12 (28 pts), ternaries 4 (11 pts), loops 4 (8 pts), boolean chains 5, error handling 2 (4 pts) (nesting depth added 29). Of this number, 51 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · kvValueFormat.validateKvValue (cognitive 56) · ×1
  • kvValueFormat.validateKvValue (cognitive 56) apps/desktop/src/lib/kv/kvValueFormat.ts:33 — kvValueFormat.validateKvValue has cognitive complexity 56 (threshold 15). Drivers by points: if/else 22 (39 pts), boolean chains 10, ternaries 1 (3 pts), error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 21). Of this number, 45 points are the body's own statements and 11 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sidebarLayoutMonitor.createSidebarLayoutMonitor (cognitive 56) · ×1
  • sidebarLayoutMonitor.createSidebarLayoutMonitor (cognitive 56) apps/desktop/src/lib/sidebar/sidebarLayoutMonitor.ts:639 — sidebarLayoutMonitor.createSidebarLayoutMonitor has cognitive complexity 56 (threshold 15). Drivers by points: if/else 41 (45 pts), boolean chains 6, loops 3, error handling 1, ternaries 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · installBridge (cognitive 56) · ×1
  • installBridge (cognitive 56) REDACTED:2 — installBridge has cognitive complexity 56 (threshold 15). Drivers by points: if/else 20 (23 pts), boolean chains 15, loops 7 (12 pts), error handling 2 (3 pts), ternaries 3 (nesting depth added 9). Most of this is not in the body itself: 0 of the 56 points are its own statements and the rest belongs to 42 function items inside it that branch ((anonymous), stream::start::onEvent, applyTheme, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · proxyManager.rewriteJSON (cognitive 55) · ×1
  • proxyManager.rewriteJSON (cognitive 55) REDACTED:462 — proxyManager.rewriteJSON has cognitive complexity 55 (threshold 15). Drivers by points: if/else 10 (34 pts), loops 6 (16 pts), boolean chains 4, match/switch 1 (nesting depth added 34). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · sqlStatementRanges.splitStatementRangeAtSoftStarts (cognitive 55) · ×1
  • sqlStatementRanges.splitStatementRangeAtSoftStarts (cognitive 55) apps/desktop/src/lib/sql/sqlStatementRanges.ts:766 — sqlStatementRanges.splitStatementRangeAtSoftStarts has cognitive complexity 55 (threshold 15). Drivers by points: if/else 21 (37 pts), boolean chains 13, ternaries 2 (3 pts), loops 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · queryEditorSqlExtensions.configureQueryEditorSqlExtensions (cognitive 55) · ×1
  • queryEditorSqlExtensions.configureQueryEditorSqlExtensions (cognitive 55) apps/desktop/src/components/editor/queryEditorSqlExtensions.ts:57 — queryEditorSqlExtensions.configureQueryEditorSqlExtensions has cognitive complexity 55 (threshold 15). Drivers by points: if/else 17 (27 pts), boolean chains 21, loops 3 (6 pts), ternaries 1 (nesting depth added 13). Of this number, 28 points are the body's own statements and 27 belong to 13 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useExternalSqlFileChanges.useExternalSqlFileChanges (cognitive 55) · ×1
  • useExternalSqlFileChanges.useExternalSqlFileChanges (cognitive 55) apps/desktop/src/composables/useExternalSqlFileChanges.ts:66 — useExternalSqlFileChanges.useExternalSqlFileChanges has cognitive complexity 55 (threshold 15). Drivers by points: if/else 31 (37 pts), boolean chains 12, error handling 5 (6 pts) (nesting depth added 7). Of this number, 48 points are the body's own statements and 7 belong to 3 function literals inside it that branch. 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 · JsonRpcServer.dispatch (cognitive 54) · ×1
  • JsonRpcServer.dispatch (cognitive 54) agents/common/src/main/java/com/dbx/agent/JsonRpcServer.java:183 — JsonRpcServer.dispatch has cognitive complexity 54 (threshold 15). Drivers by points: if/else 39 (43 pts), ternaries 2 (6 pts), error handling 1 (3 pts), boolean chains 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.
D2 · Cognitive Complexity · server.listConstraints (cognitive 54) · ×1
  • server.listConstraints (cognitive 54) REDACTED:2354 — server.listConstraints has cognitive complexity 54 (threshold 15). Drivers by points: if/else 19 (40 pts), loops 5 (8 pts), boolean chains 6 (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 · useDataGridColumnLayout.useDataGridColumnLayoutState (cognitive 54) · ×1
  • useDataGridColumnLayout.useDataGridColumnLayoutState (cognitive 54) apps/desktop/src/composables/useDataGridColumnLayout.ts:107 — useDataGridColumnLayout.useDataGridColumnLayoutState has cognitive complexity 54 (threshold 15). Drivers by points: if/else 39 (43 pts), boolean chains 9, ternaries 2 (nesting depth added 4). Of this number, 47 points are the body's own statements and 7 belong to 5 function literals inside it that branch. 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 · sqlParameters.collectDuckDbStructFieldSeparators (cognitive 54) · ×1
  • sqlParameters.collectDuckDbStructFieldSeparators (cognitive 54) apps/desktop/src/lib/sql/sqlParameters.ts:777 — sqlParameters.collectDuckDbStructFieldSeparators has cognitive complexity 54 (threshold 15). Drivers by points: if/else 18 (36 pts), ternaries 2 (7 pts), boolean chains 6, loops 2 (5 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · seo.auditPages (cognitive 54) · ×1
  • seo.auditPages (cognitive 54) docs/scripts/seo.mjs:84 — seo.auditPages has cognitive complexity 54 (threshold 15). Drivers by points: if/else 16 (36 pts), boolean chains 9, loops 4 (9 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server.listConstraints (cognitive 53) · ×1
  • server.listConstraints (cognitive 53) agents/drivers/vastbase-go/vastbase_metadata.go:1524 — server.listConstraints has cognitive complexity 53 (threshold 15). Drivers by points: if/else 20 (41 pts), loops 5 (8 pts), boolean chains 4 (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 · main.applyJavaDriverHOCON (cognitive 52) · ×1
  • main.applyJavaDriverHOCON (cognitive 52) agents/drivers/cassandra-go/config_file.go:49 — main.applyJavaDriverHOCON has cognitive complexity 52 (threshold 15). Drivers by points: if/else 42 (50 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · main.parseConnectionConfig (cognitive 52) · ×1
  • main.parseConnectionConfig (cognitive 52) agents/drivers/iotdb/driver.go:86 — main.parseConnectionConfig has cognitive complexity 52 (threshold 15). Drivers by points: if/else 28 (45 pts), boolean chains 3, loops 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server.listObjects (cognitive 52) · ×1
  • server.listObjects (cognitive 52) REDACTED:2213 — server.listObjects has cognitive complexity 52 (threshold 15). Drivers by points: if/else 15 (39 pts), loops 3 (10 pts), boolean chains 3 (nesting depth added 31). Of this number, 46 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · useQueryEditorDocumentState.useQueryEditorDocumentState (cognitive 52) · ×1
  • useQueryEditorDocumentState.useQueryEditorDocumentState (cognitive 52) apps/desktop/src/components/editor/useQueryEditorDocumentState.ts:43 — useQueryEditorDocumentState.useQueryEditorDocumentState has cognitive complexity 52 (threshold 15). Drivers by points: if/else 35 (40 pts), boolean chains 11, ternaries 1 (nesting depth added 5). Of this number, 38 points are the body's own statements and 14 belong to 6 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · useDataGridCellDetailEdit.useDataGridCellDetailEdit (cognitive 52) · ×1
  • useDataGridCellDetailEdit.useDataGridCellDetailEdit (cognitive 52) apps/desktop/src/composables/useDataGridCellDetailEdit.ts:34 — useDataGridCellDetailEdit.useDataGridCellDetailEdit has cognitive complexity 52 (threshold 15). Drivers by points: if/else 27, boolean chains 24, ternaries 1. Of this number, 39 points are the body's own statements and 13 belong to 7 function literals inside it that branch. 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 · useScheduledDatabaseBackups.useScheduledDatabaseBackups (cognitive 52) · ×1
  • useScheduledDatabaseBackups.useScheduledDatabaseBackups (cognitive 52) apps/desktop/src/composables/useScheduledDatabaseBackups.ts:22 — useScheduledDatabaseBackups.useScheduledDatabaseBackups has cognitive complexity 52 (threshold 15). Drivers by points: if/else 15 (24 pts), ternaries 4 (16 pts), boolean chains 10, loops 2 (nesting depth added 21). Of this number, 49 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · dataGridCellCoercion.parsePostgresArrayText (cognitive 52) · ×1
  • dataGridCellCoercion.parsePostgresArrayText (cognitive 52) apps/desktop/src/lib/dataGrid/dataGridCellCoercion.ts:347 — dataGridCellCoercion.parsePostgresArrayText has cognitive complexity 52 (threshold 15). Drivers by points: if/else 17 (32 pts), loops 6 (14 pts), boolean chains 6 (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 · DdlBuilder.buildTableDdl (cognitive 51) · ×1
  • DdlBuilder.buildTableDdl (cognitive 51) agents/common/src/main/java/com/dbx/agent/DdlBuilder.java:77 — DdlBuilder.buildTableDdl has cognitive complexity 51 (threshold 15). Drivers by points: if/else 14 (27 pts), loops 9 (13 pts), ternaries 5 (10 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mongoCompletion.scanMongoCallArguments (cognitive 51) · ×1
  • mongoCompletion.scanMongoCallArguments (cognitive 51) REDACTED:601 — mongoCompletion.scanMongoCallArguments has cognitive complexity 51 (threshold 15). Drivers by points: if/else 14 (32 pts), ternaries 3 (10 pts), boolean chains 8, loops 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 · mongoShellCommand.validateBulkWriteOperations (cognitive 51) · ×1
  • mongoShellCommand.validateBulkWriteOperations (cognitive 51) apps/desktop/src/lib/mongo/mongoShellCommand.ts:1800 — mongoShellCommand.validateBulkWriteOperations has cognitive complexity 51 (threshold 15). Drivers by points: if/else 17 (38 pts), boolean chains 5, ternaries 1 (4 pts), loops 2 (3 pts), error handling 1 (nesting depth added 25). Of this number, 50 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sidebarSearchTree.mergeSidebarRegexIndexScopes (cognitive 51) · ×1
  • sidebarSearchTree.mergeSidebarRegexIndexScopes (cognitive 51) apps/desktop/src/lib/sidebar/sidebarSearchTree.ts:242 — sidebarSearchTree.mergeSidebarRegexIndexScopes has cognitive complexity 51 (threshold 15). Drivers by points: if/else 14 (29 pts), loops 8 (10 pts), ternaries 5 (9 pts), boolean chains 3 (nesting depth added 21). Of this number, 37 points are the body's own statements and 14 belong to 6 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tableTree.buildSimpleObjectTreeNodes (cognitive 51) · ×1
  • tableTree.buildSimpleObjectTreeNodes (cognitive 51) apps/desktop/src/lib/table/tableTree.ts:652 — tableTree.buildSimpleObjectTreeNodes has cognitive complexity 51 (threshold 15). Drivers by points: ternaries 10 (29 pts), boolean chains 12, if/else 5 (9 pts), loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DriversClient.DriversClient (cognitive 51) · ×1
  • DriversClient.DriversClient (cognitive 51) docs/app/[lang]/drivers/DriversClient.tsx:137 — DriversClient.DriversClient has cognitive complexity 51 (threshold 15). Drivers by points: ternaries 11 (27 pts), boolean chains 14, if/else 5 (8 pts), loops 2 (nesting depth added 19). Of this number, 37 points are the body's own statements and 14 belong to 5 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · etcdSession.leaseList (cognitive 50) · ×1
  • etcdSession.leaseList (cognitive 50) agents/drivers/etcd-go/lease.go:38 — etcdSession.leaseList has cognitive complexity 50 (threshold 15). Drivers by points: if/else 22 (38 pts), loops 4 (7 pts), boolean chains 4, jumps 1 (nesting depth added 19). Of this number, 44 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useCellDetailEditor.useCellDetailEditor (cognitive 50) · ×1
  • useCellDetailEditor.useCellDetailEditor (cognitive 50) apps/desktop/src/composables/useCellDetailEditor.ts:74 — useCellDetailEditor.useCellDetailEditor has cognitive complexity 50 (threshold 15). Drivers by points: if/else 28, boolean chains 11, ternaries 10 (11 pts) (nesting depth added 1). Of this number, 33 points are the body's own statements and 17 belong to 7 function literals inside it that branch. 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 · mongoShellCommand.mongoTopLevelCommandLineStarts (cognitive 50) · ×1
  • mongoShellCommand.mongoTopLevelCommandLineStarts (cognitive 50) apps/desktop/src/lib/mongo/mongoShellCommand.ts:1469 — mongoShellCommand.mongoTopLevelCommandLineStarts has cognitive complexity 50 (threshold 15). Drivers by points: if/else 17 (36 pts), boolean chains 12, loops 1, ternaries 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 · TdengineDriver · ×1
  • TdengineDriver::completion_assistant_search (cognitive 49) agents/drivers/tdengine/src/driver.rs:232 — TdengineDriver::completion_assistant_search has cognitive complexity 49 (threshold 15). Drivers by points: if/else 16 (35 pts), loops 4 (9 pts), boolean chains 5 (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 · main.sqlRequiresSessionAffinity (cognitive 49) · ×1
  • main.sqlRequiresSessionAffinity (cognitive 49) agents/drivers/vastbase-go/connection_state.go:47 — main.sqlRequiresSessionAffinity has cognitive complexity 49 (threshold 15). Drivers by points: if/else 10 (30 pts), boolean chains 10, loops 3 (7 pts), match/switch 1 (2 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlStatementRanges.skipBalancedParens (cognitive 49) · ×1
  • sqlStatementRanges.skipBalancedParens (cognitive 49) apps/desktop/src/lib/sql/sqlStatementRanges.ts:1558 — sqlStatementRanges.skipBalancedParens has cognitive complexity 49 (threshold 15). Drivers by points: if/else 18 (43 pts), boolean chains 5, loops 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 · sync-connection-types.validateDescriptor (cognitive 49) · ×1
  • sync-connection-types.validateDescriptor (cognitive 49) scripts/sync-connection-types.mjs:108 — sync-connection-types.validateDescriptor has cognitive complexity 49 (threshold 15). Drivers by points: if/else 25 (31 pts), boolean chains 16, loops 2 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · server.dispatch (cognitive 48) · ×1
  • server.dispatch (cognitive 48) REDACTED:1053 — server.dispatch has cognitive complexity 48 (threshold 15). Drivers by points: if/else 23 (47 pts), match/switch 1 (nesting depth added 24). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · xuguWKBReader.geometry (cognitive 48) · ×1
  • xuguWKBReader.geometry (cognitive 48) agents/drivers/xugu/spatial.go:322 — xuguWKBReader.geometry has cognitive complexity 48 (threshold 15). Drivers by points: if/else 20 (40 pts), match/switch 2 (4 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlStatementRanges.oraclePlSqlTokens (cognitive 48) · ×1
  • sqlStatementRanges.oraclePlSqlTokens (cognitive 48) apps/desktop/src/lib/sql/sqlStatementRanges.ts:2351 — sqlStatementRanges.oraclePlSqlTokens has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (38 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sidebarActiveTabTarget.matchesTarget (cognitive 48) · ×1
  • sidebarActiveTabTarget.matchesTarget (cognitive 48) apps/desktop/src/lib/sidebar/sidebarActiveTabTarget.ts:256 — sidebarActiveTabTarget.matchesTarget has cognitive complexity 48 (threshold 15). Drivers by points: boolean chains 25, if/else 20 (23 pts) (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · sqlCompletion.scanCteDefinitions (cognitive 48) · ×1
  • sqlCompletion.scanCteDefinitions (cognitive 48) REDACTED:3699 — sqlCompletion.scanCteDefinitions has cognitive complexity 48 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 6 (15 pts), boolean chains 8 (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 · startDevelopment (cognitive 48) · ×1
  • startDevelopment (cognitive 48) plugins/sdk/dev-host/runtime.mjs:39 — startDevelopment has cognitive complexity 48 (threshold 15). Drivers by points: if/else 19 (25 pts), boolean chains 10, error handling 3 (7 pts), ternaries 4, loops 1 (2 pts) (nesting depth added 11). Most of this is not in the body itself: 12 of the 48 points are its own statements and the rest belongs to 20 function items inside it that branch ((anonymous), spawnCommand, run, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · main.readOracleTNSAliases (cognitive 47) · ×1
  • main.readOracleTNSAliases (cognitive 47) agents/drivers/oracle-go/tns.go:102 — main.readOracleTNSAliases has cognitive complexity 47 (threshold 15). Drivers by points: if/else 17 (38 pts), loops 3 (8 pts), boolean chains 1 (nesting depth added 26). Of this number, 40 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · sqlSemanticSelectionRanges.collectSqlRanges (cognitive 47) · ×1
  • sqlSemanticSelectionRanges.collectSqlRanges (cognitive 47) apps/desktop/src/lib/editor/sqlSemanticSelectionRanges.ts:331 — sqlSemanticSelectionRanges.collectSqlRanges has cognitive complexity 47 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 9, ternaries 3 (9 pts), loops 4 (nesting depth added 20). Of this number, 43 points are the body's own statements and 4 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · nacosConfigValidation.validateHtml (cognitive 47) · ×1
  • nacosConfigValidation.validateHtml (cognitive 47) apps/desktop/src/lib/nacos/nacosConfigValidation.ts:108 — nacosConfigValidation.validateHtml has cognitive complexity 47 (threshold 15). Drivers by points: if/else 16 (37 pts), boolean chains 5, loops 2 (4 pts), ternaries 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · frontendPlugin.buildPluginConnectionConfig (cognitive 47) · ×1
  • frontendPlugin.buildPluginConnectionConfig (cognitive 47) apps/desktop/src/lib/plugins/frontendPlugin.ts:258 — frontendPlugin.buildPluginConnectionConfig has cognitive complexity 47 (threshold 15). Drivers by points: boolean chains 23, if/else 14 (20 pts), ternaries 2 (3 pts), loops 1 (nesting depth added 7). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · sqlCompletion.collectSqlServerLocalVariables (cognitive 47) · ×1
  • sqlCompletion.collectSqlServerLocalVariables (cognitive 47) REDACTED:2635 — sqlCompletion.collectSqlServerLocalVariables has cognitive complexity 47 (threshold 15). Drivers by points: if/else 11 (32 pts), boolean chains 9, loops 3 (4 pts), ternaries 1 (2 pts) (nesting depth added 23). Of this number, 46 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · useDataGridTableMetadataLoaders.useDataGridTableMetadataLoaders (cognitive 46) · ×1
  • useDataGridTableMetadataLoaders.useDataGridTableMetadataLoaders (cognitive 46) apps/desktop/src/composables/useDataGridTableMetadataLoaders.ts:83 — useDataGridTableMetadataLoaders.useDataGridTableMetadataLoaders has cognitive complexity 46 (threshold 15). Drivers by points: if/else 21 (24 pts), boolean chains 15, error handling 6, ternaries 1 (nesting depth added 3). Of this number, 41 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · columnFormatter.normalizeColumnFormatter (cognitive 46) · ×1
  • columnFormatter.normalizeColumnFormatter (cognitive 46) apps/desktop/src/lib/dataGrid/columnFormatter.ts:234 — columnFormatter.normalizeColumnFormatter has cognitive complexity 46 (threshold 15). Drivers by points: if/else 13 (19 pts), ternaries 7 (14 pts), boolean chains 13 (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 · databaseAuthorizationPlan.buildCreateUserAuthorizationPlan (cognitive 46) · ×1
  • databaseAuthorizationPlan.buildCreateUserAuthorizationPlan (cognitive 46) apps/desktop/src/lib/database/databaseAuthorizationPlan.ts:166 — databaseAuthorizationPlan.buildCreateUserAuthorizationPlan has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 6 (19 pts), if/else 9 (16 pts), loops 3 (7 pts), boolean chains 4 (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 · settingsTransfer.parseSettingsTransferFile (cognitive 46) · ×1
  • settingsTransfer.parseSettingsTransferFile (cognitive 46) apps/desktop/src/lib/settings/settingsTransfer.ts:488 — settingsTransfer.parseSettingsTransferFile has cognitive complexity 46 (threshold 15). Drivers by points: if/else 19 (29 pts), ternaries 6 (7 pts), boolean chains 6, loops 3, 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 · routineParameters.tokenizeXuguRoutineDefinition (cognitive 46) · ×1
  • routineParameters.tokenizeXuguRoutineDefinition (cognitive 46) apps/desktop/src/lib/table/routineParameters.ts:188 — routineParameters.tokenizeXuguRoutineDefinition has cognitive complexity 46 (threshold 15). Drivers by points: if/else 11 (27 pts), loops 4 (10 pts), boolean chains 6, ternaries 1 (3 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cursor.fetchOneDriver (cognitive 45) · ×1
  • cursor.fetchOneDriver (cognitive 45) REDACTED:1047 — cursor.fetchOneDriver has cognitive complexity 45 (threshold 15). Drivers by points: if/else 27 (44 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gosasl.parseChallenge (cognitive 45) · ×1
  • gosasl.parseChallenge (cognitive 45) REDACTED:198 — gosasl.parseChallenge has cognitive complexity 45 (threshold 15). Drivers by points: if/else 12 (35 pts), loops 2 (4 pts), match/switch 1 (4 pts), boolean chains 2 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useComponentUpdates.useComponentUpdates (cognitive 45) · ×1
  • useComponentUpdates.useComponentUpdates (cognitive 45) apps/desktop/src/composables/useComponentUpdates.ts:49 — useComponentUpdates.useComponentUpdates has cognitive complexity 45 (threshold 15). Drivers by points: if/else 25 (27 pts), ternaries 5 (9 pts), boolean chains 4, error handling 2 (3 pts), loops 2 (nesting depth added 7). Of this number, 39 points are the body's own statements and 6 belong to 5 function literals inside it that branch. 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 · useSidebarTreeToolRuntime.useSidebarTreeToolRuntime (cognitive 45) · ×1
  • useSidebarTreeToolRuntime.useSidebarTreeToolRuntime (cognitive 45) apps/desktop/src/composables/useSidebarTreeToolRuntime.ts:18 — useSidebarTreeToolRuntime.useSidebarTreeToolRuntime has cognitive complexity 45 (threshold 15). Drivers by points: if/else 21 (23 pts), boolean chains 18, ternaries 3 (4 pts) (nesting depth added 3). Of this number, 44 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · dataGridConditionHighlight.tokenizeDataGridCondition (cognitive 45) · ×1
  • dataGridConditionHighlight.tokenizeDataGridCondition (cognitive 45) apps/desktop/src/lib/dataGrid/dataGridConditionHighlight.ts:51 — dataGridConditionHighlight.tokenizeDataGridCondition has cognitive complexity 45 (threshold 15). Drivers by points: boolean chains 15, loops 4 (11 pts), if/else 5 (10 pts), ternaries 3 (9 pts) (nesting depth added 18). Of this number, 43 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · redisKeyGrouping.compileRedisGroupGlob (cognitive 45) · ×1
  • redisKeyGrouping.compileRedisGroupGlob (cognitive 45) apps/desktop/src/lib/redis/redisKeyGrouping.ts:42 — redisKeyGrouping.compileRedisGroupGlob has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (25 pts), loops 5 (11 pts), boolean chains 9 (nesting depth added 17). Of this number, 31 points are the body's own statements and 14 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · model.parseCteSources (cognitive 45) · ×1
  • model.parseCteSources (cognitive 45) apps/desktop/src/lib/sql/semantic/model.ts:400 — model.parseCteSources has cognitive complexity 45 (threshold 15). Drivers by points: if/else 12 (26 pts), ternaries 5 (10 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 23). Of this number, 44 points are the body's own statements and 1 belongs to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlCompletion.parsePostgresRegclassPrefix (cognitive 45) · ×1
  • sqlCompletion.parsePostgresRegclassPrefix (cognitive 45) REDACTED:2011 — sqlCompletion.parsePostgresRegclassPrefix has cognitive complexity 45 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 10, loops 4 (8 pts), ternaries 3 (4 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlVariables.replaceReferences (cognitive 45) · ×1
  • sqlVariables.replaceReferences (cognitive 45) apps/desktop/src/lib/sql/sqlVariables.ts:203 — sqlVariables.replaceReferences has cognitive complexity 45 (threshold 15). Drivers by points: if/else 13 (36 pts), boolean chains 5, ternaries 1 (3 pts), loops 1 (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · IssueSubmissionLimiter.fetch (cognitive 45) · ×1
  • IssueSubmissionLimiter.fetch (cognitive 45) docs/worker.ts:539 — IssueSubmissionLimiter.fetch has cognitive complexity 45 (threshold 15). Drivers by points: if/else 16 (26 pts), ternaries 7 (14 pts), boolean chains 4, error handling 1 (nesting depth added 17). Of this number, 29 points are the body's own statements and 16 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · xmlFormat.parseXmlDocument (cognitive 44) · ×1
  • xmlFormat.parseXmlDocument (cognitive 44) apps/desktop/src/lib/common/xmlFormat.ts:37 — xmlFormat.parseXmlDocument has cognitive complexity 44 (threshold 15). Drivers by points: if/else 18 (37 pts), boolean chains 3, ternaries 1 (3 pts), loops 1 (nesting depth added 21). Of this number, 42 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · databaseAuthorizationPlan.postgresDatabaseAuthorizationSteps (cognitive 44) · ×1
  • databaseAuthorizationPlan.postgresDatabaseAuthorizationSteps (cognitive 44) apps/desktop/src/lib/database/databaseAuthorizationPlan.ts:438 — databaseAuthorizationPlan.postgresDatabaseAuthorizationSteps has cognitive complexity 44 (threshold 15). Drivers by points: if/else 9 (19 pts), ternaries 8 (18 pts), loops 3 (7 pts) (nesting depth added 24). Of this number, 42 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · sqlParameters.collectTriggerPseudoRecordFieldStarts (cognitive 44) · ×1
  • sqlParameters.collectTriggerPseudoRecordFieldStarts (cognitive 44) apps/desktop/src/lib/sql/sqlParameters.ts:877 — sqlParameters.collectTriggerPseudoRecordFieldStarts has cognitive complexity 44 (threshold 15). Drivers by points: if/else 16 (35 pts), boolean chains 8, 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 · main.renderXuguIndexPartitionDDL (cognitive 43) · ×1
  • main.renderXuguIndexPartitionDDL (cognitive 43) REDACTED:5219 — main.renderXuguIndexPartitionDDL has cognitive complexity 43 (threshold 15). Drivers by points: if/else 17 (31 pts), loops 4 (8 pts), 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 · useQueryEditorPointer.useQueryEditorPointer (cognitive 43) · ×1
  • useQueryEditorPointer.useQueryEditorPointer (cognitive 43) apps/desktop/src/components/editor/useQueryEditorPointer.ts:24 — useQueryEditorPointer.useQueryEditorPointer has cognitive complexity 43 (threshold 15). Drivers by points: if/else 26 (28 pts), boolean chains 13, ternaries 2 (nesting depth added 2). Of this number, 24 points are the body's own statements and 19 belong to 7 function literals inside it that branch. 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 · frontendPlugin.pluginConnectionFormValues (cognitive 43) · ×1
  • frontendPlugin.pluginConnectionFormValues (cognitive 43) apps/desktop/src/lib/plugins/frontendPlugin.ts:240 — frontendPlugin.pluginConnectionFormValues has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 8 (36 pts), if/else 3 (4 pts), boolean chains 2, loops 1 (nesting depth added 29). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · sqlCompletion.activeSingleQuotedLiteralStart (cognitive 43) · ×1
  • sqlCompletion.activeSingleQuotedLiteralStart (cognitive 43) REDACTED:1950 — sqlCompletion.activeSingleQuotedLiteralStart has cognitive complexity 43 (threshold 15). Drivers by points: if/else 18 (36 pts), boolean chains 6, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IssueSubmissionClient.IssueSubmissionClient (cognitive 43) · ×1
  • IssueSubmissionClient.IssueSubmissionClient (cognitive 43) docs/components/issues/IssueSubmissionClient.tsx:168 — IssueSubmissionClient.IssueSubmissionClient has cognitive complexity 43 (threshold 15). Drivers by points: if/else 14 (15 pts), ternaries 8 (13 pts), boolean chains 11, error handling 4 (nesting depth added 6). Of this number, 39 points are the body's own statements and 4 belong to 4 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · main.pumpLongPollWatch (cognitive 42) · ×1
  • main.pumpLongPollWatch (cognitive 42) agents/drivers/etcd2-go/watch.go:273 — main.pumpLongPollWatch has cognitive complexity 42 (threshold 15). Drivers by points: if/else 18 (35 pts), boolean chains 6, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ddlStorage.stripOceanBaseOracleStorageOptions (cognitive 42) · ×1
  • ddlStorage.stripOceanBaseOracleStorageOptions (cognitive 42) apps/desktop/src/lib/sql/ddlStorage.ts:88 — ddlStorage.stripOceanBaseOracleStorageOptions has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (26 pts), ternaries 3 (9 pts), boolean chains 6, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useMultiDbExecution.useMultiDbExecution (cognitive 42) · ×1
  • useMultiDbExecution.useMultiDbExecution (cognitive 42) apps/desktop/src/composables/useMultiDbExecution.ts:67 — useMultiDbExecution.useMultiDbExecution has cognitive complexity 42 (threshold 15). Drivers by points: if/else 18 (22 pts), boolean chains 11, error handling 4 (5 pts), loops 2 (3 pts), ternaries 1 (nesting depth added 6). Of this number, 41 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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 · usePluginShortcutSort.usePluginShortcutSort (cognitive 42) · ×1
  • usePluginShortcutSort.usePluginShortcutSort (cognitive 42) apps/desktop/src/composables/usePluginShortcutSort.ts:14 — usePluginShortcutSort.usePluginShortcutSort has cognitive complexity 42 (threshold 15). Drivers by points: if/else 19 (25 pts), boolean chains 9, ternaries 2 (7 pts), loops 1 (nesting depth added 11). Of this number, 39 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · explainPlan.parseDamengExplainText (cognitive 42) · ×1
  • explainPlan.parseDamengExplainText (cognitive 42) apps/desktop/src/lib/diagram/explainPlan.ts:75 — explainPlan.parseDamengExplainText has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (27 pts), ternaries 4 (7 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · model.parseRowSourcesAtDepth (cognitive 42) · ×1
  • model.parseRowSourcesAtDepth (cognitive 42) apps/desktop/src/lib/sql/semantic/model.ts:705 — model.parseRowSourcesAtDepth has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (29 pts), loops 4 (8 pts), boolean chains 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 · sqlCompletion.getSqlCompletionContext (cognitive 42) · ×1
  • sqlCompletion.getSqlCompletionContext (cognitive 42) REDACTED:2499 — sqlCompletion.getSqlCompletionContext has cognitive complexity 42 (threshold 15). Drivers by points: boolean chains 22, if/else 5 (9 pts), ternaries 9, loops 2 (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · sqlParameters.collectNativeSqlServerParameters (cognitive 42) · ×1
  • sqlParameters.collectNativeSqlServerParameters (cognitive 42) apps/desktop/src/lib/sql/sqlParameters.ts:1226 — sqlParameters.collectNativeSqlServerParameters has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (35 pts), boolean chains 6, 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 · tableStructureEditorState.parseExtraToColumnExtra (cognitive 42) · ×1
  • tableStructureEditorState.parseExtraToColumnExtra (cognitive 42) apps/desktop/src/lib/table/tableStructureEditorState.ts:803 — tableStructureEditorState.parseExtraToColumnExtra has cognitive complexity 42 (threshold 15). Drivers by points: if/else 21 (38 pts), boolean chains 4 (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 · KafkaAgent.listConsumerGroups (cognitive 41) · ×1
  • KafkaAgent.listConsumerGroups (cognitive 41) agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:1011 — KafkaAgent.listConsumerGroups has cognitive complexity 41 (threshold 15). Drivers by points: loops 8 (15 pts), error handling 4 (11 pts), if/else 4 (8 pts), ternaries 3 (6 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server.getObjectSourceForRelation (cognitive 41) · ×1
  • server.getObjectSourceForRelation (cognitive 41) REDACTED:2608 — server.getObjectSourceForRelation has cognitive complexity 41 (threshold 15). Drivers by points: if/else 23 (36 pts), boolean chains 5 (nesting depth added 13). Of this number, 39 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useDataGenerateSession.streamInsertTable (cognitive 41) · ×1
  • useDataGenerateSession.streamInsertTable (cognitive 41) apps/desktop/src/composables/useDataGenerateSession.ts:161 — useDataGenerateSession.streamInsertTable has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (27 pts), boolean chains 7, error handling 2 (3 pts), loops 2 (3 pts), ternaries 1 (nesting depth added 15). Of this number, 27 points are the body's own statements and 14 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlIntentionActions.tokenizeSelectionIdentifiers (cognitive 41) · ×1
  • sqlIntentionActions.tokenizeSelectionIdentifiers (cognitive 41) apps/desktop/src/lib/editor/sqlIntentionActions.ts:292 — sqlIntentionActions.tokenizeSelectionIdentifiers has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (30 pts), loops 3 (6 pts), boolean chains 5 (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 · redisKeyTree.sortRedisTreeLevelCooperatively (cognitive 41) · ×1
  • redisKeyTree.sortRedisTreeLevelCooperatively (cognitive 41) apps/desktop/src/lib/redis/redisKeyTree.ts:212 — redisKeyTree.sortRedisTreeLevelCooperatively has cognitive complexity 41 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 7 (14 pts), boolean chains 9 (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 · sidebarActiveTabTarget.activeTabSidebarTarget (cognitive 41) · ×1
  • sidebarActiveTabTarget.activeTabSidebarTarget (cognitive 41) apps/desktop/src/lib/sidebar/sidebarActiveTabTarget.ts:110 — sidebarActiveTabTarget.activeTabSidebarTarget has cognitive complexity 41 (threshold 15). Drivers by points: if/else 27 (33 pts), boolean chains 8 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · sqlCompletion.scanSelectListContext (cognitive 41) · ×1
  • sqlCompletion.scanSelectListContext (cognitive 41) REDACTED:2896 — sqlCompletion.scanSelectListContext has cognitive complexity 41 (threshold 15). Drivers by points: if/else 17 (33 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlParameters.collectSelectAssignmentVariables (cognitive 41) · ×1
  • sqlParameters.collectSelectAssignmentVariables (cognitive 41) apps/desktop/src/lib/sql/sqlParameters.ts:1384 — sqlParameters.collectSelectAssignmentVariables has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (30 pts), boolean chains 10, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tableSelectSql.sqlCteVisibilities (cognitive 41) · ×1
  • tableSelectSql.sqlCteVisibilities (cognitive 41) apps/desktop/src/lib/table/tableSelectSql.ts:316 — tableSelectSql.sqlCteVisibilities has cognitive complexity 41 (threshold 15). Drivers by points: if/else 9 (26 pts), boolean chains 9, loops 3 (6 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DbxJdbcPlugin.stripCommentsAndLiterals (cognitive 40) · ×1
  • DbxJdbcPlugin.stripCommentsAndLiterals (cognitive 40) REDACTED:1854 — DbxJdbcPlugin.stripCommentsAndLiterals has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (32 pts), boolean chains 5, ternaries 1 (2 pts), loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.convertObjectKeyedInt64Map (cognitive 40) · ×1
  • main.convertObjectKeyedInt64Map (cognitive 40) REDACTED:403 — main.convertObjectKeyedInt64Map has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 6 (11 pts), boolean chains 9 (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 · dataGridPaintTheme.resolveDataGridPaintTheme (cognitive 40) · ×1
  • dataGridPaintTheme.resolveDataGridPaintTheme (cognitive 40) apps/desktop/src/lib/dataGrid/dataGridPaintTheme.ts:261 — dataGridPaintTheme.resolveDataGridPaintTheme has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 39, loops 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 · sidebarSearchTree.filterSidebarTreeWithMatcher (cognitive 40) · ×1
  • sidebarSearchTree.filterSidebarTreeWithMatcher (cognitive 40) apps/desktop/src/lib/sidebar/sidebarSearchTree.ts:366 — sidebarSearchTree.filterSidebarTreeWithMatcher has cognitive complexity 40 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 13, ternaries 4 (10 pts), loops 1 (nesting depth added 15). Of this number, 32 points are the body's own statements and 8 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · insertValueHints.selectProjectionStarts (cognitive 40) · ×1
  • insertValueHints.selectProjectionStarts (cognitive 40) apps/desktop/src/lib/sql/insertValueHints.ts:222 — insertValueHints.selectProjectionStarts has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (28 pts), boolean chains 11, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · validateRecord (cognitive 40) · ×1
  • validateRecord (cognitive 40) plugins/sdk/dev-host/connections.mjs:13 — validateRecord has cognitive complexity 40 (threshold 15). Drivers by points: boolean chains 16, if/else 10 (16 pts), ternaries 2 (6 pts), loops 1, other 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 · DbxJdbcPlugin.getExplainInfo (cognitive 39) · ×1
  • DbxJdbcPlugin.getExplainInfo (cognitive 39) REDACTED:1475 — DbxJdbcPlugin.getExplainInfo has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (17 pts), error handling 5 (13 pts), loops 2 (5 pts), boolean chains 2, ternaries 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KafkaAgent.brokerEndpoints (cognitive 39) · ×1
  • KafkaAgent.brokerEndpoints (cognitive 39) agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:425 — KafkaAgent.brokerEndpoints has cognitive complexity 39 (threshold 15). Drivers by points: if/else 7 (18 pts), ternaries 4 (8 pts), boolean chains 7, error handling 1 (3 pts), loops 2 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · kerberosConfig.finalize (cognitive 39) · ×1
  • kerberosConfig.finalize (cognitive 39) agents/drivers/cassandra-go/kerberos.go:89 — kerberosConfig.finalize has cognitive complexity 39 (threshold 15). Drivers by points: if/else 24 (35 pts), boolean chains 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 · etcdSession.status (cognitive 39) · ×1
  • etcdSession.status (cognitive 39) agents/drivers/etcd-go/status.go:12 — etcdSession.status has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 6 (13 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.renderXuguTableDDL (cognitive 39) · ×1
  • main.renderXuguTableDDL (cognitive 39) REDACTED:4745 — main.renderXuguTableDDL has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (28 pts), match/switch 2 (5 pts), loops 4, boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.openClient (cognitive 39) · ×1
  • main.openClient (cognitive 39) agents/drivers/zookeeper/connection.go:150 — main.openClient has cognitive complexity 39 (threshold 15). Drivers by points: if/else 21 (31 pts), boolean chains 5, match/switch 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · geometryMapPreview.buildGeometryMapFeatureCollection (cognitive 39) · ×1
  • geometryMapPreview.buildGeometryMapFeatureCollection (cognitive 39) apps/desktop/src/lib/dataGrid/geometryMapPreview.ts:44 — geometryMapPreview.buildGeometryMapFeatureCollection has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (26 pts), loops 3 (6 pts), ternaries 2 (4 pts), boolean chains 3 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · insertValueHints.stepLexState (cognitive 39) · ×1
  • insertValueHints.stepLexState (cognitive 39) apps/desktop/src/lib/sql/insertValueHints.ts:426 — insertValueHints.stepLexState has cognitive complexity 39 (threshold 15). Drivers by points: if/else 19 (27 pts), boolean chains 10, ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.parseConnectionConfig (cognitive 38) · ×1
  • main.parseConnectionConfig (cognitive 38) agents/drivers/hive-go/config.go:145 — main.parseConnectionConfig has cognitive complexity 38 (threshold 15). Drivers by points: if/else 24 (32 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.rewriteNativeConnectionStringSSLMode (cognitive 38) · ×1
  • main.rewriteNativeConnectionStringSSLMode (cognitive 38) agents/drivers/kingbase-go/main.go:1203 — main.rewriteNativeConnectionStringSSLMode has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (31 pts), loops 4 (7 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · rocketMQAgent.listProducers (cognitive 38) · ×1
  • rocketMQAgent.listProducers (cognitive 38) REDACTED:27 — rocketMQAgent.listProducers has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 6 (12 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useDataGridColumnResize.useDataGridColumnResize (cognitive 38) · ×1
  • useDataGridColumnResize.useDataGridColumnResize (cognitive 38) apps/desktop/src/composables/useDataGridColumnResize.ts:50 — useDataGridColumnResize.useDataGridColumnResize has cognitive complexity 38 (threshold 15). Drivers by points: if/else 22 (26 pts), boolean chains 7, ternaries 3, loops 2 (nesting depth added 4). Of this number, 30 points are the body's own statements and 8 belong to 7 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · documentStoreProvider.buildDocumentFilterCondition (cognitive 38) · ×1
  • documentStoreProvider.buildDocumentFilterCondition (cognitive 38) apps/desktop/src/lib/app/documentStoreProvider.ts:538 — documentStoreProvider.buildDocumentFilterCondition has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (23 pts), ternaries 5 (8 pts), boolean chains 6, match/switch 1 (nesting depth added 13). Of this number, 37 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · elk-layout.extractHierarchicalLayoutResult (cognitive 38) · ×1
  • elk-layout.extractHierarchicalLayoutResult (cognitive 38) apps/desktop/src/lib/diagram/elk-layout.ts:321 — elk-layout.extractHierarchicalLayoutResult has cognitive complexity 38 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 11, loops 4 (8 pts), ternaries 3 (4 pts) (nesting depth added 13). Of this number, 26 points are the body's own statements and 12 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mongoShellCommand.splitMongoSemicolonSeparatedSegments (cognitive 38) · ×1
  • mongoShellCommand.splitMongoSemicolonSeparatedSegments (cognitive 38) apps/desktop/src/lib/mongo/mongoShellCommand.ts:1373 — mongoShellCommand.splitMongoSemicolonSeparatedSegments has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (27 pts), boolean chains 10, 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 · PluginPackageInstaller · ×1
  • PluginPackageInstaller::install_bytes_locked (cognitive 37) crates/dbx-plugin-runtime/src/plugins/installer.rs:514 — PluginPackageInstaller::install_bytes_locked has cognitive complexity 37 (threshold 15). Drivers by points: if/else 20 (30 pts), match/switch 2 (3 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PluginManifest · ×1
  • PluginManifest::compatibility (cognitive 37) crates/dbx-plugin-runtime/src/plugins/manifest.rs:1058 — PluginManifest::compatibility has cognitive complexity 37 (threshold 15). Drivers by points: if/else 21 (30 pts), boolean chains 3, match/switch 3, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.parseConnectionConfig (cognitive 37) · ×1
  • main.parseConnectionConfig (cognitive 37) agents/drivers/argo-go/config.go:142 — main.parseConnectionConfig has cognitive complexity 37 (threshold 15). Drivers by points: if/else 23 (31 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server.queryRowsWithOracleValueRewriteIfNeeded (cognitive 37) · ×1
  • server.queryRowsWithOracleValueRewriteIfNeeded (cognitive 37) REDACTED:4213 — server.queryRowsWithOracleValueRewriteIfNeeded has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (34 pts), boolean chains 3 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · geometryPreview.drawGroups (cognitive 37) · ×1
  • geometryPreview.drawGroups (cognitive 37) apps/desktop/src/lib/dataGrid/geometryPreview.ts:135 — geometryPreview.drawGroups has cognitive complexity 37 (threshold 15). Drivers by points: loops 8 (20 pts), if/else 9 (15 pts), boolean chains 2 (nesting depth added 18). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · joinedRowChanges.joinedRowChanges (cognitive 37) · ×1
  • joinedRowChanges.joinedRowChanges (cognitive 37) apps/desktop/src/lib/dataGrid/joinedRowChanges.ts:54 — joinedRowChanges.joinedRowChanges has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (26 pts), ternaries 2 (6 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 22). Of this number, 21 points are the body's own statements and 16 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · model.cteBodyProjectionShape (cognitive 37) · ×1
  • model.cteBodyProjectionShape (cognitive 37) apps/desktop/src/lib/sql/semantic/model.ts:274 — model.cteBodyProjectionShape has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (27 pts), boolean chains 7, loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · model.buildCursorIntent (cognitive 37) · ×1
  • model.buildCursorIntent (cognitive 37) apps/desktop/src/lib/sql/semantic/model.ts:974 — model.buildCursorIntent has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 9 (18 pts), if/else 10, boolean chains 9 (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 · sqlCompletion.extractReferencedTables (cognitive 37) · ×1
  • sqlCompletion.extractReferencedTables (cognitive 37) REDACTED:3414 — sqlCompletion.extractReferencedTables has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 9 (20 pts), boolean chains 8, if/else 4 (8 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlCompletion.buildColumnItems (cognitive 37) · ×1
  • sqlCompletion.buildColumnItems (cognitive 37) REDACTED:4886 — sqlCompletion.buildColumnItems has cognitive complexity 37 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 11, ternaries 8 (10 pts), loops 2 (nesting depth added 8). Of this number, 31 points are the body's own statements and 6 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DbxJdbcPlugin.listObjects (cognitive 36) · ×1
  • DbxJdbcPlugin.listObjects (cognitive 36) REDACTED:2179 — DbxJdbcPlugin.listObjects has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 9, loops 3 (5 pts), error handling 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KafkaAgent.getConsumerGroupSnapshot (cognitive 36) · ×1
  • KafkaAgent.getConsumerGroupSnapshot (cognitive 36) agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:1192 — KafkaAgent.getConsumerGroupSnapshot has cognitive complexity 36 (threshold 15). Drivers by points: loops 9 (15 pts), error handling 4 (9 pts), if/else 4 (6 pts), ternaries 3 (6 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DamengAgent.getExplainInfo (cognitive 36) · ×1
  • DamengAgent.getExplainInfo (cognitive 36) REDACTED:3173 — DamengAgent.getExplainInfo has cognitive complexity 36 (threshold 15). Drivers by points: error handling 6 (14 pts), if/else 9 (14 pts), loops 2 (5 pts), boolean chains 2, 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 · main.hasTopLevelSQLKeyword (cognitive 36) · ×1
  • main.hasTopLevelSQLKeyword (cognitive 36) agents/drivers/kingbase-go/main.go:1799 — main.hasTopLevelSQLKeyword has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (30 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · verify-schema-objects.main (cognitive 36) · ×1
  • verify-schema-objects.main (cognitive 36) REDACTED:10 — verify-schema-objects.main has cognitive complexity 36 (threshold 15). Drivers by points: error handling 7 (13 pts), if/else 11 (12 pts), boolean chains 6, ternaries 3 (4 pts), loops 1 (nesting depth added 8). Of this number, 26 points are the body's own statements and 10 belong to 7 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · http.aiAgentStream (cognitive 36) · ×1
  • http.aiAgentStream (cognitive 36) apps/desktop/src/lib/backend/http.ts:2058 — http.aiAgentStream has cognitive complexity 36 (threshold 15). Drivers by points: if/else 7 (25 pts), error handling 1 (5 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · match-engine.inferRelationships (cognitive 36) · ×1
  • match-engine.inferRelationships (cognitive 36) apps/desktop/src/lib/diagram/match-engine.ts:9 — match-engine.inferRelationships has cognitive complexity 36 (threshold 15). Drivers by points: if/else 6 (21 pts), ternaries 3 (12 pts), loops 2 (3 pts) (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · semanticSelectionRanges.createSemanticSelectionRangeIndex (cognitive 36) · ×1
  • semanticSelectionRanges.createSemanticSelectionRangeIndex (cognitive 36) apps/desktop/src/lib/editor/semanticSelectionRanges.ts:60 — semanticSelectionRanges.createSemanticSelectionRangeIndex has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 10, loops 2, ternaries 2 (nesting depth added 7). Most of this is not in the body itself: 7 of the 36 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 125, 103, 69, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · treeNodeClick.treeNodeRowDoubleClickAction (cognitive 36) · ×1
  • treeNodeClick.treeNodeRowDoubleClickAction (cognitive 36) apps/desktop/src/lib/sidebar/treeNodeClick.ts:160 — treeNodeClick.treeNodeRowDoubleClickAction has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (23 pts), ternaries 3 (8 pts), boolean chains 5 (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 · solrAdmin.buildSolrQuery (cognitive 36) · ×1
  • solrAdmin.buildSolrQuery (cognitive 36) apps/desktop/src/lib/solr/solrAdmin.ts:302 — solrAdmin.buildSolrQuery has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19 (29 pts), boolean chains 4, loops 2, ternaries 1 (nesting depth added 10). Of this number, 31 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OraclePlSqlBlock · ×1
  • OraclePlSqlBlock::is_complete (cognitive 35) crates/dbx-sql-core/src/sql.rs:2604 — OraclePlSqlBlock::is_complete has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (28 pts), boolean chains 4, match/switch 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · rocketMQAgent.listACLs (cognitive 35) · ×1
  • rocketMQAgent.listACLs (cognitive 35) agents/drivers/rocketmq/acl.go:30 — rocketMQAgent.listACLs has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 4 (10 pts), 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 · krb5.newInitiatorClient (cognitive 35) · ×1
  • krb5.newInitiatorClient (cognitive 35) agents/go-common/go-gssapi/krb5/krb5.go:807 — krb5.newInitiatorClient has cognitive complexity 35 (threshold 15). Drivers by points: if/else 17 (32 pts), boolean chains 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · safeJsonFormat.myersDiff (cognitive 35) · ×1
  • safeJsonFormat.myersDiff (cognitive 35) apps/desktop/src/lib/common/safeJsonFormat.ts:301 — safeJsonFormat.myersDiff has cognitive complexity 35 (threshold 15). Drivers by points: loops 6 (11 pts), if/else 6 (10 pts), boolean chains 9, ternaries 2 (5 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · connectionDeepLink.parseConnectionDeepLinkUpdate (cognitive 35) · ×1
  • connectionDeepLink.parseConnectionDeepLinkUpdate (cognitive 35) apps/desktop/src/lib/connection/connectionDeepLink.ts:81 — connectionDeepLink.parseConnectionDeepLinkUpdate has cognitive complexity 35 (threshold 15). Drivers by points: if/else 20 (27 pts), boolean chains 5, loops 2, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dataGridColumnFilter.unwrapOuterParentheses (cognitive 35) · ×1
  • dataGridColumnFilter.unwrapOuterParentheses (cognitive 35) apps/desktop/src/lib/dataGrid/dataGridColumnFilter.ts:85 — dataGridColumnFilter.unwrapOuterParentheses has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (30 pts), boolean chains 3, loops 1, 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 · dataDictionaryExportTask.startDataDictionaryExport (cognitive 35) · ×1
  • dataDictionaryExportTask.startDataDictionaryExport (cognitive 35) apps/desktop/src/lib/docs/dataDictionaryExportTask.ts:36 — dataDictionaryExportTask.startDataDictionaryExport has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 5 (11 pts), boolean chains 7, error handling 2 (3 pts), loops 1 (nesting depth added 12). Most of this is not in the body itself: 1 of the 35 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 43, 91, 67, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · sqlSemanticSelectionRanges.collectExpressionSection (cognitive 35) · ×1
  • sqlSemanticSelectionRanges.collectExpressionSection (cognitive 35) apps/desktop/src/lib/editor/sqlSemanticSelectionRanges.ts:247 — sqlSemanticSelectionRanges.collectExpressionSection has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 6 (7 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 12). Of this number, 33 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · elasticsearchCompletion.inspectJsonBody (cognitive 35) · ×1
  • elasticsearchCompletion.inspectJsonBody (cognitive 35) apps/desktop/src/lib/elasticsearch/elasticsearchCompletion.ts:461 — elasticsearchCompletion.inspectJsonBody has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 8, loops 3 (5 pts), 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 · sqlCompletion.buildForeignKeyRelatedTableItems (cognitive 35) · ×1
  • sqlCompletion.buildForeignKeyRelatedTableItems (cognitive 35) REDACTED:4079 — sqlCompletion.buildForeignKeyRelatedTableItems has cognitive complexity 35 (threshold 15). Drivers by points: if/else 5 (16 pts), boolean chains 8, loops 3 (6 pts), ternaries 4 (5 pts) (nesting depth added 15). Of this number, 25 points are the body's own statements and 10 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlCompletion.buildComparisonValueItems (cognitive 35) · ×1
  • sqlCompletion.buildComparisonValueItems (cognitive 35) REDACTED:4539 — sqlCompletion.buildComparisonValueItems has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 6, loops 2 (3 pts), 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 · historyStore.useHistoryStore (cognitive 35) · ×1
  • historyStore.useHistoryStore (cognitive 35) apps/desktop/src/stores/historyStore.ts:23 — historyStore.useHistoryStore has cognitive complexity 35 (threshold 15). Drivers by points: if/else 19 (22 pts), boolean chains 5, error handling 4 (5 pts), ternaries 3 (nesting depth added 4). Of this number, 33 points are the body's own statements and 2 belong to one function literal inside it that branches. 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 · InputResolver · ×1
  • InputResolver::resolve (cognitive 34) crates/dbx-sql-schema/src/sql_parser/input.rs:74 — InputResolver::resolve has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (9 pts), match/switch 3 (9 pts), 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 · main.applyHOCONAuthentication (cognitive 34) · ×1
  • main.applyHOCONAuthentication (cognitive 34) agents/drivers/cassandra-go/config_file.go:169 — main.applyHOCONAuthentication has cognitive complexity 34 (threshold 15). Drivers by points: if/else 25 (28 pts), loops 2 (3 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · server.getColumns (cognitive 34) · ×1
  • server.getColumns (cognitive 34) REDACTED:2752 — server.getColumns has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (29 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ddlStorage.stripOracleStorageAttributes (cognitive 34) · ×1
  • ddlStorage.stripOracleStorageAttributes (cognitive 34) apps/desktop/src/lib/sql/ddlStorage.ts:213 — ddlStorage.stripOracleStorageAttributes has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 11, ternaries 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useSchemaDiffConfig.useSchemaDiffConfig (cognitive 34) · ×1
  • useSchemaDiffConfig.useSchemaDiffConfig (cognitive 34) apps/desktop/src/composables/useSchemaDiffConfig.ts:67 — useSchemaDiffConfig.useSchemaDiffConfig has cognitive complexity 34 (threshold 15). Drivers by points: if/else 22 (23 pts), loops 3 (5 pts), boolean chains 4, ternaries 2 (nesting depth added 3). Of this number, 33 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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 · safeJsonFormat.decodeJsonSource (cognitive 34) · ×1
  • safeJsonFormat.decodeJsonSource (cognitive 34) apps/desktop/src/lib/common/safeJsonFormat.ts:127 — safeJsonFormat.decodeJsonSource has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (26 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 17). Of this number, 33 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · connectionConfigTransfer.prepareConnectionConfigImport (cognitive 34) · ×1
  • connectionConfigTransfer.prepareConnectionConfigImport (cognitive 34) apps/desktop/src/lib/connection/connectionConfigTransfer.ts:183 — connectionConfigTransfer.prepareConnectionConfigImport has cognitive complexity 34 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 7 (12 pts), boolean chains 5, ternaries 3 (nesting depth added 13). Of this number, 31 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · productionSafety.sqlTargetSafetyText (cognitive 34) · ×1
  • productionSafety.sqlTargetSafetyText (cognitive 34) REDACTED:261 — productionSafety.sqlTargetSafetyText has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 3 (7 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · elasticsearchCompletion.flattenElasticsearchMappingFields (cognitive 34) · ×1
  • elasticsearchCompletion.flattenElasticsearchMappingFields (cognitive 34) apps/desktop/src/lib/elasticsearch/elasticsearchCompletion.ts:232 — elasticsearchCompletion.flattenElasticsearchMappingFields has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (18 pts), ternaries 3 (10 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · diagnostics.leadingUnquotedSqlKeywords (cognitive 34) · ×1
  • diagnostics.leadingUnquotedSqlKeywords (cognitive 34) apps/desktop/src/lib/sql/semantic/diagnostics.ts:86 — diagnostics.leadingUnquotedSqlKeywords has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (20 pts), ternaries 2 (7 pts), loops 2 (4 pts), 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 · sqlCompletion.maskSqlForStructureScan (cognitive 34) · ×1
  • sqlCompletion.maskSqlForStructureScan (cognitive 34) REDACTED:2249 — sqlCompletion.maskSqlForStructureScan has cognitive complexity 34 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 4 (10 pts), boolean chains 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 · sqlRisk.sqlSafetyText (cognitive 34) · ×1
  • sqlRisk.sqlSafetyText (cognitive 34) apps/desktop/src/lib/sql/sqlRisk.ts:152 — sqlRisk.sqlSafetyText has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 3 (7 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · settingsStore.normalizeMcpGlobalPolicy (cognitive 34) · ×1
  • settingsStore.normalizeMcpGlobalPolicy (cognitive 34) apps/desktop/src/stores/settingsStore.ts:172 — settingsStore.normalizeMcpGlobalPolicy has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 21, ternaries 8 (9 pts), if/else 4 (nesting depth added 1). Most of this is not in the body itself: 10 of the 34 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 177, 183, 214, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · json.shellConstructorToExtendedJson (cognitive 34) · ×1
  • json.shellConstructorToExtendedJson (cognitive 34) REDACTED:633 — json.shellConstructorToExtendedJson has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 6 (11 pts), boolean chains 6, match/switch 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 · registerDbxMcpBridge (cognitive 34) · ×1
  • registerDbxMcpBridge (cognitive 34) crates/dbx-ai-provider/assets/pi-mcp-bridge.mjs:47 — registerDbxMcpBridge has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (17 pts), other 8, boolean chains 4, error handling 2, loops 2, ternaries 1 (nesting depth added 3). Most of this is not in the body itself: 8 of the 34 points are its own statements and the rest belongs to 18 function items inside it that branch ((anonymous), request::(anonymous), execute, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · dbx_sqlite_worker · ×1
  • dbx_sqlite_worker::runtime::query_statement (cognitive 33) crates/dbx-sqlite-worker/src/runtime.rs:141 — dbx_sqlite_worker::runtime::query_statement has cognitive complexity 33 (threshold 15). Drivers by points: match/switch 5 (15 pts), if/else 3 (10 pts), loops 2 (7 pts), boolean chains 1 (nesting depth added 22). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · MongoAgent.bulkWriteModel (cognitive 33) · ×1
  • MongoAgent.bulkWriteModel (cognitive 33) agents/drivers/mongodb/src/main/java/com/dbx/agent/mongodb/MongoAgent.java:2073 — MongoAgent.bulkWriteModel has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 2 (6 pts), ternaries 2 (5 pts), match/switch 1 (nesting depth added 20). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · etcd2Session.status (cognitive 33) · ×1
  • etcd2Session.status (cognitive 33) agents/drivers/etcd2-go/status.go:14 — etcd2Session.status has cognitive complexity 33 (threshold 15). Drivers by points: if/else 18 (28 pts), loops 3 (5 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server.completionAssistantSearch (cognitive 33) · ×1
  • server.completionAssistantSearch (cognitive 33) agents/drivers/iotdb/metadata.go:486 — server.completionAssistantSearch has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 5, loops 3 (5 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.skipSQLParenthesized (cognitive 33) · ×1
  • main.skipSQLParenthesized (cognitive 33) agents/drivers/kingbase-go/main.go:1893 — main.skipSQLParenthesized has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (27 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · client.valuesToBytes (cognitive 33) · ×1
  • client.valuesToBytes (cognitive 33) agents/go-common/iotdb-client-go/client/session.go:1131 — client.valuesToBytes has cognitive complexity 33 (threshold 15). Drivers by points: match/switch 9 (26 pts), if/else 2 (6 pts), loops 1 (nesting depth added 21). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · dataGridColumnFilter.splitTopLevelAnd (cognitive 33) · ×1
  • dataGridColumnFilter.splitTopLevelAnd (cognitive 33) apps/desktop/src/lib/dataGrid/dataGridColumnFilter.ts:121 — dataGridColumnFilter.splitTopLevelAnd has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (30 pts), boolean chains 2, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shortcutDisplay.shortcutKeyLabel (cognitive 33) · ×1
  • shortcutDisplay.shortcutKeyLabel (cognitive 33) apps/desktop/src/lib/editor/shortcutDisplay.ts:66 — shortcutDisplay.shortcutKeyLabel has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16, ternaries 8 (15 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · datagripImport.parseJdbcUrl (cognitive 33) · ×1
  • datagripImport.parseJdbcUrl (cognitive 33) apps/desktop/src/lib/imports/datagripImport.ts:133 — datagripImport.parseJdbcUrl has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 4, loops 2 (4 pts), ternaries 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 · redisCommandDocs.commandKeySpecs (cognitive 33) · ×1
  • redisCommandDocs.commandKeySpecs (cognitive 33) apps/desktop/src/lib/redis/redisCommandDocs.ts:126 — redisCommandDocs.commandKeySpecs has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (17 pts), ternaries 5 (12 pts), boolean chains 3, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlCompletion.singularTableName (cognitive 33) · ×1
  • sqlCompletion.singularTableName (cognitive 33) REDACTED:5359 — sqlCompletion.singularTableName has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (21 pts), boolean chains 12 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · SshConfigLoader · ×1
  • SshConfigLoader::parse_lines (cognitive 32) crates/dbx-driver-support/src/ssh_config.rs:212 — SshConfigLoader::parse_lines has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 3 (8 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DialectYaml · ×1
  • DialectYaml::build_capability_flags (cognitive 32) REDACTED:539 — DialectYaml::build_capability_flags has cognitive complexity 32 (threshold 15). Drivers by points: if/else 32. 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 · DamengAgent.queryConstrainedTables (cognitive 32) · ×1
  • DamengAgent.queryConstrainedTables (cognitive 32) REDACTED:577 — DamengAgent.queryConstrainedTables has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (24 pts), error handling 5 (7 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DamengAgent.splitTableDdlDefinitions (cognitive 32) · ×1
  • DamengAgent.splitTableDdlDefinitions (cognitive 32) REDACTED:2126 — DamengAgent.splitTableDdlDefinitions has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (30 pts), boolean chains 1, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JdbcConnectionAffinity.sanitizeSql (cognitive 32) · ×1
  • JdbcConnectionAffinity.sanitizeSql (cognitive 32) agents/common/src/main/java/com/dbx/agent/JdbcConnectionAffinity.java:41 — JdbcConnectionAffinity.sanitizeSql has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (27 pts), boolean chains 4, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MultiSessionJsonRpcServer.handleRequest (cognitive 32) · ×1
  • MultiSessionJsonRpcServer.handleRequest (cognitive 32) agents/common/src/main/java/com/dbx/agent/MultiSessionJsonRpcServer.java:129 — MultiSessionJsonRpcServer.handleRequest has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 4 (20 pts), if/else 10, boolean chains 1, error handling 1 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · server.listObjects (cognitive 32) · ×1
  • server.listObjects (cognitive 32) REDACTED:1635 — server.listObjects has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (26 pts), loops 3 (6 pts) (nesting depth added 14). Of this number, 31 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.convertObjectKeyedMap (cognitive 32) · ×1
  • main.convertObjectKeyedMap (cognitive 32) REDACTED:336 — main.convertObjectKeyedMap has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 4 (7 pts), boolean chains 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 · useTauriEvents.useTauriEvents (cognitive 32) · ×1
  • useTauriEvents.useTauriEvents (cognitive 32) apps/desktop/src/composables/useTauriEvents.ts:6 — useTauriEvents.useTauriEvents has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14, error handling 10, loops 5, boolean chains 3. Most of this is not in the body itself: 0 of the 32 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 41, 87, 64, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · explainPlan.parseOracleExplainText (cognitive 32) · ×1
  • explainPlan.parseOracleExplainText (cognitive 32) apps/desktop/src/lib/diagram/explainPlan.ts:161 — explainPlan.parseOracleExplainText has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 6 (10 pts), boolean chains 6, loops 3 (4 pts) (nesting depth added 11). Of this number, 30 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · keyboardShortcuts.matchesShortcut (cognitive 32) · ×1
  • keyboardShortcuts.matchesShortcut (cognitive 32) apps/desktop/src/lib/editor/keyboardShortcuts.ts:142 — keyboardShortcuts.matchesShortcut has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (24 pts), boolean chains 8 (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 · nacosAdmin.normalizeNacosEndpoint (cognitive 32) · ×1
  • nacosAdmin.normalizeNacosEndpoint (cognitive 32) apps/desktop/src/lib/nacos/nacosAdmin.ts:129 — nacosAdmin.normalizeNacosEndpoint has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 5 (11 pts), boolean chains 10, if/else 7 (10 pts), error handling 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 · mysqlRoutineSyntaxDiagnostics.tokenizeMysqlRoutineSql (cognitive 32) · ×1
  • mysqlRoutineSyntaxDiagnostics.tokenizeMysqlRoutineSql (cognitive 32) apps/desktop/src/lib/sql/mysqlRoutineSyntaxDiagnostics.ts:138 — mysqlRoutineSyntaxDiagnostics.tokenizeMysqlRoutineSql has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 4 (14 pts), boolean chains 3, loops 1 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · diagnostics.buildSqlSemanticDiagnostics (cognitive 32) · ×1
  • diagnostics.buildSqlSemanticDiagnostics (cognitive 32) apps/desktop/src/lib/sql/semantic/diagnostics.ts:266 — diagnostics.buildSqlSemanticDiagnostics has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 3, boolean chains 2, ternaries 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlServerQueryWrapping.topLevelSqlTokens (cognitive 32) · ×1
  • sqlServerQueryWrapping.topLevelSqlTokens (cognitive 32) apps/desktop/src/lib/sql/sqlServerQueryWrapping.ts:32 — sqlServerQueryWrapping.topLevelSqlTokens has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 4 (10 pts), boolean chains 8 (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 · sqlVariables.collectDeclarations (cognitive 32) · ×1
  • sqlVariables.collectDeclarations (cognitive 32) apps/desktop/src/lib/sql/sqlVariables.ts:66 — sqlVariables.collectDeclarations has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (27 pts), boolean chains 4, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tableVGroup.normalizeTableVGroupLayout (cognitive 32) · ×1
  • tableVGroup.normalizeTableVGroupLayout (cognitive 32) apps/desktop/src/lib/table/tableVGroup.ts:599 — tableVGroup.normalizeTableVGroupLayout has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 7, ternaries 2 (6 pts), loops 2 (nesting depth added 11). Most of this is not in the body itself: 13 of the 32 points are its own statements and the rest belongs to one function literal inside it that branches (line 617). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · tabPresentation.tabIconClass (cognitive 32) · ×1
  • tabPresentation.tabIconClass (cognitive 32) apps/desktop/src/lib/tabs/tabPresentation.ts:686 — tabPresentation.tabIconClass has cognitive complexity 32 (threshold 15). Drivers by points: if/else 26, boolean chains 6. 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 · json.hasUnclosedMongoDelimiters (cognitive 32) · ×1
  • json.hasUnclosedMongoDelimiters (cognitive 32) REDACTED:305 — json.hasUnclosedMongoDelimiters has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (20 pts), ternaries 2 (7 pts), boolean chains 4, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DamengAgent.isIgnorableDbmsOutputError (cognitive 31) · ×1
  • DamengAgent.isIgnorableDbmsOutputError (cognitive 31) REDACTED:394 — DamengAgent.isIgnorableDbmsOutputError has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (20 pts), loops 4 (8 pts), 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 · cassandraConfig.finalize (cognitive 31) · ×1
  • cassandraConfig.finalize (cognitive 31) agents/drivers/cassandra-go/config.go:452 — cassandraConfig.finalize has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 9 (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 · etcdSession.put (cognitive 31) · ×1
  • etcdSession.put (cognitive 31) agents/drivers/etcd-go/kv.go:229 — etcdSession.put has cognitive complexity 31 (threshold 15). Drivers by points: if/else 18 (25 pts), boolean chains 6 (nesting depth added 7). Of this number, 20 points are the body's own statements and 11 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.parseKingbasePartitionBound (cognitive 31) · ×1
  • main.parseKingbasePartitionBound (cognitive 31) REDACTED:1471 — main.parseKingbasePartitionBound has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (24 pts), match/switch 1 (3 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.isQuerySQL (cognitive 31) · ×1
  • main.isQuerySQL (cognitive 31) agents/drivers/vastbase-go/main.go:1416 — main.isQuerySQL has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 6, loops 3 (5 pts), match/switch 2 (5 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useNavigationTargets.useNavigationTargets (cognitive 31) · ×1
  • useNavigationTargets.useNavigationTargets (cognitive 31) apps/desktop/src/composables/useNavigationTargets.ts:340 — useNavigationTargets.useNavigationTargets has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 9, error handling 3 (6 pts), ternaries 2 (3 pts), loops 1 (nesting depth added 8). Of this number, 28 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dataGridContextMenu.createDataGridColumnContextMenuItems (cognitive 31) · ×1
  • dataGridContextMenu.createDataGridColumnContextMenuItems (cognitive 31) apps/desktop/src/lib/dataGrid/dataGridContextMenu.ts:73 — dataGridContextMenu.createDataGridColumnContextMenuItems has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 6 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · navicatImport.parseConnection (cognitive 31) · ×1
  • navicatImport.parseConnection (cognitive 31) apps/desktop/src/lib/imports/navicatImport.ts:283 — navicatImport.parseConnection has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 15, ternaries 8 (10 pts), if/else 5 (6 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · redisCompletion.argumentTokenItems (cognitive 31) · ×1
  • redisCompletion.argumentTokenItems (cognitive 31) apps/desktop/src/lib/redis/redisCompletion.ts:389 — redisCompletion.argumentTokenItems has cognitive complexity 31 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 7 (12 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 15). Of this number, 24 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · diagnostics.isSqlServerGoSeparatorLine (cognitive 31) · ×1
  • diagnostics.isSqlServerGoSeparatorLine (cognitive 31) apps/desktop/src/lib/sql/semantic/diagnostics.ts:165 — diagnostics.isSqlServerGoSeparatorLine has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 6 (9 pts), boolean chains 8 (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 · sqlCompletion.buildObjectItems (cognitive 31) · ×1
  • sqlCompletion.buildObjectItems (cognitive 31) REDACTED:4168 — sqlCompletion.buildObjectItems has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 16, ternaries 11 (14 pts), if/else 1 (nesting depth added 3). Most of this is not in the body itself: 3 of the 31 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 4175, 4174). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · server.completionAssistantSearch (cognitive 30) · ×1
  • server.completionAssistantSearch (cognitive 30) agents/drivers/neo4j-go/metadata.go:241 — server.completionAssistantSearch has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 5, loops 3 (5 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useQuickOpen.matchQuickOpenText (cognitive 30) · ×1
  • useQuickOpen.matchQuickOpenText (cognitive 30) apps/desktop/src/composables/useQuickOpen.ts:176 — useQuickOpen.matchQuickOpenText has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · http.aiStream (cognitive 30) · ×1
  • http.aiStream (cognitive 30) apps/desktop/src/lib/backend/http.ts:1969 — http.aiStream has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (20 pts), error handling 1 (5 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dataGenerate.findGeneratorKey (cognitive 30) · ×1
  • dataGenerate.findGeneratorKey (cognitive 30) apps/desktop/src/lib/dataGrid/dataGenerate.ts:1197 — dataGenerate.findGeneratorKey has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 9, 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 · dataGridColumnType.resolveDataGridTypeVisualKind (cognitive 30) · ×1
  • dataGridColumnType.resolveDataGridTypeVisualKind (cognitive 30) apps/desktop/src/lib/dataGrid/dataGridColumnType.ts:304 — dataGridColumnType.resolveDataGridTypeVisualKind has cognitive complexity 30 (threshold 15). Drivers by points: if/else 19 (23 pts), boolean chains 7 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · dataGridForeignKeyDisplay.createForeignKeyDisplayRequestCoordinator (cognitive 30) · ×1
  • dataGridForeignKeyDisplay.createForeignKeyDisplayRequestCoordinator (cognitive 30) apps/desktop/src/lib/dataGrid/dataGridForeignKeyDisplay.ts:39 — dataGridForeignKeyDisplay.createForeignKeyDisplayRequestCoordinator has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (18 pts), loops 5, boolean chains 4, ternaries 2 (3 pts) (nesting depth added 7). Most of this is not in the body itself: 8 of the 30 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 60, 71, 49, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · dbAdminSql.buildDuplicateTableStructurePlan (cognitive 30) · ×1
  • dbAdminSql.buildDuplicateTableStructurePlan (cognitive 30) apps/desktop/src/lib/database/dbAdminSql.ts:244 — dbAdminSql.buildDuplicateTableStructurePlan has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 15, if/else 6 (8 pts), ternaries 4 (7 pts) (nesting depth added 5). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · codemirrorCurrentStatementFrameLayer.currentStatementFrameRect (cognitive 30) · ×1
  • codemirrorCurrentStatementFrameLayer.currentStatementFrameRect (cognitive 30) apps/desktop/src/lib/editor/codemirrorCurrentStatementFrameLayer.ts:70 — codemirrorCurrentStatementFrameLayer.currentStatementFrameRect has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 9, ternaries 4 (8 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · diagnostics.updateSqlServerBatchScanState (cognitive 30) · ×1
  • diagnostics.updateSqlServerBatchScanState (cognitive 30) apps/desktop/src/lib/sql/semantic/diagnostics.ts:204 — diagnostics.updateSqlServerBatchScanState has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (22 pts), ternaries 2 (7 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · model.sqlSemanticTableNameSpans (cognitive 30) · ×1
  • model.sqlSemanticTableNameSpans (cognitive 30) apps/desktop/src/lib/sql/semantic/model.ts:155 — model.sqlSemanticTableNameSpans has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 9, loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · queryStore.annotateQueryResultSources (cognitive 30) · ×1
  • queryStore.annotateQueryResultSources (cognitive 30) apps/desktop/src/stores/queryStore.ts:419 — queryStore.annotateQueryResultSources has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 8 (13 pts), if/else 5 (11 pts), boolean chains 5, 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 · DbxJdbcPlugin.readValue (cognitive 29) · ×1
  • DbxJdbcPlugin.readValue (cognitive 29) REDACTED:4299 — DbxJdbcPlugin.readValue has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 6, ternaries 2 (4 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · SpannerAgent.completionAssistantSearch (cognitive 29) · ×1
  • SpannerAgent.completionAssistantSearch (cognitive 29) agents/drivers/spanner/src/main/java/com/dbx/agent/spanner/SpannerAgent.java:344 — SpannerAgent.completionAssistantSearch has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (15 pts), ternaries 2 (6 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dbx_tunnel.run_worker (cognitive 29) · ×1
  • dbx_tunnel.run_worker (cognitive 29) deploy/dbx_tunnel.php:147 — dbx_tunnel.run_worker has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 3, error handling 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 · IoTDBRpcDataSet.getStringByTsBlockColumnIndexAndDataType (cognitive 29) · ×1
  • IoTDBRpcDataSet.getStringByTsBlockColumnIndexAndDataType (cognitive 29) agents/go-common/iotdb-client-go/client/rpcdataset.go:606 — IoTDBRpcDataSet.getStringByTsBlockColumnIndexAndDataType has cognitive complexity 29 (threshold 15). Drivers by points: if/else 18 (28 pts), match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · Tablet.SetValueAt (cognitive 29) · ×1
  • Tablet.SetValueAt (cognitive 29) agents/go-common/iotdb-client-go/client/tablet.go:124 — Tablet.SetValueAt has cognitive complexity 29 (threshold 15). Drivers by points: match/switch 9 (17 pts), if/else 6 (10 pts), boolean chains 2 (nesting depth added 12). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · sqlStatementRanges.statementRangeAtCursor (cognitive 29) · ×1
  • sqlStatementRanges.statementRangeAtCursor (cognitive 29) apps/desktop/src/lib/sql/sqlStatementRanges.ts:674 — sqlStatementRanges.statementRangeAtCursor has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 9, 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 · usePluginShortcutHeight.usePluginShortcutHeight (cognitive 29) · ×1
  • usePluginShortcutHeight.usePluginShortcutHeight (cognitive 29) apps/desktop/src/composables/usePluginShortcutHeight.ts:5 — usePluginShortcutHeight.usePluginShortcutHeight has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 12 (nesting depth added 2). Of this number, 19 points are the body's own statements and 10 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · errorUtils.normalizeBackendErrorAtDepth (cognitive 29) · ×1
  • errorUtils.normalizeBackendErrorAtDepth (cognitive 29) apps/desktop/src/lib/backend/errorUtils.ts:204 — errorUtils.normalizeBackendErrorAtDepth has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 5, error handling 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dataGridSelectionPersistence.captureDataGridSelection (cognitive 29) · ×1
  • dataGridSelectionPersistence.captureDataGridSelection (cognitive 29) apps/desktop/src/lib/dataGrid/dataGridSelectionPersistence.ts:134 — dataGridSelectionPersistence.captureDataGridSelection has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 8 (13 pts), if/else 7 (9 pts), boolean chains 7 (nesting depth added 7). Of this number, 23 points are the body's own statements and 6 belong to 5 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · databaseAuthorizationPlan.databaseAuthorizationsFromTableGrants (cognitive 29) · ×1
  • databaseAuthorizationPlan.databaseAuthorizationsFromTableGrants (cognitive 29) apps/desktop/src/lib/database/databaseAuthorizationPlan.ts:123 — databaseAuthorizationPlan.databaseAuthorizationsFromTableGrants has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 6 (13 pts), boolean chains 6, if/else 3 (6 pts), loops 3 (4 pts) (nesting depth added 11). Of this number, 22 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · explainPlan.parseDamengPlanLine (cognitive 29) · ×1
  • explainPlan.parseDamengPlanLine (cognitive 29) apps/desktop/src/lib/diagram/explainPlan.ts:298 — explainPlan.parseDamengPlanLine has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 2, 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 · explainPlan.buildDamengTree (cognitive 29) · ×1
  • explainPlan.buildDamengTree (cognitive 29) apps/desktop/src/lib/diagram/explainPlan.ts:701 — explainPlan.buildDamengTree has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 9, ternaries 2 (4 pts), loops 3 (nesting depth added 8). Of this number, 27 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · hoverTableSql.parseColumnLine (cognitive 29) · ×1
  • hoverTableSql.parseColumnLine (cognitive 29) apps/desktop/src/lib/editor/hoverTableSql.ts:549 — hoverTableSql.parseColumnLine has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 4 (7 pts), boolean chains 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 · sqlIntentionActions.resolveNavigationTarget (cognitive 29) · ×1
  • sqlIntentionActions.resolveNavigationTarget (cognitive 29) apps/desktop/src/lib/editor/sqlIntentionActions.ts:749 — sqlIntentionActions.resolveNavigationTarget has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (24 pts), boolean chains 4, error handling 1 (nesting depth added 14). Of this number, 18 points are the body's own statements and 11 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · influxDbV1Delete.resolveInfluxDbV1DeleteTarget (cognitive 29) · ×1
  • influxDbV1Delete.resolveInfluxDbV1DeleteTarget (cognitive 29) apps/desktop/src/lib/influxdb/influxDbV1Delete.ts:84 — influxDbV1Delete.resolveInfluxDbV1DeleteTarget has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 5, loops 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · redisCommandDocs.commandArguments (cognitive 29) · ×1
  • redisCommandDocs.commandArguments (cognitive 29) apps/desktop/src/lib/redis/redisCommandDocs.ts:97 — redisCommandDocs.commandArguments has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 11 (22 pts), boolean chains 4, if/else 1 (2 pts), loops 1 (nesting depth added 12). Of this number, 28 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlVariables.readValueEnd (cognitive 29) · ×1
  • sqlVariables.readValueEnd (cognitive 29) apps/desktop/src/lib/sql/sqlVariables.ts:164 — sqlVariables.readValueEnd has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 6, 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 · tableStructureEditorState.isWrappedByOuterParens (cognitive 29) · ×1
  • tableStructureEditorState.isWrappedByOuterParens (cognitive 29) apps/desktop/src/lib/table/tableStructureEditorState.ts:934 — tableStructureEditorState.isWrappedByOuterParens has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 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 · tableTree.coalesceXuguPackageObjects (cognitive 29) · ×1
  • tableTree.coalesceXuguPackageObjects (cognitive 29) apps/desktop/src/lib/table/tableTree.ts:590 — tableTree.coalesceXuguPackageObjects has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (19 pts), ternaries 3 (6 pts), boolean chains 2, loops 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tabPresentation.tabTooltipLines (cognitive 29) · ×1
  • tabPresentation.tabTooltipLines (cognitive 29) apps/desktop/src/lib/tabs/tabPresentation.ts:292 — tabPresentation.tabTooltipLines has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 13, if/else 11 (13 pts), ternaries 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · requireAiRecommendationUpdate (cognitive 29) · ×1
  • requireAiRecommendationUpdate (cognitive 29) plugins/sdk/dev-host/server.mjs:47 — requireAiRecommendationUpdate has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 13, 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 · DegradationChain · ×1
  • DegradationChain::decide (cognitive 28) REDACTED:1335 — DegradationChain::decide has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (27 pts), match/switch 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 · McpGlobalPolicy · ×1
  • McpGlobalPolicy::normalized (cognitive 28) REDACTED:647 — McpGlobalPolicy::normalized has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 4, boolean chains 3, match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MongoAgent.parseDropIndexesValue (cognitive 28) · ×1
  • MongoAgent.parseDropIndexesValue (cognitive 28) agents/drivers/mongodb/src/main/java/com/dbx/agent/mongodb/MongoAgent.java:1501 — MongoAgent.parseDropIndexesValue has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cassandraConfig.clusterConfig (cognitive 28) · ×1
  • cassandraConfig.clusterConfig (cognitive 28) agents/drivers/cassandra-go/config.go:364 — cassandraConfig.clusterConfig has cognitive complexity 28 (threshold 15). Drivers by points: if/else 18 (25 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · etcdSession.readableKeyRanges (cognitive 28) · ×1
  • etcdSession.readableKeyRanges (cognitive 28) agents/drivers/etcd-go/auth.go:39 — etcdSession.readableKeyRanges has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (24 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server.completionAssistantTables (cognitive 28) · ×1
  • server.completionAssistantTables (cognitive 28) REDACTED:1953 — server.completionAssistantTables has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 3, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · rocketMQAgent.viewMessage (cognitive 28) · ×1
  • rocketMQAgent.viewMessage (cognitive 28) REDACTED:149 — rocketMQAgent.viewMessage has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server.completionAssistantSearchTypeMembers (cognitive 28) · ×1
  • server.completionAssistantSearchTypeMembers (cognitive 28) agents/drivers/xugu/type_members.go:163 — server.completionAssistantSearchTypeMembers has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · client.NewIoTDBRpcDataSet (cognitive 28) · ×1
  • client.NewIoTDBRpcDataSet (cognitive 28) agents/go-common/iotdb-client-go/client/rpcdataset.go:56 — client.NewIoTDBRpcDataSet has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (24 pts), loops 3 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlStatementRanges.advanceMysqlRoutineBlockCompleteness (cognitive 28) · ×1
  • sqlStatementRanges.advanceMysqlRoutineBlockCompleteness (cognitive 28) apps/desktop/src/lib/sql/sqlStatementRanges.ts:1931 — sqlStatementRanges.advanceMysqlRoutineBlockCompleteness has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 2, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlStatementRanges.sapHanaScriptBlockIsComplete (cognitive 28) · ×1
  • sqlStatementRanges.sapHanaScriptBlockIsComplete (cognitive 28) apps/desktop/src/lib/sql/sqlStatementRanges.ts:2209 — sqlStatementRanges.sapHanaScriptBlockIsComplete has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (18 pts), ternaries 2 (7 pts), boolean chains 2, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useAppUpdater.compareParsedUpdateVersions (cognitive 28) · ×1
  • useAppUpdater.compareParsedUpdateVersions (cognitive 28) apps/desktop/src/composables/useAppUpdater.ts:49 — useAppUpdater.compareParsedUpdateVersions has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 4 (10 pts), boolean chains 3, loops 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useSchemaDiffSession.runSchemaDiffSession (cognitive 28) · ×1
  • useSchemaDiffSession.runSchemaDiffSession (cognitive 28) apps/desktop/src/composables/useSchemaDiffSession.ts:115 — useSchemaDiffSession.runSchemaDiffSession has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 11, ternaries 10, if/else 6, error handling 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 · aiMessageRender.createAiMessageRenderer (cognitive 28) · ×1
  • aiMessageRender.createAiMessageRenderer (cognitive 28) apps/desktop/src/lib/ai/aiMessageRender.ts:92 — aiMessageRender.createAiMessageRenderer has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 6, ternaries 5 (6 pts), error handling 1 (nesting depth added 3). Of this number, 25 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · dataGridSelectionPersistence.restoreDataGridSelection (cognitive 28) · ×1
  • dataGridSelectionPersistence.restoreDataGridSelection (cognitive 28) apps/desktop/src/lib/dataGrid/dataGridSelectionPersistence.ts:200 — dataGridSelectionPersistence.restoreDataGridSelection has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 7 (10 pts), boolean chains 3, loops 1 (nesting depth added 7). Of this number, 24 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · codemirrorSqlBlockFolding.computeBlockFoldRanges (cognitive 28) · ×1
  • codemirrorSqlBlockFolding.computeBlockFoldRanges (cognitive 28) apps/desktop/src/lib/editor/codemirrorSqlBlockFolding.ts:164 — codemirrorSqlBlockFolding.computeBlockFoldRanges has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 5, ternaries 1 (3 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · redisCommandTable.firstRedisArgvUpper (cognitive 28) · ×1
  • redisCommandTable.firstRedisArgvUpper (cognitive 28) apps/desktop/src/lib/redis/redisCommandTable.ts:463 — redisCommandTable.firstRedisArgvUpper has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 5, loops 3 (5 pts), ternaries 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · redisCommandTokenizer.tokenizeRedisLine (cognitive 28) · ×1
  • redisCommandTokenizer.tokenizeRedisLine (cognitive 28) apps/desktop/src/lib/redis/redisCommandTokenizer.ts:28 — redisCommandTokenizer.tokenizeRedisLine has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 3, loops 3 (nesting depth added 10). Of this number, 27 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlCompletion.currentLineBlockEnd (cognitive 28) · ×1
  • sqlCompletion.currentLineBlockEnd (cognitive 28) REDACTED:2302 — sqlCompletion.currentLineBlockEnd has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 4, loops 3 (4 pts), ternaries 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlCompletion.parseTrailingIdentifierContext (cognitive 28) · ×1
  • sqlCompletion.parseTrailingIdentifierContext (cognitive 28) REDACTED:2758 — sqlCompletion.parseTrailingIdentifierContext has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 5 (9 pts), boolean chains 5, 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 · sqlParameters.findMatchingXmlTagClose (cognitive 28) · ×1
  • sqlParameters.findMatchingXmlTagClose (cognitive 28) apps/desktop/src/lib/sql/sqlParameters.ts:661 — sqlParameters.findMatchingXmlTagClose has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (24 pts), boolean chains 3, 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 · start (cognitive 28) · ×1
  • start (cognitive 28) plugins/sdk/dev-host/sidecar.mjs:99 — start has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (18 pts), error handling 3 (5 pts), boolean chains 3, ternaries 2 (nesting depth added 6). Most of this is not in the body itself: 8 of the 28 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 111, 157, 144, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · DbxJdbcPlugin.getObjectSource (cognitive 27) · ×1
  • DbxJdbcPlugin.getObjectSource (cognitive 27) REDACTED:3989 — DbxJdbcPlugin.getObjectSource has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (21 pts), ternaries 1 (3 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PoolEntry.borrow (cognitive 27) · ×1
  • PoolEntry.borrow (cognitive 27) agents/common/src/main/java/com/dbx/agent/JdbcConnectionPoolRegistry.java:578 — PoolEntry.borrow has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (17 pts), ternaries 2 (6 pts), boolean chains 2, error handling 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 · server.listForeignKeysFromCatalog (cognitive 27) · ×1
  • server.listForeignKeysFromCatalog (cognitive 27) REDACTED:2250 — server.listForeignKeysFromCatalog has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · rocketMQAgent.listTopics (cognitive 27) · ×1
  • rocketMQAgent.listTopics (cognitive 27) REDACTED:32 — rocketMQAgent.listTopics has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 4 (5 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.parseXuguObjectTypeMethod (cognitive 27) · ×1
  • main.parseXuguObjectTypeMethod (cognitive 27) agents/drivers/xugu/type_members.go:324 — main.parseXuguObjectTypeMethod has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (23 pts), boolean chains 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 · sqlStatementRanges.elasticsearchRequestLineCandidates (cognitive 27) · ×1
  • sqlStatementRanges.elasticsearchRequestLineCandidates (cognitive 27) apps/desktop/src/lib/sql/sqlStatementRanges.ts:132 — sqlStatementRanges.elasticsearchRequestLineCandidates has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlFilePreviewLabel.buildDisplayFileNames (cognitive 27) · ×1
  • sqlFilePreviewLabel.buildDisplayFileNames (cognitive 27) apps/desktop/src/components/sql-file/sqlFilePreviewLabel.ts:15 — sqlFilePreviewLabel.buildDisplayFileNames has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 4 (9 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 16). Of this number, 23 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ai.formatSchema (cognitive 27) · ×1
  • ai.formatSchema (cognitive 27) apps/desktop/src/lib/ai/ai.ts:731 — ai.formatSchema has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 7 (14 pts), if/else 5 (7 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 11). Most of this is not in the body itself: 1 of the 27 points is its own statement and the rest belongs to one function literal inside it that branches (line 735). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · documentStoreProvider.parseMongoFilterValueAs (cognitive 27) · ×1
  • documentStoreProvider.parseMongoFilterValueAs (cognitive 27) apps/desktop/src/lib/app/documentStoreProvider.ts:896 — documentStoreProvider.parseMongoFilterValueAs has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 2, error handling 1 (2 pts), match/switch 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · productionSafety.referencedDatabases (cognitive 27) · ×1
  • productionSafety.referencedDatabases (cognitive 27) REDACTED:145 — productionSafety.referencedDatabases has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 4 (7 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · codemirrorSqlDialect.createDbxCodeMirrorSqlDialect (cognitive 27) · ×1
  • codemirrorSqlDialect.createDbxCodeMirrorSqlDialect (cognitive 27) apps/desktop/src/lib/editor/codemirrorSqlDialect.ts:355 — codemirrorSqlDialect.createDbxCodeMirrorSqlDialect has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 13, ternaries 12 (13 pts), if/else 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 · editorThemes.resolveEditorTheme (cognitive 27) · ×1
  • editorThemes.resolveEditorTheme (cognitive 27) apps/desktop/src/lib/editor/editorThemes.ts:682 — editorThemes.resolveEditorTheme has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 8 (24 pts), match/switch 1 (2 pts), if/else 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 · identifierSearch.identifierMatchScore (cognitive 27) · ×1
  • identifierSearch.identifierMatchScore (cognitive 27) apps/desktop/src/lib/sql/identifierSearch.ts:7 — identifierSearch.identifierMatchScore has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (17 pts), ternaries 3 (7 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · completion.sqlCompletionContextFromSemantic (cognitive 27) · ×1
  • completion.sqlCompletionContextFromSemantic (cognitive 27) apps/desktop/src/lib/sql/semantic/completion.ts:337 — completion.sqlCompletionContextFromSemantic has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 13, ternaries 10 (11 pts), if/else 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 · sqlCompletion.computeMatchScore (cognitive 27) · ×1
  • sqlCompletion.computeMatchScore (cognitive 27) REDACTED:5691 — sqlCompletion.computeMatchScore has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (17 pts), ternaries 3 (7 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tableTree.mergeTableTreePageChildren (cognitive 27) · ×1
  • tableTree.mergeTableTreePageChildren (cognitive 27) apps/desktop/src/lib/table/tableTree.ts:430 — tableTree.mergeTableTreePageChildren has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (19 pts), loops 5, boolean chains 3 (nesting depth added 5). Most of this is not in the body itself: 12 of the 27 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 510, 440, 455, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · tableVGroup.reorderTableVGroupEntry (cognitive 27) · ×1
  • tableVGroup.reorderTableVGroupEntry (cognitive 27) apps/desktop/src/lib/table/tableVGroup.ts:230 — tableVGroup.reorderTableVGroupEntry has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (18 pts), ternaries 2 (4 pts), boolean chains 3, loops 2 (nesting depth added 9). Most of this is not in the body itself: 9 of the 27 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 260, 234, 233). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · DbxJdbcPlugin.oracleExplainBindMarkerCount (cognitive 26) · ×1
  • DbxJdbcPlugin.oracleExplainBindMarkerCount (cognitive 26) REDACTED:1638 — DbxJdbcPlugin.oracleExplainBindMarkerCount has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (22 pts), boolean chains 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 · EwkbWktDecoder.geometryToWkt (cognitive 26) · ×1
  • EwkbWktDecoder.geometryToWkt (cognitive 26) agents/common/src/main/java/com/dbx/agent/EwkbWktDecoder.java:489 — EwkbWktDecoder.geometryToWkt has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 6, loops 1 (2 pts), match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · main.withTerminalKeyword (cognitive 26) · ×1
  • main.withTerminalKeyword (cognitive 26) agents/drivers/kingbase-go/main.go:1743 — main.withTerminalKeyword has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 3, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.rewriteNestedOracleSelects (cognitive 26) · ×1
  • main.rewriteNestedOracleSelects (cognitive 26) REDACTED:4403 — main.rewriteNestedOracleSelects has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (21 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.paginateManagementArray (cognitive 26) · ×1
  • main.paginateManagementArray (cognitive 26) REDACTED:318 — main.paginateManagementArray has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 1, loops 1 (nesting depth added 10). Of this number, 20 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server.listObjects (cognitive 26) · ×1
  • server.listObjects (cognitive 26) agents/drivers/vastbase-go/vastbase_metadata.go:1028 — server.listObjects has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 11). Of this number, 25 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useDataCompareSession.runDataCompareSession (cognitive 26) · ×1
  • useDataCompareSession.runDataCompareSession (cognitive 26) apps/desktop/src/composables/useDataCompareSession.ts:334 — useDataCompareSession.runDataCompareSession has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (4 pts), error handling 2 (3 pts), 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 · useDataGridDistinctValueLoader.useDataGridDistinctValueLoader (cognitive 26) · ×1
  • useDataGridDistinctValueLoader.useDataGridDistinctValueLoader (cognitive 26) apps/desktop/src/composables/useDataGridDistinctValueLoader.ts:61 — useDataGridDistinctValueLoader.useDataGridDistinctValueLoader has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 5, loops 3, error handling 1, ternaries 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · documentStoreProvider.translateFieldFilterToElasticsearchQuery (cognitive 26) · ×1
  • documentStoreProvider.translateFieldFilterToElasticsearchQuery (cognitive 26) apps/desktop/src/lib/app/documentStoreProvider.ts:1027 — documentStoreProvider.translateFieldFilterToElasticsearchQuery has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 5, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ltr-auto-layout.orderTablesByConnectivity (cognitive 26) · ×1
  • ltr-auto-layout.orderTablesByConnectivity (cognitive 26) apps/desktop/src/lib/diagram/ltr-auto-layout.ts:40 — ltr-auto-layout.orderTablesByConnectivity has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 7 (8 pts), boolean chains 2 (nesting depth added 9). Of this number, 15 points are the body's own statements and 11 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · soqlCompletion.fieldItems (cognitive 26) · ×1
  • soqlCompletion.fieldItems (cognitive 26) apps/desktop/src/lib/soql/soqlCompletion.ts:420 — soqlCompletion.fieldItems has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 3 (6 pts), boolean chains 5, loops 3 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlAnalysis.findTopLevelKeyword (cognitive 26) · ×1
  • sqlAnalysis.findTopLevelKeyword (cognitive 26) apps/desktop/src/lib/sql/sqlAnalysis.ts:831 — sqlAnalysis.findTopLevelKeyword has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 4, ternaries 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlCompletion.buildJoinConditionItemsForPair (cognitive 26) · ×1
  • sqlCompletion.buildJoinConditionItemsForPair (cognitive 26) REDACTED:5178 — sqlCompletion.buildJoinConditionItemsForPair has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 6, loops 4, ternaries 3 (4 pts) (nesting depth added 5). Of this number, 21 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlParameters.extractSqlParameterDescriptors (cognitive 26) · ×1
  • sqlParameters.extractSqlParameterDescriptors (cognitive 26) apps/desktop/src/lib/sql/sqlParameters.ts:171 — sqlParameters.extractSqlParameterDescriptors has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (7 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 13). Of this number, 20 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlParameters.decodeMyBatisXmlComparisonEntities (cognitive 26) · ×1
  • sqlParameters.decodeMyBatisXmlComparisonEntities (cognitive 26) apps/desktop/src/lib/sql/sqlParameters.ts:317 — sqlParameters.decodeMyBatisXmlComparisonEntities has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (17 pts), ternaries 2 (5 pts), boolean chains 3, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlParameters.collectComplexTypeFieldSeparators (cognitive 26) · ×1
  • sqlParameters.collectComplexTypeFieldSeparators (cognitive 26) apps/desktop/src/lib/sql/sqlParameters.ts:1035 — sqlParameters.collectComplexTypeFieldSeparators has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 3, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · routineParameters.stripXuguSqlComments (cognitive 26) · ×1
  • routineParameters.stripXuguSqlComments (cognitive 26) apps/desktop/src/lib/table/routineParameters.ts:369 — routineParameters.stripXuguSqlComments has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SqlServerLegacyAgent.shouldFallbackToJtds (cognitive 25) · ×1
  • SqlServerLegacyAgent.shouldFallbackToJtds (cognitive 25) agents/drivers/sqlserver-legacy/src/main/java/com/dbx/agent/sqlserverlegacy/SqlServerLegacyAgent.java:206 — SqlServerLegacyAgent.shouldFallbackToJtds has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 10, 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 · server.getTopicConfig (cognitive 25) · ×1
  • server.getTopicConfig (cognitive 25) agents/drivers/rabbitmq/operations.go:208 — server.getTopicConfig has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 1 (5 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · wkbGeometry.wkt (cognitive 25) · ×1
  • wkbGeometry.wkt (cognitive 25) agents/drivers/vastbase-go/spatial.go:218 — wkbGeometry.wkt has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 3 (6 pts), match/switch 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · main.classifyRPCError (cognitive 25) · ×1
  • main.classifyRPCError (cognitive 25) agents/drivers/xugu/protocol_error.go:48 — main.classifyRPCError has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 7, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · backend-errors.translateKnownMessage (cognitive 25) · ×1
  • backend-errors.translateKnownMessage (cognitive 25) apps/desktop/src/i18n/backend-errors.ts:214 — backend-errors.translateKnownMessage has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (17 pts), ternaries 2 (7 pts), loops 1 (nesting depth added 15). Of this number, 21 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · openTabsPersistence.restoreOpenTabsArray (cognitive 25) · ×1
  • openTabsPersistence.restoreOpenTabsArray (cognitive 25) apps/desktop/src/lib/app/openTabsPersistence.ts:254 — openTabsPersistence.restoreOpenTabsArray has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 12 (13 pts), boolean chains 7, if/else 4, error handling 1 (nesting depth added 1). Most of this is not in the body itself: 6 of the 25 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 267, 260, 271). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · queryEditorTableDrop.parseTableReferencePayload (cognitive 25) · ×1
  • queryEditorTableDrop.parseTableReferencePayload (cognitive 25) apps/desktop/src/lib/editor/queryEditorTableDrop.ts:193 — queryEditorTableDrop.parseTableReferencePayload has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 7, ternaries 2, error handling 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 · diagramSvgExport.buildTableDiagramSvg (cognitive 25) · ×1
  • diagramSvgExport.buildTableDiagramSvg (cognitive 25) apps/desktop/src/lib/export/diagramSvgExport.ts:245 — diagramSvgExport.buildTableDiagramSvg has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 6, loops 4 (5 pts) (nesting depth added 7). Of this number, 19 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gridSnapshot.renderGridSnapshotHtml (cognitive 25) · ×1
  • gridSnapshot.renderGridSnapshotHtml (cognitive 25) apps/desktop/src/lib/gridSnapshot/gridSnapshot.ts:128 — gridSnapshot.renderGridSnapshotHtml has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 19 (21 pts), boolean chains 4 (nesting depth added 2). Of this number, 14 points are the body's own statements and 11 belong to 3 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · datagripImport.parseDbForestGroupPaths (cognitive 25) · ×1
  • datagripImport.parseDbForestGroupPaths (cognitive 25) apps/desktop/src/lib/imports/datagripImport.ts:345 — datagripImport.parseDbForestGroupPaths has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 3, loops 2, ternaries 2 (nesting depth added 7). Of this number, 20 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cteNavigation.findCteColumnResolution (cognitive 25) · ×1
  • cteNavigation.findCteColumnResolution (cognitive 25) apps/desktop/src/lib/sql/semantic/cteNavigation.ts:118 — cteNavigation.findCteColumnResolution has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 6, ternaries 2 (3 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlAnalysis.analyzeEditableQueryEditability (cognitive 25) · ×1
  • sqlAnalysis.analyzeEditableQueryEditability (cognitive 25) apps/desktop/src/lib/sql/sqlAnalysis.ts:233 — sqlAnalysis.analyzeEditableQueryEditability has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14, boolean chains 7, ternaries 4. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · sqlCompletion.parseTrailingIdentifierPart (cognitive 25) · ×1
  • sqlCompletion.parseTrailingIdentifierPart (cognitive 25) REDACTED:2808 — sqlCompletion.parseTrailingIdentifierPart has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlServerRoutineSyntaxDiagnostics.tokenizeSqlServerSyntax (cognitive 25) · ×1
  • sqlServerRoutineSyntaxDiagnostics.tokenizeSqlServerSyntax (cognitive 25) apps/desktop/src/lib/sql/sqlServerRoutineSyntaxDiagnostics.ts:150 — sqlServerRoutineSyntaxDiagnostics.tokenizeSqlServerSyntax has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 3, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlParameters.collectDeclareStatementVariables (cognitive 25) · ×1
  • sqlParameters.collectDeclareStatementVariables (cognitive 25) apps/desktop/src/lib/sql/sqlParameters.ts:1304 — sqlParameters.collectDeclareStatementVariables has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 5, 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 · sqlParameters.collectSetStatementVariables (cognitive 25) · ×1
  • sqlParameters.collectSetStatementVariables (cognitive 25) apps/desktop/src/lib/sql/sqlParameters.ts:1344 — sqlParameters.collectSetStatementVariables has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 5, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (sqlParameters.collectExecNamedArgumentStarts) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · sqlParameters.collectRoutineDefinitionVariables (cognitive 25) · ×1
  • sqlParameters.collectRoutineDefinitionVariables (cognitive 25) apps/desktop/src/lib/sql/sqlParameters.ts:1458 — sqlParameters.collectRoutineDefinitionVariables has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 5, 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 · sqlParameters.collectExecNamedArgumentStarts (cognitive 25) · ×1
  • sqlParameters.collectExecNamedArgumentStarts (cognitive 25) apps/desktop/src/lib/sql/sqlParameters.ts:1498 — sqlParameters.collectExecNamedArgumentStarts has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 5, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (sqlParameters.collectSetStatementVariables) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · sqlNavigation.sqlObjectHoverDetail (cognitive 25) · ×1
  • sqlNavigation.sqlObjectHoverDetail (cognitive 25) apps/desktop/src/lib/sql/sqlNavigation.ts:214 — sqlNavigation.sqlObjectHoverDetail has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 8 (24 pts), if/else 1 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · tabPresentation.resultRunSourceLabel (cognitive 25) · ×1
  • tabPresentation.resultRunSourceLabel (cognitive 25) apps/desktop/src/lib/tabs/tabPresentation.ts:511 — tabPresentation.resultRunSourceLabel has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 5 (8 pts), boolean chains 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 · queryStore.appendQueryResultSegment (cognitive 25) · ×1
  • queryStore.appendQueryResultSegment (cognitive 25) apps/desktop/src/stores/queryStore.ts:316 — queryStore.appendQueryResultSegment has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 9 (11 pts), boolean chains 8, if/else 4, loops 2 (nesting depth added 2). Of this number, 21 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · readOnlyUnlockStore.useReadOnlyUnlockStore (cognitive 25) · ×1
  • readOnlyUnlockStore.useReadOnlyUnlockStore (cognitive 25) apps/desktop/src/stores/readOnlyUnlockStore.ts:33 — readOnlyUnlockStore.useReadOnlyUnlockStore has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (18 pts), loops 2 (3 pts), boolean chains 2, error handling 2 (nesting depth added 4). Of this number, 20 points are the body's own statements and 5 belong to 2 function literals inside it that branch. 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 · ContributorsExperience.ContributorsExperience (cognitive 25) · ×1
  • ContributorsExperience.ContributorsExperience (cognitive 25) docs/components/contributors/ContributorsExperience.tsx:190 — ContributorsExperience.ContributorsExperience has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 10 (14 pts), if/else 5 (6 pts), boolean chains 5 (nesting depth added 5). Of this number, 17 points are the body's own statements and 8 belong to 5 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SqlScanner · ×1
  • SqlScanner::step (cognitive 24) crates/dbx-sql-core/src/sql.rs:2039 — SqlScanner::step has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 9, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TranswarpAgent.getColumns (cognitive 24) · ×1
  • TranswarpAgent.getColumns (cognitive 24) REDACTED:199 — TranswarpAgent.getColumns has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 11 (15 pts), boolean chains 5, error handling 2, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MongoAgent.applyAggregateOptions (cognitive 24) · ×1
  • MongoAgent.applyAggregateOptions (cognitive 24) agents/drivers/mongodb/src/main/java/com/dbx/agent/mongodb/MongoAgent.java:676 — MongoAgent.applyAggregateOptions has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (22 pts), loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.materializedViewDDLFromCatalog (cognitive 24) · ×1
  • main.materializedViewDDLFromCatalog (cognitive 24) agents/drivers/cassandra-go/materialized_view.go:253 — main.materializedViewDDLFromCatalog has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (14 pts), loops 5 (8 pts), boolean chains 2 (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 · server.getTableDialectDDL (cognitive 24) · ×1
  • server.getTableDialectDDL (cognitive 24) agents/drivers/iotdb/metadata.go:438 — server.getTableDialectDDL has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.parseHostEndpoint (cognitive 24) · ×1
  • main.parseHostEndpoint (cognitive 24) agents/drivers/kingbase-go/main.go:586 — main.parseHostEndpoint has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 4 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · server.getTablePartitioning (cognitive 24) · ×1
  • server.getTablePartitioning (cognitive 24) REDACTED:1169 — server.getTablePartitioning has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 4, loops 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server.listConstraints (cognitive 24) · ×1
  • server.listConstraints (cognitive 24) REDACTED:2779 — server.listConstraints has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 5, 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 · main.xuguParenthesizedGroups (cognitive 24) · ×1
  • main.xuguParenthesizedGroups (cognitive 24) REDACTED:5695 — main.xuguParenthesizedGroups has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (19 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ddlStorage.oracleStorageClauseEnd (cognitive 24) · ×1
  • ddlStorage.oracleStorageClauseEnd (cognitive 24) apps/desktop/src/lib/sql/ddlStorage.ts:170 — ddlStorage.oracleStorageClauseEnd has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11, ternaries 4 (8 pts), boolean chains 5 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · useDataGridCellDetail.useDataGridCellDetail (cognitive 24) · ×1
  • useDataGridCellDetail.useDataGridCellDetail (cognitive 24) apps/desktop/src/composables/useDataGridCellDetail.ts:8 — useDataGridCellDetail.useDataGridCellDetail has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 7, ternaries 1 (nesting depth added 5). Most of this is not in the body itself: 0 of the 24 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 34, 49, 26, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · index.localeFromLanguageTag (cognitive 24) · ×1
  • index.localeFromLanguageTag (cognitive 24) apps/desktop/src/i18n/index.ts:36 — index.localeFromLanguageTag has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 11 (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 · ai.buildSystemPrompt (cognitive 24) · ×1
  • ai.buildSystemPrompt (cognitive 24) apps/desktop/src/lib/ai/ai.ts:337 — ai.buildSystemPrompt has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 11 (17 pts), if/else 6, 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 · dataGenerate.isWrappedByOuterParens (cognitive 24) · ×1
  • dataGenerate.isWrappedByOuterParens (cognitive 24) apps/desktop/src/lib/dataGrid/dataGenerate.ts:251 — dataGenerate.isWrappedByOuterParens has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 4, 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 · dataGridCellCoercion.coerceDataGridCellValue (cognitive 24) · ×1
  • dataGridCellCoercion.coerceDataGridCellValue (cognitive 24) apps/desktop/src/lib/dataGrid/dataGridCellCoercion.ts:25 — dataGridCellCoercion.coerceDataGridCellValue has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 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 · elasticsearchRequestRisk.uncommentedLines (cognitive 24) · ×1
  • elasticsearchRequestRisk.uncommentedLines (cognitive 24) apps/desktop/src/lib/elasticsearch/elasticsearchRequestRisk.ts:82 — elasticsearchRequestRisk.uncommentedLines has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mongoShellCommand.parseMongoFindCommand (cognitive 24) · ×1
  • mongoShellCommand.parseMongoFindCommand (cognitive 24) apps/desktop/src/lib/mongo/mongoShellCommand.ts:373 — mongoShellCommand.parseMongoFindCommand has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 6, ternaries 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · mongoShellCommand.mongoCommentAwareBodyEnd (cognitive 24) · ×1
  • mongoShellCommand.mongoCommentAwareBodyEnd (cognitive 24) apps/desktop/src/lib/mongo/mongoShellCommand.ts:1556 — mongoShellCommand.mongoCommentAwareBodyEnd has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 7, 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 · pluginMarketplace.comparePrerelease (cognitive 24) · ×1
  • pluginMarketplace.comparePrerelease (cognitive 24) apps/desktop/src/lib/plugins/pluginMarketplace.ts:233 — pluginMarketplace.comparePrerelease has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 2 (6 pts), boolean chains 3, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pluginShortcuts.collectPluginShortcuts (cognitive 24) · ×1
  • pluginShortcuts.collectPluginShortcuts (cognitive 24) apps/desktop/src/lib/plugins/pluginShortcuts.ts:64 — pluginShortcuts.collectPluginShortcuts has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 6, loops 3, ternaries 2 (3 pts) (nesting depth added 6). Of this number, 14 points are the body's own statements and 10 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · schemaDiffTableMapping.reconcileSchemaDiffTableMappings (cognitive 24) · ×1
  • schemaDiffTableMapping.reconcileSchemaDiffTableMappings (cognitive 24) apps/desktop/src/lib/schema/schemaDiffTableMapping.ts:47 — schemaDiffTableMapping.reconcileSchemaDiffTableMappings has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 5, loops 3 (4 pts), ternaries 2 (nesting depth added 8). Of this number, 21 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · solrRequestRisk.uncommentedLines (cognitive 24) · ×1
  • solrRequestRisk.uncommentedLines (cognitive 24) apps/desktop/src/lib/solr/solrRequestRisk.ts:145 — solrRequestRisk.uncommentedLines has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · executableStatementRangeCache.executableStartAfterLeadingDirective (cognitive 24) · ×1
  • executableStatementRangeCache.executableStartAfterLeadingDirective (cognitive 24) apps/desktop/src/lib/sql/executableStatementRangeCache.ts:95 — executableStatementRangeCache.executableStartAfterLeadingDirective has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlCompletion.buildTableItems (cognitive 24) · ×1
  • sqlCompletion.buildTableItems (cognitive 24) REDACTED:4031 — sqlCompletion.buildTableItems has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 9 (13 pts), boolean chains 11 (nesting depth added 4). Most of this is not in the body itself: 0 of the 24 points are its own statements and the rest belongs to one function literal inside it that branches (line 4048). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · sqlCompletion.splitRoutineSignatureParameters (cognitive 24) · ×1
  • sqlCompletion.splitRoutineSignatureParameters (cognitive 24) REDACTED:4211 — sqlCompletion.splitRoutineSignatureParameters has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 4, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlCompletion.completionColumnPrefixCandidates (cognitive 24) · ×1
  • sqlCompletion.completionColumnPrefixCandidates (cognitive 24) REDACTED:4825 — sqlCompletion.completionColumnPrefixCandidates has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tabPresentation.statementExecutionMarkers (cognitive 24) · ×1
  • tabPresentation.statementExecutionMarkers (cognitive 24) apps/desktop/src/lib/tabs/tabPresentation.ts:423 — tabPresentation.statementExecutionMarkers has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 4 (7 pts), boolean chains 4, loops 1 (nesting depth added 7). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · json.isMongoRegexValuePosition (cognitive 24) · ×1
  • json.isMongoRegexValuePosition (cognitive 24) REDACTED:135 — json.isMongoRegexValuePosition has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · database-env.main (cognitive 24) · ×1
  • database-env.main (cognitive 24) scripts/database-env.mjs:526 — database-env.main has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 3 (6 pts), boolean chains 5, ternaries 1 (2 pts), match/switch 1 (nesting depth added 6). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DbxJdbcPlugin.appendInceptorRoutinesFromSystemTables (cognitive 23) · ×1
  • DbxJdbcPlugin.appendInceptorRoutinesFromSystemTables (cognitive 23) REDACTED:2293 — DbxJdbcPlugin.appendInceptorRoutinesFromSystemTables has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 3 (7 pts), boolean chains 3, ternaries 2, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RuntimeServer.handleRuntimeRequest (cognitive 23) · ×1
  • RuntimeServer.handleRuntimeRequest (cognitive 23) agents/drivers/mongodb/src/main/java/com/dbx/agent/mongodb/MongoAgent.java:2500 — RuntimeServer.handleRuntimeRequest has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 3 (12 pts), if/else 9, boolean chains 1, error handling 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 · KafkaAgent.applySecurityProperties (cognitive 23) · ×1
  • KafkaAgent.applySecurityProperties (cognitive 23) agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:515 — KafkaAgent.applySecurityProperties has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 2, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PhysicalConnectionBudget.wrap (cognitive 23) · ×1
  • PhysicalConnectionBudget.wrap (cognitive 23) agents/common/src/main/java/com/dbx/agent/JdbcConnectionPoolRegistry.java:1688 — PhysicalConnectionBudget.wrap has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 7, ternaries 1 (2 pts), 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 · etcdSession.listReadableRanges (cognitive 23) · ×1
  • etcdSession.listReadableRanges (cognitive 23) agents/drivers/etcd-go/kv.go:118 — etcdSession.listReadableRanges has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 4 (5 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · etcd2Session.put (cognitive 23) · ×1
  • etcd2Session.put (cognitive 23) agents/drivers/etcd2-go/kv.go:178 — etcd2Session.put has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (16 pts), 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 · server.listSchemas (cognitive 23) · ×1
  • server.listSchemas (cognitive 23) REDACTED:1547 — server.listSchemas has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.skipXuguTypeQuotedOrComment (cognitive 23) · ×1
  • main.skipXuguTypeQuotedOrComment (cognitive 23) agents/drivers/xugu/type_members.go:524 — main.skipXuguTypeQuotedOrComment has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 3, loops 1 (2 pts), match/switch 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 · server.listTablespaces (cognitive 23) · ×1
  • server.listTablespaces (cognitive 23) REDACTED:1763 — server.listTablespaces has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 2, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server.listTablesByAvailableSources (cognitive 23) · ×1
  • server.listTablesByAvailableSources (cognitive 23) REDACTED:2160 — server.listTablesByAvailableSources has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server.getTableDDL (cognitive 23) · ×1
  • server.getTableDDL (cognitive 23) REDACTED:3753 — server.getTableDDL has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Int32ArrayColumnDecoder.ReadColumn (cognitive 23) · ×1
  • Int32ArrayColumnDecoder.ReadColumn (cognitive 23) agents/go-common/iotdb-client-go/client/column_decoder.go:91 — Int32ArrayColumnDecoder.ReadColumn has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (4 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (Int64ArrayColumnDecoder.ReadColumn) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · Int64ArrayColumnDecoder.ReadColumn (cognitive 23) · ×1
  • Int64ArrayColumnDecoder.ReadColumn (cognitive 23) agents/go-common/iotdb-client-go/client/column_decoder.go:147 — Int64ArrayColumnDecoder.ReadColumn has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (4 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (Int32ArrayColumnDecoder.ReadColumn) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · Server.Serve (cognitive 23) · ×1
  • Server.Serve (cognitive 23) plugins/sdk/go/dbx-plugin-sdk/sdk.go:190 — Server.Serve has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 1 (nesting depth added 11). Of this number, 16 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlStatementRanges.scanSqlServerControlFlow (cognitive 23) · ×1
  • sqlStatementRanges.scanSqlServerControlFlow (cognitive 23) apps/desktop/src/lib/sql/sqlStatementRanges.ts:913 — sqlStatementRanges.scanSqlServerControlFlow has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 5, 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 · sqlStatementRanges.nextSqlWordToken (cognitive 23) · ×1
  • sqlStatementRanges.nextSqlWordToken (cognitive 23) apps/desktop/src/lib/sql/sqlStatementRanges.ts:1492 — sqlStatementRanges.nextSqlWordToken has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (7 pts), boolean chains 4 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffHunkBuilder.buildHunks (cognitive 23) · ×1
  • DiffHunkBuilder.buildHunks (cognitive 23) apps/desktop/src/components/diff/DiffHunkBuilder.ts:390 — DiffHunkBuilder.buildHunks has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useTabScroll.useTabScroll (cognitive 23) · ×1
  • useTabScroll.useTabScroll (cognitive 23) apps/desktop/src/composables/useTabScroll.ts:4 — useTabScroll.useTabScroll has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16, boolean chains 5, ternaries 2. Of this number, 19 points are the body's own statements and 4 belong to 2 function literals inside it that branch. 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 · JsonSourceScanner.readNumberToken (cognitive 23) · ×1
  • JsonSourceScanner.readNumberToken (cognitive 23) apps/desktop/src/lib/common/safeJsonFormat.ts:532 — JsonSourceScanner.readNumberToken has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 3 (6 pts), boolean chains 4 (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 · columnFormatter.formatTemporalValueForExport (cognitive 23) · ×1
  • columnFormatter.formatTemporalValueForExport (cognitive 23) apps/desktop/src/lib/dataGrid/columnFormatter.ts:473 — columnFormatter.formatTemporalValueForExport has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 4 (13 pts), if/else 4 (9 pts), boolean chains 1 (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · dataGenerate.generateTableRowsChunk (cognitive 23) · ×1
  • dataGenerate.generateTableRowsChunk (cognitive 23) apps/desktop/src/lib/dataGrid/dataGenerate.ts:1959 — dataGenerate.generateTableRowsChunk has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (4 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 11). Most of this is not in the body itself: 4 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 1965). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · dataGridCopyExtractor.validateDataGridExtractorOptions (cognitive 23) · ×1
  • dataGridCopyExtractor.validateDataGridExtractorOptions (cognitive 23) apps/desktop/src/lib/dataGrid/dataGridCopyExtractor.ts:203 — dataGridCopyExtractor.validateDataGridExtractorOptions has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 9, if/else 8, ternaries 3 (6 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · codemirrorSqlAliasHighlights.createSqlAliasHighlights (cognitive 23) · ×1
  • codemirrorSqlAliasHighlights.createSqlAliasHighlights (cognitive 23) apps/desktop/src/lib/editor/codemirrorSqlAliasHighlights.ts:11 — codemirrorSqlAliasHighlights.createSqlAliasHighlights has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 7 (nesting depth added 3). Of this number, 20 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · hoverTableSql.reformatHoverDdl (cognitive 23) · ×1
  • hoverTableSql.reformatHoverDdl (cognitive 23) apps/desktop/src/lib/editor/hoverTableSql.ts:767 — hoverTableSql.reformatHoverDdl has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (19 pts), ternaries 2, boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shortcutRegistry.normalizeShortcutSettings (cognitive 23) · ×1
  • shortcutRegistry.normalizeShortcutSettings (cognitive 23) apps/desktop/src/lib/editor/shortcutRegistry.ts:682 — shortcutRegistry.normalizeShortcutSettings has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 5, loops 2, ternaries 2 (nesting depth added 5). Of this number, 15 points are the body's own statements and 8 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FrontendPluginRegistry.listPaletteMenuCommands (cognitive 23) · ×1
  • FrontendPluginRegistry.listPaletteMenuCommands (cognitive 23) apps/desktop/src/lib/plugins/frontendPlugin.ts:124 — FrontendPluginRegistry.listPaletteMenuCommands has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (15 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 14). Of this number, 21 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · javaSerialized.normalizeJavaSerializedValue (cognitive 23) · ×1
  • javaSerialized.normalizeJavaSerializedValue (cognitive 23) apps/desktop/src/lib/redis/codec/javaSerialized.ts:392 — javaSerialized.normalizeJavaSerializedValue has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (14 pts), ternaries 4 (7 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · redisKeyPattern.createRedisKeyPatternMatcher (cognitive 23) · ×1
  • redisKeyPattern.createRedisKeyPatternMatcher (cognitive 23) apps/desktop/src/lib/redis/redisKeyPattern.ts:86 — redisKeyPattern.createRedisKeyPatternMatcher has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 4 (11 pts), if/else 6 (7 pts), error handling 1 (2 pts), loops 2, boolean chains 1 (nesting depth added 9). Most of this is not in the body itself: 0 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 88). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · sidebarTreeArrowNavigation.sidebarTreeArrowAction (cognitive 23) · ×1
  • sidebarTreeArrowNavigation.sidebarTreeArrowAction (cognitive 23) apps/desktop/src/lib/sidebar/sidebarTreeArrowNavigation.ts:16 — sidebarTreeArrowNavigation.sidebarTreeArrowAction has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 2 (4 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · xuguTypeMembers.buildXuguTypeMemberNodes (cognitive 23) · ×1
  • xuguTypeMembers.buildXuguTypeMemberNodes (cognitive 23) apps/desktop/src/lib/sidebar/xuguTypeMembers.ts:12 — xuguTypeMembers.buildXuguTypeMemberNodes has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 3 (8 pts), boolean chains 6, 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 · ddlDisplay.applyDdlDatabaseQualifier (cognitive 23) · ×1
  • ddlDisplay.applyDdlDatabaseQualifier (cognitive 23) apps/desktop/src/lib/sql/ddlDisplay.ts:345 — ddlDisplay.applyDdlDatabaseQualifier has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · insertValueHints.parseInsertClause (cognitive 23) · ×1
  • insertValueHints.parseInsertClause (cognitive 23) apps/desktop/src/lib/sql/insertValueHints.ts:295 — insertValueHints.parseInsertClause has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 6, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · insertValueHints.findEnclosingDollarQuoteStartInText (cognitive 23) · ×1
  • insertValueHints.findEnclosingDollarQuoteStartInText (cognitive 23) apps/desktop/src/lib/sql/insertValueHints.ts:615 — insertValueHints.findEnclosingDollarQuoteStartInText has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 2 (3 pts), boolean chains 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 · sqlAnalysis.analyzeSelectStructureForDisplay (cognitive 23) · ×1
  • sqlAnalysis.analyzeSelectStructureForDisplay (cognitive 23) apps/desktop/src/lib/sql/sqlAnalysis.ts:316 — sqlAnalysis.analyzeSelectStructureForDisplay has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11, ternaries 8, boolean chains 4. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · sqlParameters.parseXmlAttributes (cognitive 23) · ×1
  • sqlParameters.parseXmlAttributes (cognitive 23) apps/desktop/src/lib/sql/sqlParameters.ts:631 — sqlParameters.parseXmlAttributes has cognitive complexity 23 (threshold 15). Drivers by points: loops 6 (11 pts), if/else 5 (10 pts), boolean chains 2 (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · sqlFormatter.formatSqlText (cognitive 23) · ×1
  • sqlFormatter.formatSqlText (cognitive 23) apps/desktop/src/lib/sql/sqlFormatter.ts:333 — sqlFormatter.formatSqlText has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 7 (8 pts), error handling 4 (7 pts) (nesting depth added 6). Of this number, 14 points are the body's own statements and 9 belong to 3 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · routineParameters.parseXuguRoutineParameter (cognitive 23) · ×1
  • routineParameters.parseXuguRoutineParameter (cognitive 23) apps/desktop/src/lib/table/routineParameters.ts:293 — routineParameters.parseXuguRoutineParameter has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 4, ternaries 2, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · tableDataExport.fetchTableDataForExport (cognitive 23) · ×1
  • tableDataExport.fetchTableDataForExport (cognitive 23) apps/desktop/src/lib/table/tableDataExport.ts:28 — tableDataExport.fetchTableDataForExport has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 4, error handling 1 (2 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · transferTaskStore.normalizeTask (cognitive 23) · ×1
  • transferTaskStore.normalizeTask (cognitive 23) apps/desktop/src/stores/transferTaskStore.ts:63 — transferTaskStore.normalizeTask has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 12, if/else 5 (7 pts), loops 1 (2 pts), ternaries 2 (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ai-html-runtime-canary.main (cognitive 23) · ×1
  • ai-html-runtime-canary.main (cognitive 23) scripts/ai-html-runtime-canary.mjs:174 — ai-html-runtime-canary.main has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 2, boolean chains 1, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · verify-plugin-cli-package.verifyDev (cognitive 23) · ×1
  • verify-plugin-cli-package.verifyDev (cognitive 23) scripts/verify-plugin-cli-package.mjs:132 — verify-plugin-cli-package.verifyDev has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 3, error handling 1 (3 pts) (nesting depth added 6). Of this number, 12 points are the body's own statements and 11 belong to 4 function literals inside it that branch. 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 · DbxJdbcPlugin.oracleListIndexes (cognitive 22) · ×1
  • DbxJdbcPlugin.oracleListIndexes (cognitive 22) REDACTED:3924 — DbxJdbcPlugin.oracleListIndexes has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (10 pts), error handling 3 (5 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DamengAgent.queryConstrainedObjectsWithoutValidity (cognitive 22) · ×1
  • DamengAgent.queryConstrainedObjectsWithoutValidity (cognitive 22) REDACTED:1148 — DamengAgent.queryConstrainedObjectsWithoutValidity has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (14 pts), error handling 5 (7 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JdbcExecutor.executePage (cognitive 22) · ×1
  • JdbcExecutor.executePage (cognitive 22) agents/common/src/main/java/com/dbx/agent/JdbcExecutor.java:379 — JdbcExecutor.executePage has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 2 (4 pts), error handling 2 (3 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JdbcExecutor.withStatementMessages (cognitive 22) · ×1
  • JdbcExecutor.withStatementMessages (cognitive 22) agents/common/src/main/java/com/dbx/agent/JdbcExecutor.java:913 — JdbcExecutor.withStatementMessages has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3, loops 2 (3 pts), error handling 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 · QueryResult.normalizeRowsWithSpatial (cognitive 22) · ×1
  • QueryResult.normalizeRowsWithSpatial (cognitive 22) agents/common/src/main/java/com/dbx/agent/QueryResult.java:144 — QueryResult.normalizeRowsWithSpatial has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 3 (7 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.legacyMaterializedViewOptions (cognitive 22) · ×1
  • main.legacyMaterializedViewOptions (cognitive 22) agents/drivers/cassandra-go/materialized_view.go:183 — main.legacyMaterializedViewOptions has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), 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 · server.peekMessages (cognitive 22) · ×1
  • server.peekMessages (cognitive 22) agents/drivers/rabbitmq/operations.go:1160 — server.peekMessages has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 2, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server.getObjectSource (cognitive 22) · ×1
  • server.getObjectSource (cognitive 22) REDACTED:3196 — server.getObjectSource has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 4, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gohive.ParseDSN (cognitive 22) · ×1
  • gohive.ParseDSN (cognitive 22) agents/go-common/gohive/dsn.go:27 — gohive.ParseDSN has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 1, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · TSaslTransport.Open (cognitive 22) · ×1
  • TSaslTransport.Open (cognitive 22) agents/go-common/gohive/sasl_transport.go:108 — TSaslTransport.Open has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useDataGridCanvasRuntime.useDataGridCanvasRuntime (cognitive 22) · ×1
  • useDataGridCanvasRuntime.useDataGridCanvasRuntime (cognitive 22) apps/desktop/src/composables/useDataGridCanvasRuntime.ts:55 — useDataGridCanvasRuntime.useDataGridCanvasRuntime has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12, boolean chains 8, error handling 1 (2 pts) (nesting depth added 1). Of this number, 20 points are the body's own statements and 2 belong to 4 function literals inside it that branch. 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 · useDataGridScrollbars.useDataGridScrollbars (cognitive 22) · ×1
  • useDataGridScrollbars.useDataGridScrollbars (cognitive 22) apps/desktop/src/composables/useDataGridScrollbars.ts:32 — useDataGridScrollbars.useDataGridScrollbars has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11, boolean chains 9, loops 1 (2 pts) (nesting depth added 1). Of this number, 21 points are the body's own statements and 1 belongs to 4 function literals inside it that branch. 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 · aiIntentRouter.routeByRulesUnchecked (cognitive 22) · ×1
  • aiIntentRouter.routeByRulesUnchecked (cognitive 22) apps/desktop/src/lib/ai/aiIntentRouter.ts:220 — aiIntentRouter.routeByRulesUnchecked has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12, boolean chains 10. 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 · aiMessageRender.parseAiMessage (cognitive 22) · ×1
  • aiMessageRender.parseAiMessage (cognitive 22) apps/desktop/src/lib/ai/aiMessageRender.ts:330 — aiMessageRender.parseAiMessage has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (7 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LightweightJsonScanner.readStringValue (cognitive 22) · ×1
  • LightweightJsonScanner.readStringValue (cognitive 22) apps/desktop/src/lib/app/documentJsonValues.ts:332 — LightweightJsonScanner.readStringValue has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · agentDriverInstallHint.agentDriverInstallKey (cognitive 22) · ×1
  • agentDriverInstallHint.agentDriverInstallKey (cognitive 22) apps/desktop/src/lib/connection/agentDriverInstallHint.ts:34 — agentDriverInstallHint.agentDriverInstallKey has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (15 pts), ternaries 3 (5 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · connectionUrl.urlParamsRequireTls (cognitive 22) · ×1
  • connectionUrl.urlParamsRequireTls (cognitive 22) REDACTED:380 — connectionUrl.urlParamsRequireTls has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 11, if/else 7 (11 pts) (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · dataGridContextMenu.createDataGridCellContextMenuItems (cognitive 22) · ×1
  • dataGridContextMenu.createDataGridCellContextMenuItems (cognitive 22) apps/desktop/src/lib/dataGrid/dataGridContextMenu.ts:160 — dataGridContextMenu.createDataGridCellContextMenuItems has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gridNewRowPlacement.buildOrderedGridRows (cognitive 22) · ×1
  • gridNewRowPlacement.buildOrderedGridRows (cognitive 22) apps/desktop/src/lib/dataGrid/gridNewRowPlacement.ts:54 — gridNewRowPlacement.buildOrderedGridRows has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 3, ternaries 1 (2 pts) (nesting depth added 7). Of this number, 17 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · draft-table.validateDraftTable (cognitive 22) · ×1
  • draft-table.validateDraftTable (cognitive 22) apps/desktop/src/lib/diagram/draft-table.ts:110 — draft-table.validateDraftTable has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · codemirrorSqlDialect.codeMirrorBaseDialect (cognitive 22) · ×1
  • codemirrorSqlDialect.codeMirrorBaseDialect (cognitive 22) apps/desktop/src/lib/editor/codemirrorSqlDialect.ts:339 — codemirrorSqlDialect.codeMirrorBaseDialect has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (18 pts), ternaries 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · plainTextSelectionRanges.scanBracketRanges (cognitive 22) · ×1
  • plainTextSelectionRanges.scanBracketRanges (cognitive 22) apps/desktop/src/lib/editor/plainTextSelectionRanges.ts:40 — plainTextSelectionRanges.scanBracketRanges has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlHoverSearch.applyHoverSearchHighlights (cognitive 22) · ×1
  • sqlHoverSearch.applyHoverSearchHighlights (cognitive 22) apps/desktop/src/lib/editor/sqlHoverSearch.ts:60 — sqlHoverSearch.applyHoverSearchHighlights has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (6 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlIntentionActions.buildBatchQualifyActions (cognitive 22) · ×1
  • sqlIntentionActions.buildBatchQualifyActions (cognitive 22) apps/desktop/src/lib/editor/sqlIntentionActions.ts:199 — sqlIntentionActions.buildBatchQualifyActions has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (17 pts), ternaries 2 (3 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tableMetadataCache.loadTableColumns (cognitive 22) · ×1
  • tableMetadataCache.loadTableColumns (cognitive 22) apps/desktop/src/lib/metadata/tableMetadataCache.ts:205 — tableMetadataCache.loadTableColumns has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 7 (15 pts), if/else 4 (6 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mongoCompletion.skipMongoStringOrComment (cognitive 22) · ×1
  • mongoCompletion.skipMongoStringOrComment (cognitive 22) REDACTED:1249 — mongoCompletion.skipMongoStringOrComment has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 7, ternaries 2 (4 pts), loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mongoCompletion.isInsideMongoComment (cognitive 22) · ×1
  • mongoCompletion.isInsideMongoComment (cognitive 22) REDACTED:1333 — mongoCompletion.isInsideMongoComment has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 6, ternaries 1 (3 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mongoShellCommand.parseMongoCommand (cognitive 22) · ×1
  • mongoShellCommand.parseMongoCommand (cognitive 22) apps/desktop/src/lib/mongo/mongoShellCommand.ts:959 — mongoShellCommand.parseMongoCommand has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 14, if/else 4 (6 pts), boolean chains 1, loops 1 (nesting depth added 2). Most of this is not in the body itself: 8 of the 22 points are its own statements and the rest belongs to 14 function literals inside it that branch (lines 971, 975, 979, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · sidebarLayoutMonitor.detectLayoutAnomalies (cognitive 22) · ×1
  • sidebarLayoutMonitor.detectLayoutAnomalies (cognitive 22) apps/desktop/src/lib/sidebar/sidebarLayoutMonitor.ts:443 — sidebarLayoutMonitor.detectLayoutAnomalies has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 9 (nesting depth added 5). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sidebarNodeOrdering.orderSidebarTreeChildrenForParent (cognitive 22) · ×1
  • sidebarNodeOrdering.orderSidebarTreeChildrenForParent (cognitive 22) apps/desktop/src/lib/sidebar/sidebarNodeOrdering.ts:51 — sidebarNodeOrdering.orderSidebarTreeChildrenForParent has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 5 (nesting depth added 6). Of this number, 18 points are the body's own statements and 4 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · model.clauseSpans (cognitive 22) · ×1
  • model.clauseSpans (cognitive 22) apps/desktop/src/lib/sql/semantic/model.ts:824 — model.clauseSpans has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 3, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlAnalysis.parseSelectColumns (cognitive 22) · ×1
  • sqlAnalysis.parseSelectColumns (cognitive 22) apps/desktop/src/lib/sql/sqlAnalysis.ts:414 — sqlAnalysis.parseSelectColumns has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 4, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlCompletion.maskSqlLiteralsAndComments (cognitive 22) · ×1
  • sqlCompletion.maskSqlLiteralsAndComments (cognitive 22) REDACTED:3364 — sqlCompletion.maskSqlLiteralsAndComments has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 15, if/else 4 (6 pts), loops 1 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · sqlCompletion.splitQualifiedNameRawParts (cognitive 22) · ×1
  • sqlCompletion.splitQualifiedNameRawParts (cognitive 22) REDACTED:3869 — sqlCompletion.splitQualifiedNameRawParts has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 5, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tableDependencySort.sortTablesByFkDependency (cognitive 22) · ×1
  • tableDependencySort.sortTablesByFkDependency (cognitive 22) apps/desktop/src/lib/table/tableDependencySort.ts:17 — tableDependencySort.sortTablesByFkDependency has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 6 (8 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tabPresentation.syncTabTitleNumbers (cognitive 22) · ×1
  • tabPresentation.syncTabTitleNumbers (cognitive 22) apps/desktop/src/lib/tabs/tabPresentation.ts:158 — tabPresentation.syncTabTitleNumbers has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 4 (7 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · migrationStore.useMigrationStore (cognitive 22) · ×1
  • migrationStore.useMigrationStore (cognitive 22) apps/desktop/src/stores/migrationStore.ts:8 — migrationStore.useMigrationStore has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 9, if/else 8, error handling 4, ternaries 1. Of this number, 16 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · worker.handleInstallBeacon (cognitive 22) · ×1
  • worker.handleInstallBeacon (cognitive 22) deploy/plugin-stats-worker/worker.ts:251 — worker.handleInstallBeacon has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4, error handling 2 (3 pts), ternaries 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · InstallTabs.InstallTabs (cognitive 22) · ×1
  • InstallTabs.InstallTabs (cognitive 22) docs/components/landing/InstallTabs.tsx:231 — InstallTabs.InstallTabs has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 12 (16 pts), if/else 5, boolean chains 1 (nesting depth added 4). Most of this is not in the body itself: 6 of the 22 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 324, 241, 250, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · json.findMatchingParen (cognitive 22) · ×1
  • json.findMatchingParen (cognitive 22) REDACTED:266 — json.findMatchingParen has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · i18n.localizeManifest (cognitive 22) · ×1
  • i18n.localizeManifest (cognitive 22) plugins/sdk/dev-host/ui/i18n.js:98 — i18n.localizeManifest has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 9, if/else 4 (7 pts), loops 3 (6 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sync-connection-types.loadConnectionProfiles (cognitive 22) · ×1
  • sync-connection-types.loadConnectionProfiles (cognitive 22) scripts/sync-connection-types.mjs:153 — sync-connection-types.loadConnectionProfiles has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 6, loops 2 (nesting depth added 2). Most of this is not in the body itself: 6 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 164). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · MySqlSqlFileExecutor · ×1
  • MySqlSqlFileExecutor::execute_statement_inner (cognitive 21) REDACTED:327 — MySqlSqlFileExecutor::execute_statement_inner has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (17 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SnippetSyncClient · ×1
  • SnippetSyncClient::put_snapshot (cognitive 21) crates/dbx-core/src/persistence/cloud_sync.rs:1930 — SnippetSyncClient::put_snapshot has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (19 pts), match/switch 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 · AgentDriverClient · ×1
  • AgentDriverClient::call_typed_with_timeout_and_cancel (cognitive 21) crates/dbx-driver-agent/src/agent_driver.rs:1760 — AgentDriverClient::call_typed_with_timeout_and_cancel has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 6 (11 pts), if/else 8 (9 pts), boolean chains 1 (nesting depth added 6). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · AgentManager · ×1
  • AgentManager::collect_driver_store_usage (cognitive 21) crates/dbx-driver-agent/src/agent_manager.rs:1073 — AgentManager::collect_driver_store_usage has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WkbGeometry · ×1
  • WkbGeometry::to_wkt (cognitive 21) crates/dbx-driver-support/src/wkb.rs:47 — WkbGeometry::to_wkt has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (18 pts), match/switch 2 (3 pts) (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · HanaDoBlock · ×1
  • HanaDoBlock::is_complete (cognitive 21) crates/dbx-sql-core/src/sql.rs:2490 — HanaDoBlock::is_complete has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Gbase8sAgent.overrideLocaleParams (cognitive 21) · ×1
  • Gbase8sAgent.overrideLocaleParams (cognitive 21) agents/drivers/gbase8s/src/main/java/com/dbx/agent/gbase8s/Gbase8sAgent.java:780 — Gbase8sAgent.overrideLocaleParams has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DdlBuilder.buildOracleObjectGrantSql (cognitive 21) · ×1
  • DdlBuilder.buildOracleObjectGrantSql (cognitive 21) agents/common/src/main/java/com/dbx/agent/DdlBuilder.java:245 — DdlBuilder.buildOracleObjectGrantSql has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (5 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConnectionFactoryDataSource.getConnection (cognitive 21) · ×1
  • ConnectionFactoryDataSource.getConnection (cognitive 21) agents/common/src/main/java/com/dbx/agent/JdbcConnectionPoolRegistry.java:788 — ConnectionFactoryDataSource.getConnection has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (16 pts), error handling 4, boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.loadJKSTruststore (cognitive 21) · ×1
  • main.loadJKSTruststore (cognitive 21) REDACTED:97 — main.loadJKSTruststore has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.consumeWatchChannel (cognitive 21) · ×1
  • main.consumeWatchChannel (cognitive 21) agents/drivers/etcd-go/watch.go:271 — main.consumeWatchChannel has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · etcd2Session.rename (cognitive 21) · ×1
  • etcd2Session.rename (cognitive 21) agents/drivers/etcd2-go/kv.go:286 — etcd2Session.rename has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · server.listTriggerDefinitionsFor (cognitive 21) · ×1
  • server.listTriggerDefinitionsFor (cognitive 21) REDACTED:2837 — server.listTriggerDefinitionsFor has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 2, loops 2 (nesting depth added 5). Of this number, 17 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.oracleExplainPlanBindParams (cognitive 21) · ×1
  • main.oracleExplainPlanBindParams (cognitive 21) REDACTED:3689 — main.oracleExplainPlanBindParams has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.parseSingleOracleTableRef (cognitive 21) · ×1
  • main.parseSingleOracleTableRef (cognitive 21) REDACTED:4507 — main.parseSingleOracleTableRef has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 5 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server.getTableDDLWithOptions (cognitive 21) · ×1
  • server.getTableDDLWithOptions (cognitive 21) REDACTED:3078 — server.getTableDDLWithOptions has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server.queryRowsWithTimeout (cognitive 21) · ×1
  • server.queryRowsWithTimeout (cognitive 21) REDACTED:5218 — server.queryRowsWithTimeout has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (21 pts) (nesting depth added 6). Of this number, 12 points are the body's own statements and 9 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · rocketMQAgent.createACLs (cognitive 21) · ×1
  • rocketMQAgent.createACLs (cognitive 21) agents/drivers/rocketmq/acl.go:93 — rocketMQAgent.createACLs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · rocketMQAgent.deleteACLs (cognitive 21) · ×1
  • rocketMQAgent.deleteACLs (cognitive 21) agents/drivers/rocketmq/acl.go:146 — rocketMQAgent.deleteACLs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.rewriteNativeConnectionStringSSLMode (cognitive 21) · ×1
  • main.rewriteNativeConnectionStringSSLMode (cognitive 21) agents/drivers/vastbase-go/main.go:1204 — main.rewriteNativeConnectionStringSSLMode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.xuguListObjectsQuery (cognitive 21) · ×1
  • main.xuguListObjectsQuery (cognitive 21) REDACTED:2518 — main.xuguListObjectsQuery has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (7 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.splitXuguTopLevel (cognitive 21) · ×1
  • main.splitXuguTopLevel (cognitive 21) REDACTED:5732 — main.splitXuguTopLevel has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server.put (cognitive 21) · ×1
  • server.put (cognitive 21) agents/drivers/zookeeper/operations.go:89 — server.put has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (20 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HiveConnector.Connect (cognitive 21) · ×1
  • HiveConnector.Connect (cognitive 21) REDACTED:73 — HiveConnector.Connect has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Session.ExecuteQueryStatement (cognitive 21) · ×1
  • Session.ExecuteQueryStatement (cognitive 21) agents/go-common/iotdb-client-go/client/session.go:574 — Session.ExecuteQueryStatement has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 2 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: 3 other methods here (Session.ExecuteAggregationQuery, Session.ExecuteAggregationQueryWithLegalNodes, Session.ExecuteFastLastDataQueryForOnePrefixPath) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · Session.ExecuteAggregationQuery (cognitive 21) · ×1
  • Session.ExecuteAggregationQuery (cognitive 21) agents/go-common/iotdb-client-go/client/session.go:605 — Session.ExecuteAggregationQuery has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 2 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: 3 other methods here (Session.ExecuteQueryStatement, Session.ExecuteAggregationQueryWithLegalNodes, Session.ExecuteFastLastDataQueryForOnePrefixPath) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · Session.ExecuteAggregationQueryWithLegalNodes (cognitive 21) · ×1
  • Session.ExecuteAggregationQueryWithLegalNodes (cognitive 21) agents/go-common/iotdb-client-go/client/session.go:638 — Session.ExecuteAggregationQueryWithLegalNodes has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 2 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: 3 other methods here (Session.ExecuteQueryStatement, Session.ExecuteAggregationQuery, Session.ExecuteFastLastDataQueryForOnePrefixPath) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · Session.ExecuteFastLastDataQueryForOnePrefixPath (cognitive 21) · ×1
  • Session.ExecuteFastLastDataQueryForOnePrefixPath (cognitive 21) agents/go-common/iotdb-client-go/client/session.go:672 — Session.ExecuteFastLastDataQueryForOnePrefixPath has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 2 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: 3 other methods here (Session.ExecuteQueryStatement, Session.ExecuteAggregationQuery, Session.ExecuteAggregationQueryWithLegalNodes) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · Server.serveFramed (cognitive 21) · ×1
  • Server.serveFramed (cognitive 21) plugins/sdk/go/dbx-plugin-sdk/sdk.go:249 — Server.serveFramed has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · verify-partition-ddl.main (cognitive 21) · ×1
  • verify-partition-ddl.main (cognitive 21) agents/drivers/oceanbase-oracle/scripts/verify-partition-ddl.ts:10 — verify-partition-ddl.main has cognitive complexity 21 (threshold 15). Drivers by points: loops 8 (11 pts), if/else 3 (4 pts), ternaries 3 (4 pts), boolean chains 2 (nesting depth added 5). Of this number, 15 points are the body's own statements and 6 belong to 5 function literals inside it that branch. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · DiffHunkBuilder.alignWithinWindow (cognitive 21) · ×1
  • DiffHunkBuilder.alignWithinWindow (cognitive 21) apps/desktop/src/components/diff/DiffHunkBuilder.ts:223 — DiffHunkBuilder.alignWithinWindow has cognitive complexity 21 (threshold 15). Drivers by points: loops 7 (12 pts), if/else 2 (6 pts), boolean chains 3 (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · useQueryEditorIntentions.useQueryEditorIntentions (cognitive 21) · ×1
  • useQueryEditorIntentions.useQueryEditorIntentions (cognitive 21) apps/desktop/src/components/editor/useQueryEditorIntentions.ts:24 — useQueryEditorIntentions.useQueryEditorIntentions has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (12 pts), error handling 2 (3 pts), loops 1 (2 pts), match/switch 2, boolean chains 1, ternaries 1 (nesting depth added 5). Of this number, 12 points are the body's own statements and 9 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · useQueryEditorTableDrop.useQueryEditorTableDrop (cognitive 21) · ×1
  • useQueryEditorTableDrop.useQueryEditorTableDrop (cognitive 21) apps/desktop/src/components/editor/useQueryEditorTableDrop.ts:29 — useQueryEditorTableDrop.useQueryEditorTableDrop has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13, boolean chains 4, ternaries 3, error handling 1. Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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 · transferSelections.matchBulkObjectNames (cognitive 21) · ×1
  • transferSelections.matchBulkObjectNames (cognitive 21) apps/desktop/src/components/transfer/transferSelections.ts:149 — transferSelections.matchBulkObjectNames has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 4 (5 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · transferStrategy.createTransferSubmission (cognitive 21) · ×1
  • transferStrategy.createTransferSubmission (cognitive 21) apps/desktop/src/components/transfer/transferStrategy.ts:50 — transferStrategy.createTransferSubmission has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 5, error handling 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useVerticalOverlayScrollbar.useVerticalOverlayScrollbar (cognitive 21) · ×1
  • useVerticalOverlayScrollbar.useVerticalOverlayScrollbar (cognitive 21) apps/desktop/src/composables/useVerticalOverlayScrollbar.ts:18 — useVerticalOverlayScrollbar.useVerticalOverlayScrollbar has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16, boolean chains 4, ternaries 1. Of this number, 15 points are the body's own statements and 6 belong to 3 function literals inside it that branch. 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 · elk-layout.extractLayoutResult (cognitive 21) · ×1
  • elk-layout.extractLayoutResult (cognitive 21) apps/desktop/src/lib/diagram/elk-layout.ts:265 — elk-layout.extractLayoutResult has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (5 pts), boolean chains 4, ternaries 3 (4 pts) (nesting depth added 8). Of this number, 16 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · layer-store.useLayerStore (cognitive 21) · ×1
  • layer-store.useLayerStore (cognitive 21) apps/desktop/src/lib/diagram/layer-store.ts:35 — layer-store.useLayerStore has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13, boolean chains 7, loops 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 · plainTextSelectionRanges.scanQuotedRanges (cognitive 21) · ×1
  • plainTextSelectionRanges.scanQuotedRanges (cognitive 21) apps/desktop/src/lib/editor/plainTextSelectionRanges.ts:18 — plainTextSelectionRanges.scanQuotedRanges has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (15 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · exportDiagnostics.summarizeExportRows (cognitive 21) · ×1
  • exportDiagnostics.summarizeExportRows (cognitive 21) apps/desktop/src/lib/export/exportDiagnostics.ts:40 — exportDiagnostics.summarizeExportRows has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (3 pts), ternaries 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 · mongoCompletion.findOpenMongoQuoteStart (cognitive 21) · ×1
  • mongoCompletion.findOpenMongoQuoteStart (cognitive 21) REDACTED:1141 — mongoCompletion.findOpenMongoQuoteStart has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mongoDocumentValues.parseMongoDocumentInputValue (cognitive 21) · ×1
  • mongoDocumentValues.parseMongoDocumentInputValue (cognitive 21) apps/desktop/src/lib/mongo/mongoDocumentValues.ts:109 — mongoDocumentValues.parseMongoDocumentInputValue has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 4, ternaries 1 (3 pts), error handling 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · mongoDocumentValues.formatMongoShellLiteral (cognitive 21) · ×1
  • mongoDocumentValues.formatMongoShellLiteral (cognitive 21) apps/desktop/src/lib/mongo/mongoDocumentValues.ts:420 — mongoDocumentValues.formatMongoShellLiteral has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 8 (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 · mqConsoleDefaults.resolveAvailableMqTabs (cognitive 21) · ×1
  • mqConsoleDefaults.resolveAvailableMqTabs (cognitive 21) apps/desktop/src/lib/mq/mqConsoleDefaults.ts:163 — mqConsoleDefaults.resolveAvailableMqTabs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 5 (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 · pluginHostBridge.requirePluginDataQueryRequest (cognitive 21) · ×1
  • pluginHostBridge.requirePluginDataQueryRequest (cognitive 21) REDACTED:1414 — pluginHostBridge.requirePluginDataQueryRequest has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 5, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ddlSearchMarks.applyDdlSearchMarks (cognitive 21) · ×1
  • ddlSearchMarks.applyDdlSearchMarks (cognitive 21) apps/desktop/src/lib/sql/ddlSearchMarks.ts:32 — ddlSearchMarks.applyDdlSearchMarks has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (4 pts), ternaries 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · primitives.renderInline (cognitive 21) · ×1
  • primitives.renderInline (cognitive 21) apps/desktop/src/lib/sql/layout/primitives.ts:337 — primitives.renderInline has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 3 (5 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ddl.createTableLayout (cognitive 21) · ×1
  • ddl.createTableLayout (cognitive 21) apps/desktop/src/lib/sql/layout/ddl.ts:86 — ddl.createTableLayout has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (19 pts), ternaries 2 (nesting depth added 6). Most of this is not in the body itself: 10 of the 21 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 111, 100, 106). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · mysqlRoutineSyntaxDiagnostics.findRoutineDeclarations (cognitive 21) · ×1
  • mysqlRoutineSyntaxDiagnostics.findRoutineDeclarations (cognitive 21) apps/desktop/src/lib/sql/mysqlRoutineSyntaxDiagnostics.ts:75 — mysqlRoutineSyntaxDiagnostics.findRoutineDeclarations has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlInListPaste.hasSingleWrappingParentheses (cognitive 21) · ×1
  • sqlInListPaste.hasSingleWrappingParentheses (cognitive 21) apps/desktop/src/lib/sql/sqlInListPaste.ts:167 — sqlInListPaste.hasSingleWrappingParentheses has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · objectBrowserRows.groupObjectBrowserRows (cognitive 21) · ×1
  • objectBrowserRows.groupObjectBrowserRows (cognitive 21) apps/desktop/src/lib/table/objectBrowserRows.ts:261 — objectBrowserRows.groupObjectBrowserRows has cognitive complexity 21 (threshold 15). Drivers by points: loops 5 (8 pts), if/else 6 (7 pts), boolean chains 5, ternaries 1 (nesting depth added 4). Of this number, 11 points are the body's own statements and 10 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tabPresentation.tabModeLabel (cognitive 21) · ×1
  • tabPresentation.tabModeLabel (cognitive 21) apps/desktop/src/lib/tabs/tabPresentation.ts:647 — tabPresentation.tabModeLabel has cognitive complexity 21 (threshold 15). Drivers by points: if/else 20, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · tabUiState.sanitizeValue (cognitive 21) · ×1
  • tabUiState.sanitizeValue (cognitive 21) apps/desktop/src/lib/tabs/tabUiState.ts:72 — tabUiState.sanitizeValue has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 3, ternaries 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · json.readMongoRegexLiteral (cognitive 21) · ×1
  • json.readMongoRegexLiteral (cognitive 21) REDACTED:46 — json.readMongoRegexLiteral has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · json.splitTopLevel (cognitive 21) · ×1
  • json.splitTopLevel (cognitive 21) REDACTED:225 — json.splitTopLevel has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 4, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InsertSqlTemplate · ×1
  • InsertSqlTemplate::build (cognitive 20) REDACTED:3950 — InsertSqlTemplate::build has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DbxJdbcPlugin.hive2ShowCreateObjectSource (cognitive 20) · ×1
  • DbxJdbcPlugin.hive2ShowCreateObjectSource (cognitive 20) REDACTED:4136 — DbxJdbcPlugin.hive2ShowCreateObjectSource has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), error handling 1 (2 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DbxJdbcPlugin.listSchemas (cognitive 20) · ×1
  • DbxJdbcPlugin.listSchemas (cognitive 20) REDACTED:2080 — DbxJdbcPlugin.listSchemas has cognitive complexity 20 (threshold 15). Drivers by points: error handling 5 (11 pts), if/else 6 (8 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GenericJdbcDdlBuilder.buildTableDdl (cognitive 20) · ×1
  • GenericJdbcDdlBuilder.buildTableDdl (cognitive 20) plugins/jdbc/src/main/java/app/dbx/jdbc/GenericJdbcDdlBuilder.java:23 — GenericJdbcDdlBuilder.buildTableDdl has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4, ternaries 2 (4 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MongoAgent.collationOrNull (cognitive 20) · ×1
  • MongoAgent.collationOrNull (cognitive 20) agents/drivers/mongodb/src/main/java/com/dbx/agent/mongodb/MongoAgent.java:917 — MongoAgent.collationOrNull has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 3, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · KafkaAgent.resetConsumerGroupOffsets (cognitive 20) · ×1
  • KafkaAgent.resetConsumerGroupOffsets (cognitive 20) agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:1502 — KafkaAgent.resetConsumerGroupOffsets has cognitive complexity 20 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 4 (7 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · DamengAgent.isDamengMetadataUnavailableError (cognitive 20) · ×1
  • DamengAgent.isDamengMetadataUnavailableError (cognitive 20) REDACTED:737 — DamengAgent.isDamengMetadataUnavailableError has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (11 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConnectionFactoryDataSource.classifyCheckoutFailure (cognitive 20) · ×1
  • ConnectionFactoryDataSource.classifyCheckoutFailure (cognitive 20) agents/common/src/main/java/com/dbx/agent/JdbcConnectionPoolRegistry.java:944 — ConnectionFactoryDataSource.classifyCheckoutFailure has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 2 (6 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · validate_agents.validate_jdbc_architecture (cognitive 20) · ×1
  • validate_agents.validate_jdbc_architecture (cognitive 20) agents/scripts/validate_agents.py:189 — validate_agents.validate_jdbc_architecture has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (6 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.scanCQLRow (cognitive 20) · ×1
  • main.scanCQLRow (cognitive 20) agents/drivers/cassandra-go/query.go:234 — main.scanCQLRow has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 4 (8 pts) (nesting depth added 11). Most of this is not in the body itself: 8 of the 20 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 245, 264). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · server.dispatch (cognitive 20) · ×1
  • server.dispatch (cognitive 20) REDACTED:848 — server.dispatch has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (19 pts), match/switch 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 · main.queryMessagesByKey (cognitive 20) · ×1
  • main.queryMessagesByKey (cognitive 20) REDACTED:216 — main.queryMessagesByKey has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · rocketMQAgent.peekMessages (cognitive 20) · ×1
  • rocketMQAgent.peekMessages (cognitive 20) REDACTED:103 — rocketMQAgent.peekMessages has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server.loadIndexPartitionMetadata (cognitive 20) · ×1
  • server.loadIndexPartitionMetadata (cognitive 20) REDACTED:2987 — server.loadIndexPartitionMetadata has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 4 (nesting depth added 6). Of this number, 10 points are the body's own statements and 10 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server.buildTableDDL (cognitive 20) · ×1
  • server.buildTableDDL (cognitive 20) REDACTED:4496 — server.buildTableDDL has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (20 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server.listPrefix (cognitive 20) · ×1
  • server.listPrefix (cognitive 20) agents/drivers/zookeeper/operations.go:268 — server.listPrefix has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · server.rowsWithMetadata (cognitive 20) · ×1
  • server.rowsWithMetadata (cognitive 20) agents/drivers/zookeeper/operations.go:377 — server.rowsWithMetadata has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 9). Most of this is not in the body itself: 7 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 389). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · cursor.pollUntilData (cognitive 20) · ×1
  • cursor.pollUntilData (cognitive 20) REDACTED:1459 — cursor.pollUntilData has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 2 (3 pts), loops 1 (nesting depth added 8). Most of this is not in the body itself: 5 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 1463). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · useQueryEditorLayout.useQueryEditorLayout (cognitive 20) · ×1
  • useQueryEditorLayout.useQueryEditorLayout (cognitive 20) apps/desktop/src/components/editor/useQueryEditorLayout.ts:5 — useQueryEditorLayout.useQueryEditorLayout has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 3 (nesting depth added 3). Of this number, 11 points are the body's own statements and 9 belong to one function literal inside it that branches. 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 · useDataGenerateSession.runDataGenerateSession (cognitive 20) · ×1
  • useDataGenerateSession.runDataGenerateSession (cognitive 20) apps/desktop/src/composables/useDataGenerateSession.ts:265 — useDataGenerateSession.runDataGenerateSession has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 8, if/else 5 (8 pts), error handling 2 (3 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · usePluginShortcuts.usePluginShortcuts (cognitive 20) · ×1
  • usePluginShortcuts.usePluginShortcuts (cognitive 20) apps/desktop/src/composables/usePluginShortcuts.ts:11 — usePluginShortcuts.usePluginShortcuts has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 6, error handling 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 · appBackgroundImage.surfaceColorWithAlpha (cognitive 20) · ×1
  • appBackgroundImage.surfaceColorWithAlpha (cognitive 20) apps/desktop/src/lib/app/appBackgroundImage.ts:167 — appBackgroundImage.surfaceColorWithAlpha has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 2 (5 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LightweightJsonScanner.readNumberToken (cognitive 20) · ×1
  • LightweightJsonScanner.readNumberToken (cognitive 20) apps/desktop/src/lib/app/documentJsonValues.ts:391 — LightweightJsonScanner.readNumberToken has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · connectionUrlBuilder.standardUrlScheme (cognitive 20) · ×1
  • connectionUrlBuilder.standardUrlScheme (cognitive 20) apps/desktop/src/lib/connection/connectionUrlBuilder.ts:208 — connectionUrlBuilder.standardUrlScheme has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 5 (13 pts), if/else 3 (6 pts), match/switch 1 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · draft-table.validateLivePendingColumns (cognitive 20) · ×1
  • draft-table.validateLivePendingColumns (cognitive 20) apps/desktop/src/lib/diagram/draft-table.ts:137 — draft-table.validateLivePendingColumns has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 2, 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 · elk-layout.computeLayoutWithLayers (cognitive 20) · ×1
  • elk-layout.computeLayoutWithLayers (cognitive 20) apps/desktop/src/lib/diagram/elk-layout.ts:71 — elk-layout.computeLayoutWithLayers has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 5 (8 pts), boolean chains 4 (nesting depth added 6). Of this number, 16 points are the body's own statements and 4 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · codemirrorShellLineCommentHighlight.createShellLineCommentHighlight (cognitive 20) · ×1
  • codemirrorShellLineCommentHighlight.createShellLineCommentHighlight (cognitive 20) apps/desktop/src/lib/editor/codemirrorShellLineCommentHighlight.ts:27 — codemirrorShellLineCommentHighlight.createShellLineCommentHighlight has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dbeaverImport.buildConnection (cognitive 20) · ×1
  • dbeaverImport.buildConnection (cognitive 20) apps/desktop/src/lib/imports/dbeaverImport.ts:242 — dbeaverImport.buildConnection has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 15, ternaries 4, if/else 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · redisCommandDocs.mapEntries (cognitive 20) · ×1
  • redisCommandDocs.mapEntries (cognitive 20) apps/desktop/src/lib/redis/redisCommandDocs.ts:37 — redisCommandDocs.mapEntries has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, loops 2 (5 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · redisValuePresentation.toYamlLines (cognitive 20) · ×1
  • redisValuePresentation.toYamlLines (cognitive 20) apps/desktop/src/lib/redis/redisValuePresentation.ts:409 — redisValuePresentation.toYamlLines has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 7). Most of this is not in the body itself: 6 of the 20 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 424, 413). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · settingsTransfer.isSqlShortcutActionItem (cognitive 20) · ×1
  • settingsTransfer.isSqlShortcutActionItem (cognitive 20) apps/desktop/src/lib/settings/settingsTransfer.ts:379 — settingsTransfer.isSqlShortcutActionItem has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 7 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · mongoCollectionMutation.buildMongoCreateIndexRequest (cognitive 20) · ×1
  • mongoCollectionMutation.buildMongoCreateIndexRequest (cognitive 20) apps/desktop/src/lib/sidebar/mongoCollectionMutation.ts:156 — mongoCollectionMutation.buildMongoCreateIndexRequest has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 11 (12 pts), if/else 5 (6 pts), boolean chains 1, loops 1 (nesting depth added 2). Of this number, 17 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · sidebarLayout.reorderEntry (cognitive 20) · ×1
  • sidebarLayout.reorderEntry (cognitive 20) apps/desktop/src/lib/sidebar/sidebarLayout.ts:476 — sidebarLayout.reorderEntry has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, ternaries 1 (3 pts), loops 1 (nesting depth added 5). Most of this is not in the body itself: 8 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 493). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · treeNodeClick.treeNodeRowAction (cognitive 20) · ×1
  • treeNodeClick.treeNodeRowAction (cognitive 20) apps/desktop/src/lib/sidebar/treeNodeClick.ts:134 — treeNodeClick.treeNodeRowAction has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11, boolean chains 5, ternaries 2 (4 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · executableStatementRangeCache.executableStatementRangeAtCursor (cognitive 20) · ×1
  • executableStatementRangeCache.executableStatementRangeAtCursor (cognitive 20) apps/desktop/src/lib/sql/executableStatementRangeCache.ts:135 — executableStatementRangeCache.executableStatementRangeAtCursor has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 6, 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 · mysqlRoutineSyntaxDiagnostics.analyzeMysqlRoutineSyntax (cognitive 20) · ×1
  • mysqlRoutineSyntaxDiagnostics.analyzeMysqlRoutineSyntax (cognitive 20) apps/desktop/src/lib/sql/mysqlRoutineSyntaxDiagnostics.ts:36 — mysqlRoutineSyntaxDiagnostics.analyzeMysqlRoutineSyntax has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 10). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to one function literal inside it that branches (line 44). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · sqlAnalysis.hasTopLevelSemicolon (cognitive 20) · ×1
  • sqlAnalysis.hasTopLevelSemicolon (cognitive 20) apps/desktop/src/lib/sql/sqlAnalysis.ts:796 — sqlAnalysis.hasTopLevelSemicolon has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 4, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · statementDelimiter.trailingGapIsWhitespaceOrComment (cognitive 20) · ×1
  • statementDelimiter.trailingGapIsWhitespaceOrComment (cognitive 20) apps/desktop/src/lib/sql/statementDelimiter.ts:37 — statementDelimiter.trailingGapIsWhitespaceOrComment has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 6, 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 · pgPartitionPresentation.splitPgPartitionBoundValues (cognitive 20) · ×1
  • pgPartitionPresentation.splitPgPartitionBoundValues (cognitive 20) apps/desktop/src/lib/table/pgPartitionPresentation.ts:89 — pgPartitionPresentation.splitPgPartitionBoundValues has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 6, 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 · tableTree.mergeTableInfosIntoObjects (cognitive 20) · ×1
  • tableTree.mergeTableInfosIntoObjects (cognitive 20) apps/desktop/src/lib/table/tableTree.ts:241 — tableTree.mergeTableInfosIntoObjects has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 4, loops 1, ternaries 1 (nesting depth added 8). Of this number, 16 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · json.replaceMongoRegexLiterals (cognitive 20) · ×1
  • json.replaceMongoRegexLiterals (cognitive 20) REDACTED:91 — json.replaceMongoRegexLiterals has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · json.replaceMongoEjsonDeserialize (cognitive 20) · ×1
  • json.replaceMongoEjsonDeserialize (cognitive 20) REDACTED:502 — json.replaceMongoEjsonDeserialize has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · json.convertSingleQuotedStrings (cognitive 20) · ×1
  • json.convertSingleQuotedStrings (cognitive 20) REDACTED:724 — json.convertSingleQuotedStrings has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 1, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · push (cognitive 20) · ×1
  • push (cognitive 20) plugins/sdk/dev-host/sidecar.mjs:32 — push has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), ternaries 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RuntimeConfig · ×1
  • RuntimeConfig::from_environment_and_args (cognitive 19) crates/dbx-mcp/src/runtime.rs:43 — RuntimeConfig::from_environment_and_args has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 4, match/switch 1 (2 pts), loops 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 · DialectPluginLoader · ×1
  • DialectPluginLoader::scan_and_load (cognitive 19) crates/dbx-sql-dialect/src/sql_dialect/dialect_loader.rs:187 — DialectPluginLoader::scan_and_load has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (8 pts), match/switch 3 (8 pts), loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JsSafeCell · ×1
  • JsSafeCell::serialize (cognitive 19) crates/dbx-types/src/types.rs:662 — JsSafeCell::serialize has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · DbxJdbcPlugin.executeQueryOnConnection (cognitive 19) · ×1
  • DbxJdbcPlugin.executeQueryOnConnection (cognitive 19) REDACTED:1008 — DbxJdbcPlugin.executeQueryOnConnection has cognitive complexity 19 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 2 (4 pts), ternaries 2 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · DbxJdbcPlugin.oracleListObjects (cognitive 19) · ×1
  • DbxJdbcPlugin.oracleListObjects (cognitive 19) REDACTED:3814 — DbxJdbcPlugin.oracleListObjects has cognitive complexity 19 (threshold 15). Drivers by points: error handling 8 (11 pts), loops 6 (7 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KafkaAgent.peekMessages (cognitive 19) · ×1
  • KafkaAgent.peekMessages (cognitive 19) agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:1623 — KafkaAgent.peekMessages has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 4 (5 pts), boolean chains 3, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · DamengAgent.identityColumnsFromDdlText (cognitive 19) · ×1
  • DamengAgent.identityColumnsFromDdlText (cognitive 19) REDACTED:2088 — DamengAgent.identityColumnsFromDdlText has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentRpcError.classify (cognitive 19) · ×1
  • AgentRpcError.classify (cognitive 19) agents/common/src/main/java/com/dbx/agent/AgentRpcError.java:99 — AgentRpcError.classify has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 4 (9 pts), boolean chains 7, if/else 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 · EwkbWktDecoder.tryParseHex (cognitive 19) · ×1
  • EwkbWktDecoder.tryParseHex (cognitive 19) agents/common/src/main/java/com/dbx/agent/EwkbWktDecoder.java:238 — EwkbWktDecoder.tryParseHex has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 11, if/else 5 (6 pts), loops 2 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · PostgresLikeAgent.listForeignKeysFromCatalogArrays (cognitive 19) · ×1
  • PostgresLikeAgent.listForeignKeysFromCatalogArrays (cognitive 19) agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:745 — PostgresLikeAgent.listForeignKeysFromCatalogArrays has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 4 (5 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · etcdSession.defrag (cognitive 19) · ×1
  • etcdSession.defrag (cognitive 19) agents/drivers/etcd-go/maintenance.go:55 — etcdSession.defrag has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.neo4jTLSConfigurer (cognitive 19) · ×1
  • main.neo4jTLSConfigurer (cognitive 19) agents/drivers/neo4j-go/driver.go:105 — main.neo4jTLSConfigurer has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 4 (nesting depth added 5). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server.runPagedOracleSelect (cognitive 19) · ×1
  • server.runPagedOracleSelect (cognitive 19) REDACTED:3847 — server.runPagedOracleSelect has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.readConsumerStatusFromBrokers (cognitive 19) · ×1
  • main.readConsumerStatusFromBrokers (cognitive 19) REDACTED:313 — main.readConsumerStatusFromBrokers has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server.listTables (cognitive 19) · ×1
  • server.listTables (cognitive 19) REDACTED:2085 — server.listTables has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Krb5Mech.continueInitiator (cognitive 19) · ×1
  • Krb5Mech.continueInitiator (cognitive 19) agents/go-common/go-gssapi/krb5/krb5.go:335 — Krb5Mech.continueInitiator has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (15 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Tablet.Swap (cognitive 19) · ×1
  • Tablet.Swap (cognitive 19) agents/go-common/iotdb-client-go/client/tablet.go:59 — Tablet.Swap has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlStatementRanges.mergeSqlServerControlFlowBatches (cognitive 19) · ×1
  • sqlStatementRanges.mergeSqlServerControlFlowBatches (cognitive 19) apps/desktop/src/lib/sql/sqlStatementRanges.ts:980 — sqlStatementRanges.mergeSqlServerControlFlowBatches has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · verify_offline_jdbc_release.main (cognitive 19) · ×1
  • verify_offline_jdbc_release.main (cognitive 19) agents/scripts/verify_offline_jdbc_release.mjs:64 — verify_offline_jdbc_release.main has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · queryEditorHoverContent.createQueryEditorHoverContent (cognitive 19) · ×1
  • queryEditorHoverContent.createQueryEditorHoverContent (cognitive 19) apps/desktop/src/components/editor/queryEditorHoverContent.ts:16 — queryEditorHoverContent.createQueryEditorHoverContent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 5, error handling 2 (3 pts), ternaries 2, loops 1 (nesting depth added 4). Of this number, 11 points are the body's own statements and 8 belong to 6 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useBackgroundImage.useBackgroundImage (cognitive 19) · ×1
  • useBackgroundImage.useBackgroundImage (cognitive 19) apps/desktop/src/composables/useBackgroundImage.ts:66 — useBackgroundImage.useBackgroundImage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 6 (7 pts) (nesting depth added 5). Most of this is not in the body itself: 0 of the 19 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 105, 90, 73). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · useDataGridConditionEditor.activeQuoteAt (cognitive 19) · ×1
  • useDataGridConditionEditor.activeQuoteAt (cognitive 19) REDACTED:90 — useDataGridConditionEditor.activeQuoteAt has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 5, loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · aiProposalDetect.lastLineMentionsWriteSql (cognitive 19) · ×1
  • aiProposalDetect.lastLineMentionsWriteSql (cognitive 19) apps/desktop/src/lib/ai/aiProposalDetect.ts:274 — aiProposalDetect.lastLineMentionsWriteSql has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · errorUtils.boundedFallbackTextAtDepth (cognitive 19) · ×1
  • errorUtils.boundedFallbackTextAtDepth (cognitive 19) apps/desktop/src/lib/backend/errorUtils.ts:284 — errorUtils.boundedFallbackTextAtDepth has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JsonSourceScanner.readStringToken (cognitive 19) · ×1
  • JsonSourceScanner.readStringToken (cognitive 19) apps/desktop/src/lib/common/safeJsonFormat.ts:488 — JsonSourceScanner.readStringToken has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · connectionUrlBuilder.connectionUrlCopyFormats (cognitive 19) · ×1
  • connectionUrlBuilder.connectionUrlCopyFormats (cognitive 19) apps/desktop/src/lib/connection/connectionUrlBuilder.ts:475 — connectionUrlBuilder.connectionUrlCopyFormats has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 6 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · agentTarget.consulAgentWriteBlockedReason (cognitive 19) · ×1
  • agentTarget.consulAgentWriteBlockedReason (cognitive 19) apps/desktop/src/lib/consul/agentTarget.ts:39 — agentTarget.consulAgentWriteBlockedReason has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10, boolean chains 8, error handling 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 · dataGenerate.generateSkuFromPattern (cognitive 19) · ×1
  • dataGenerate.generateSkuFromPattern (cognitive 19) apps/desktop/src/lib/dataGrid/dataGenerate.ts:640 — dataGenerate.generateSkuFromPattern has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 3, 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 · dataGridSort.compareDataGridValues (cognitive 19) · ×1
  • dataGridSort.compareDataGridValues (cognitive 19) apps/desktop/src/lib/dataGrid/dataGridSort.ts:93 — dataGridSort.compareDataGridValues has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 6, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlExecutionTargetRegistry.createProvider (cognitive 19) · ×1
  • sqlExecutionTargetRegistry.createProvider (cognitive 19) apps/desktop/src/lib/database/sqlExecutionTargetRegistry.ts:65 — sqlExecutionTargetRegistry.createProvider has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 6, ternaries 2 (nesting depth added 1). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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 · erDiagram.buildDiagramJoinSql (cognitive 19) · ×1
  • erDiagram.buildDiagramJoinSql (cognitive 19) apps/desktop/src/lib/diagram/erDiagram.ts:371 — erDiagram.buildDiagramJoinSql has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, if/else 3 (5 pts), ternaries 3 (4 pts), loops 1 (nesting depth added 3). Of this number, 13 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · codemirrorInsertValueHints.parseClausesNearView (cognitive 19) · ×1
  • codemirrorInsertValueHints.parseClausesNearView (cognitive 19) apps/desktop/src/lib/editor/codemirrorInsertValueHints.ts:107 — codemirrorInsertValueHints.parseClausesNearView has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · diagramFormats.buildDiagramDbml (cognitive 19) · ×1
  • diagramFormats.buildDiagramDbml (cognitive 19) apps/desktop/src/lib/export/diagramFormats.ts:112 — diagramFormats.buildDiagramDbml has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (4 pts), ternaries 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · navicatImport.readNode (cognitive 19) · ×1
  • navicatImport.readNode (cognitive 19) apps/desktop/src/lib/imports/navicatImport.ts:171 — navicatImport.readNode has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 4, loops 3 (4 pts), ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · kvKeyTree.buildKvKeyTree (cognitive 19) · ×1
  • kvKeyTree.buildKvKeyTree (cognitive 19) apps/desktop/src/lib/kv/kvKeyTree.ts:79 — kvKeyTree.buildKvKeyTree has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (7 pts), ternaries 2 (7 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 10). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pluginUiHtmlCache.inlineLocalUiAssets (cognitive 19) · ×1
  • pluginUiHtmlCache.inlineLocalUiAssets (cognitive 19) apps/desktop/src/lib/plugins/pluginUiHtmlCache.ts:59 — pluginUiHtmlCache.inlineLocalUiAssets has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (4 pts), ternaries 2, boolean chains 1 (nesting depth added 7). Of this number, 15 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sidebarSearch.matchSidebarLabelWithRegex (cognitive 19) · ×1
  • sidebarSearch.matchSidebarLabelWithRegex (cognitive 19) apps/desktop/src/lib/sidebar/sidebarSearch.ts:143 — sidebarSearch.matchSidebarLabelWithRegex has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ddlDisplay.findCreateTableBody (cognitive 19) · ×1
  • ddlDisplay.findCreateTableBody (cognitive 19) apps/desktop/src/lib/sql/ddlDisplay.ts:391 — ddlDisplay.findCreateTableBody has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 7, loops 2 (nesting depth added 3). Of this number, 17 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · errorPosition.resolveSqlErrorOffset (cognitive 19) · ×1
  • errorPosition.resolveSqlErrorOffset (cognitive 19) apps/desktop/src/lib/sql/errorPosition.ts:150 — errorPosition.resolveSqlErrorOffset has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 2, ternaries 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · insertValueHints.buildInsertValueHints (cognitive 19) · ×1
  • insertValueHints.buildInsertValueHints (cognitive 19) apps/desktop/src/lib/sql/insertValueHints.ts:741 — insertValueHints.buildInsertValueHints has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlCompletion.buildCompositeHeuristicJoinConditionItems (cognitive 19) · ×1
  • sqlCompletion.buildCompositeHeuristicJoinConditionItems (cognitive 19) REDACTED:5262 — sqlCompletion.buildCompositeHeuristicJoinConditionItems has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 6, ternaries 2, loops 1 (nesting depth added 2). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. 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 · sqlInListPaste.splitPasteTokens (cognitive 19) · ×1
  • sqlInListPaste.splitPasteTokens (cognitive 19) apps/desktop/src/lib/sql/sqlInListPaste.ts:83 — sqlInListPaste.splitPasteTokens has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 4, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlNavigation.resolveSqlObjectNavigationIdentity (cognitive 19) · ×1
  • sqlNavigation.resolveSqlObjectNavigationIdentity (cognitive 19) apps/desktop/src/lib/sql/sqlNavigation.ts:493 — sqlNavigation.resolveSqlObjectNavigationIdentity has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 5, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · sqlNavigation.sqlObjectNavigationTargetFromIdentity (cognitive 19) · ×1
  • sqlNavigation.sqlObjectNavigationTargetFromIdentity (cognitive 19) apps/desktop/src/lib/sql/sqlNavigation.ts:552 — sqlNavigation.sqlObjectNavigationTargetFromIdentity has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 7 (12 pts), if/else 4 (5 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · routineParameters.sqlServerParameterDeclarationType (cognitive 19) · ×1
  • routineParameters.sqlServerParameterDeclarationType (cognitive 19) apps/desktop/src/lib/table/routineParameters.ts:452 — routineParameters.sqlServerParameterDeclarationType has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7, boolean chains 6, ternaries 3 (6 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · tableVGroup.findTableVGroupContainerNode (cognitive 19) · ×1
  • tableVGroup.findTableVGroupContainerNode (cognitive 19) apps/desktop/src/lib/table/tableVGroup.ts:557 — tableVGroup.findTableVGroupContainerNode has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 6, ternaries 3 (4 pts), loops 1 (nesting depth added 4). Most of this is not in the body itself: 8 of the 19 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 566, 558, 588). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · tabSwitcherKeyboard.tabSwitcherReleaseKeys (cognitive 19) · ×1
  • tabSwitcherKeyboard.tabSwitcherReleaseKeys (cognitive 19) apps/desktop/src/lib/tabs/tabSwitcherKeyboard.ts:22 — tabSwitcherKeyboard.tabSwitcherReleaseKeys has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · json.removeTrailingCommas (cognitive 19) · ×1
  • json.removeTrailingCommas (cognitive 19) REDACTED:423 — json.removeTrailingCommas has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · database-env.allPortMappingsDefaultToLoopback (cognitive 19) · ×1
  • database-env.allPortMappingsDefaultToLoopback (cognitive 19) scripts/database-env.mjs:342 — database-env.allPortMappingsDefaultToLoopback has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · stopProcessTree (cognitive 19) · ×1
  • stopProcessTree (cognitive 19) plugins/sdk/dev-host/process-tree.mjs:5 — stopProcessTree has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 5, error handling 1, loops 1 (nesting depth added 4). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to 4 function items inside it that branch (signal, (anonymous)::(anonymous), (anonymous), …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · PoolRoutingControl · ×1
  • PoolRoutingControl::detach_agent_pool_if_current (cognitive 18) REDACTED:661 — PoolRoutingControl::detach_agent_pool_if_current has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StrictTranscodingReader · ×1
  • StrictTranscodingReader::read (cognitive 18) REDACTED:833 — StrictTranscodingReader::read has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UserInputSpec · ×1
  • UserInputSpec::parse (cognitive 18) crates/dbx-plugin-runtime/src/plugins/runtime.rs:804 — UserInputSpec::parse has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 4 (5 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UpdateDownloadSource · ×1
  • UpdateDownloadSource::installer_asset_candidates (cognitive 18) src-tauri/src/commands/update.rs:296 — UpdateDownloadSource::installer_asset_candidates has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, loops 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KafkaAgent.collectPeekedMessages (cognitive 18) · ×1
  • KafkaAgent.collectPeekedMessages (cognitive 18) agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:1824 — KafkaAgent.collectPeekedMessages has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · build_driver_zips.build_driver_zips (cognitive 18) · ×1
  • build_driver_zips.build_driver_zips (cognitive 18) agents/scripts/build_driver_zips.py:65 — build_driver_zips.build_driver_zips has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.splitTopLevelSQLList (cognitive 18) · ×1
  • main.splitTopLevelSQLList (cognitive 18) REDACTED:4945 — main.splitTopLevelSQLList has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.findTopLevelSQLKeyword (cognitive 18) · ×1
  • main.findTopLevelSQLKeyword (cognitive 18) REDACTED:4983 — main.findTopLevelSQLKeyword has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (12 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server.getExplainInfo (cognitive 18) · ×1
  • server.getExplainInfo (cognitive 18) REDACTED:3588 — server.getExplainInfo has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · rocketMQAgent.listConsumerGroups (cognitive 18) · ×1
  • rocketMQAgent.listConsumerGroups (cognitive 18) REDACTED:35 — rocketMQAgent.listConsumerGroups has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · main.readQuerySessionPage (cognitive 18) · ×1
  • main.readQuerySessionPage (cognitive 18) agents/drivers/vastbase-go/main.go:875 — main.readQuerySessionPage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.negotiateSASLDigest (cognitive 18) · ×1
  • main.negotiateSASLDigest (cognitive 18) agents/drivers/zookeeper/sasl.go:81 — main.negotiateSASLDigest has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gohive.parseHiveServer2Info (cognitive 18) · ×1
  • gohive.parseHiveServer2Info (cognitive 18) REDACTED:329 — gohive.parseHiveServer2Info has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cursor.description (cognitive 18) · ×1
  • cursor.description (cognitive 18) REDACTED:1333 — cursor.description has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlStatementRanges.skipSqlTrivia (cognitive 18) · ×1
  • sqlStatementRanges.skipSqlTrivia (cognitive 18) apps/desktop/src/lib/sql/sqlStatementRanges.ts:1037 — sqlStatementRanges.skipSqlTrivia has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useExportTracker.findActiveOverlappingTransfer (cognitive 18) · ×1
  • useExportTracker.findActiveOverlappingTransfer (cognitive 18) apps/desktop/src/composables/useExportTracker.ts:377 — useExportTracker.findActiveOverlappingTransfer has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useFlatTree.createFlatTreeIndex (cognitive 18) · ×1
  • useFlatTree.createFlatTreeIndex (cognitive 18) apps/desktop/src/composables/useFlatTree.ts:134 — useFlatTree.createFlatTreeIndex has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 pts), 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 · useQuickOpen.matchWordPrefixes (cognitive 18) · ×1
  • useQuickOpen.matchWordPrefixes (cognitive 18) apps/desktop/src/composables/useQuickOpen.ts:131 — useQuickOpen.matchWordPrefixes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (6 pts), loops 3 (6 pts), ternaries 1 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · documentStoreProvider.parseDocumentFilterValueList (cognitive 18) · ×1
  • documentStoreProvider.parseDocumentFilterValueList (cognitive 18) apps/desktop/src/lib/app/documentStoreProvider.ts:624 — documentStoreProvider.parseDocumentFilterValueList has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 3, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · connectionLevelDatabaseBootstrap.stripLeadingSqlComments (cognitive 18) · ×1
  • connectionLevelDatabaseBootstrap.stripLeadingSqlComments (cognitive 18) apps/desktop/src/lib/connection/connectionLevelDatabaseBootstrap.ts:77 — connectionLevelDatabaseBootstrap.stripLeadingSqlComments has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · columnFormatter.parseIoTDBTimestampEditorValue (cognitive 18) · ×1
  • columnFormatter.parseIoTDBTimestampEditorValue (cognitive 18) apps/desktop/src/lib/dataGrid/columnFormatter.ts:383 — columnFormatter.parseIoTDBTimestampEditorValue has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 3, error handling 2 (3 pts), ternaries 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · columnFormatter.formatJsonPath (cognitive 18) · ×1
  • columnFormatter.formatJsonPath (cognitive 18) apps/desktop/src/lib/dataGrid/columnFormatter.ts:698 — columnFormatter.formatJsonPath has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dataGridColumnFilter.splitFilterValues (cognitive 18) · ×1
  • dataGridColumnFilter.splitFilterValues (cognitive 18) apps/desktop/src/lib/dataGrid/dataGridColumnFilter.ts:253 — dataGridColumnFilter.splitFilterValues has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 3, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dataGridColumnIndexIcon.buildColumnIndexMap (cognitive 18) · ×1
  • dataGridColumnIndexIcon.buildColumnIndexMap (cognitive 18) apps/desktop/src/lib/dataGrid/dataGridColumnIndexIcon.ts:11 — dataGridColumnIndexIcon.buildColumnIndexMap has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (8 pts), ternaries 2 (5 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · geometryPreview.tokenize (cognitive 18) · ×1
  • geometryPreview.tokenize (cognitive 18) apps/desktop/src/lib/dataGrid/geometryPreview.ts:14 — geometryPreview.tokenize has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 4, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dataDictionaryPdf.flowObjects (cognitive 18) · ×1
  • dataDictionaryPdf.flowObjects (cognitive 18) apps/desktop/src/lib/docs/dataDictionaryPdf.ts:247 — dataDictionaryPdf.flowObjects has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 6). Of this number, 15 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlSemanticSelectionRanges.validateTokens (cognitive 18) · ×1
  • sqlSemanticSelectionRanges.validateTokens (cognitive 18) apps/desktop/src/lib/editor/sqlSemanticSelectionRanges.ts:108 — sqlSemanticSelectionRanges.validateTokens has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · diagramFormats.diagramExportFileName (cognitive 18) · ×1
  • diagramFormats.diagramExportFileName (cognitive 18) apps/desktop/src/lib/export/diagramFormats.ts:100 — diagramFormats.diagramExportFileName has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8 (17 pts), boolean chains 1 (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · dbeaverImport.parseJdbcUrl (cognitive 18) · ×1
  • dbeaverImport.parseJdbcUrl (cognitive 18) apps/desktop/src/lib/imports/dbeaverImport.ts:148 — dbeaverImport.parseJdbcUrl has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 4, loops 1 (2 pts), error handling 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · navicatImport.inferProfile (cognitive 18) · ×1
  • navicatImport.inferProfile (cognitive 18) apps/desktop/src/lib/imports/navicatImport.ts:153 — navicatImport.inferProfile has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tableMetadataCache.loadTableMetadata (cognitive 18) · ×1
  • tableMetadataCache.loadTableMetadata (cognitive 18) apps/desktop/src/lib/metadata/tableMetadataCache.ts:302 — tableMetadataCache.loadTableMetadata has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (9 pts), boolean chains 5, if/else 3 (4 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mongoCompletion.getMongoCompletionContext (cognitive 18) · ×1
  • mongoCompletion.getMongoCompletionContext (cognitive 18) REDACTED:262 — mongoCompletion.getMongoCompletionContext has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8, ternaries 4 (8 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mongoDocumentValues.buildMongoCopyUpdateDocument (cognitive 18) · ×1
  • mongoDocumentValues.buildMongoCopyUpdateDocument (cognitive 18) apps/desktop/src/lib/mongo/mongoDocumentValues.ts:301 — mongoDocumentValues.buildMongoCopyUpdateDocument has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, 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 · mongoShellCommand.findUnsupportedValueConstructor (cognitive 18) · ×1
  • mongoShellCommand.findUnsupportedValueConstructor (cognitive 18) apps/desktop/src/lib/mongo/mongoShellCommand.ts:207 — mongoShellCommand.findUnsupportedValueConstructor has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, ternaries 1 (3 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mongoSyntaxDiagnostics.describeMongoWriteRisk (cognitive 18) · ×1
  • mongoSyntaxDiagnostics.describeMongoWriteRisk (cognitive 18) apps/desktop/src/lib/mongo/mongoSyntaxDiagnostics.ts:76 — mongoSyntaxDiagnostics.describeMongoWriteRisk has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (13 pts), if/else 2 (4 pts), match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · nacosAdmin.pairChangedLines (cognitive 18) · ×1
  • nacosAdmin.pairChangedLines (cognitive 18) apps/desktop/src/lib/nacos/nacosAdmin.ts:622 — nacosAdmin.pairChangedLines has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 7 (16 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sidebarTableVGroupDrag.resolveTableVGroupDropTarget (cognitive 18) · ×1
  • sidebarTableVGroupDrag.resolveTableVGroupDropTarget (cognitive 18) apps/desktop/src/lib/sidebar/sidebarTableVGroupDrag.ts:29 — sidebarTableVGroupDrag.resolveTableVGroupDropTarget has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · completion.sqlSemanticSelectStarIsOnlyProjection (cognitive 18) · ×1
  • completion.sqlSemanticSelectStarIsOnlyProjection (cognitive 18) apps/desktop/src/lib/sql/semantic/completion.ts:77 — completion.sqlSemanticSelectStarIsOnlyProjection has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 7, loops 1, ternaries 1 (nesting depth added 2). Of this number, 16 points are the body's own statements and 2 belong to 3 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · model.trailingIdentifier (cognitive 18) · ×1
  • model.trailingIdentifier (cognitive 18) apps/desktop/src/lib/sql/semantic/model.ts:845 — model.trailingIdentifier has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 6). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlCompletion.objectMatchesCompletionContext (cognitive 18) · ×1
  • sqlCompletion.objectMatchesCompletionContext (cognitive 18) REDACTED:4279 — sqlCompletion.objectMatchesCompletionContext has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 6, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · routineParameters.xuguFunctionReturnType (cognitive 18) · ×1
  • routineParameters.xuguFunctionReturnType (cognitive 18) apps/desktop/src/lib/table/routineParameters.ts:341 — routineParameters.xuguFunctionReturnType has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, 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 · tableStructureEditorState.columnDataTypeForEditor (cognitive 18) · ×1
  • tableStructureEditorState.columnDataTypeForEditor (cognitive 18) apps/desktop/src/lib/table/tableStructureEditorState.ts:997 — tableStructureEditorState.columnDataTypeForEditor has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, ternaries 2 (4 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tableVGroup.applyTableVGroupsToChildren (cognitive 18) · ×1
  • tableVGroup.applyTableVGroupsToChildren (cognitive 18) apps/desktop/src/lib/table/tableVGroup.ts:484 — tableVGroup.applyTableVGroupsToChildren has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 3, boolean chains 2 (nesting depth added 5). Of this number, 14 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · json.quoteUnquotedObjectKeys (cognitive 18) · ×1
  • json.quoteUnquotedObjectKeys (cognitive 18) REDACTED:456 — json.quoteUnquotedObjectKeys has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NacosAdminConfig · ×1
  • NacosAdminConfig::validate (cognitive 17) crates/dbx-core/src/admin/nacos/config.rs:208 — NacosAdminConfig::validate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 2, loops 1, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · BackupSchedule · ×1
  • BackupSchedule::next_after (cognitive 17) crates/dbx-core/src/scheduled_backup/models.rs:181 — BackupSchedule::next_after has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DbxJdbcPlugin.listIndexes (cognitive 17) · ×1
  • DbxJdbcPlugin.listIndexes (cognitive 17) REDACTED:2447 — DbxJdbcPlugin.listIndexes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (6 pts), boolean chains 4, error handling 3 (4 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · validate_agents.validate_manifest_fields (cognitive 17) · ×1
  • validate_agents.validate_manifest_fields (cognitive 17) agents/scripts/validate_agents.py:148 — validate_agents.validate_manifest_fields has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 1, loops 1, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.renderCQLValue (cognitive 17) · ×1
  • main.renderCQLValue (cognitive 17) agents/drivers/cassandra-go/values.go:39 — main.renderCQLValue has cognitive complexity 17 (threshold 15). Drivers by points: loops 5 (9 pts), if/else 4 (6 pts), match/switch 2 (nesting depth added 6). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · etcdSession.listPrefix (cognitive 17) · ×1
  • etcdSession.listPrefix (cognitive 17) agents/drivers/etcd-go/kv.go:27 — etcdSession.listPrefix has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 3, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · etcd2Session.authRolePermission (cognitive 17) · ×1
  • etcd2Session.authRolePermission (cognitive 17) agents/drivers/etcd2-go/auth.go:322 — etcd2Session.authRolePermission has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (14 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · main.queryTimestampPrecision (cognitive 17) · ×1
  • main.queryTimestampPrecision (cognitive 17) agents/drivers/iotdb/driver.go:274 — main.queryTimestampPrecision has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2, match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.main (cognitive 17) · ×1
  • main.main (cognitive 17) REDACTED:582 — main.main has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 7). Of this number, 13 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.oracleColumnTypeDDL (cognitive 17) · ×1
  • main.oracleColumnTypeDDL (cognitive 17) REDACTED:3530 — main.oracleColumnTypeDDL has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 5 (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 · server.oracleCompletionValidSynonymTargets (cognitive 17) · ×1
  • server.oracleCompletionValidSynonymTargets (cognitive 17) REDACTED:2037 — server.oracleCompletionValidSynonymTargets has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.managementGetAll (cognitive 17) · ×1
  • main.managementGetAll (cognitive 17) REDACTED:163 — main.managementGetAll has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.managementGetPage (cognitive 17) · ×1
  • main.managementGetPage (cognitive 17) REDACTED:201 — main.managementGetPage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.matchingBrace (cognitive 17) · ×1
  • main.matchingBrace (cognitive 17) REDACTED:404 — main.matchingBrace has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (14 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server.appendTableIndexDDL (cognitive 17) · ×1
  • server.appendTableIndexDDL (cognitive 17) REDACTED:5154 — server.appendTableIndexDDL has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.requireReachableServer (cognitive 17) · ×1
  • main.requireReachableServer (cognitive 17) agents/drivers/zookeeper/connection.go:387 — main.requireReachableServer has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 3 (7 pts), if/else 2 (6 pts), loops 3 (4 pts) (nesting depth added 9). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 396, 414). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · semver.recursivePreReleaseCompare (cognitive 17) · ×1
  • semver.recursivePreReleaseCompare (cognitive 17) agents/go-common/go-semver/semver.go:207 — semver.recursivePreReleaseCompare has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · GSSAPIMechanism.negotiateSecurityLayer (cognitive 17) · ×1
  • GSSAPIMechanism.negotiateSecurityLayer (cognitive 17) agents/go-common/gosasl/gssapi.go:132 — GSSAPIMechanism.negotiateSecurityLayer has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · IoTDBRpcDataSet.getObjectByTsBlockIndex (cognitive 17) · ×1
  • IoTDBRpcDataSet.getObjectByTsBlockIndex (cognitive 17) agents/go-common/iotdb-client-go/client/rpcdataset.go:522 — IoTDBRpcDataSet.getObjectByTsBlockIndex has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (16 pts), match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useQueryEditorStatementBoundaries.useQueryEditorStatementBoundaries (cognitive 17) · ×1
  • useQueryEditorStatementBoundaries.useQueryEditorStatementBoundaries (cognitive 17) apps/desktop/src/components/editor/useQueryEditorStatementBoundaries.ts:28 — useQueryEditorStatementBoundaries.useQueryEditorStatementBoundaries has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 4. Of this number, 13 points are the body's own statements and 4 belong to 3 function literals inside it that branch. 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 · useDataGenerateSession.cloneColumn (cognitive 17) · ×1
  • useDataGenerateSession.cloneColumn (cognitive 17) apps/desktop/src/composables/useDataGenerateSession.ts:99 — useDataGenerateSession.cloneColumn has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 9 (17 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · errorUtils.isBackendError (cognitive 17) · ×1
  • errorUtils.isBackendError (cognitive 17) apps/desktop/src/lib/backend/errorUtils.ts:128 — errorUtils.isBackendError has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 8 (nesting depth added 2). Of this number, 15 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · codeSnapshot.applySnapshotSqlTableColors (cognitive 17) · ×1
  • codeSnapshot.applySnapshotSqlTableColors (cognitive 17) apps/desktop/src/lib/codeSnapshot/codeSnapshot.ts:238 — codeSnapshot.applySnapshotSqlTableColors has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 5, ternaries 1 (2 pts), error handling 1 (nesting depth added 4). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 263, 285). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · connectionDeepLink.serviceEndpoint (cognitive 17) · ×1
  • connectionDeepLink.serviceEndpoint (cognitive 17) apps/desktop/src/lib/connection/connectionDeepLink.ts:201 — connectionDeepLink.serviceEndpoint has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · connectionDeepLink.parseConnectionDeepLink (cognitive 17) · ×1
  • connectionDeepLink.parseConnectionDeepLink (cognitive 17) apps/desktop/src/lib/connection/connectionDeepLink.ts:273 — connectionDeepLink.parseConnectionDeepLink has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (6 pts), boolean chains 4, ternaries 4, error handling 2 (3 pts) (nesting depth added 2). Of this number, 14 points are the body's own statements and 3 belong to one function literal inside it that branches. 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 · connectionUrl.parseJdbcOracleUrl (cognitive 17) · ×1
  • connectionUrl.parseJdbcOracleUrl (cognitive 17) REDACTED:498 — connectionUrl.parseJdbcOracleUrl has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 4 (5 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessionModel.normalizeConsulSession (cognitive 17) · ×1
  • sessionModel.normalizeConsulSession (cognitive 17) apps/desktop/src/lib/consul/sessionModel.ts:5 — sessionModel.normalizeConsulSession has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 11 (13 pts), boolean chains 4 (nesting depth added 2). Of this number, 14 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · dataGenerate.formatGeneratedValue (cognitive 17) · ×1
  • dataGenerate.formatGeneratedValue (cognitive 17) apps/desktop/src/lib/dataGrid/dataGenerate.ts:1809 — dataGenerate.formatGeneratedValue has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 2 (4 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dataGridCopyExtractor.normalizeDataGridExtractorOptions (cognitive 17) · ×1
  • dataGridCopyExtractor.normalizeDataGridExtractorOptions (cognitive 17) apps/desktop/src/lib/dataGrid/dataGridCopyExtractor.ts:161 — dataGridCopyExtractor.normalizeDataGridExtractorOptions has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 9, boolean chains 8. Of this number, 15 points are the body's own statements and 2 belong to one function literal inside it that branches. 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 · dataGridLargeValues.createResultScopedRowCache (cognitive 17) · ×1
  • dataGridLargeValues.createResultScopedRowCache (cognitive 17) apps/desktop/src/lib/dataGrid/dataGridLargeValues.ts:48 — dataGridLargeValues.createResultScopedRowCache has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 3, boolean chains 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dataGridReplace.prepareDataGridCellReplacements (cognitive 17) · ×1
  • dataGridReplace.prepareDataGridCellReplacements (cognitive 17) apps/desktop/src/lib/dataGrid/dataGridReplace.ts:53 — dataGridReplace.prepareDataGridCellReplacements has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 3 (5 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · createDatabaseCharsetOptions.parseCreateDatabaseCharsetMetadata (cognitive 17) · ×1
  • createDatabaseCharsetOptions.parseCreateDatabaseCharsetMetadata (cognitive 17) apps/desktop/src/lib/database/createDatabaseCharsetOptions.ts:68 — createDatabaseCharsetOptions.parseCreateDatabaseCharsetMetadata has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 2, loops 2, ternaries 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlExecutionTargetCapabilities.sqlExecutionTargetCapabilities (cognitive 17) · ×1
  • sqlExecutionTargetCapabilities.sqlExecutionTargetCapabilities (cognitive 17) apps/desktop/src/lib/database/sqlExecutionTargetCapabilities.ts:43 — sqlExecutionTargetCapabilities.sqlExecutionTargetCapabilities has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (9 pts), boolean chains 7, if/else 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 · explainPlan.oraclePredicateDetails (cognitive 17) · ×1
  • explainPlan.oraclePredicateDetails (cognitive 17) apps/desktop/src/lib/diagram/explainPlan.ts:252 — explainPlan.oraclePredicateDetails has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · keyboardShortcuts.eventToShortcut (cognitive 17) · ×1
  • keyboardShortcuts.eventToShortcut (cognitive 17) apps/desktop/src/lib/editor/keyboardShortcuts.ts:94 — keyboardShortcuts.eventToShortcut has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · sqlSemanticSelectionRanges.normalizeTokens (cognitive 17) · ×1
  • sqlSemanticSelectionRanges.normalizeTokens (cognitive 17) apps/desktop/src/lib/editor/sqlSemanticSelectionRanges.ts:82 — sqlSemanticSelectionRanges.normalizeTokens has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 3, ternaries 1 (3 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · datagripImport.mergeFragments (cognitive 17) · ×1
  • datagripImport.mergeFragments (cognitive 17) apps/desktop/src/lib/imports/datagripImport.ts:398 — datagripImport.mergeFragments has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 12, loops 3, if/else 1 (2 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · mongoConnectionOptions.mongodbAuthFailureHint (cognitive 17) · ×1
  • mongoConnectionOptions.mongodbAuthFailureHint (cognitive 17) apps/desktop/src/lib/mongo/mongoConnectionOptions.ts:57 — mongoConnectionOptions.mongodbAuthFailureHint has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, boolean chains 7. 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 · nacosConfigValidation.closeImplicitHtmlTags (cognitive 17) · ×1
  • nacosConfigValidation.closeImplicitHtmlTags (cognitive 17) apps/desktop/src/lib/nacos/nacosConfigValidation.ts:95 — nacosConfigValidation.closeImplicitHtmlTags has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, boolean chains 8. 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 · PluginHostBridge.requestInit (cognitive 17) · ×1
  • PluginHostBridge.requestInit (cognitive 17) REDACTED:339 — PluginHostBridge.requestInit has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 5, loops 2 (4 pts), error handling 1 (nesting depth added 3). Of this number, 14 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PluginHostBridge.publishAiRecommendations (cognitive 17) · ×1
  • PluginHostBridge.publishAiRecommendations (cognitive 17) REDACTED:461 — PluginHostBridge.publishAiRecommendations has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 10 (15 pts), boolean chains 1, if/else 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 · multiSourceResult.summarizeNumericColumns (cognitive 17) · ×1
  • multiSourceResult.summarizeNumericColumns (cognitive 17) apps/desktop/src/lib/query/multiSourceResult.ts:103 — multiSourceResult.summarizeNumericColumns has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · msgpack.toJsonable (cognitive 17) · ×1
  • msgpack.toJsonable (cognitive 17) apps/desktop/src/lib/redis/codec/msgpack.ts:21 — msgpack.toJsonable has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 2 (4 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · redisCompletion.argumentGrammar (cognitive 17) · ×1
  • redisCompletion.argumentGrammar (cognitive 17) apps/desktop/src/lib/redis/redisCompletion.ts:323 — redisCompletion.argumentGrammar has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, loops 2 (4 pts), boolean chains 1, ternaries 1 (nesting depth added 2). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 341, 334, 332, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · redisSyntaxDiagnostics.buildRedisSyntaxDiagnostics (cognitive 17) · ×1
  • redisSyntaxDiagnostics.buildRedisSyntaxDiagnostics (cognitive 17) apps/desktop/src/lib/redis/redisSyntaxDiagnostics.ts:42 — redisSyntaxDiagnostics.buildRedisSyntaxDiagnostics has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · schemaDiff.normalizeSchemaDiffDependencyGraph (cognitive 17) · ×1
  • schemaDiff.normalizeSchemaDiffDependencyGraph (cognitive 17) apps/desktop/src/lib/schema/schemaDiff.ts:305 — schemaDiff.normalizeSchemaDiffDependencyGraph has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 9 (13 pts), boolean chains 2, if/else 2 (nesting depth added 4). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 310). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · soqlCompletion.valueItems (cognitive 17) · ×1
  • soqlCompletion.valueItems (cognitive 17) apps/desktop/src/lib/soql/soqlCompletion.ts:456 — soqlCompletion.valueItems has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 4, ternaries 1 (3 pts), loops 1 (nesting depth added 4). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 465). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · insertValueHints.parseValuesRows (cognitive 17) · ×1
  • insertValueHints.parseValuesRows (cognitive 17) apps/desktop/src/lib/sql/insertValueHints.ts:158 — insertValueHints.parseValuesRows has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · printer.printElement (cognitive 17) · ×1
  • printer.printElement (cognitive 17) apps/desktop/src/lib/sql/layout/printer.ts:192 — printer.printElement has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (3 pts), boolean chains 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · completion.mutationTargetIntroducer (cognitive 17) · ×1
  • completion.mutationTargetIntroducer (cognitive 17) apps/desktop/src/lib/sql/semantic/completion.ts:297 — completion.mutationTargetIntroducer has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, loops 2 (nesting depth added 6). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · references.mergeSqlSemanticReferenceAnalysis (cognitive 17) · ×1
  • references.mergeSqlSemanticReferenceAnalysis (cognitive 17) apps/desktop/src/lib/sql/semantic/references.ts:92 — references.mergeSqlSemanticReferenceAnalysis has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, loops 2 (nesting depth added 5). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 102). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · sqlCompletion.detectCompletionContextKind (cognitive 17) · ×1
  • sqlCompletion.detectCompletionContextKind (cognitive 17) REDACTED:2731 — sqlCompletion.detectCompletionContextKind has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 4, ternaries 2 (4 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · sqlCompletion.findMatchingParen (cognitive 17) · ×1
  • sqlCompletion.findMatchingParen (cognitive 17) REDACTED:3639 — sqlCompletion.findMatchingParen has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlCompletion.buildAliasCandidates (cognitive 17) · ×1
  • sqlCompletion.buildAliasCandidates (cognitive 17) REDACTED:4722 — sqlCompletion.buildAliasCandidates has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3 (nesting depth added 6). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlCompletion.findActiveFunctionOpenParen (cognitive 17) · ×1
  • sqlCompletion.findActiveFunctionOpenParen (cognitive 17) REDACTED:5908 — sqlCompletion.findActiveFunctionOpenParen has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlParameters.splitCommaSeparatedValues (cognitive 17) · ×1
  • sqlParameters.splitCommaSeparatedValues (cognitive 17) apps/desktop/src/lib/sql/sqlParameters.ts:280 — sqlParameters.splitCommaSeparatedValues has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlNavigation.matchSqlObject (cognitive 17) · ×1
  • sqlNavigation.matchSqlObject (cognitive 17) apps/desktop/src/lib/sql/sqlNavigation.ts:709 — sqlNavigation.matchSqlObject has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 6 (8 pts) (nesting depth added 2). Of this number, 12 points are the body's own statements and 5 belong to 6 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · postgresDataTypeHelp.gaussdbMTypeDisplayName (cognitive 17) · ×1
  • postgresDataTypeHelp.gaussdbMTypeDisplayName (cognitive 17) apps/desktop/src/lib/table/postgresDataTypeHelp.ts:164 — postgresDataTypeHelp.gaussdbMTypeDisplayName has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 6. 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 · tableTree.buildPrefixSortIndex (cognitive 17) · ×1
  • tableTree.buildPrefixSortIndex (cognitive 17) apps/desktop/src/lib/table/tableTree.ts:153 — tableTree.buildPrefixSortIndex has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 4 (5 pts), boolean chains 2, ternaries 1 (nesting depth added 5). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 168). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · tableVGroup.findTableVGroupHostContainer (cognitive 17) · ×1
  • tableVGroup.findTableVGroupHostContainer (cognitive 17) apps/desktop/src/lib/table/tableVGroup.ts:661 — tableVGroup.findTableVGroupHostContainer has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 9). Most of this is not in the body itself: 0 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 662). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · tabPresentation.tabDatabaseIconType (cognitive 17) · ×1
  • tabPresentation.tabDatabaseIconType (cognitive 17) apps/desktop/src/lib/tabs/tabPresentation.ts:671 — tabPresentation.tabDatabaseIconType has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Diagnostics.query (cognitive 17) · ×1
  • Diagnostics.query (cognitive 17) plugins/sdk/dev-host/diagnostics.mjs:70 — Diagnostics.query has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 4 (5 pts), ternaries 2, loops 1 (nesting depth added 1). Of this number, 12 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · redact · ×1
  • redact::visit (cognitive 17) plugins/sdk/dev-host/diagnostics.mjs:9 — redact::visit has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 4, ternaries 2 (3 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · StreamingToolCallAccumulator · ×1
  • StreamingToolCallAccumulator::process (cognitive 16) crates/dbx-ai-provider/src/ai.rs:4226 — StreamingToolCallAccumulator::process has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · PluginServer · ×1
  • PluginServer::serve_framed (cognitive 16) plugins/sdk/rust/dbx-plugin-sdk/src/lib.rs:503 — PluginServer::serve_framed has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 2 (4 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OceanBaseOracleAgent.getTableDdl (cognitive 16) · ×1
  • OceanBaseOracleAgent.getTableDdl (cognitive 16) agents/drivers/oceanbase-oracle/src/main/java/com/dbx/agent/oceanbaseoracle/OceanBaseOracleAgent.java:954 — OceanBaseOracleAgent.getTableDdl has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 4, loops 3, error handling 1 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KafkaAgent.collectLatestPeekRange (cognitive 16) · ×1
  • KafkaAgent.collectLatestPeekRange (cognitive 16) agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:1945 — KafkaAgent.collectLatestPeekRange has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (3 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KafkaAgent.collectLatestPeekedMessages (cognitive 16) · ×1
  • KafkaAgent.collectLatestPeekedMessages (cognitive 16) agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:1869 — KafkaAgent.collectLatestPeekedMessages has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · H2Agent.getTableDdl (cognitive 16) · ×1
  • H2Agent.getTableDdl (cognitive 16) agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:353 — H2Agent.getTableDdl has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 4 (5 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AbstractJdbcAgent.finishPooledRequest (cognitive 16) · ×1
  • AbstractJdbcAgent.finishPooledRequest (cognitive 16) agents/common/src/main/java/com/dbx/agent/AbstractJdbcAgent.java:389 — AbstractJdbcAgent.finishPooledRequest has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 6 (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 · main.parseCassandraConfig (cognitive 16) · ×1
  • main.parseCassandraConfig (cognitive 16) agents/drivers/cassandra-go/config.go:54 — main.parseCassandraConfig has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 2, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · main.applyNativeHOCON (cognitive 16) · ×1
  • main.applyNativeHOCON (cognitive 16) agents/drivers/cassandra-go/config_file.go:288 — main.applyNativeHOCON has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14 (15 pts), 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 · main.tableDDLFromMetadata (cognitive 16) · ×1
  • main.tableDDLFromMetadata (cognitive 16) agents/drivers/cassandra-go/metadata.go:492 — main.tableDDLFromMetadata has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 4 (5 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server.executeQuery (cognitive 16) · ×1
  • server.executeQuery (cognitive 16) agents/drivers/cassandra-go/query.go:13 — server.executeQuery has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · etcdSession.authRolePermission (cognitive 16) · ×1
  • etcdSession.authRolePermission (cognitive 16) agents/drivers/etcd-go/auth.go:396 — etcdSession.authRolePermission has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (16 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.datasetRow (cognitive 16) · ×1
  • main.datasetRow (cognitive 16) agents/drivers/iotdb/query.go:414 — main.datasetRow has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server.getTreeDialectDDL (cognitive 16) · ×1
  • server.getTreeDialectDDL (cognitive 16) agents/drivers/iotdb/metadata.go:388 — server.getTreeDialectDDL has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.takeParenGroup (cognitive 16) · ×1
  • main.takeParenGroup (cognitive 16) REDACTED:1558 — main.takeParenGroup has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), boolean chains 6, match/switch 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.normalizeNestedValue (cognitive 16) · ×1
  • main.normalizeNestedValue (cognitive 16) agents/drivers/neo4j-go/query.go:309 — main.normalizeNestedValue has cognitive complexity 16 (threshold 15). Drivers by points: loops 5 (11 pts), boolean chains 2, if/else 1 (2 pts), match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · main.normalizeNonFiniteQueryRows (cognitive 16) · ×1
  • main.normalizeNonFiniteQueryRows (cognitive 16) REDACTED:402 — main.normalizeNonFiniteQueryRows has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.oracleCompletionArgumentDataType (cognitive 16) · ×1
  • main.oracleCompletionArgumentDataType (cognitive 16) REDACTED:2265 — main.oracleCompletionArgumentDataType has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.oracleTriggerBody (cognitive 16) · ×1
  • main.oracleTriggerBody (cognitive 16) REDACTED:2909 — main.oracleTriggerBody has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.terminateOracleViewDDL (cognitive 16) · ×1
  • main.terminateOracleViewDDL (cognitive 16) REDACTED:3416 — main.terminateOracleViewDDL has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, 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 · main.classifyRPCError (cognitive 16) · ×1
  • main.classifyRPCError (cognitive 16) agents/drivers/vastbase-go/protocol_error.go:33 — main.classifyRPCError has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server.applyPostgresIdentityMetadata (cognitive 16) · ×1
  • server.applyPostgresIdentityMetadata (cognitive 16) agents/drivers/vastbase-go/vastbase_metadata.go:2185 — server.applyPostgresIdentityMetadata has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3, 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 · main.parseXuguPackageMembers (cognitive 16) · ×1
  • main.parseXuguPackageMembers (cognitive 16) agents/drivers/xugu/package_members.go:177 — main.parseXuguPackageMembers has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.detectServerVersion (cognitive 16) · ×1
  • main.detectServerVersion (cognitive 16) agents/drivers/zookeeper/connection.go:309 — main.detectServerVersion has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gosasl.negotiateToken (cognitive 16) · ×1
  • gosasl.negotiateToken (cognitive 16) agents/go-common/gosasl/http_spnego.go:223 — gosasl.negotiateToken has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · client.newClusterSessionWithSqlDialect (cognitive 16) · ×1
  • client.newClusterSessionWithSqlDialect (cognitive 16) agents/go-common/iotdb-client-go/client/session.go:1354 — client.newClusterSessionWithSqlDialect has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ddlStorage.spliceTightRemovals (cognitive 16) · ×1
  • ddlStorage.spliceTightRemovals (cognitive 16) apps/desktop/src/lib/sql/ddlStorage.ts:56 — ddlStorage.spliceTightRemovals has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 3 (5 pts), loops 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · build_offline_jdbc_payload.validateAndCopyBundle (cognitive 16) · ×1
  • build_offline_jdbc_payload.validateAndCopyBundle (cognitive 16) agents/scripts/build_offline_jdbc_payload.mjs:82 — build_offline_jdbc_payload.validateAndCopyBundle has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 5, loops 1, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · verify_offline_jdbc_release.validatePayload (cognitive 16) · ×1
  • verify_offline_jdbc_release.validatePayload (cognitive 16) agents/scripts/verify_offline_jdbc_release.mjs:41 — verify_offline_jdbc_release.validatePayload has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, 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 · useQueryEditorExecution.useQueryEditorExecution (cognitive 16) · ×1
  • useQueryEditorExecution.useQueryEditorExecution (cognitive 16) apps/desktop/src/components/editor/useQueryEditorExecution.ts:29 — useQueryEditorExecution.useQueryEditorExecution has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 4, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · errorUtils.jsonObjectEnd (cognitive 16) · ×1
  • errorUtils.jsonObjectEnd (cognitive 16) apps/desktop/src/lib/backend/errorUtils.ts:65 — errorUtils.jsonObjectEnd has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · safeJsonFormat.diffText (cognitive 16) · ×1
  • safeJsonFormat.diffText (cognitive 16) apps/desktop/src/lib/common/safeJsonFormat.ts:245 — safeJsonFormat.diffText has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (6 pts), loops 3 (5 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · connectionUrl.parseZooKeeperUrl (cognitive 16) · ×1
  • connectionUrl.parseZooKeeperUrl (cognitive 16) REDACTED:236 — connectionUrl.parseZooKeeperUrl has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 8, boolean chains 4, if/else 3, error handling 1. Of this number, 10 points are the body's own statements and 6 belong to one function literal inside it that branches. 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 · connectionUrl.parseJdbcDremioUrl (cognitive 16) · ×1
  • connectionUrl.parseJdbcDremioUrl (cognitive 16) REDACTED:634 — connectionUrl.parseJdbcDremioUrl has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 4 (6 pts), ternaries 2 (3 pts), loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dataGridReplace.findDataGridReplacementMatches (cognitive 16) · ×1
  • dataGridReplace.findDataGridReplacementMatches (cognitive 16) apps/desktop/src/lib/dataGrid/dataGridReplace.ts:36 — dataGridReplace.findDataGridReplacementMatches has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, loops 1 (nesting depth added 5). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 41). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · gridSelection.summarizeSelection (cognitive 16) · ×1
  • gridSelection.summarizeSelection (cognitive 16) apps/desktop/src/lib/dataGrid/gridSelection.ts:108 — gridSelection.summarizeSelection has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (8 pts), if/else 1 (3 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · databaseUserAdmin.splitMySqlIdentifierPath (cognitive 16) · ×1
  • databaseUserAdmin.splitMySqlIdentifierPath (cognitive 16) REDACTED:772 — databaseUserAdmin.splitMySqlIdentifierPath has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · queryEditorTextEdits.blankLineDeletionChanges (cognitive 16) · ×1
  • queryEditorTextEdits.blankLineDeletionChanges (cognitive 16) apps/desktop/src/lib/editor/queryEditorTextEdits.ts:22 — queryEditorTextEdits.blankLineDeletionChanges has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (3 pts), ternaries 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 · sqlSemanticSelectionRanges.collectExpressionRanges (cognitive 16) · ×1
  • sqlSemanticSelectionRanges.collectExpressionRanges (cognitive 16) apps/desktop/src/lib/editor/sqlSemanticSelectionRanges.ts:305 — sqlSemanticSelectionRanges.collectExpressionRanges has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2, ternaries 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · datagripImport.inferProfile (cognitive 16) · ×1
  • datagripImport.inferProfile (cognitive 16) apps/desktop/src/lib/imports/datagripImport.ts:243 — datagripImport.inferProfile has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 2, 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 · datagripImport.parseDataSourcesXml (cognitive 16) · ×1
  • datagripImport.parseDataSourcesXml (cognitive 16) apps/desktop/src/lib/imports/datagripImport.ts:276 — datagripImport.parseDataSourcesXml has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · kvValueFormat.detectKvValueFormat (cognitive 16) · ×1
  • kvValueFormat.detectKvValueFormat (cognitive 16) apps/desktop/src/lib/kv/kvValueFormat.ts:17 — kvValueFormat.detectKvValueFormat has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 5. 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 · objectMetadataCache.loadObjectMetadataFacet (cognitive 16) · ×1
  • objectMetadataCache.loadObjectMetadataFacet (cognitive 16) apps/desktop/src/lib/metadata/objectMetadataCache.ts:124 — objectMetadataCache.loadObjectMetadataFacet has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mongoShellCommand.mongoFilterContainsOpaqueLogic (cognitive 16) · ×1
  • mongoShellCommand.mongoFilterContainsOpaqueLogic (cognitive 16) apps/desktop/src/lib/mongo/mongoShellCommand.ts:1887 — mongoShellCommand.mongoFilterContainsOpaqueLogic has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 7 (nesting depth added 3). Most of this is not in the body itself: 0 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 1888). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · FrontendPluginRegistry.listToolbarMenuCommands (cognitive 16) · ×1
  • FrontendPluginRegistry.listToolbarMenuCommands (cognitive 16) apps/desktop/src/lib/plugins/frontendPlugin.ts:103 — FrontendPluginRegistry.listToolbarMenuCommands has cognitive complexity 16 (threshold 15). Drivers by points: if/else 2 (7 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 8). Of this number, 13 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pluginHostBridge.requirePluginAiRecommendationUpdate (cognitive 16) · ×1
  • pluginHostBridge.requirePluginAiRecommendationUpdate (cognitive 16) REDACTED:1456 — pluginHostBridge.requirePluginAiRecommendationUpdate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 6, ternaries 1. Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 1462). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · redisCommandDocs.parseRedisCommandCatalog (cognitive 16) · ×1
  • redisCommandDocs.parseRedisCommandCatalog (cognitive 16) apps/desktop/src/lib/redis/redisCommandDocs.ts:207 — redisCommandDocs.parseRedisCommandCatalog has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 6). Most of this is not in the body itself: 0 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 209). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · redisCommandSafety.firstRedisCommandToken (cognitive 16) · ×1
  • redisCommandSafety.firstRedisCommandToken (cognitive 16) apps/desktop/src/lib/redis/redisCommandSafety.ts:252 — redisCommandSafety.firstRedisCommandToken has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 3, ternaries 2 (3 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · redisKeyTree.flattenVisibleRedisKeyTreeCooperatively (cognitive 16) · ×1
  • redisKeyTree.flattenVisibleRedisKeyTreeCooperatively (cognitive 16) apps/desktop/src/lib/redis/redisKeyTree.ts:270 — redisKeyTree.flattenVisibleRedisKeyTreeCooperatively has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · schemaDiff.buildDeploySqlForObjects (cognitive 16) · ×1
  • schemaDiff.buildDeploySqlForObjects (cognitive 16) apps/desktop/src/lib/schema/schemaDiff.ts:925 — schemaDiff.buildDeploySqlForObjects has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, loops 1 (nesting depth added 6). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sidebarDatabaseStorage.applySidebarTableStorage (cognitive 16) · ×1
  • sidebarDatabaseStorage.applySidebarTableStorage (cognitive 16) apps/desktop/src/lib/sidebar/sidebarDatabaseStorage.ts:50 — sidebarDatabaseStorage.applySidebarTableStorage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, loops 1 (nesting depth added 5). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 54, 52). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · sidebarLayoutMonitor.captureRows (cognitive 16) · ×1
  • sidebarLayoutMonitor.captureRows (cognitive 16) apps/desktop/src/lib/sidebar/sidebarLayoutMonitor.ts:272 — sidebarLayoutMonitor.captureRows has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sidebarLayoutMonitor.buildAnomalyDigest (cognitive 16) · ×1
  • sidebarLayoutMonitor.buildAnomalyDigest (cognitive 16) apps/desktop/src/lib/sidebar/sidebarLayoutMonitor.ts:576 — sidebarLayoutMonitor.buildAnomalyDigest has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (10 pts), if/else 4, boolean chains 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sidebarSearch.matchesWordPrefixConcatenation (cognitive 16) · ×1
  • sidebarSearch.matchesWordPrefixConcatenation (cognitive 16) apps/desktop/src/lib/sidebar/sidebarSearch.ts:106 — sidebarSearch.matchesWordPrefixConcatenation has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sidebarSearchTree.filterLocallySearchedTables (cognitive 16) · ×1
  • sidebarSearchTree.filterLocallySearchedTables (cognitive 16) apps/desktop/src/lib/sidebar/sidebarSearchTree.ts:86 — sidebarSearchTree.filterLocallySearchedTables has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, ternaries 5 (7 pts), if/else 1 (nesting depth added 2). Most of this is not in the body itself: 0 of the 16 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 87, 97, 103, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · sidebarSearchTree.filterSidebarTreeToConnectedConnections (cognitive 16) · ×1
  • sidebarSearchTree.filterSidebarTreeToConnectedConnections (cognitive 16) apps/desktop/src/lib/sidebar/sidebarSearchTree.ts:442 — sidebarSearchTree.filterSidebarTreeToConnectedConnections has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 1, loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sidebarVisibleFilterSummary.sidebarVisibleFilterSummary (cognitive 16) · ×1
  • sidebarVisibleFilterSummary.sidebarVisibleFilterSummary (cognitive 16) apps/desktop/src/lib/sidebar/sidebarVisibleFilterSummary.ts:21 — sidebarVisibleFilterSummary.sidebarVisibleFilterSummary has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), ternaries 6, boolean chains 2, loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ddlDisplay.findColumnAttributePositions (cognitive 16) · ×1
  • ddlDisplay.findColumnAttributePositions (cognitive 16) apps/desktop/src/lib/sql/ddlDisplay.ts:425 — ddlDisplay.findColumnAttributePositions has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, ternaries 7, if/else 2. Of this number, 12 points are the body's own statements and 4 belong to 4 function literals inside it that branch. 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 · sqlAnalysis.lastTopLevelWhitespaceStart (cognitive 16) · ×1
  • sqlAnalysis.lastTopLevelWhitespaceStart (cognitive 16) apps/desktop/src/lib/sql/sqlAnalysis.ts:533 — sqlAnalysis.lastTopLevelWhitespaceStart has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 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 · sqlAnalysis.parseTableSourceAt (cognitive 16) · ×1
  • sqlAnalysis.parseTableSourceAt (cognitive 16) apps/desktop/src/lib/sql/sqlAnalysis.ts:659 — sqlAnalysis.parseTableSourceAt has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 5, boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · sqlCompletion.extractSelectList (cognitive 16) · ×1
  • sqlCompletion.extractSelectList (cognitive 16) REDACTED:3594 — sqlCompletion.extractSelectList has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, 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 · sqlCompletion.extractSubqueryReferences (cognitive 16) · ×1
  • sqlCompletion.extractSubqueryReferences (cognitive 16) REDACTED:3794 — sqlCompletion.extractSubqueryReferences has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlCompletion.findMatchingOpenParen (cognitive 16) · ×1
  • sqlCompletion.findMatchingOpenParen (cognitive 16) REDACTED:5877 — sqlCompletion.findMatchingOpenParen has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlServerRoutineSyntaxDiagnostics.missingDeclareDataTypeTokens (cognitive 16) · ×1
  • sqlServerRoutineSyntaxDiagnostics.missingDeclareDataTypeTokens (cognitive 16) apps/desktop/src/lib/sql/sqlServerRoutineSyntaxDiagnostics.ts:57 — sqlServerRoutineSyntaxDiagnostics.missingDeclareDataTypeTokens has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · objectSourceLoad.loadObjectSourceWithRoutineFallback (cognitive 16) · ×1
  • objectSourceLoad.loadObjectSourceWithRoutineFallback (cognitive 16) apps/desktop/src/lib/table/objectSourceLoad.ts:11 — objectSourceLoad.loadObjectSourceWithRoutineFallback has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 2 (3 pts), error handling 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · tableColumnTemplates.mergeTableColumnTemplateFields (cognitive 16) · ×1
  • tableColumnTemplates.mergeTableColumnTemplateFields (cognitive 16) apps/desktop/src/lib/table/tableColumnTemplates.ts:76 — tableColumnTemplates.mergeTableColumnTemplateFields has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tableVGroup.findTableVGroupHolderContainer (cognitive 16) · ×1
  • tableVGroup.findTableVGroupHolderContainer (cognitive 16) apps/desktop/src/lib/table/tableVGroup.ts:682 — tableVGroup.findTableVGroupHolderContainer has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 9). Most of this is not in the body itself: 0 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 683). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · tabPresentation.tabConnectionGeneratedColor (cognitive 16) · ×1
  • tabPresentation.tabConnectionGeneratedColor (cognitive 16) apps/desktop/src/lib/tabs/tabPresentation.ts:45 — tabPresentation.tabConnectionGeneratedColor has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (15 pts), loops 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · tabResultCache.selectResultCachePruneKeys (cognitive 16) · ×1
  • tabResultCache.selectResultCachePruneKeys (cognitive 16) apps/desktop/src/lib/tabs/tabResultCache.ts:292 — tabResultCache.selectResultCachePruneKeys has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, loops 2 (nesting depth added 5). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tabUiState.sanitizeTabUiState (cognitive 16) · ×1
  • tabUiState.sanitizeTabUiState (cognitive 16) apps/desktop/src/lib/tabs/tabUiState.ts:103 — tabUiState.sanitizeTabUiState has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 3, loops 1 (2 pts), ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · settingsStore.inferAiProviderFromConfig (cognitive 16) · ×1
  • settingsStore.inferAiProviderFromConfig (cognitive 16) apps/desktop/src/stores/settingsStore.ts:661 — settingsStore.inferAiProviderFromConfig has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 8. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · meilisearchManagement.formatMeilisearchTaskDuration (cognitive 16) · ×1
  • meilisearchManagement.formatMeilisearchTaskDuration (cognitive 16) apps/desktop/src/types/meilisearchManagement.ts:169 — meilisearchManagement.formatMeilisearchTaskDuration has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, ternaries 3 (5 pts), boolean chains 4 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · platformDetection.detectPlatformId (cognitive 16) · ×1
  • platformDetection.detectPlatformId (cognitive 16) docs/lib/platformDetection.ts:22 — platformDetection.detectPlatformId has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 6, ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D22 · Internal API Consistency · Redundant pagination/listing operations. `list_prefix` appears to be a standard paginated lister (using `continuation` token), while `list_recursive` takes `max_entries` and `max_value_bytes` but lacks a continuation token in the signature, suggesting it might be a one-shot fetch or an incomplete pagination implementation. They likely serve the same domain (KV listing) but with confusingly different signatures and capabilities. · ×1
  • Redundant pagination/listing operations. `list_prefix` appears to be a standard paginated lister (using `continuation` token), while `list_recursive` takes `max_entries` and `max_value_bytes` but lacks a continuation token in the signature, suggesting it might be a one-shot fetch or an incomplete pagination implementation. They likely serve the same domain (KV listing) but with confusingly different signatures and capabilities. — Unify into a single `list_keys` or `list_prefix` method that supports pagination via a continuation token. Remove `list_recursive` or ensure it delegates to the paginated version. (signatures: ConsulClient.list_recursive(prefix: str, max_entries: usize, max_value_bytes: usize): Result | ConsulClient.list_prefix(prefix: str, limit: usize, continuation: str): Result)
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (7 members, 32 shared lines) · ×1
  • Near-duplicate member family (7 members, 32 shared lines) agents/drivers/argo-go/main.go:175 — agents/drivers/argo-go/main.go:175-237 | agents/drivers/cassandra-go/main.go:173-240 | agents/drivers/hive-go/main.go:175-237 | agents/drivers/iotdb/main.go:179-241 | agents/drivers/kingbase-go/main.go:221-284 | agents/drivers/neo4j-go/main.go:200-261 | agents/drivers/vastbase-go/main.go:233-306 — These 7 members are variants of one another: a block of 32 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
D4 · Code Duplication · Near-duplicate member family (6 members, 27 shared lines) · ×1
  • Near-duplicate member family (6 members, 27 shared lines) agents/drivers/argo-go/main.go:390 — agents/drivers/argo-go/main.go:390-475 | agents/drivers/cassandra-go/main.go:324-405 | agents/drivers/hive-go/main.go:390-475 | agents/drivers/iotdb/main.go:326-396 | agents/drivers/kingbase-go/main.go:356-470 | agents/drivers/vastbase-go/main.go:386-489 — These 6 members are variants of one another: a block of 27 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication · Near-duplicate member family (6 members, 25 shared lines) · ×1
  • Near-duplicate member family (6 members, 25 shared lines) agents/drivers/argo-go/main.go:390 — agents/drivers/argo-go/main.go:390-475 | agents/drivers/hive-go/main.go:390-475 | agents/drivers/iotdb/main.go:326-396 | agents/drivers/kingbase-go/main.go:356-470 | agents/drivers/neo4j-go/main.go:421-492 | agents/drivers/vastbase-go/main.go:386-489 — These 6 members are variants of one another: a block of 25 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication · Near-duplicate member family (5 members, 64 shared lines) · ×1
  • Near-duplicate member family (5 members, 64 shared lines) crates/dbx-core/src/schema/table_structure_sql/sqlite_rebuild.rs:784 — crates/dbx-core/src/schema/table_structure_sql/sqlite_rebuild.rs:784-867 | crates/dbx-core/src/schema/table_structure_sql/sqlite_rebuild.rs:869-948 | crates/dbx-core/src/schema/table_structure_sql/sqlite_rebuild.rs:1034-1117 | crates/dbx-core/src/schema/table_structure_sql/sqlite_rebuild.rs:1212-1291 | crates/dbx-core/src/schema/table_structure_sql/sqlite_rebuild.rs:1358-1438 — These 5 members are variants of one another: a block of 64 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Near-duplicate member family (4 members, 25 shared lines) · ×1
  • Near-duplicate member family (4 members, 25 shared lines) REDACTED:7336 — REDACTED:7336-7387 | REDACTED:7406-7464 | REDACTED:7475-7531 | REDACTED:7545-7652 — These 4 members are variants of one another: a block of 25 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Near-duplicate member family (4 members, 16 shared lines) · ×1
  • Near-duplicate member family (4 members, 16 shared lines) agents/drivers/kingbase-go/main.go:221 — agents/drivers/kingbase-go/main.go:221-284 | REDACTED:667-730 | agents/drivers/vastbase-go/main.go:233-306 | REDACTED:775-834 — These 4 members are variants of one another: a block of 16 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Near-duplicate member family (4 members, 7 shared lines) · ×1
  • Near-duplicate member family (4 members, 7 shared lines) agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:404 — agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:404-450 | agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:531-610 | agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:639-691 | agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:705-743 — These 4 members are variants of one another: a block of 7 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Near-duplicate member family (3 members, 83 shared lines) · ×1
  • Near-duplicate member family (3 members, 83 shared lines) REDACTED:2508 — REDACTED:2508-3243 | src-tauri/src/commands/connection.rs:1183-1729 | src-tauri/src/commands/connection.rs:1744-2184 — These 3 members are variants of one another: a block of 83 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication · Near-duplicate member family (3 members, 30 shared lines) · ×1
  • Near-duplicate member family (3 members, 30 shared lines) crates/dbx-driver-mysql/src/mysql.rs:5375 — crates/dbx-driver-mysql/src/mysql.rs:5375-5547 | crates/dbx-driver-mysql/src/mysql.rs:5559-5763 | crates/dbx-driver-mysql/src/mysql.rs:5787-5896 — These 3 members are variants of one another: a block of 30 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication · Near-duplicate member family (3 members, 18 shared lines) · ×1
  • Near-duplicate member family (3 members, 18 shared lines) crates/dbx-driver-mongodb/src/mongo_shell.rs:515 — crates/dbx-driver-mongodb/src/mongo_shell.rs:515-535 | crates/dbx-web/src/routes/mcp_policy.rs:197-217 | src-tauri/src/commands/mcp_bridge.rs:1423-1443 — These 3 members are variants of one another: a block of 18 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication · Near-duplicate member family (3 members, 17 shared lines) · ×1
  • Near-duplicate member family (3 members, 17 shared lines) crates/dbx-web/src/routes/database_export.rs:167 — crates/dbx-web/src/routes/database_export.rs:167-192 | crates/dbx-web/src/routes/query_result_export.rs:153-178 | crates/dbx-web/src/routes/table_export.rs:138-166 — These 3 members are variants of one another: a block of 17 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication · Near-duplicate member family (3 members, 6 shared lines) · ×1
  • Near-duplicate member family (3 members, 6 shared lines) crates/dbx-driver-mongodb/src/mongo_shell.rs:493 — crates/dbx-driver-mongodb/src/mongo_shell.rs:493-506 | crates/dbx-web/src/routes/mcp_policy.rs:175-188 | src-tauri/src/commands/mcp_bridge.rs:1401-1414 — These 3 members are variants of one another: a block of 6 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication · Near-duplicate member pair (150 shared lines) · ×1
  • Near-duplicate member pair (150 shared lines) agents/drivers/argo-go/config.go:527 — agents/drivers/argo-go/config.go:527-683 | agents/drivers/hive-go/config.go:533-689 — These two members are variants of one another: 150 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (88 shared lines) · ×1
  • Near-duplicate member pair (88 shared lines) REDACTED:1058 — REDACTED:1058-1167 | agents/drivers/vastbase-go/vastbase_metadata.go:917-1026 — These two members are variants of one another: 88 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (57 shared lines) · ×1
  • Near-duplicate member pair (57 shared lines) REDACTED:3409 — REDACTED:3409-3646 | REDACTED:4077-4251 — These two members are variants of one another: 57 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (56 shared lines) · ×1
  • Near-duplicate member pair (56 shared lines) crates/dbx-web/src/routes/mongodb_import_export.rs:115 — crates/dbx-web/src/routes/mongodb_import_export.rs:115-208 | crates/dbx-web/src/routes/table_import.rs:111-216 — These two members are variants of one another: 56 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (46 shared lines) · ×1
  • Near-duplicate member pair (46 shared lines) REDACTED:848 — REDACTED:848-1003 | REDACTED:1053-1241 — These two members are variants of one another: 46 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (40 shared lines) · ×1
  • Near-duplicate member pair (40 shared lines) crates/dbx-core/src/admin/consul/blocking.rs:119 — crates/dbx-core/src/admin/consul/blocking.rs:119-167 | crates/dbx-core/src/admin/consul/blocking.rs:174-220 — These two members are variants of one another: 40 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (38 shared lines) · ×1
  • Near-duplicate member pair (38 shared lines) agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:1192 — agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:1192-1327 | agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:1011-1128 — These two members are variants of one another: 38 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (34 shared lines) · ×1
  • Near-duplicate member pair (34 shared lines) crates/dbx-sql-data/src/data_grid_neo4j_sql.rs:7 — crates/dbx-sql-data/src/data_grid_neo4j_sql.rs:7-77 | crates/dbx-sql-data/src/data_grid_neo4j_sql.rs:79-155 — These two members are variants of one another: 34 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (33 shared lines) · ×1
  • Near-duplicate member pair (33 shared lines) REDACTED:2354 — REDACTED:2354-2475 | agents/drivers/vastbase-go/vastbase_metadata.go:1524-1644 — These two members are variants of one another: 33 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (32 shared lines) · ×1
  • Near-duplicate member pair (32 shared lines) crates/dbx-web/src/routes/schema.rs:214 — crates/dbx-web/src/routes/schema.rs:214-254 | crates/dbx-web/src/routes/schema.rs:259-318 — These two members are variants of one another: 32 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (28 shared lines) · ×1
  • Near-duplicate member pair (28 shared lines) REDACTED:919 — REDACTED:919-960 | REDACTED:2819-2854 — These two members are variants of one another: 28 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Edited copy of a member (26 corresponding lines) · ×1
  • Edited copy of a member (26 corresponding lines) crates/dbx-drivers/src/db/rqlite_driver.rs:127 — crates/dbx-drivers/src/db/rqlite_driver.rs:127-153 | crates/dbx-drivers/src/db/turso_driver.rs:169-195 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (23 corresponding lines) · ×1
  • Edited copy of a member (23 corresponding lines) crates/dbx-web/src/routes/mongodb_import_export.rs:249 — crates/dbx-web/src/routes/mongodb_import_export.rs:249-271 | crates/dbx-web/src/routes/table_import.rs:263-288 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (29 corresponding lines) · ×1
  • Edited copy of a member (29 corresponding lines) agents/drivers/informix/src/main/java/com/dbx/agent/informix/InformixAgent.java:97 — agents/drivers/informix/src/main/java/com/dbx/agent/informix/InformixAgent.java:97-130 | agents/drivers/gbase8s/src/main/java/com/dbx/agent/gbase8s/Gbase8sAgent.java:954-992 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×1
  • Edited copy of a member (13 corresponding lines) crates/dbx-core/src/persistence/cloud_sync.rs:2953 — crates/dbx-core/src/persistence/cloud_sync.rs:2953-2979 | crates/dbx-core/src/persistence/cloud_sync.rs:2981-2996 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×1
  • Edited copy of a member (18 corresponding lines) REDACTED:353 — REDACTED:353-370 | REDACTED:353-370 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×1
  • Edited copy of a member (10 corresponding lines) agents/drivers/etcd-go/watch.go:182 — agents/drivers/etcd-go/watch.go:182-191 | agents/drivers/etcd2-go/watch.go:177-186 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Members sharing a duplicated core (24 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (24 members, 50+ identical tokens) crates/dbx-core/src/query/redis_ops.rs:114 — crates/dbx-core/src/query/redis_ops.rs:114-135 | crates/dbx-core/src/query/redis_ops.rs:144-165 | crates/dbx-core/src/query/redis_ops.rs:173-194 | crates/dbx-core/src/query/redis_ops.rs:201-222 | crates/dbx-core/src/query/redis_ops.rs:304-325 | crates/dbx-core/src/query/redis_ops.rs:336-357 | crates/dbx-core/src/query/redis_ops.rs:409-430 | crates/dbx-core/src/query/redis_ops.rs:442-463 | crates/dbx-core/src/query/redis_ops.rs:479-500 | crates/dbx-core/src/query/redis_ops.rs:509-530 | crates/dbx-core/src/query/redis_ops.rs:539-560 | crates/dbx-core/src/query/redis_ops.rs:579-600 | crates/dbx-core/src/query/redis_ops.rs:609-630 | crates/dbx-core/src/query/redis_ops.rs:647-668 | crates/dbx-core/src/query/redis_ops.rs:687-708 | crates/dbx-core/src/query/redis_ops.rs:725-746 | crates/dbx-core/src/query/redis_ops.rs:756-777 | crates/dbx-core/src/query/redis_ops.rs:785-806 | crates/dbx-core/src/query/redis_ops.rs:817-838 | crates/dbx-core/src/query/redis_ops.rs:848-869 | crates/dbx-core/src/query/redis_ops.rs:878-899 | crates/dbx-core/src/query/redis_ops.rs:931-952 | crates/dbx-core/src/query/redis_ops.rs:960-981 | crates/dbx-core/src/query/redis_ops.rs:1215-1238 — These 24 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 24 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 24 times.
D4 · Code Duplication · Members sharing a duplicated core (13 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (13 members, 50+ identical tokens) src-tauri/src/commands/mcp_bridge.rs:1935 — src-tauri/src/commands/mcp_bridge.rs:1935-1952 | src-tauri/src/commands/mcp_bridge.rs:1954-1984 | src-tauri/src/commands/mcp_bridge.rs:1986-2012 | src-tauri/src/commands/mcp_bridge.rs:2014-2031 | src-tauri/src/commands/mcp_bridge.rs:2033-2052 | src-tauri/src/commands/mcp_bridge.rs:2054-2086 | src-tauri/src/commands/mcp_bridge.rs:2088-2114 | src-tauri/src/commands/mcp_bridge.rs:2116-2146 | src-tauri/src/commands/mcp_bridge.rs:2148-2178 | src-tauri/src/commands/mcp_bridge.rs:2180-2202 | src-tauri/src/commands/mcp_bridge.rs:2204-2233 | src-tauri/src/commands/mcp_bridge.rs:2235-2272 | src-tauri/src/commands/mcp_bridge.rs:2274-2309 — These 13 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 13 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 13 times.
D4 · Code Duplication · Members sharing a duplicated core (12 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (12 members, 50+ identical tokens) agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java:95 — agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java:95-124 | agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:186-225 | agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:103-123 | agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:163-199 | agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:220-241 | agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:283-323 | agents/drivers/informix/src/main/java/com/dbx/agent/informix/InformixAgent.java:307-349 | agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:107-131 | agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:173-213 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:105-125 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:165-201 | agents/drivers/trino/src/main/java/com/dbx/agent/trino/TrinoAgent.java:108-132 — These 12 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 12 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 12 times.
D4 · Code Duplication · Members sharing a duplicated core (11 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (11 members, 50+ identical tokens) agents/drivers/argo-go/main.go:106 — agents/drivers/argo-go/main.go:106-142 | agents/drivers/cassandra-go/main.go:114-149 | agents/drivers/etcd-go/main.go:127-165 | agents/drivers/etcd2-go/main.go:97-135 | agents/drivers/hive-go/main.go:106-142 | agents/drivers/iotdb/main.go:110-146 | agents/drivers/kingbase-go/main.go:169-204 | agents/drivers/neo4j-go/main.go:127-163 | REDACTED:582-637 | agents/drivers/vastbase-go/main.go:181-216 | REDACTED:708-750 — These 11 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 11 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 11 times.
D4 · Code Duplication · Members sharing a duplicated core (10 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (10 members, 50+ identical tokens) agents/drivers/argo-go/main.go:160 — agents/drivers/argo-go/main.go:160-173 | agents/drivers/cassandra-go/main.go:158-171 | agents/drivers/etcd-go/main.go:184-197 | agents/drivers/etcd2-go/main.go:154-167 | agents/drivers/hive-go/main.go:160-173 | agents/drivers/iotdb/main.go:164-177 | agents/drivers/neo4j-go/main.go:185-198 | agents/drivers/vastbase-go/main.go:218-231 | REDACTED:760-773 | REDACTED:1038-1051 — These 10 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 10 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 10 times.
D4 · Code Duplication · Duplicated block (64–66 lines × 2) · ×1
  • Duplicated block (64–66 lines × 2) agents/drivers/duckdb/src/sql.rs:2 — agents/drivers/duckdb/src/sql.rs:2-65 | crates/dbx-drivers/src/db/duckdb_sql.rs:12-77 — before extracting anything, compare `agents/drivers/duckdb/src/sql.rs` and `crates/dbx-drivers/src/db/duckdb_sql.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 147 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (48 lines × 5) · ×1
  • Duplicated block (48 lines × 5) crates/dbx-core/src/schema/table_structure_sql/sqlite_rebuild.rs:818 — crates/dbx-core/src/schema/table_structure_sql/sqlite_rebuild.rs:818-865 | crates/dbx-core/src/schema/table_structure_sql/sqlite_rebuild.rs:898-945 | crates/dbx-core/src/schema/table_structure_sql/sqlite_rebuild.rs:1068-1115 | crates/dbx-core/src/schema/table_structure_sql/sqlite_rebuild.rs:1242-1289 | crates/dbx-core/src/schema/table_structure_sql/sqlite_rebuild.rs:1389-1436 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (48 lines × 3) · ×1
  • Duplicated block (48 lines × 3) crates/dbx-driver-mongodb/src/mongo_shell.rs:441 — crates/dbx-driver-mongodb/src/mongo_shell.rs:441-488 | crates/dbx-web/src/routes/mcp_policy.rs:123-170 | src-tauri/src/commands/mcp_bridge.rs:1349-1396 — before extracting anything, compare `crates/dbx-driver-mongodb/src/mongo_shell.rs` and `crates/dbx-web/src/routes/mcp_policy.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 145 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (41–42 lines × 6) · ×1
  • Duplicated block (41–42 lines × 6) REDACTED:1775 — REDACTED:1775-1816 | REDACTED:1876-1916 | REDACTED:1988-2029 | REDACTED:2085-2125 | REDACTED:2170-2210 | REDACTED:2255-2295 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (38–39 lines × 3) · ×1
  • Duplicated block (38–39 lines × 3) REDACTED:7425 — REDACTED:7425-7462 | REDACTED:7912-7949 | REDACTED:8245-8283 — 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 (29–34 lines × 2) · ×1
  • Duplicated block (29–34 lines × 2) REDACTED:4876 — REDACTED:4876-4909 | REDACTED:5062-5090 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (27 lines × 3) · ×1
  • Duplicated block (27 lines × 3) REDACTED:4160 — REDACTED:4160-4186 | REDACTED:4219-4245 | REDACTED:4278-4304 — 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 (26 lines × 3) · ×1
  • Duplicated block (26 lines × 3) crates/dbx-sql-dialect/src/sql_dialect/ddl_profile.rs:671 — crates/dbx-sql-dialect/src/sql_dialect/ddl_profile.rs:671-696 | crates/dbx-sql-dialect/src/sql_dialect/ddl_profile.rs:726-751 | crates/dbx-sql-dialect/src/sql_dialect/ddl_profile.rs:786-811 — 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 (24–26 lines × 2) · ×1
  • Duplicated block (24–26 lines × 2) crates/dbx-driver-agent/src/agent_service.rs:1641 — crates/dbx-driver-agent/src/agent_service.rs:1641-1664 | crates/dbx-driver-agent/src/agent_service.rs:1770-1795 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (21–26 lines × 2) · ×1
  • Duplicated block (21–26 lines × 2) crates/dbx-sql-dialect/src/sql_dialect/ddl_profile.rs:704 — crates/dbx-sql-dialect/src/sql_dialect/ddl_profile.rs:704-724 | crates/dbx-sql-dialect/src/sql_dialect/ddl_profile.rs:759-784 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (22–25 lines × 2) · ×1
  • Duplicated block (22–25 lines × 2) crates/dbx-sql-dialect/src/sql_dialect/ddl_profile.rs:481 — crates/dbx-sql-dialect/src/sql_dialect/ddl_profile.rs:481-505 | crates/dbx-sql-dialect/src/sql_dialect/ddl_profile.rs:652-673 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (22–24 lines × 6) · ×1
  • Duplicated block (22–24 lines × 6) REDACTED:1845 — REDACTED:1845-1868 | REDACTED:1944-1966 | REDACTED:2039-2062 | REDACTED:2140-2161 | REDACTED:2226-2247 | REDACTED:2317-2338 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (24 lines × 3) · ×1
  • Duplicated block (24 lines × 3) crates/dbx-core/src/query/mongo_ops.rs:1485 — crates/dbx-core/src/query/mongo_ops.rs:1485-1508 | crates/dbx-drivers/src/db/dynamodb_driver.rs:541-564 | crates/dbx-mcp/src/backend.rs:2673-2696 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
D4 · Code Duplication · Duplicated block (23–24 lines × 2) · ×1
  • Duplicated block (23–24 lines × 2) crates/dbx-driver-mongodb/src/mongo_shell.rs:1273 — crates/dbx-driver-mongodb/src/mongo_shell.rs:1273-1296 | crates/dbx-driver-mongodb/src/mongo_shell.rs:1408-1430 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (22–23 lines × 3) · ×1
  • Duplicated block (22–23 lines × 3) REDACTED:7371 — REDACTED:7371-7392 | REDACTED:7835-7856 | REDACTED:8193-8215 — 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 (22 lines × 4) · ×1
  • Duplicated block (22 lines × 4) REDACTED:81 — REDACTED:81-102 | crates/dbx-drivers/src/db/influxdb3_driver.rs:90-111 | crates/dbx-drivers/src/db/influxdb_driver.rs:131-152 | crates/dbx-drivers/src/db/victoriametrics_driver.rs:154-175 — before extracting anything, compare `crates/dbx-drivers/src/db/influxdb3_driver.rs` and `crates/dbx-drivers/src/db/influxdb_driver.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (21–22 lines × 2) · ×1
  • Duplicated block (21–22 lines × 2) crates/dbx-core/src/admin/consul/archive.rs:481 — crates/dbx-core/src/admin/consul/archive.rs:481-501 | crates/dbx-core/src/admin/consul/kv.rs:486-507 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (17–21 lines × 3) · ×1
  • Duplicated block (17–21 lines × 3) REDACTED:190 — REDACTED:190-206 | crates/dbx-drivers/src/db/rqlite_driver.rs:171-191 | crates/dbx-drivers/src/db/turso_driver.rs:213-233 — before extracting anything, compare `REDACTED` and `crates/dbx-drivers/src/db/rqlite_driver.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (20 lines × 4) · ×1
  • Duplicated block (20 lines × 4) crates/dbx-ai-provider/src/ai_claude_code_cli.rs:96 — crates/dbx-ai-provider/src/ai_claude_code_cli.rs:96-115 | crates/dbx-ai-provider/src/ai_codebuddy_cli.rs:173-192 | crates/dbx-ai-provider/src/ai_codex_cli.rs:343-362 | crates/dbx-ai-provider/src/ai_grok_cli.rs:143-162 — before extracting anything, compare `crates/dbx-ai-provider/src/ai_claude_code_cli.rs` and `crates/dbx-ai-provider/src/ai_codebuddy_cli.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (18–20 lines × 2) · ×1
  • Duplicated block (18–20 lines × 2) REDACTED:6170 — REDACTED:6170-6189 | REDACTED:6234-6251 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (19–20 lines × 2) · ×1
  • Duplicated block (19–20 lines × 2) crates/dbx-driver-sqlserver/src/sqlserver.rs:1612 — crates/dbx-driver-sqlserver/src/sqlserver.rs:1612-1630 | crates/dbx-sql-data/src/query_result_sql.rs:2288-2307 — before extracting anything, compare `crates/dbx-driver-sqlserver/src/sqlserver.rs` and `crates/dbx-sql-data/src/query_result_sql.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (19 lines × 4) · ×1
  • Duplicated block (19 lines × 4) REDACTED:7342 — REDACTED:7342-7360 | REDACTED:7411-7429 | REDACTED:7482-7500 | REDACTED:7573-7591 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (16–19 lines × 2) · ×1
  • Duplicated block (16–19 lines × 2) REDACTED:2668 — REDACTED:2668-2683 | src-tauri/src/commands/connection.rs:2038-2056 — before extracting anything, compare `REDACTED` and `src-tauri/src/commands/connection.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 247 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (15–18 lines × 3) · ×1
  • Duplicated block (15–18 lines × 3) crates/dbx-sql-dialect/src/sql_dialect/ddl_profile.rs:494 — crates/dbx-sql-dialect/src/sql_dialect/ddl_profile.rs:494-511 | crates/dbx-sql-dialect/src/sql_dialect/ddl_profile.rs:662-676 | crates/dbx-sql-dialect/src/sql_dialect/ddl_profile.rs:777-791 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (15–18 lines × 2) · ×1
  • Duplicated block (15–18 lines × 2) REDACTED:7607 — REDACTED:7607-7624 | REDACTED:8095-8109 — both copies are in the same file, so extract the 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 (16–18 lines × 2) · ×1
  • Duplicated block (16–18 lines × 2) REDACTED:8123 — REDACTED:8123-8138 | REDACTED:9070-9087 — both copies are in the same file, so extract the 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 (16–17 lines × 3) · ×1
  • Duplicated block (16–17 lines × 3) crates/dbx-driver-mysql/src/mysql.rs:5478 — crates/dbx-driver-mysql/src/mysql.rs:5478-5494 | crates/dbx-driver-mysql/src/mysql.rs:5630-5645 | crates/dbx-driver-mysql/src/mysql.rs:5827-5843 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (15–17 lines × 2) · ×1
  • Duplicated block (15–17 lines × 2) crates/dbx-drivers/src/db/sqlite.rs:2747 — crates/dbx-drivers/src/db/sqlite.rs:2747-2763 | crates/dbx-sqlite-worker/src/runtime.rs:100-114 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (15–16 lines × 5) · ×1
  • Duplicated block (15–16 lines × 5) REDACTED:3830 — REDACTED:3830-3845 | REDACTED:4165-4179 | REDACTED:4224-4238 | REDACTED:4283-4297 | REDACTED:4347-4361 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (16 lines × 5) · ×1
  • Duplicated block (16 lines × 5) crates/dbx-core/src/schema/table_structure_sql/sqlite_rebuild.rs:790 — crates/dbx-core/src/schema/table_structure_sql/sqlite_rebuild.rs:790-805 | crates/dbx-core/src/schema/table_structure_sql/sqlite_rebuild.rs:876-891 | crates/dbx-core/src/schema/table_structure_sql/sqlite_rebuild.rs:1039-1054 | crates/dbx-core/src/schema/table_structure_sql/sqlite_rebuild.rs:1217-1232 | crates/dbx-core/src/schema/table_structure_sql/sqlite_rebuild.rs:1362-1377 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (15–16 lines × 4) · ×1
  • Duplicated block (15–16 lines × 4) REDACTED:190 — REDACTED:190-204 | crates/dbx-drivers/src/db/rqlite_driver.rs:173-188 | crates/dbx-drivers/src/db/sqlite.rs:2514-2529 | crates/dbx-drivers/src/db/turso_driver.rs:215-230 — before extracting anything, compare `REDACTED` and `crates/dbx-drivers/src/db/rqlite_driver.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (13–16 lines × 3) · ×1
  • Duplicated block (13–16 lines × 3) crates/dbx-core/src/query/document_ops.rs:493 — crates/dbx-core/src/query/document_ops.rs:493-505 | crates/dbx-core/src/query/mongo_ops.rs:345-360 | crates/dbx-core/src/query/mongo_ops.rs:507-522 — before extracting anything, compare `crates/dbx-core/src/query/document_ops.rs` and `crates/dbx-core/src/query/mongo_ops.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (14–16 lines × 2) · ×1
  • Duplicated block (14–16 lines × 2) agents/drivers/duckdb/src/sql.rs:405 — agents/drivers/duckdb/src/sql.rs:405-418 | crates/dbx-sql-core/src/sql.rs:2417-2432 — before extracting anything, compare `agents/drivers/duckdb/src/sql.rs` and `crates/dbx-sql-core/src/sql.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (12–16 lines × 2) · ×1
  • Duplicated block (12–16 lines × 2) REDACTED:1317 — REDACTED:1317-1328 | REDACTED:2065-2080 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (15 lines × 6) · ×1
  • Duplicated block (15 lines × 6) REDACTED:1200 — REDACTED:1200-1214 | REDACTED:1251-1265 | REDACTED:1302-1316 | REDACTED:1357-1371 | REDACTED:1408-1422 | REDACTED:1473-1487 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (12–14 lines × 3) · ×1
  • Duplicated block (12–14 lines × 3) agents/drivers/duckdb/src/sql.rs:390 — agents/drivers/duckdb/src/sql.rs:390-401 | crates/dbx-sql-core/src/sql.rs:2336-2349 | crates/dbx-sql-core/src/sql.rs:2383-2396 — before extracting anything, compare `agents/drivers/duckdb/src/sql.rs` and `crates/dbx-sql-core/src/sql.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (12–14 lines × 2) · ×1
  • Duplicated block (12–14 lines × 2) REDACTED:2921 — REDACTED:2921-2934 | src-tauri/src/commands/connection.rs:2077-2088 — before extracting anything, compare `REDACTED` and `src-tauri/src/commands/connection.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 247 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (12–13 lines × 3) · ×1
  • Duplicated block (12–13 lines × 3) crates/dbx-sql-schema/src/schema_diff.rs:6193 — crates/dbx-sql-schema/src/schema_diff.rs:6193-6205 | crates/dbx-sql-schema/src/schema_diff.rs:6240-6251 | crates/dbx-sql-schema/src/schema_diff.rs:6267-6278 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (9–13 lines × 2) · ×1
  • Duplicated block (9–13 lines × 2) crates/dbx-ai-provider/src/ai.rs:3509 — crates/dbx-ai-provider/src/ai.rs:3509-3521 | crates/dbx-ai-provider/src/ai.rs:3579-3587 — both copies are in the same file, so extract the 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 (2–13 lines × 3) · ×1
  • Duplicated block (2–13 lines × 3) REDACTED:2794 — REDACTED:2794-2806 | src-tauri/src/commands/connection.rs:1423-1424 | src-tauri/src/commands/connection.rs:1910-1922 — before extracting anything, compare `REDACTED` and `src-tauri/src/commands/connection.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 247 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (10–12 lines × 3) · ×1
  • Duplicated block (10–12 lines × 3) agents/drivers/duckdb/src/sql.rs:403 — agents/drivers/duckdb/src/sql.rs:403-413 | REDACTED:2045-2054 | crates/dbx-sql-core/src/sql.rs:2415-2426 — before extracting anything, compare `agents/drivers/duckdb/src/sql.rs` and `crates/dbx-sql-core/src/sql.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (11 lines × 13) · ×1
  • Duplicated block (11 lines × 13) src-tauri/src/commands/mcp_bridge.rs:1937 — src-tauri/src/commands/mcp_bridge.rs:1937-1947 | src-tauri/src/commands/mcp_bridge.rs:1956-1966 | src-tauri/src/commands/mcp_bridge.rs:1988-1998 | src-tauri/src/commands/mcp_bridge.rs:2016-2026 | src-tauri/src/commands/mcp_bridge.rs:2035-2045 | src-tauri/src/commands/mcp_bridge.rs:2056-2066 | src-tauri/src/commands/mcp_bridge.rs:2090-2100 | src-tauri/src/commands/mcp_bridge.rs:2118-2128 | src-tauri/src/commands/mcp_bridge.rs:2150-2160 | src-tauri/src/commands/mcp_bridge.rs:2182-2192 | src-tauri/src/commands/mcp_bridge.rs:2206-2216 | src-tauri/src/commands/mcp_bridge.rs:2237-2247 | src-tauri/src/commands/mcp_bridge.rs:2276-2286 — all 13 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (9–11 lines × 2) · ×1
  • Duplicated block (9–11 lines × 2) REDACTED:2807 — REDACTED:2807-2815 | src-tauri/src/commands/connection.rs:1425-1435 — before extracting anything, compare `REDACTED` and `src-tauri/src/commands/connection.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 247 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (10 lines × 6) · ×1
  • Duplicated block (10 lines × 6) crates/dbx-sql-schema/src/schema_diff.rs:3627 — crates/dbx-sql-schema/src/schema_diff.rs:3627-3636 | crates/dbx-sql-schema/src/schema_diff.rs:3776-3785 | crates/dbx-sql-schema/src/schema_diff.rs:3856-3865 | crates/dbx-sql-schema/src/schema_diff.rs:3922-3931 | crates/dbx-sql-schema/src/schema_diff.rs:3976-3985 | crates/dbx-sql-schema/src/schema_diff.rs:4045-4054 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (7–9 lines × 3) · ×1
  • Duplicated block (7–9 lines × 3) crates/dbx-mcp/src/server.rs:1191 — crates/dbx-mcp/src/server.rs:1191-1197 | crates/dbx-mcp/src/server.rs:1228-1234 | crates/dbx-mcp/src/server.rs:2728-2736 — 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 (3–9 lines × 5) · ×1
  • Duplicated block (3–9 lines × 5) crates/dbx-web/src/routes/schema.rs:479 — crates/dbx-web/src/routes/schema.rs:479-481 | crates/dbx-web/src/routes/schema.rs:546-554 | crates/dbx-web/src/routes/schema.rs:583-585 | crates/dbx-web/src/routes/schema.rs:603-605 | crates/dbx-web/src/routes/schema.rs:624-632 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (8 lines × 18) · ×1
  • Duplicated block (8 lines × 18) crates/dbx-core/src/query/redis_ops.rs:410 — crates/dbx-core/src/query/redis_ops.rs:410-417 | crates/dbx-core/src/query/redis_ops.rs:443-450 | crates/dbx-core/src/query/redis_ops.rs:480-487 | crates/dbx-core/src/query/redis_ops.rs:510-517 | crates/dbx-core/src/query/redis_ops.rs:540-547 | crates/dbx-core/src/query/redis_ops.rs:580-587 | crates/dbx-core/src/query/redis_ops.rs:610-617 | crates/dbx-core/src/query/redis_ops.rs:648-655 | crates/dbx-core/src/query/redis_ops.rs:688-695 | crates/dbx-core/src/query/redis_ops.rs:726-733 | crates/dbx-core/src/query/redis_ops.rs:757-764 | crates/dbx-core/src/query/redis_ops.rs:786-793 | crates/dbx-core/src/query/redis_ops.rs:818-825 | crates/dbx-core/src/query/redis_ops.rs:849-856 | crates/dbx-core/src/query/redis_ops.rs:879-886 | crates/dbx-core/src/query/redis_ops.rs:932-939 | crates/dbx-core/src/query/redis_ops.rs:961-968 | crates/dbx-core/src/query/redis_ops.rs:1216-1223 — all 18 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (8 lines × 9) · ×1
  • Duplicated block (8 lines × 9) REDACTED:2825 — REDACTED:2825-2832 | REDACTED:2841-2848 | REDACTED:2857-2864 | src-tauri/src/commands/connection.rs:1452-1459 | src-tauri/src/commands/connection.rs:1480-1487 | src-tauri/src/commands/connection.rs:1497-1504 | src-tauri/src/commands/connection.rs:1942-1949 | src-tauri/src/commands/connection.rs:1968-1975 | src-tauri/src/commands/connection.rs:1984-1991 — before extracting anything, compare `REDACTED` and `src-tauri/src/commands/connection.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 247 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (8 lines × 7) · ×1
  • Duplicated block (8 lines × 7) crates/dbx-core/src/admin/mq/adapters/pulsar.rs:527 — crates/dbx-core/src/admin/mq/adapters/pulsar.rs:527-534 | crates/dbx-core/src/admin/mq/adapters/pulsar.rs:547-554 | crates/dbx-core/src/admin/mq/adapters/pulsar.rs:580-587 | crates/dbx-core/src/admin/mq/adapters/pulsar.rs:605-612 | crates/dbx-core/src/admin/mq/adapters/pulsar.rs:674-681 | crates/dbx-core/src/admin/mq/adapters/pulsar.rs:694-701 | crates/dbx-core/src/admin/mq/adapters/pulsar.rs:711-718 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (7 lines × 24) · ×1
  • Duplicated block (7 lines × 24) crates/dbx-core/src/query/redis_ops.rs:117 — crates/dbx-core/src/query/redis_ops.rs:117-123 | crates/dbx-core/src/query/redis_ops.rs:147-153 | crates/dbx-core/src/query/redis_ops.rs:176-182 | crates/dbx-core/src/query/redis_ops.rs:204-210 | crates/dbx-core/src/query/redis_ops.rs:307-313 | crates/dbx-core/src/query/redis_ops.rs:339-345 | crates/dbx-core/src/query/redis_ops.rs:412-418 | crates/dbx-core/src/query/redis_ops.rs:445-451 | crates/dbx-core/src/query/redis_ops.rs:482-488 | crates/dbx-core/src/query/redis_ops.rs:512-518 | crates/dbx-core/src/query/redis_ops.rs:542-548 | crates/dbx-core/src/query/redis_ops.rs:582-588 | crates/dbx-core/src/query/redis_ops.rs:612-618 | crates/dbx-core/src/query/redis_ops.rs:650-656 | crates/dbx-core/src/query/redis_ops.rs:690-696 | crates/dbx-core/src/query/redis_ops.rs:728-734 | crates/dbx-core/src/query/redis_ops.rs:759-765 | crates/dbx-core/src/query/redis_ops.rs:788-794 | crates/dbx-core/src/query/redis_ops.rs:820-826 | crates/dbx-core/src/query/redis_ops.rs:851-857 | crates/dbx-core/src/query/redis_ops.rs:881-887 | crates/dbx-core/src/query/redis_ops.rs:934-940 | crates/dbx-core/src/query/redis_ops.rs:963-969 | crates/dbx-core/src/query/redis_ops.rs:1218-1224 — all 24 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 (3–7 lines × 3) · ×1
  • Duplicated block (3–7 lines × 3) crates/dbx-ai-provider/src/ai_cli_agent.rs:456 — crates/dbx-ai-provider/src/ai_cli_agent.rs:456-462 | crates/dbx-ai-provider/src/ai_cli_agent.rs:634-640 | crates/dbx-ai-provider/src/ai_cli_agent.rs:981-983 — 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 (2–7 lines × 9) · ×1
  • Duplicated block (2–7 lines × 9) crates/dbx-driver-elasticsearch/src/lib.rs:733 — crates/dbx-driver-elasticsearch/src/lib.rs:733-734 | crates/dbx-driver-elasticsearch/src/lib.rs:989-990 | crates/dbx-driver-elasticsearch/src/lib.rs:1003-1004 | crates/dbx-driver-elasticsearch/src/lib.rs:1506-1507 | crates/dbx-driver-elasticsearch/src/lib.rs:1542-1543 | crates/dbx-driver-elasticsearch/src/lib.rs:1590-1591 | crates/dbx-driver-elasticsearch/src/lib.rs:1893-1894 | crates/dbx-driver-elasticsearch/src/lib.rs:1914-1920 | crates/dbx-driver-elasticsearch/src/lib.rs:1976-1982 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (5–7 lines × 4) · ×1
  • Duplicated block (5–7 lines × 4) crates/dbx-sql-schema/src/table_structure_sql/column_alter.rs:493 — crates/dbx-sql-schema/src/table_structure_sql/column_alter.rs:493-497 | crates/dbx-sql-schema/src/table_structure_sql/column_alter.rs:583-589 | crates/dbx-sql-schema/src/table_structure_sql/column_alter.rs:701-707 | crates/dbx-sql-schema/src/table_structure_sql/column_alter.rs:915-919 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (6 lines × 6) · ×1
  • Duplicated block (6 lines × 6) crates/dbx-core/src/query/redis_ops.rs:906 — crates/dbx-core/src/query/redis_ops.rs:906-911 | crates/dbx-core/src/query/redis_ops.rs:1090-1095 | crates/dbx-core/src/query/redis_ops.rs:1139-1144 | crates/dbx-core/src/query/redis_ops.rs:1164-1169 | crates/dbx-core/src/query/redis_ops.rs:1247-1252 | crates/dbx-core/src/query/redis_ops.rs:1309-1314 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (4–6 lines × 4) · ×1
  • Duplicated block (4–6 lines × 4) crates/dbx-ai-provider/src/ai_claude_code_cli.rs:85 — crates/dbx-ai-provider/src/ai_claude_code_cli.rs:85-90 | crates/dbx-ai-provider/src/ai_codebuddy_cli.rs:162-167 | crates/dbx-ai-provider/src/ai_codex_cli.rs:381-384 | crates/dbx-ai-provider/src/ai_grok_cli.rs:132-137 — before extracting anything, compare `crates/dbx-ai-provider/src/ai_claude_code_cli.rs` and `crates/dbx-ai-provider/src/ai_codebuddy_cli.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (1–6 lines × 14) · ×1
  • Duplicated block (1–6 lines × 14) crates/dbx-driver-mysql/src/manticoresearch.rs:181 — crates/dbx-driver-mysql/src/manticoresearch.rs:181-182 | crates/dbx-driver-mysql/src/mysql.rs:3694-3696 | crates/dbx-driver-mysql/src/mysql.rs:3765-3768 | crates/dbx-driver-mysql/src/mysql.rs:4451-4453 | crates/dbx-driver-mysql/src/mysql.rs:7082-7085 | crates/dbx-driver-mysql/src/mysql_compatible.rs:129-130 | crates/dbx-driver-mysql/src/ob_oracle.rs:54-54 | crates/dbx-driver-mysql/src/ob_oracle.rs:76-79 | crates/dbx-driver-mysql/src/ob_oracle.rs:117-120 | crates/dbx-driver-mysql/src/ob_oracle.rs:166-171 | crates/dbx-driver-mysql/src/ob_oracle.rs:230-235 | crates/dbx-driver-mysql/src/ob_oracle.rs:261-264 | crates/dbx-driver-mysql/src/ob_oracle.rs:309-314 | crates/dbx-driver-mysql/src/starrocks.rs:75-76 — before extracting anything, compare `crates/dbx-driver-mysql/src/manticoresearch.rs` and `crates/dbx-driver-mysql/src/mysql.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (4–6 lines × 3) · ×1
  • Duplicated block (4–6 lines × 3) crates/dbx-ai-provider/src/ai_claude_code_cli.rs:331 — crates/dbx-ai-provider/src/ai_claude_code_cli.rs:331-336 | crates/dbx-ai-provider/src/ai_codebuddy_cli.rs:410-415 | crates/dbx-ai-provider/src/ai_codebuddy_cli.rs:610-613 — before extracting anything, compare `crates/dbx-ai-provider/src/ai_claude_code_cli.rs` and `crates/dbx-ai-provider/src/ai_codebuddy_cli.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (5 lines × 8) · ×1
  • Duplicated block (5 lines × 8) crates/dbx-ai-provider/src/ai.rs:3775 — crates/dbx-ai-provider/src/ai.rs:3775-3779 | crates/dbx-ai-provider/src/ai.rs:3881-3885 | crates/dbx-ai-provider/src/ai.rs:4016-4020 | crates/dbx-ai-provider/src/ai.rs:4112-4116 | crates/dbx-ai-provider/src/ai.rs:4351-4355 | crates/dbx-ai-provider/src/ai.rs:4544-4548 | crates/dbx-ai-provider/src/ai.rs:4719-4723 | crates/dbx-ai-provider/src/ai.rs:4973-4977 — all 8 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 (3–5 lines × 5) · ×1
  • Duplicated block (3–5 lines × 5) crates/dbx-core/src/schema/mod.rs:410 — crates/dbx-core/src/schema/mod.rs:410-414 | crates/dbx-core/src/schema/mod.rs:480-484 | crates/dbx-core/src/schema/mod.rs:515-519 | crates/dbx-core/src/schema/mod.rs:549-551 | crates/dbx-core/src/schema/mod.rs:584-588 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (2–5 lines × 7) · ×1
  • Duplicated block (2–5 lines × 7) crates/dbx-driver-mysql/src/mysql.rs:3693 — crates/dbx-driver-mysql/src/mysql.rs:3693-3694 | crates/dbx-driver-mysql/src/mysql.rs:7005-7006 | crates/dbx-driver-mysql/src/mysql.rs:7022-7026 | crates/dbx-driver-mysql/src/mysql.rs:7077-7081 | crates/dbx-driver-mysql/src/mysql_compatible.rs:140-141 | crates/dbx-driver-mysql/src/mysql_compatible.rs:237-238 | crates/dbx-driver-mysql/src/starrocks.rs:74-75 — there are 7 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 7 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (4–5 lines × 3) · ×1
  • Duplicated block (4–5 lines × 3) crates/dbx-drivers/src/db/questdb.rs:54 — crates/dbx-drivers/src/db/questdb.rs:54-58 | crates/dbx-drivers/src/db/questdb.rs:85-89 | crates/dbx-drivers/src/db/questdb.rs:111-114 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (7 lines × 8) · ×1
  • Duplicated block (7 lines × 8) crates/dbx-ai-provider/src/ai_claude_code_cli.rs:187 — crates/dbx-ai-provider/src/ai_claude_code_cli.rs:187-193 | crates/dbx-ai-provider/src/ai_codebuddy_cli.rs:267-273 | crates/dbx-ai-provider/src/ai_codex_cli.rs:488-494 | crates/dbx-ai-provider/src/ai_cursor_cli.rs:158-164 | crates/dbx-ai-provider/src/ai_grok_cli.rs:237-243 | crates/dbx-ai-provider/src/ai_opencode_cli.rs:131-137 | crates/dbx-ai-provider/src/ai_pi_agent_cli.rs:430-436 | crates/dbx-ai-provider/src/ai_qoder_cli.rs:119-125 — before extracting anything, compare `crates/dbx-ai-provider/src/ai_claude_code_cli.rs` and `crates/dbx-ai-provider/src/ai_codebuddy_cli.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (4–8 lines × 4) · ×1
  • Duplicated block (4–8 lines × 4) crates/dbx-driver-mysql/src/manticoresearch.rs:79 — crates/dbx-driver-mysql/src/manticoresearch.rs:79-82 | crates/dbx-driver-mysql/src/mysql.rs:4452-4455 | crates/dbx-driver-mysql/src/oceanbase_mysql.rs:22-29 | crates/dbx-driver-mysql/src/starrocks.rs:77-84 — before extracting anything, compare `crates/dbx-driver-mysql/src/manticoresearch.rs` and `crates/dbx-driver-mysql/src/mysql.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (2–5 lines × 10) · ×1
  • Duplicated block (2–5 lines × 10) REDACTED:2303 — REDACTED:2303-2304 | REDACTED:2460-2461 | REDACTED:2471-2475 | REDACTED:2481-2485 | REDACTED:2908-2909 | REDACTED:2930-2932 | REDACTED:4165-4166 | REDACTED:5896-5897 | REDACTED:8099-8100 | REDACTED:8187-8188 — all 10 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (17–44 lines × 2) · ×1
  • Duplicated block (17–44 lines × 2) REDACTED:2393 — REDACTED:2393-2436 | REDACTED:2449-2465 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2393` 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 (10–42 lines × 12) · ×1
  • Duplicated block (10–42 lines × 12) REDACTED:1931 — REDACTED:1931-1940 | REDACTED:1960-1983 | REDACTED:2042-2053 | REDACTED:2271-2304 | REDACTED:2329-2348 | REDACTED:2394-2435 | REDACTED:2450-2464 | REDACTED:2485-2495 | REDACTED:2865-2876 | REDACTED:3007-3017 | agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:251-260 | agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:267-277 — there are 12 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 12 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1931` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:2305` calls `equals`, `getString` and `REDACTED:2349` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (28 lines × 3) · ×1
  • Duplicated block (28 lines × 3) agents/drivers/ignite/src/main/java/com/dbx/agent/ignite/IgniteAgent.java:93 — agents/drivers/ignite/src/main/java/com/dbx/agent/ignite/IgniteAgent.java:93-120 | agents/drivers/ignite3/src/main/java/com/dbx/agent/ignite3/Ignite3Agent.java:107-134 | agents/drivers/kylin/src/main/java/com/dbx/agent/kylin/KylinAgent.java:72-99 — before extracting anything, compare `agents/drivers/ignite/src/main/java/com/dbx/agent/ignite/IgniteAgent.java` and `agents/drivers/ignite3/src/main/java/com/dbx/agent/ignite3/Ignite3Agent.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/ignite/src/main/java/com/dbx/agent/ignite/IgniteAgent.java:93` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (20–27 lines × 4) · ×1
  • Duplicated block (20–27 lines × 4) agents/common/src/main/java/com/dbx/agent/BaseDatabaseAgent.java:30 — agents/common/src/main/java/com/dbx/agent/BaseDatabaseAgent.java:30-49 | agents/common/src/main/java/com/dbx/agent/ConfiguredJdbcAgent.java:133-155 | agents/common/src/main/java/com/dbx/agent/DatabaseAgent.java:86-105 | agents/drivers/spanner/src/main/java/com/dbx/agent/spanner/SpannerAgent.java:198-224 — before extracting anything, compare `agents/common/src/main/java/com/dbx/agent/BaseDatabaseAgent.java` and `agents/common/src/main/java/com/dbx/agent/DatabaseAgent.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `agents/common/src/main/java/com/dbx/agent/ConfiguredJdbcAgent.java:133` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `agents/drivers/spanner/src/main/java/com/dbx/agent/spanner/SpannerAgent.java:197` calls `resolveSchema` and `agents/common/src/main/java/com/dbx/agent/BaseDatabaseAgent.java:29` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (18–23 lines × 2) · ×1
  • Duplicated block (18–23 lines × 2) agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:180 — agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:180-202 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:70-87 — before extracting anything, compare `agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java` and `agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 210 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:180` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:179` calls `resolveSchema` and `agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:69` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (15–22 lines × 3) · ×1
  • Duplicated block (15–22 lines × 3) agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:406 — agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:406-420 | agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:480-501 | agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:557-575 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:406` 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 (14–15 lines × 6) · ×1
  • Duplicated block (14–15 lines × 6) agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:728 — agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:728-741 | REDACTED:2432-2446 | REDACTED:2461-2475 | agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:347-361 | agents/drivers/oceanbase-oracle/src/main/java/com/dbx/agent/oceanbaseoracle/OceanBaseOracleAgent.java:1290-1303 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:343-357 — there are 6 copies across 5 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:728` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note 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 (12–15 lines × 6) · ×1
  • Duplicated block (12–15 lines × 6) agents/drivers/gbase8s/src/main/java/com/dbx/agent/gbase8s/Gbase8sAgent.java:512 — agents/drivers/gbase8s/src/main/java/com/dbx/agent/gbase8s/Gbase8sAgent.java:512-524 | agents/drivers/gbase8s/src/main/java/com/dbx/agent/gbase8s/Gbase8sAgent.java:609-623 | agents/drivers/gbase8s/src/main/java/com/dbx/agent/gbase8s/Gbase8sAgent.java:878-889 | agents/drivers/gbase8s/src/main/java/com/dbx/agent/gbase8s/Gbase8sAgent.java:914-925 | agents/drivers/gbase8s/src/main/java/com/dbx/agent/gbase8s/Gbase8sAgent.java:1024-1035 | agents/drivers/gbase8s/src/main/java/com/dbx/agent/gbase8s/Gbase8sAgent.java:1059-1072 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/gbase8s/src/main/java/com/dbx/agent/gbase8s/Gbase8sAgent.java:512` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `agents/drivers/gbase8s/src/main/java/com/dbx/agent/gbase8s/Gbase8sAgent.java:626` calls `loadColumnNamesByNumber` and `agents/drivers/gbase8s/src/main/java/com/dbx/agent/gbase8s/Gbase8sAgent.java:926` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (13–15 lines × 2) · ×1
  • Duplicated block (13–15 lines × 2) agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:197 — agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:197-211 | agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:182-194 — before extracting anything, compare `agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java` and `agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 90 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:197` 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 (10–14 lines × 5) · ×1
  • Duplicated block (10–14 lines × 5) agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java:111 — agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java:111-124 | agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:232-241 | agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:118-131 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:116-125 | agents/drivers/trino/src/main/java/com/dbx/agent/trino/TrinoAgent.java:119-132 — before extracting anything, compare `agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java` and `agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java:111` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 × 7) · ×1
  • Duplicated block (13 lines × 7) agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:113 — agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:113-125 | agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:89-101 | agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:206-218 | agents/drivers/informix/src/main/java/com/dbx/agent/informix/InformixAgent.java:239-251 | agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:93-105 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:91-103 | agents/drivers/trino/src/main/java/com/dbx/agent/trino/TrinoAgent.java:94-106 — before extracting anything, compare `agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java` and `agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 98 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:222` calls `resolveSchema` and `agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:129` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (9–13 lines × 6) · ×1
  • Duplicated block (9–13 lines × 6) agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:1068 — agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:1068-1080 | REDACTED:2494-2502 | agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:379-391 | agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:574-586 | agents/drivers/oceanbase-oracle/src/main/java/com/dbx/agent/oceanbaseoracle/OceanBaseOracleAgent.java:1323-1331 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:375-387 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 6 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 6 times. Read the line range as the matched WINDOW rather than a finished unit: at `agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:1068` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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–12 lines × 2) · ×1
  • Duplicated block (8–12 lines × 2) agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:371 — agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:371-382 | agents/drivers/informix/src/main/java/com/dbx/agent/informix/InformixAgent.java:473-480 — 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 `agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:371` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 (10 lines × 9) · ×1
  • Duplicated block (10 lines × 9) agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java:213 — agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java:213-222 | agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:436-445 | REDACTED:228-237 | agents/drivers/gbase8s/src/main/java/com/dbx/agent/gbase8s/Gbase8sAgent.java:1121-1130 | agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:468-477 | agents/drivers/informix/src/main/java/com/dbx/agent/informix/InformixAgent.java:575-584 | agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:345-354 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:427-436 | agents/drivers/trino/src/main/java/com/dbx/agent/trino/TrinoAgent.java:247-256 — before extracting anything, compare `agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java` and `agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java:210` calls `tableTypeAllowed`, `add` and `REDACTED:227` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (8–10 lines × 4) · ×1
  • Duplicated block (8–10 lines × 4) agents/common/src/main/java/com/dbx/agent/MultiSessionJsonRpcServer.java:131 — agents/common/src/main/java/com/dbx/agent/MultiSessionJsonRpcServer.java:131-138 | agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:117-125 | agents/drivers/mongodb/src/main/java/com/dbx/agent/mongodb/MongoAgent.java:2450-2459 | agents/drivers/mongodb/src/main/java/com/dbx/agent/mongodb/MongoAgent.java:2503-2510 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `agents/common/src/main/java/com/dbx/agent/MultiSessionJsonRpcServer.java:131` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:115` calls `parseString`, `getAsJsonObject` and `agents/common/src/main/java/com/dbx/agent/MultiSessionJsonRpcServer.java:129` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (9–10 lines × 4) · ×1
  • Duplicated block (9–10 lines × 4) agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:466 — agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:466-475 | agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:495-503 | agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:721-730 | agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:758-766 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:466` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:720` calls `catalogRelation` and `agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:495` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (3–10 lines × 3) · ×1
  • Duplicated block (3–10 lines × 3) agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:182 — agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:182-191 | agents/drivers/informix/src/main/java/com/dbx/agent/informix/InformixAgent.java:340-342 | agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:191-200 — 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 `agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:182` 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 (9 lines × 10) · ×1
  • Duplicated block (9 lines × 10) agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java:217 — agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java:217-225 | agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:440-448 | agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:472-480 | agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:491-499 | agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:647-655 | agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:666-674 | agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:349-357 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:431-439 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:450-458 | agents/drivers/trino/src/main/java/com/dbx/agent/trino/TrinoAgent.java:251-259 — before extracting anything, compare `agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java` and `agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/bigquery/src/main/java/com/dbx/agent/bigquery/BigQueryAgent.java:217` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 (7–9 lines × 4) · ×1
  • Duplicated block (7–9 lines × 4) agents/common/src/main/java/com/dbx/agent/AbstractJdbcAgent.java:547 — agents/common/src/main/java/com/dbx/agent/AbstractJdbcAgent.java:547-553 | REDACTED:447-453 | REDACTED:759-767 | REDACTED:774-780 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:772` calls `contains` and `REDACTED:446` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (7–8 lines × 9) · ×1
  • Duplicated block (7–8 lines × 9) agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:329 — agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:329-335 | agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:424-431 | agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:469-476 | agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:562-568 | agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:650-656 | agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:724-731 | agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:760-767 | agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:834-841 | agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:1063-1069 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:329` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:467` calls `catalogRelation` and `agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:328` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (6–7 lines × 6) · ×1
  • Duplicated block (6–7 lines × 6) REDACTED:2401 — REDACTED:2401-2406 | REDACTED:3818-3824 | REDACTED:3841-3847 | REDACTED:3872-3878 | REDACTED:3888-3893 | REDACTED:3903-3908 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2401` 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–7 lines × 5) · ×1
  • Duplicated block (6–7 lines × 5) agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:565 — agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:565-570 | REDACTED:3014-3019 | agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:498-503 | agents/drivers/sqlserver-legacy/src/main/java/com/dbx/agent/sqlserverlegacy/SqlServerLegacyAgent.java:389-394 | REDACTED:4238-4244 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times. Read the line range as the matched WINDOW rather than a finished unit: at `agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:565` 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–6 lines × 3) · ×1
  • Duplicated block (5–6 lines × 3) agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:255 — agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:255-259 | REDACTED:3937-3941 | REDACTED:4238-4243 — 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 `agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:255` 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 (5–6 lines × 2) · ×1
  • Duplicated block (5–6 lines × 2) agents/drivers/gbase8s/src/main/java/com/dbx/agent/gbase8s/Gbase8sAgent.java:1075 — agents/drivers/gbase8s/src/main/java/com/dbx/agent/gbase8s/Gbase8sAgent.java:1075-1080 | agents/drivers/informix/src/main/java/com/dbx/agent/informix/InformixAgent.java:433-437 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/gbase8s/src/main/java/com/dbx/agent/gbase8s/Gbase8sAgent.java:1075` 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 (4–5 lines × 5) · ×1
  • Duplicated block (4–5 lines × 5) agents/drivers/oceanbase-oracle/src/main/java/com/dbx/agent/oceanbaseoracle/OceanBaseOracleAgent.java:986 — agents/drivers/oceanbase-oracle/src/main/java/com/dbx/agent/oceanbaseoracle/OceanBaseOracleAgent.java:986-989 | agents/drivers/oceanbase-oracle/src/main/java/com/dbx/agent/oceanbaseoracle/OceanBaseOracleAgent.java:1059-1063 | agents/drivers/oceanbase-oracle/src/main/java/com/dbx/agent/oceanbaseoracle/OceanBaseOracleAgent.java:1170-1174 | agents/drivers/oceanbase-oracle/src/main/java/com/dbx/agent/oceanbaseoracle/OceanBaseOracleAgent.java:1289-1293 | agents/drivers/oceanbase-oracle/src/main/java/com/dbx/agent/oceanbaseoracle/OceanBaseOracleAgent.java:1320-1324 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/oceanbase-oracle/src/main/java/com/dbx/agent/oceanbaseoracle/OceanBaseOracleAgent.java:986` 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 (4–5 lines × 9) · ×1
  • Duplicated block (4–5 lines × 9) agents/common/src/main/java/com/dbx/agent/BaseDatabaseAgent.java:12 — agents/common/src/main/java/com/dbx/agent/BaseDatabaseAgent.java:12-16 | agents/common/src/main/java/com/dbx/agent/DatabaseAgent.java:61-65 | agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:207-210 | agents/drivers/db2/src/main/java/com/dbx/agent/db2/Db2Agent.java:152-155 | agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java:128-131 | agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:247-250 | agents/drivers/informix/src/main/java/com/dbx/agent/informix/InformixAgent.java:280-283 | agents/drivers/snowflake/src/main/java/com/dbx/agent/snowflake/SnowflakeAgent.java:136-139 | agents/drivers/sundb/src/main/java/com/dbx/agent/sundb/SundbAgent.java:130-133 — before extracting anything, compare `agents/common/src/main/java/com/dbx/agent/BaseDatabaseAgent.java` and `agents/common/src/main/java/com/dbx/agent/DatabaseAgent.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `agents/common/src/main/java/com/dbx/agent/BaseDatabaseAgent.java:12` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `agents/drivers/h2/src/main/java/com/dbx/agent/h2/H2Agent.java:246` calls `resolveSchema` and `agents/common/src/main/java/com/dbx/agent/PostgresLikeAgent.java:206` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (95 lines × 2) · ×1
  • Duplicated block (95 lines × 2) agents/drivers/argo-go/query.go:84 — agents/drivers/argo-go/query.go:84-178 | agents/drivers/hive-go/query.go:84-178 — `agents/drivers/argo-go/query.go` and `agents/drivers/hive-go/query.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 20 separate duplicated blocks between them, totalling at least 444 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (93 lines × 2) · ×1
  • Duplicated block (93 lines × 2) REDACTED:636 — REDACTED:636-728 | agents/drivers/vastbase-go/vastbase_metadata.go:495-587 — `REDACTED` and `agents/drivers/vastbase-go/vastbase_metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 71 separate duplicated blocks between them, totalling at least 1426 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (92 lines × 2) · ×1
  • Duplicated block (92 lines × 2) agents/drivers/argo-go/config.go:174 — agents/drivers/argo-go/config.go:174-265 | agents/drivers/hive-go/config.go:180-271 — `agents/drivers/argo-go/config.go` and `agents/drivers/hive-go/config.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 1107 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/config.go:174` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 (86 lines × 2) · ×1
  • Duplicated block (86 lines × 2) agents/drivers/argo-go/main.go:19 — agents/drivers/argo-go/main.go:19-104 | agents/drivers/hive-go/main.go:19-104 — `agents/drivers/argo-go/main.go` and `agents/drivers/hive-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 43 separate duplicated blocks between them, totalling at least 699 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (79 lines × 2) · ×1
  • Duplicated block (79 lines × 2) REDACTED:542 — REDACTED:542-620 | agents/drivers/vastbase-go/vastbase_metadata.go:401-479 — `REDACTED` and `agents/drivers/vastbase-go/vastbase_metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 71 separate duplicated blocks between them, totalling at least 1426 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (76 lines × 2) · ×1
  • Duplicated block (76 lines × 2) agents/drivers/argo-go/config.go:1042 — agents/drivers/argo-go/config.go:1042-1117 | agents/drivers/hive-go/config.go:1073-1148 — `agents/drivers/argo-go/config.go` and `agents/drivers/hive-go/config.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 1107 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (74 lines × 2) · ×1
  • Duplicated block (74 lines × 2) agents/drivers/argo-go/config.go:563 — agents/drivers/argo-go/config.go:563-636 | agents/drivers/hive-go/config.go:569-642 — `agents/drivers/argo-go/config.go` and `agents/drivers/hive-go/config.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 1107 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (68 lines × 2) · ×1
  • Duplicated block (68 lines × 2) REDACTED:96 — REDACTED:96-163 | REDACTED:96-163 — `REDACTED` and `REDACTED` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 17 separate duplicated blocks between them, totalling at least 340 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (67 lines × 2) · ×1
  • Duplicated block (67 lines × 2) agents/drivers/argo-go/main.go:391 — agents/drivers/argo-go/main.go:391-457 | agents/drivers/hive-go/main.go:391-457 — `agents/drivers/argo-go/main.go` and `agents/drivers/hive-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 43 separate duplicated blocks between them, totalling at least 699 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/main.go:391` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (57 lines × 2) · ×1
  • Duplicated block (57 lines × 2) agents/drivers/argo-go/zookeeper_tls.go:61 — agents/drivers/argo-go/zookeeper_tls.go:61-117 | agents/drivers/hive-go/zookeeper_tls.go:61-117 — `agents/drivers/argo-go/zookeeper_tls.go` and `agents/drivers/hive-go/zookeeper_tls.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 223 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (54 lines × 2) · ×1
  • Duplicated block (54 lines × 2) agents/drivers/argo-go/zookeeper_tls.go:120 — agents/drivers/argo-go/zookeeper_tls.go:120-173 | agents/drivers/hive-go/zookeeper_tls.go:120-173 — `agents/drivers/argo-go/zookeeper_tls.go` and `agents/drivers/hive-go/zookeeper_tls.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 223 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (44 lines × 2) · ×1
  • Duplicated block (44 lines × 2) REDACTED:1776 — REDACTED:1776-1819 | agents/drivers/vastbase-go/vastbase_metadata.go:1107-1150 — `REDACTED` and `agents/drivers/vastbase-go/vastbase_metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 71 separate duplicated blocks between them, totalling at least 1426 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1776` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 (4–31 lines × 4) · ×1
  • Duplicated block (4–31 lines × 4) agents/drivers/kingbase-go/main.go:756 — agents/drivers/kingbase-go/main.go:756-786 | REDACTED:4100-4103 | agents/drivers/vastbase-go/main.go:680-710 | REDACTED:4162-4165 — 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 register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `agents/drivers/vastbase-go/main.go:679` calls `noteSQLSessionState` and `agents/drivers/kingbase-go/main.go:755` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (26 lines × 5) · ×1
  • Duplicated block (26 lines × 5) agents/drivers/argo-go/metadata.go:100 — agents/drivers/argo-go/metadata.go:100-125 | agents/drivers/cassandra-go/metadata.go:94-119 | agents/drivers/hive-go/metadata.go:100-125 | agents/drivers/iotdb/metadata.go:79-104 | agents/drivers/neo4j-go/metadata.go:62-87 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/metadata.go:100` 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 (25 lines × 7) · ×1
  • Duplicated block (25 lines × 7) agents/drivers/argo-go/metadata.go:112 — agents/drivers/argo-go/metadata.go:112-136 | agents/drivers/cassandra-go/metadata.go:106-130 | agents/drivers/hive-go/metadata.go:112-136 | agents/drivers/iotdb/metadata.go:91-115 | agents/drivers/kingbase-go/main.go:76-100 | agents/drivers/neo4j-go/metadata.go:74-98 | agents/drivers/vastbase-go/main.go:70-94 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 7 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 7 times. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/metadata.go:112` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (24 lines × 5) · ×1
  • Duplicated block (24 lines × 5) agents/drivers/argo-go/main.go:42 — agents/drivers/argo-go/main.go:42-65 | agents/drivers/cassandra-go/main.go:56-79 | agents/drivers/hive-go/main.go:42-65 | agents/drivers/iotdb/main.go:57-80 | agents/drivers/neo4j-go/main.go:55-78 — `agents/drivers/argo-go/main.go` and `agents/drivers/cassandra-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 276 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/main.go:42` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (23 lines × 8) · ×1
  • Duplicated block (23 lines × 8) agents/drivers/argo-go/metadata.go:107 — agents/drivers/argo-go/metadata.go:107-129 | agents/drivers/cassandra-go/metadata.go:101-123 | agents/drivers/hive-go/metadata.go:107-129 | agents/drivers/iotdb/metadata.go:86-108 | agents/drivers/kingbase-go/main.go:71-93 | agents/drivers/neo4j-go/metadata.go:69-91 | REDACTED:290-312 | agents/drivers/vastbase-go/main.go:65-87 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 8 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 8 times. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/metadata.go:107` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (23 lines × 4) · ×1
  • Duplicated block (23 lines × 4) agents/drivers/cassandra-go/main.go:22 — agents/drivers/cassandra-go/main.go:22-44 | agents/drivers/iotdb/main.go:27-49 | agents/drivers/neo4j-go/main.go:26-48 | agents/drivers/vastbase-go/main.go:25-47 — `agents/drivers/cassandra-go/main.go` and `agents/drivers/iotdb/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 30 separate duplicated blocks between them, totalling at least 389 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/cassandra-go/main.go:22` 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 (22–23 lines × 2) · ×1
  • Duplicated block (22–23 lines × 2) agents/go-common/iotdb-client-go/client/session.go:113 — agents/go-common/iotdb-client-go/client/session.go:113-134 | agents/go-common/iotdb-client-go/client/session.go:171-193 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `agents/go-common/iotdb-client-go/client/session.go:135` calls `GetSessionId`, `RequestStatementId`, `Background` and `agents/go-common/iotdb-client-go/client/session.go:194` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (20–22 lines × 2) · ×1
  • Duplicated block (20–22 lines × 2) agents/drivers/etcd-go/watch.go:218 — agents/drivers/etcd-go/watch.go:218-237 | agents/drivers/etcd2-go/watch.go:213-234 — `agents/drivers/etcd-go/watch.go` and `agents/drivers/etcd2-go/watch.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 117 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/etcd-go/watch.go:218` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (21 lines × 7) · ×1
  • Duplicated block (21 lines × 7) agents/drivers/argo-go/main.go:122 — agents/drivers/argo-go/main.go:122-142 | agents/drivers/cassandra-go/main.go:129-149 | agents/drivers/hive-go/main.go:122-142 | agents/drivers/iotdb/main.go:126-146 | agents/drivers/kingbase-go/main.go:184-204 | agents/drivers/neo4j-go/main.go:143-163 | agents/drivers/vastbase-go/main.go:196-216 — `agents/drivers/argo-go/main.go` and `agents/drivers/cassandra-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 276 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/main.go:122` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (20 lines × 7) · ×1
  • Duplicated block (20 lines × 7) agents/drivers/argo-go/metadata.go:54 — agents/drivers/argo-go/metadata.go:54-73 | agents/drivers/cassandra-go/metadata.go:39-58 | agents/drivers/hive-go/metadata.go:54-73 | agents/drivers/iotdb/metadata.go:46-65 | REDACTED:144-163 | agents/drivers/neo4j-go/metadata.go:41-60 | agents/drivers/vastbase-go/vastbase_metadata.go:71-90 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 7 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 7 times. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/metadata.go:54` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (19 lines × 6) · ×1
  • Duplicated block (19 lines × 6) agents/drivers/argo-go/main.go:51 — agents/drivers/argo-go/main.go:51-69 | agents/drivers/cassandra-go/main.go:65-83 | agents/drivers/hive-go/main.go:51-69 | agents/drivers/iotdb/main.go:66-84 | agents/drivers/kingbase-go/main.go:102-120 | agents/drivers/neo4j-go/main.go:64-82 — `agents/drivers/argo-go/main.go` and `agents/drivers/cassandra-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 276 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (19 lines × 5) · ×1
  • Duplicated block (19 lines × 5) agents/drivers/cassandra-go/main.go:24 — agents/drivers/cassandra-go/main.go:24-42 | agents/drivers/iotdb/main.go:29-47 | agents/drivers/neo4j-go/main.go:28-46 | agents/drivers/vastbase-go/main.go:27-45 | REDACTED:318-336 — `agents/drivers/cassandra-go/main.go` and `agents/drivers/iotdb/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 30 separate duplicated blocks between them, totalling at least 389 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/cassandra-go/main.go:24` 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 (9–15 lines × 6) · ×1
  • Duplicated block (9–15 lines × 6) agents/drivers/argo-go/protocol_error.go:105 — agents/drivers/argo-go/protocol_error.go:105-113 | agents/drivers/cassandra-go/protocol_error.go:121-135 | agents/drivers/etcd-go/protocol_error.go:74-83 | agents/drivers/etcd2-go/protocol_error.go:66-74 | agents/drivers/hive-go/protocol_error.go:105-113 | agents/drivers/neo4j-go/protocol_error.go:120-128 — `agents/drivers/argo-go/protocol_error.go` and `agents/drivers/cassandra-go/protocol_error.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 56 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/protocol_error.go:105` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (15 lines × 5) · ×1
  • Duplicated block (15 lines × 5) agents/drivers/cassandra-go/main.go:218 — agents/drivers/cassandra-go/main.go:218-232 | agents/drivers/iotdb/main.go:224-238 | agents/drivers/kingbase-go/main.go:267-281 | agents/drivers/neo4j-go/main.go:244-258 | agents/drivers/vastbase-go/main.go:284-298 — `agents/drivers/cassandra-go/main.go` and `agents/drivers/iotdb/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 30 separate duplicated blocks between them, totalling at least 389 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/cassandra-go/main.go:218` 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (14 lines × 11) · ×1
  • Duplicated block (14 lines × 11) agents/drivers/argo-go/main.go:112 — agents/drivers/argo-go/main.go:112-125 | agents/drivers/cassandra-go/main.go:119-132 | agents/drivers/etcd-go/main.go:133-146 | agents/drivers/etcd2-go/main.go:103-116 | agents/drivers/hive-go/main.go:112-125 | agents/drivers/iotdb/main.go:116-129 | agents/drivers/kingbase-go/main.go:174-187 | agents/drivers/neo4j-go/main.go:133-146 | REDACTED:589-602 | agents/drivers/vastbase-go/main.go:186-199 | REDACTED:713-726 — `agents/drivers/argo-go/main.go` and `agents/drivers/cassandra-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 276 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/main.go:112` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `agents/drivers/etcd-go/main.go:149` calls `closeAll` and `agents/drivers/argo-go/main.go:128` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (14 lines × 9) · ×1
  • Duplicated block (14 lines × 9) agents/drivers/argo-go/main.go:128 — agents/drivers/argo-go/main.go:128-141 | agents/drivers/cassandra-go/main.go:135-148 | agents/drivers/etcd-go/main.go:150-163 | agents/drivers/etcd2-go/main.go:120-133 | agents/drivers/hive-go/main.go:128-141 | agents/drivers/iotdb/main.go:132-145 | agents/drivers/kingbase-go/main.go:190-203 | agents/drivers/neo4j-go/main.go:149-162 | agents/drivers/vastbase-go/main.go:202-215 — `agents/drivers/argo-go/main.go` and `agents/drivers/cassandra-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 276 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/main.go:128` 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 register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `agents/drivers/etcd-go/main.go:149` calls `closeAll` and `agents/drivers/cassandra-go/main.go:134` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (8–14 lines × 3) · ×1
  • Duplicated block (8–14 lines × 3) agents/drivers/kingbase-go/main.go:1020 — agents/drivers/kingbase-go/main.go:1020-1027 | agents/drivers/vastbase-go/main.go:1014-1021 | REDACTED:3969-3982 — `agents/drivers/kingbase-go/main.go` and `agents/drivers/vastbase-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 50 separate duplicated blocks between them, totalling at least 708 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/kingbase-go/main.go:1020` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (12 lines × 10) · ×1
  • Duplicated block (12 lines × 10) agents/drivers/argo-go/main.go:162 — agents/drivers/argo-go/main.go:162-173 | agents/drivers/cassandra-go/main.go:160-171 | agents/drivers/etcd-go/main.go:186-197 | agents/drivers/etcd2-go/main.go:156-167 | agents/drivers/hive-go/main.go:162-173 | agents/drivers/iotdb/main.go:166-177 | agents/drivers/neo4j-go/main.go:187-198 | agents/drivers/vastbase-go/main.go:220-231 | REDACTED:762-773 | REDACTED:1040-1051 — `agents/drivers/argo-go/main.go` and `agents/drivers/cassandra-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 276 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/main.go:162` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (12 lines × 6) · ×1
  • Duplicated block (12 lines × 6) agents/go-common/iotdb-client-go/client/column.go:228 — agents/go-common/iotdb-client-go/client/column.go:228-239 | agents/go-common/iotdb-client-go/client/column.go:300-311 | agents/go-common/iotdb-client-go/client/column.go:372-383 | agents/go-common/iotdb-client-go/client/column.go:444-455 | agents/go-common/iotdb-client-go/client/column.go:516-527 | agents/go-common/iotdb-client-go/client/column.go:588-599 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (12 lines × 5) · ×1
  • Duplicated block (12 lines × 5) agents/drivers/argo-go/main.go:226 — agents/drivers/argo-go/main.go:226-237 | agents/drivers/hive-go/main.go:226-237 | agents/drivers/iotdb/main.go:229-240 | agents/drivers/kingbase-go/main.go:272-283 | agents/drivers/neo4j-go/main.go:249-260 — `agents/drivers/argo-go/main.go` and `agents/drivers/hive-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 43 separate duplicated blocks between them, totalling at least 699 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/main.go:226` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (10 lines × 7) · ×1
  • Duplicated block (10 lines × 7) agents/drivers/argo-go/main.go:213 — agents/drivers/argo-go/main.go:213-222 | agents/drivers/cassandra-go/main.go:211-220 | agents/drivers/hive-go/main.go:213-222 | agents/drivers/iotdb/main.go:217-226 | agents/drivers/kingbase-go/main.go:260-269 | agents/drivers/neo4j-go/main.go:237-246 | agents/drivers/vastbase-go/main.go:277-286 — `agents/drivers/argo-go/main.go` and `agents/drivers/cassandra-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 276 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/main.go:213` 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 first that the copies are not typed on the same thing: the declarations holding them bind `string` to `runtimeServer *runtimeServer) dispatch(method` in one and `r *runtimeServer) dispatch(method` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (8–9 lines × 5) · ×1
  • Duplicated block (8–9 lines × 5) agents/drivers/argo-go/main.go:402 — agents/drivers/argo-go/main.go:402-410 | agents/drivers/hive-go/main.go:402-410 | agents/drivers/iotdb/main.go:340-347 | agents/drivers/kingbase-go/main.go:386-393 | agents/drivers/vastbase-go/main.go:417-424 — `agents/drivers/argo-go/main.go` and `agents/drivers/hive-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 43 separate duplicated blocks between them, totalling at least 699 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/main.go:402` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (7–8 lines × 5) · ×1
  • Duplicated block (7–8 lines × 5) agents/drivers/argo-go/metadata.go:249 — agents/drivers/argo-go/metadata.go:249-255 | agents/drivers/argo-go/metadata.go:264-271 | agents/drivers/hive-go/metadata.go:255-261 | agents/drivers/hive-go/metadata.go:270-277 | agents/drivers/iotdb/metadata.go:174-180 — `agents/drivers/argo-go/metadata.go` and `agents/drivers/hive-go/metadata.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 946 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/metadata.go:249` 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 (7 lines × 9) · ×1
  • Duplicated block (7 lines × 9) agents/drivers/argo-go/main.go:185 — agents/drivers/argo-go/main.go:185-191 | agents/drivers/cassandra-go/main.go:183-189 | agents/drivers/hive-go/main.go:185-191 | agents/drivers/iotdb/main.go:189-195 | agents/drivers/kingbase-go/main.go:237-243 | agents/drivers/neo4j-go/main.go:210-216 | REDACTED:681-687 | agents/drivers/vastbase-go/main.go:249-255 | REDACTED:789-795 — `agents/drivers/argo-go/main.go` and `agents/drivers/cassandra-go/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 276 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `string` to `runtimeServer *runtimeServer) dispatch(method` in one and `r *runtimeServer) dispatch(method` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (18 lines × 7) · ×1
  • Duplicated block (18 lines × 7) agents/drivers/argo-go/protocol_error.go:72 — agents/drivers/argo-go/protocol_error.go:72-89 | agents/drivers/cassandra-go/protocol_error.go:86-103 | agents/drivers/hive-go/protocol_error.go:72-89 | agents/drivers/iotdb/protocol_error.go:72-89 | agents/drivers/neo4j-go/protocol_error.go:85-102 | agents/drivers/vastbase-go/protocol_error.go:84-101 | agents/drivers/xugu/protocol_error.go:131-148 — `agents/drivers/argo-go/protocol_error.go` and `agents/drivers/cassandra-go/protocol_error.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 56 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (12 lines × 9) · ×1
  • Duplicated block (12 lines × 9) agents/drivers/argo-go/protocol_error.go:134 — agents/drivers/argo-go/protocol_error.go:134-145 | agents/drivers/cassandra-go/protocol_error.go:145-156 | agents/drivers/etcd-go/protocol_error.go:132-143 | agents/drivers/etcd2-go/protocol_error.go:124-135 | agents/drivers/hive-go/protocol_error.go:134-145 | agents/drivers/iotdb/protocol_error.go:127-138 | agents/drivers/neo4j-go/protocol_error.go:138-149 | agents/drivers/vastbase-go/protocol_error.go:143-154 | agents/drivers/xugu/protocol_error.go:222-233 — `agents/drivers/argo-go/protocol_error.go` and `agents/drivers/cassandra-go/protocol_error.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 56 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (17 lines × 8) · ×1
  • Duplicated block (17 lines × 8) agents/drivers/argo-go/metadata.go:56 — agents/drivers/argo-go/metadata.go:56-72 | agents/drivers/cassandra-go/metadata.go:41-57 | agents/drivers/hive-go/metadata.go:56-72 | agents/drivers/iotdb/metadata.go:48-64 | REDACTED:146-162 | agents/drivers/neo4j-go/metadata.go:43-59 | agents/drivers/vastbase-go/vastbase_metadata.go:73-89 | REDACTED:476-492 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 8 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 8 times. Read the line range as the matched WINDOW rather than a finished unit: at `agents/drivers/argo-go/metadata.go:56` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (6 lines × 7) · ×1
  • Duplicated block (6 lines × 7) REDACTED:990 — REDACTED:990-995 | REDACTED:996-1001 | REDACTED:1008-1013 | REDACTED:1014-1019 | REDACTED:1020-1025 | REDACTED:1026-1031 | REDACTED:1032-1038 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:990` 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 (94 lines × 2) · ×1
  • Duplicated block (94 lines × 2) REDACTED:185 — REDACTED:185-278 | REDACTED:185-278 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 397 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (47 lines × 2) · ×1
  • Duplicated block (47 lines × 2) REDACTED:485 — REDACTED:485-531 | REDACTED:485-531 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 397 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D5 · Coupling · Unstable project dbx-drivers · ×1
  • Unstable project dbx-drivers — dbx-drivers has instability 0.93 with 1 dependents.
D5 · Coupling · Unstable project dbx-sql · ×1
  • Unstable project dbx-sql — dbx-sql has instability 0.83 with 1 dependents.
D8 · Code Coverage · Coverage not measured · ×1
  • Coverage not measured — JavaScript/TypeScript suite — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — the vitest suite in the repository root ran and passed but wrote no lcov report. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
R10 · Code Duplication · Duplication concentrated across 45 sibling directories (291 clone groups) · ×1
  • Duplication concentrated across 45 sibling directories (291 clone groups) apps/desktop/src/components/layout/SqlLibraryPanel.vue:1088 — 291 duplicated blocks under apps/desktop/src/components/ have copies in at least two of the sibling directories admin, ai, backup, chart, codeSnapshot, common (+39 more sibling(s) not listed) — 169 of them are reported below, and 122 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 291 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 291 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 291 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 5 sibling directories (203 clone groups) · ×1
  • Duplication concentrated across 5 sibling directories (203 clone groups) apps/desktop/src/components/generate/params/IdNumberParams.vue:37 — 203 duplicated blocks under apps/desktop/src/ have copies in at least two of the sibling directories components, composables, lib, stores, types — 132 of them are reported below, and 71 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 203 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 203 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 203 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 39 sibling directories (122 clone groups) · ×1
  • Duplication concentrated across 39 sibling directories (122 clone groups) apps/desktop/src/lib/app/documentJsonValues.ts:306 — 122 duplicated blocks under apps/desktop/src/lib/ have copies in at least two of the sibling directories ai, app, backend, codeSnapshot, common, connection (+33 more sibling(s) not listed) — 84 of them are reported below, and 38 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 122 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 122 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 122 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 5 sibling directories (7 clone groups) · ×1
  • Duplication concentrated across 5 sibling directories (7 clone groups) apps/desktop/src/components/ui/context-menu/ContextMenuItem.vue:9 — 7 duplicated blocks under apps/desktop/src/components/ui/ have copies in at least two of the sibling directories context-menu, dialog, dropdown-menu, popover, tabs — 4 of them are reported below, and 3 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 7 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 7 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 7 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 5 sibling directories (6 clone groups) · ×1
  • Duplication concentrated across 5 sibling directories (6 clone groups) packages/mcp-server/bin/dbx-mcp-server.js:55 — 6 duplicated blocks under the repository root have copies in at least two of the sibling directories agents, apps, packages, plugins, scripts — 5 of them are reported below, and 1 is counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 6 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 6 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 6 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplicated block with local edits (192 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (192 matched lines × 2 locations) apps/desktop/src/components/admin/DamengRoleAdmin.vue:58 — apps/desktop/src/components/admin/DamengRoleAdmin.vue:58 · apps/desktop/src/components/admin/DamengUserAdmin.vue:81 — the two spans are one implementation copied and then locally edited — 1628 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (178 lines × 2 locations) · ×1
  • Duplicated block (178 lines × 2 locations) apps/desktop/src/components/layout/SqlLibraryPanel.vue:1088 — apps/desktop/src/components/layout/SqlLibraryPanel.vue:1088 · apps/desktop/src/components/transfer/TransferTaskTree.vue:333 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R10 · Code Duplication · Duplicated block with local edits (126 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (126 matched lines × 2 locations) apps/desktop/src/lib/metadata/objectDdlCache.ts:39 — apps/desktop/src/lib/metadata/objectDdlCache.ts:39 · apps/desktop/src/lib/metadata/objectMetadataCache.ts:24 — the two spans are one implementation copied and then locally edited — 1255 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (102 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (102 matched lines × 2 locations) apps/desktop/src/components/admin/MySqlDashboard.vue:32 — apps/desktop/src/components/admin/MySqlDashboard.vue:32 · apps/desktop/src/components/admin/PostgresDashboard.vue:29 — the two spans are one implementation copied and then locally edited — 1079 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (101 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (101 matched lines × 2 locations) apps/desktop/src/components/mq/rabbitmq/RabbitMqPermissionsPanel.vue:84 — apps/desktop/src/components/mq/rabbitmq/RabbitMqPermissionsPanel.vue:84 · apps/desktop/src/components/mq/rabbitmq/RabbitMqPoliciesPanel.vue:58 — the two spans are one implementation copied and then locally edited — 589 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (73 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (73 matched lines × 2 locations) apps/desktop/src/lib/app/documentJsonValues.ts:306 — apps/desktop/src/lib/app/documentJsonValues.ts:306 · apps/desktop/src/lib/common/safeJsonFormat.ts:462 — the two spans are one implementation copied and then locally edited — 596 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (71 lines × 2 locations) · ×1
  • Duplicated block (71 lines × 2 locations) apps/desktop/src/lib/sql/sqlStatementRanges.ts:1096 — apps/desktop/src/lib/sql/sqlStatementRanges.ts:1096 · apps/desktop/src/lib/sql/sqlStatementRanges.ts:1327 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (66 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (66 matched lines × 2 locations) apps/desktop/src/components/mq/SubscriptionsPanel.vue:19 — apps/desktop/src/components/mq/SubscriptionsPanel.vue:19 · apps/desktop/src/components/mq/TopicsPanel.vue:32 — the two spans are one implementation copied and then locally edited — 437 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (64 lines × 2 locations) · ×1
  • Duplicated block (64 lines × 2 locations) apps/desktop/src/lib/backend/http.ts:3783 — apps/desktop/src/lib/backend/http.ts:3783 · apps/desktop/src/lib/backend/tauri.ts:3867 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (63 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (63 matched lines × 2 locations) apps/desktop/src/lib/sql/identifierSearch.ts:7 — apps/desktop/src/lib/sql/identifierSearch.ts:7 · REDACTED:5691 — the two spans are one implementation copied and then locally edited — 523 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (61 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (61 matched lines × 2 locations) apps/desktop/src/components/codeSnapshot/CodeSnapshotDialog.vue:65 — apps/desktop/src/components/codeSnapshot/CodeSnapshotDialog.vue:65 · apps/desktop/src/components/grid/GridSnapshotDialog.vue:29 — the two spans are one implementation copied and then locally edited — 436 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (61 lines × 2 locations) · ×1
  • Duplicated block (61 lines × 2 locations) apps/desktop/src/components/sidebar/ConnectionTree.vue:1238 — apps/desktop/src/components/sidebar/ConnectionTree.vue:1238 · apps/desktop/src/components/sidebar/ConnectionTree.vue:1311 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block with local edits (56 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (56 matched lines × 2 locations) apps/desktop/src/lib/sql/sqlFormatter.ts:460 — apps/desktop/src/lib/sql/sqlFormatter.ts:460 · apps/desktop/src/lib/sql/sqlFormatter.ts:747 — the two spans are one implementation copied and then locally edited — 491 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (55 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (55 matched lines × 2 locations) apps/desktop/src/components/mq/ProducerConsumerPanel.vue:12 — apps/desktop/src/components/mq/ProducerConsumerPanel.vue:12 · apps/desktop/src/components/mq/SendMessagePanel.vue:12 — the two spans are one implementation copied and then locally edited — 375 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (54 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (54 matched lines × 2 locations) apps/desktop/src/composables/useDataGridCanvasRuntime.ts:68 — apps/desktop/src/composables/useDataGridCanvasRuntime.ts:68 · apps/desktop/src/composables/useDataGridScrollbars.ts:44 — the two spans are one implementation copied and then locally edited — 260 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (53 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (53 matched lines × 2 locations) apps/desktop/src/components/diff/SchemaDiffConfigStep.vue:95 — apps/desktop/src/components/diff/SchemaDiffConfigStep.vue:95 · apps/desktop/src/components/diff/SchemaDiffConfigStep.vue:261 — the two spans are one implementation copied and then locally edited — 498 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (50 lines × 2 locations) · ×1
  • Duplicated block (50 lines × 2 locations) apps/desktop/src/components/generate/params/IdNumberParams.vue:37 — apps/desktop/src/components/generate/params/IdNumberParams.vue:37 · apps/desktop/src/lib/dataGrid/dataGenerate.ts:702 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication · Duplicated block with local edits (50 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (50 matched lines × 2 locations) apps/desktop/src/components/mq/ExchangesPanel.vue:107 — apps/desktop/src/components/mq/ExchangesPanel.vue:107 · apps/desktop/src/components/mq/TopicsPanel.vue:282 — the two spans are one implementation copied and then locally edited — 292 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (48 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (48 matched lines × 2 locations) apps/desktop/src/components/sidebar/VisibleNacosNamespacesDialog.vue:20 — apps/desktop/src/components/sidebar/VisibleNacosNamespacesDialog.vue:20 · apps/desktop/src/components/sidebar/VisibleSchemasDialog.vue:33 — the two spans are one implementation copied and then locally edited — 334 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (45 lines × 2 locations) · ×1
  • Duplicated block (45 lines × 2 locations) apps/desktop/src/components/diagram/SchemaDiagramDialog.vue:811 — apps/desktop/src/components/diagram/SchemaDiagramDialog.vue:811 · apps/desktop/src/components/diagram/SchemaDiagramDialog.vue:857 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (41 lines × 2 locations) · ×1
  • Duplicated block (41 lines × 2 locations) apps/desktop/src/components/generate/params/IdNumberParams.vue:149 — apps/desktop/src/components/generate/params/IdNumberParams.vue:149 · apps/desktop/src/components/generate/params/SkuParams.vue:22 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
R10 · Code Duplication · Duplicated block with local edits (40 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (40 matched lines × 2 locations) apps/desktop/src/components/connection/ConnectionDialog.vue:833 — apps/desktop/src/components/connection/ConnectionDialog.vue:833 · apps/desktop/src/components/grid/DataGridBulkEditDialog.vue:23 — the two spans are one implementation copied and then locally edited — 336 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (39 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (39 matched lines × 2 locations) apps/desktop/src/components/consul/ConsulAcl.vue:14 — apps/desktop/src/components/consul/ConsulAcl.vue:14 · apps/desktop/src/components/consul/ConsulScope.vue:13 — the two spans are one implementation copied and then locally edited — 389 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R2 · Cyclomatic Complexity · Complex function executeTabSql (cyclomatic 496, cognitive 696) · ×1
  • Complex function executeTabSql (cyclomatic 496, cognitive 696) apps/desktop/src/stores/queryStore.ts:6640 — executeTabSql has cyclomatic complexity 496 and cognitive complexity 696; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function connectionConfigForSubmit (cyclomatic 243, cognitive 312) · ×1
  • Complex function connectionConfigForSubmit (cyclomatic 243, cognitive 312) apps/desktop/src/components/connection/ConnectionDialog.vue:4576 — connectionConfigForSubmit has cyclomatic complexity 243 and cognitive complexity 312; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function send (cyclomatic 225, cognitive 324) · ×1
  • Complex function send (cyclomatic 225, cognitive 324) apps/desktop/src/components/editor/AiAssistant.vue:3230 — send has cyclomatic complexity 225 and cognitive complexity 324; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function applyEditorSettingsPatch (cyclomatic 205, cognitive 215) · ×1
  • Complex function applyEditorSettingsPatch (cyclomatic 205, cognitive 215) apps/desktop/src/stores/settingsStore.ts:2511 — applyEditorSettingsPatch has cyclomatic complexity 205 and cognitive complexity 215; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function toggle (cyclomatic 200, cognitive 208) · ×1
  • Complex function toggle (cyclomatic 200, cognitive 208) REDACTED:814 — toggle has cyclomatic complexity 200 and cognitive complexity 208; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function normalizeEditorSettings (cyclomatic 125, cognitive 118) · ×1
  • Complex function normalizeEditorSettings (cyclomatic 125, cognitive 118) apps/desktop/src/stores/settingsStore.ts:1636 — normalizeEditorSettings has cyclomatic complexity 125 and cognitive complexity 118; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function performAsyncCompletionWithResult (cyclomatic 117, cognitive 149) · ×1
  • Complex function performAsyncCompletionWithResult (cyclomatic 117, cognitive 149) apps/desktop/src/components/editor/useQueryEditorCompletion.ts:1373 — performAsyncCompletionWithResult has cyclomatic complexity 117 and cognitive complexity 149; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function buildDefaultGeneratorParams (cyclomatic 108, cognitive 121) · ×1
  • Complex function buildDefaultGeneratorParams (cyclomatic 108, cognitive 121) apps/desktop/src/lib/dataGrid/dataGenerate.ts:1257 — buildDefaultGeneratorParams has cyclomatic complexity 108 and cognitive complexity 121; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function loadTreeNodeChildren (cyclomatic 106, cognitive 83) · ×1
  • Complex function loadTreeNodeChildren (cyclomatic 106, cognitive 83) apps/desktop/src/stores/connectionStore.ts:7521 — loadTreeNodeChildren has cyclomatic complexity 106 and cognitive complexity 83; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function dispatch (cyclomatic 105, cognitive 161) · ×1
  • Complex function dispatch (cyclomatic 105, cognitive 161) REDACTED:537 — dispatch has cyclomatic complexity 105 and cognitive complexity 161; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function getIconInfo (cyclomatic 101, cognitive 24) · ×1
  • Complex function getIconInfo (cyclomatic 101, cognitive 24) apps/desktop/src/components/sidebar/TreeItem.vue:245 — getIconInfo has cyclomatic complexity 101 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 97, cognitive 135) · ×1
  • Complex function (anonymous) (cyclomatic 97, cognitive 135) apps/desktop/src/components/connection/ConnectionDialog.vue:3049 — (anonymous) has cyclomatic complexity 97 and cognitive complexity 135; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function buildObjectSidebarMenu (cyclomatic 95, cognitive 141) · ×1
  • Complex function buildObjectSidebarMenu (cyclomatic 95, cognitive 141) REDACTED:6221 — buildObjectSidebarMenu has cyclomatic complexity 95 and cognitive complexity 141; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function onGridKeydown (cyclomatic 92, cognitive 104) · ×1
  • Complex function onGridKeydown (cyclomatic 92, cognitive 104) apps/desktop/src/components/grid/DataGrid.vue:9429 — onGridKeydown has cyclomatic complexity 92 and cognitive complexity 104; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function splitSqlStatementRanges (cyclomatic 89, cognitive 184) · ×1
  • Complex function splitSqlStatementRanges (cyclomatic 89, cognitive 184) apps/desktop/src/lib/sql/sqlStatementRanges.ts:333 — splitSqlStatementRanges has cyclomatic complexity 89 and cognitive complexity 184; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function getTreeNodeIconInfo (cyclomatic 89, cognitive 11) · ×1
  • Complex function getTreeNodeIconInfo (cyclomatic 89, cognitive 11) apps/desktop/src/lib/sidebar/treeNodeIcon.ts:10 — getTreeNodeIconInfo has cyclomatic complexity 89 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function provideSqlCompletions (cyclomatic 88, cognitive 112) · ×1
  • Complex function provideSqlCompletions (cyclomatic 88, cognitive 112) apps/desktop/src/components/editor/useQueryEditorCompletion.ts:654 — provideSqlCompletions has cyclomatic complexity 88 and cognitive complexity 112; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function handleQuickOpenSelect (cyclomatic 86, cognitive 88) · ×1
  • Complex function handleQuickOpenSelect (cyclomatic 86, cognitive 88) apps/desktop/src/App.vue:3299 — handleQuickOpenSelect has cyclomatic complexity 86 and cognitive complexity 88; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function explainTabSql (cyclomatic 84, cognitive 165) · ×1
  • Complex function explainTabSql (cyclomatic 84, cognitive 165) apps/desktop/src/stores/queryStore.ts:8231 — explainTabSql has cyclomatic complexity 84 and cognitive complexity 165; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function saveChanges (cyclomatic 83, cognitive 111) · ×1
  • Complex function saveChanges (cyclomatic 83, cognitive 111) apps/desktop/src/composables/useDataGridEditor.ts:1881 — saveChanges has cyclomatic complexity 83 and cognitive complexity 111; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files · Large Files · ×1
  • Large Files — 239 file(s) over 400 lines (counted as significant lines — blank lines excluded — over production source only, tests excluded), largest first: apps/desktop/src/components/grid/DataGrid.vue (14331), apps/desktop/src/i18n/locales/ru.ts (11882), apps/desktop/src/i18n/locales/en.ts (11382), REDACTED (11343), apps/desktop/src/components/editor/EditorSettingsDialog.vue (11040), apps/desktop/src/i18n/locales/es.ts (10974) (+233 more).
R7 · Dead Code · Dead file (~317 LoC) · ×1
  • Dead file (~317 LoC) deploy/plugin-stats-worker/worker.ts — no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~208 LoC) · ×1
  • Dead file (~208 LoC) REDACTED — no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~151 LoC) · ×1
  • Dead file (~151 LoC) apps/desktop/src/components/config/TagManagementPanel.vue — no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~146 LoC) · ×1
  • Dead file (~146 LoC) agents/drivers/oceanbase-oracle/scripts/verify-partition-ddl.ts — no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~136 LoC) · ×1
  • Dead file (~136 LoC) REDACTED — no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~130 LoC) · ×1
  • Dead file (~130 LoC) apps/desktop/src/lib/sql/sqlServerQueryWrapping.ts — no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~97 LoC) · ×1
  • Dead file (~97 LoC) scripts/check-mq-integration.mjs — no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~74 LoC) · ×1
  • Dead file (~74 LoC) apps/desktop/src/components/diff/OscStatusPanel.vue — no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~55 LoC) · ×1
  • Dead file (~55 LoC) apps/desktop/src/components/config/ConfigDriftPanel.vue — no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~45 LoC) · ×1
  • Dead file (~45 LoC) apps/desktop/src/components/diff/RebasePanel.vue — no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~33 LoC) · ×1
  • Dead file (~33 LoC) apps/desktop/src/components/ui/context-menu/ContextMenuItem.vue — no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (apps/desktop/src/components/ui/context-menu/index.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~30 LoC) · ×1
  • Dead file (~30 LoC) apps/desktop/src/components/ui/sheet/SheetContent.vue — no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (apps/desktop/src/components/ui/sheet/index.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~29 LoC) · ×1
  • Dead file (~29 LoC) apps/desktop/src/components/config/ConfigHotReloadIndicator.vue — no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~23 LoC) · ×1
  • Dead file (~23 LoC) apps/desktop/src/components/diff/StrictTagAlertPanel.vue — no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~22 LoC) · ×1
  • Dead file (~22 LoC) apps/desktop/src/components/diff/ConflictMatrix.vue — no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~17 LoC) · ×1
  • Dead file (~17 LoC) apps/desktop/src/components/ui/context-menu/ContextMenuContent.vue — no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (apps/desktop/src/components/ui/context-menu/index.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~16 LoC) · ×1
  • Dead file (~16 LoC) apps/desktop/src/lib/diagram/diagramZoom.ts — no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~15 LoC) · ×1
  • Dead file (~15 LoC) apps/desktop/src/components/grid/JsonValueTable.vue — no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~13 LoC) · ×1
  • Dead file (~13 LoC) apps/desktop/src/components/ui/context-menu/ContextMenuSubContent.vue — no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (apps/desktop/src/components/ui/context-menu/index.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~11 LoC) · ×1
  • Dead file (~11 LoC) apps/desktop/src/components/ui/context-menu/ContextMenuTrigger.vue — no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (apps/desktop/src/components/ui/context-menu/index.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~9 LoC) · ×1
  • Dead file (~9 LoC) scripts/release-node-packages.mjs — no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~5 LoC) · ×1
  • Dead file (~5 LoC) apps/desktop/src/components/ui/context-menu/ContextMenuGroup.vue — no import path from any entry point (261 application, 19 tooling, 1647 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (apps/desktop/src/components/ui/context-menu/index.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R8 · Dependency Hygiene · Unused dependency '@oxfmt/binding-darwin-arm64' · ×1
  • Unused dependency '@oxfmt/binding-darwin-arm64' — Declared in the root package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
R8 · Dependency Hygiene · Unused dependency '@oxlint/binding-darwin-arm64' · ×1
  • Unused dependency '@oxlint/binding-darwin-arm64' — Declared in the root package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
R8 · Dependency Hygiene · Unused dependency '@tauri-apps/plugin-updater' · ×1
  • Unused dependency '@tauri-apps/plugin-updater' — Declared in the root package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
S1 · Web-Security Posture · Third-party script without Subresource Integrity · ×1
  • Third-party script without Subresource Integrity docs/app/[lang]/layout.tsx:66 — `https://analytics.unihub.top/script.js` is executed by this page with no Subresource Integrity. Whoever can answer that request — the CDN, anyone who compromises it, anyone on the network path — runs arbitrary script in this page's origin, with its session. The URL also names no version, so it resolves to whatever that origin serves at fetch time — the executed bytes can change with nobody touching this repository.
Minor — 47 finding(s)
X9 · Subsumed condition operand · Subsumed condition operand · ×11
  • Subsumed condition operand .github/scripts/label-pull-request.mjs:147 — `file.startsWith("packages/mcp-server/")` can never decide this `||` — every value satisfying `file.startsWith("packages/mcp-server/")` also satisfies `file.startsWith("packages/mcp-")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand src-tauri/src/commands/keychain.rs:38 — `stderr.contains("The specified item could not be found")` can never decide this `||` — every value satisfying `stderr.contains("The specified item could not be found")` also satisfies `stderr.contains("could not be found")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand crates/dbx-driver-mysql/src/mysql.rs:2658 — `lower.contains("this command is not supported in the prepared statement protocol yet")` can never decide this `||` — every value satisfying `lower.contains("this command is not supported in the prepared statement protocol yet")` also satisfies `lower.contains("prepared statement protocol")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand crates/dbx-core/tests/live_mongodb_legacy_agent_commands.rs:266 — `missing.contains("ns not found")` can never decide this `||` — every value satisfying `missing.contains("ns not found")` also satisfies `missing.contains("not found")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand crates/dbx-ai-provider/src/ai_codex_cli.rs:1018 — `lower.contains("the filename or extension is too long")` can never decide this `||` — every value satisfying `lower.contains("the filename or extension is too long")` also satisfies `lower.contains("filename or extension is too long")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand crates/dbx-ai-provider/src/ai_codex_cli.rs:1023 — `lower.contains("not authenticated")` can never decide this `||` — every value satisfying `lower.contains("not authenticated")` also satisfies `lower.contains("auth")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand REDACTED:519 — `strings.HasPrefix(topic, "%RETRY%")` can never decide this `||` — every value satisfying `strings.HasPrefix(topic, "%RETRY%")` also satisfies `strings.HasPrefix(topic, "%R")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand REDACTED:522 — `strings.HasPrefix(topic, "%DLQ%")` can never decide this `||` — every value satisfying `strings.HasPrefix(topic, "%DLQ%")` also satisfies `strings.HasPrefix(topic, "%D")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand crates/dbx-sql-schema/src/table_structure_sql/validation.rs:128 — `lower.starts_with("character varying")` can never decide this `||` — every value satisfying `lower.starts_with("character varying")` also satisfies `lower.starts_with("character")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand crates/dbx-core/src/persistence/cloud_sync.rs:2337 — `normalized.contains("clientsecret")` can never decide this `||` — every value satisfying `normalized.contains("clientsecret")` also satisfies `normalized.contains("secret")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand REDACTED:4514 — `normalized.startsWith("bit varying")` can never decide this `||` — every value satisfying `normalized.startsWith("bit varying")` also satisfies `normalized.startsWith("bit ")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
D29 · Static Analysis (SAST) · REDACTED · ×9
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
ED3 · Event naming · Event not named in past tense · ×7
  • Event not named in past tense: benchmarkMetadata REDACTED:59 — `benchmarkMetadata` reads as an instruction, not a fact that happened. Events describe something that already occurred — name them in the past tense (e.g. `OrderPlaced`, `PaymentCaptured`) so the ubiquitous language stays clear.
  • Event not named in past tense: rpcError REDACTED:51 — `rpcError` reads as an instruction, not a fact that happened. Events describe something that already occurred — name them in the past tense (e.g. `OrderPlaced`, `PaymentCaptured`) so the ubiquitous language stays clear.
  • Event not named in past tense: AgentEvent crates/dbx-ai-provider/src/agent_events.rs:8 — `AgentEvent` reads as an instruction, not a fact that happened. Events describe something that already occurred — name them in the past tense (e.g. `OrderPlaced`, `PaymentCaptured`) so the ubiquitous language stays clear.
  • Event not named in past tense: ReloadEvent crates/dbx-sql-dialect/src/sql_dialect/hot_reload.rs:28 — `ReloadEvent` reads as an instruction, not a fact that happened. Events describe something that already occurred — name them in the past tense (e.g. `OrderPlaced`, `PaymentCaptured`) so the ubiquitous language stays clear.
  • Event not named in past tense: DownloadEvent vendor/tauri-plugin-updater/src/commands.rs:16 — `DownloadEvent` reads as an instruction, not a fact that happened. Events describe something that already occurred — name them in the past tense (e.g. `OrderPlaced`, `PaymentCaptured`) so the ubiquitous language stays clear.
  • Event not named in past tense: PageLoadEvent vendor/wry/src/lib.rs:2562 — `PageLoadEvent` reads as an instruction, not a fact that happened. Events describe something that already occurred — name them in the past tense (e.g. `OrderPlaced`, `PaymentCaptured`) so the ubiquitous language stays clear.
  • Event not named in past tense: SidebarLayoutMonitorEvent apps/desktop/src/lib/sidebar/sidebarLayoutMonitor.ts:128 — `SidebarLayoutMonitorEvent` reads as an instruction, not a fact that happened. Events describe something that already occurred — name them in the past tense (e.g. `OrderPlaced`, `PaymentCaptured`) so the ubiquitous language stays clear.
D16 · Bus Factor · Off-boarding risk · ×4
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 29 significant file(s) lose their only recent owner: src-tauri/src/commands/saved_sql.rs, REDACTED, agents/drivers/cassandra-go/kerberos.go, REDACTED, REDACTED, REDACTED, agents/drivers/iotdb/main.go, REDACTED (+21 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 12 significant file(s) lose their only recent owner: apps/desktop/src/lib/dataGrid/dataGridSelectionPersistence.ts, apps/desktop/src/lib/dataGrid/dataGridForeignKeyDisplay.ts, apps/desktop/src/lib/dataGrid/dataGridLargeValues.ts, apps/desktop/src/lib/sql/mysqlRoutineSyntaxDiagnostics.ts, agents/common/src/main/java/com/dbx/agent/MetadataListConstraints.java, agents/common/src/main/java/com/dbx/agent/ColumnInfo.java, src-tauri/src/commands/window_controls.rs, apps/desktop/src/lib/editor/sqlHoverLayout.ts (+4 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 9 significant file(s) lose their only recent owner: crates/dbx-core/src/admin/nacos/namespace_access.rs, crates/dbx-core/src/admin/nacos/search.rs, apps/desktop/src/i18n/locales/consulZhCN.ts, apps/desktop/src/i18n/locales/consulUi.ts, src-tauri/src/commands/nacos_cmd.rs, apps/desktop/src/lib/backend/nacos-tauri.ts, apps/desktop/src/types/meilisearchManagement.ts, crates/dbx-core/src/admin/nacos/port.rs (+1 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #4 — If anonymized user #4 becomes unavailable, 3 significant file(s) lose their only recent owner: agents/drivers/xugu/protocol_error.go, apps/desktop/src/lib/sidebar/xuguTypeMembers.ts, apps/desktop/src/lib/sidebar/xuguPublicSynonyms.ts. Pair on, review, or document these before any departure.
D19 · Documentation Quality · Documentation · ×2
  • Documentation: no project overview README.md — The opening paragraph describes DBX's purpose and hero image but does not state what the repository is or what it does. State the repository's scope (what tiers, tools, packages are documented) so readers can find the right README.
  • Documentation: no contributor guidance README.md — The root README has no contribution or code-of-conduct guidance. Add a short CONTRIBUTING.md section covering pull request guidelines, review process, and licensing.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Low CVE · ×2
  • REDACTED
  • REDACTED
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 15 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 (71 single-owned of 1311 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 1311 of the 1995 production source files in this repository met that bar). They are anonymized user #5 (2 file(s)), anonymized user #6 (2 file(s)), anonymized user #7 (2 file(s)), anonymized user #8 (1 file(s)), anonymized user #9 (1 file(s)), anonymized user #10 (1 file(s)) (+9 more) — spread or document their files in the same way, at lower priority than the named off-boarding risks above.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D26 · Project Cohesion · Split crates/dbx-core · ×1
  • Split crates/dbx-core — A huge catch-all at 200k LoC across 24 namespaces is a sprawling grab-bag. Suggested:
D26 · Project Cohesion · Split crates/dbx-web · ×1
  • Split crates/dbx-web — A 23k-LoC web framework whose namespaces are all routes and a src catch-all, spread across two namespaces. Suggested:
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Low vulnerability · ×1
  • REDACTED
D31 · IaC & Container Security · Low IaC · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 24/83 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `agents/drivers/access`, `agents/drivers/bigquery`, `agents/drivers/cache`, `agents/drivers/cassandra-go`, `agents/drivers/databend` and 54 more.
Minor — 22 finding(s)
D12 · Dependency Hygiene · Outdated · ×18
  • Outdated: gitee.com/XuguDB/go-xugu-driver — `gitee.com/XuguDB/go-xugu-driver` is required at v1.0.12 in agents/drivers/xugu/go.mod, but v1.0.15 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get gitee.com/XuguDB/go-xugu-driver@v1.0.15 && go mod tidy` and commit the updated REDACTED and REDACTED.
  • Outdated: github.com/amigoer/rocketmq-admin-go — `github.com/amigoer/rocketmq-admin-go` is required at v1.1.1 in REDACTED, but v1.4.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/amigoer/rocketmq-admin-go@v1.4.0 && go mod tidy` and commit the updated REDACTED and REDACTED.
  • Outdated: github.com/apache/iotdb-client-go/v2 — `github.com/apache/iotdb-client-go/v2` is required at v2.0.8 in agents/drivers/iotdb/bench/go/go.mod, but v2.0.10 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/apache/iotdb-client-go/v2@v2.0.10 && go mod tidy` and commit the updated REDACTED and REDACTED.
  • Outdated: github.com/apache/thrift — `github.com/apache/thrift` is required at v0.22.0 in agents/go-common/gohive/go.mod, but v0.24.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/apache/thrift@v0.24.0 && go mod tidy` and commit the updated REDACTED and REDACTED.
  • Outdated: github.com/datastax/gocql-astra/v2 — `github.com/datastax/gocql-astra/v2` is required at v2.0.1 in REDACTED, but v2.0.2 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/datastax/gocql-astra/v2@v2.0.2 && go mod tidy` and commit the updated REDACTED and REDACTED.
  • Outdated: github.com/gurkankaymak/hocon — `github.com/gurkankaymak/hocon` is required at v1.3.0 in REDACTED, but v1.4.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/gurkankaymak/hocon@v1.4.0 && go mod tidy` and commit the updated REDACTED and REDACTED.
  • Outdated: github.com/jcmturner/gofork — `github.com/jcmturner/gofork` is required at v1.0.0 in REDACTED, but v1.7.6 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/jcmturner/gofork@v1.7.6 && go mod tidy` and commit the updated REDACTED and REDACTED.
  • Outdated: github.com/jcmturner/gokrb5 — `github.com/jcmturner/gokrb5` is required at v8.4.2+incompatible in REDACTED, but v8.4.4+incompatible is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/jcmturner/gokrb5@v8.4.4+incompatible && go mod tidy` and commit the updated REDACTED and REDACTED.
  • Outdated: github.com/jcmturner/gokrb5/v8 — `github.com/jcmturner/gokrb5/v8` is required at v8.4.2 in REDACTED, but v8.4.4 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/jcmturner/gokrb5/v8@v8.4.4 && go mod tidy` and commit the updated REDACTED and REDACTED.
  • Outdated: github.com/neo4j/neo4j-go-driver/v6 — `github.com/neo4j/neo4j-go-driver/v6` is required at v6.2.0 in agents/drivers/neo4j-go/go.mod, but v6.3.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/neo4j/neo4j-go-driver/v6@v6.3.0 && go mod tidy` and commit the updated REDACTED and REDACTED.
  • Outdated: github.com/rabbitmq/amqp091-go — `github.com/rabbitmq/amqp091-go` is required at v1.13.0 in agents/drivers/rabbitmq/go.mod, but v1.15.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/rabbitmq/amqp091-go@v1.15.0 && go mod tidy` and commit the updated REDACTED and REDACTED.
  • Outdated: github.com/stretchr/testify — `github.com/stretchr/testify` is required at v1.7.0 in REDACTED, but v1.12.1 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/stretchr/testify@v1.12.1 && go mod tidy` and commit the updated REDACTED and REDACTED.
  • Outdated: go.etcd.io/etcd/api/v3 — `go.etcd.io/etcd/api/v3` is required at v3.7.1 in REDACTED, but v3.7.2 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get go.etcd.io/etcd/api/v3@v3.7.2 && go mod tidy` and commit the updated REDACTED and REDACTED.
  • Outdated: go.etcd.io/etcd/client/v3 — `go.etcd.io/etcd/client/v3` is required at v3.7.1 in REDACTED, but v3.7.2 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get go.etcd.io/etcd/client/v3@v3.7.2 && go mod tidy` and commit the updated REDACTED and REDACTED.
  • Outdated: golang.org/x/net — `golang.org/x/net` is required at v0.44.0 in REDACTED, but v0.59.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get golang.org/x/net@v0.59.0 && go mod tidy` and commit the updated REDACTED and REDACTED.
  • Outdated: golang.org/x/net — `golang.org/x/net` is required at v0.41.0 in agents/go-common/gohive/go.mod, but v0.59.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get golang.org/x/net@v0.59.0 && go mod tidy` and commit the updated REDACTED and REDACTED.
  • Outdated: golang.org/x/text — `golang.org/x/text` is required at v0.22.0 in REDACTED, but v0.42.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get golang.org/x/text@v0.42.0 && go mod tidy` and commit the updated REDACTED and REDACTED.
  • Outdated: google.golang.org/grpc — `google.golang.org/grpc` is required at v1.82.1 in REDACTED, but v1.84.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get google.golang.org/grpc@v1.84.0 && go mod tidy` and commit the updated REDACTED and REDACTED.
D10 · Test Quality · Skipped (documented) · ×4
  • Skipped (documented): (unnamed test) apps/desktop/src/lib/backend/__tests__/elasticsearchIndexTransportContract.spec.ts:28 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) apps/desktop/src/lib/backend/__tests__/consulTransportContract.spec.ts:138 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) apps/desktop/src/lib/backend/__tests__/consulCoreEndpointContract.spec.ts:141 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) apps/desktop/src/lib/backend/__tests__/consulCoreEndpointContract.spec.ts:180 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs

Appendix B — Reproduction & audit trail

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

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-a25ba294c5cc45fca257a3dd883828a6/history.json --exit-code 0 --source .11artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-a25ba294c5cc45fca257a3dd883828a6/tree.json --exit-code 0 --source .7artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/watchdog-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off .483artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update68artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .31artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 53 file(s) — `.github/scripts/suggest-similar-issues.mjs`, `apps/desktop/src/components/editor/queryEditorCodeMirrorRuntime.ts`, `apps/desktop/src/components/editor/queryEditorSqlExtensions.ts`, `apps/desktop/src/components/editor/useQueryEditorBatchSelection.ts`, `apps/desktop/src/components/editor/useQueryEditorCompletion.ts`, … (+48 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update0artifacts/raw/trivy-fs.json

Run 01a0e9f1-77b3-7e98-800a-394a0b964beb · 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