Public report — openpilot, published 26 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.15 (frozen) · verify this survey Filed cd_71d7e821a3104b19b85f0fb566bc34d1 Filed 26 September 2026, 10:51 UTC Public

Commaai/openpilot

Measured 26 September 2026, 09:42 UTC

49% Weak
CriticalWeakAdequateStrongExemplary

Medium · 48,430 LoC · rebuild ~0.4 person-years · weakest lens: Readiness (40%)

Findings by grade

44 critical 501 serious 23 minor 40 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
26 September 2026, 09:42 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 ▸

30/34dimensions tool-verifieddeterministic · confidence 1.0 · 4 LLM-assisted, advisory
550findings with an exact file:lineof 568 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
34/114dimensions across the health lenses48430 LoC — wide & deep
Chapters

Executive summary

Band capped at Weak: the weakest category (Dependencies, 7%) reads Critical — the cover never out-promises the category table.

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

This system is a medium-sized asset with a fragile operational foundation. While the underlying architecture is robust and the code is relatively small to rebuild, the overall health score of 49% signals significant risk. The business value here is substantial, with nearly 50,000 lines of production code and a rebuild cost of approximately €55,000. However, the system’s weakest point is its readiness for production, which stands at just 40%. This gap creates a tangible threat to delivery speed and reliability, as the team lacks the safety nets needed to deploy changes confidently.

The most critical issue is the lack of operational guardrails. Without automated checks to catch security regressions or prevent bad builds from reaching users, every release carries a hidden risk of outage or exposure. This is not merely a technical debt; it is a velocity tax. The current code quality imposes a 5–11% drag on every change, meaning the team pays a premium in time and effort for every feature or fix. This inefficiency compounds over time, draining resources that could otherwise be spent on innovation.

Despite these risks, the system has genuine strengths. The architecture is sound, with a high score of 99%, indicating that the structural design is solid and changes do not ripple uncontrollably. The code itself is clean, with no boilerplate or straight-line logic, suggesting that the core logic is well-structured and maintainable. These positives provide a stable base upon which to build improvements.

To maximize leverage, the team should first integrate static application security testing into the continuous integration pipeline. This single step would block security regressions before they land, paying for itself within months by reducing the annual drag on development. Additionally, implementing a manual gate for releases would prevent bad builds from reaching users, providing an immediate layer of protection. These actions address the highest risks with minimal effort, stabilizing the system and restoring confidence in the delivery process.

How the score is built — each lens's share of the headline Width is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
Readiness 40% · 46% weightAccessibility 47% · 25% weightMaturity 59% · 14% weightSecurity 65% · 8% weightCode Health 79% · 4% weightArchitecture 99% · 2% weight

Raise Readiness 40 → 70 (the Healthy floor) ⇒ headline 49 → ~57.

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

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

  • D1 · SelfdriveD.update_events (cyclomatic 156) openpilot/selfdrive/selfdrived/selfdrived.py
  • D1 · hardwared.hardware_thread (cyclomatic 63) openpilot/system/hardware/hardwared.py
  • D1 · qcomgpsd.main (cyclomatic 47) openpilot/system/qcomgpsd/qcomgpsd.py
  • D1 · serve._render_blocks (cyclomatic 46) docs/serve.py
  • D1 · CarEvents.create_common_events (cyclomatic 46) openpilot/selfdrive/car/car_events.py
  • D1 · modeld.main (cyclomatic 45) REDACTED
  • D1 · generate_report.report (cyclomatic 41) openpilot/tools/lateral_maneuvers/generate_report.py
  • D1 · ChestnutStatus.update (cyclomatic 40) openpilot/system/hardware/chestnut/status.py
  • D1 · CarEvents.update (cyclomatic 37) openpilot/selfdrive/car/car_events.py
  • D1 · LocationEstimator.handle_log (cyclomatic 33) openpilot/selfdrive/locationd/locationd.py
  • D1 · DriverMonitoring._update_events (cyclomatic 32) openpilot/selfdrive/monitoring/policy.py
  • D1 · UnifiedLabel._render (cyclomatic 31) openpilot/system/ui/widgets/label.py
  • D1 · SimulatorBridge._run (cyclomatic 30) openpilot/tools/sim/bridge/common.py
  • D1 · lateral_maneuversd.main (cyclomatic 29) openpilot/tools/lateral_maneuvers/lateral_maneuversd.py
  • D1 · DriverMonitoring._update_states (cyclomatic 27) openpilot/selfdrive/monitoring/policy.py
  • D1 · GuiScrollPanel2._handle_mouse_event (cyclomatic 27) openpilot/system/ui/lib/scroll_panel2.py
  • D1 · Route._get_segments_local (cyclomatic 26) openpilot/tools/lib/route.py
  • D1 · DesireHelper.update (cyclomatic 25) openpilot/selfdrive/controls/lib/desire_helper.py
  • D1 · StateMachine.update (cyclomatic 25) openpilot/selfdrive/selfdrived/state.py
  • D1 · WifiManager._handle_state_change (cyclomatic 25) openpilot/system/ui/lib/wifi_manager.py
  • D1 · serve.inject_glossary (cyclomatic 24) docs/serve.py
  • D1 · GuiApplication.render (cyclomatic 24) REDACTED
  • D1 · serve.render_inline (cyclomatic 23) docs/serve.py
  • D1 · qrcode._parse_data (cyclomatic 23) openpilot/common/qrcode.py
  • D1 · potools.extract_strings (cyclomatic 23) openpilot/selfdrive/ui/translations/potools.py
  • D1 · CheckUpdateButton._update_state (cyclomatic 22) REDACTED
  • D1 · UbloxMsgParser._parse_glonass_ephemeris (cyclomatic 22) openpilot/system/ubloxd/ubloxd.py
  • D1 · generate_report.report (cyclomatic 22) openpilot/tools/longitudinal_maneuvers/generate_report.py
  • D1 · potools.parse_po (cyclomatic 21) openpilot/selfdrive/ui/translations/potools.py
  • D1 · manager.manager_thread (cyclomatic 21) openpilot/system/manager/manager.py
  • D1 · compressed_vipc.decoder (cyclomatic 21) openpilot/tools/camerastream/compressed_vipc.py
  • D1 · ci_results.format_markdown (cyclomatic 21) scripts/ci_results.py
  • D1 · VCruiseHelper._update_v_cruise_non_pcm (cyclomatic 20) openpilot/selfdrive/car/cruise.py
  • D1 · file_downloader.cmd_download (cyclomatic 20) openpilot/tools/lib/file_downloader.py
  • D1 · metadrive_process.metadrive_process (cyclomatic 20) openpilot/tools/sim/bridge/metadrive/metadrive_process.py
  • D1 · check_shell.check_text (cyclomatic 20) scripts/lint/check_shell.py
  • D1 · utils.tabulate (cyclomatic 19) REDACTED
  • D1 · registration.register (cyclomatic 19) openpilot/system/athena/registration.py
  • D1 · Widget._process_mouse_events (cyclomatic 19) openpilot/system/ui/widgets/__init__.py
  • D1 · qrcode._rs_correct (cyclomatic 18) openpilot/common/qrcode.py
  • D1 · Controls.state_control (cyclomatic 18) openpilot/selfdrive/controls/controlsd.py
  • D1 · locationd.main (cyclomatic 18) openpilot/selfdrive/locationd/locationd.py
  • D1 · SelfdriveD.data_sample (cyclomatic 18) openpilot/selfdrive/selfdrived/selfdrived.py
  • D1 · GuiScrollPanel2._update_state (cyclomatic 18) openpilot/system/ui/lib/scroll_panel2.py
  • D1 · Keyboard._render (cyclomatic 18) openpilot/system/ui/widgets/keyboard.py
  • D1 · StreamSession.message_handler (cyclomatic 18) openpilot/system/webrtc/webrtcd.py
  • D1 · Generator.node_emits (cyclomatic 18) openpilot/tools/jotpluggler/generate_event_extractors.py
  • D1 · SteeringAccuracyTool.update (cyclomatic 18) tools/car_porting/measure_steering_accuracy.py
  • D1 · binary_struct._parse_field (cyclomatic 17) openpilot/system/ubloxd/binary_struct.py
  • D1 · ui.ui_thread (cyclomatic 17) openpilot/tools/replay/ui.py
  • D1 · max_lat_accel.find_events (cyclomatic 17) tools/scripts/car/max_lat_accel.py
  • D1 · SelfdriveD.__init__ (cyclomatic 16) openpilot/selfdrive/selfdrived/selfdrived.py
  • D1 · SoftwareLayout._update_state (cyclomatic 16) openpilot/selfdrive/ui/layouts/settings/software.py
  • D1 · athenad.log_handler (cyclomatic 16) REDACTED
  • D1 · structs.parse_struct (cyclomatic 16) openpilot/system/qcomgpsd/structs.py
  • D1 · updated.main (cyclomatic 16) openpilot/system/updated/updated.py
  • D2 · SelfdriveD.update_events (cognitive 191) openpilot/selfdrive/selfdrived/selfdrived.py
  • D2 · generate_report.report (cognitive 126) openpilot/tools/lateral_maneuvers/generate_report.py
  • D2 · serve._render_blocks (cognitive 114) docs/serve.py
  • D2 · hardwared.hardware_thread (cognitive 110) openpilot/system/hardware/hardwared.py
  • D2 · qcomgpsd.main (cognitive 105) openpilot/system/qcomgpsd/qcomgpsd.py
  • D2 · modeld.main (cognitive 77) REDACTED
  • D2 · potools.extract_strings (cognitive 67) openpilot/selfdrive/ui/translations/potools.py
  • D2 · SteeringAccuracyTool.update (cognitive 66) tools/car_porting/measure_steering_accuracy.py
  • D2 · CarEvents.update (cognitive 59) openpilot/selfdrive/car/car_events.py
  • D2 · compressed_vipc.decoder (cognitive 57) openpilot/tools/camerastream/compressed_vipc.py
  • D2 · UnifiedLabel._render (cognitive 53) openpilot/system/ui/widgets/label.py
  • D2 · CarEvents.create_common_events (cognitive 52) openpilot/selfdrive/car/car_events.py
  • D2 · GuiScrollPanel2._handle_mouse_event (cognitive 52) openpilot/system/ui/lib/scroll_panel2.py
  • D2 · lateral_maneuversd.main (cognitive 51) openpilot/tools/lateral_maneuvers/lateral_maneuversd.py
  • D2 · Route._get_segments_local (cognitive 51) openpilot/tools/lib/route.py
  • D2 · generate_report.report (cognitive 50) openpilot/tools/longitudinal_maneuvers/generate_report.py
  • D2 · serve.inject_glossary (cognitive 48) docs/serve.py
  • D2 · qrcode._parse_data (cognitive 48) openpilot/common/qrcode.py
  • D2 · ci_results.format_markdown (cognitive 47) scripts/ci_results.py
  • D2 · ChestnutStatus.update (cognitive 46) openpilot/system/hardware/chestnut/status.py
  • D2 · GuiApplication.render (cognitive 46) REDACTED
  • D2 · LocationEstimator.handle_log (cognitive 45) openpilot/selfdrive/locationd/locationd.py
  • D2 · locationd.main (cognitive 40) openpilot/selfdrive/locationd/locationd.py
  • D2 · potools.parse_po (cognitive 40) openpilot/selfdrive/ui/translations/potools.py
  • D2 · Route._get_segments_remote (cognitive 40) openpilot/tools/lib/route.py
  • D2 · SimulatorBridge._run (cognitive 40) openpilot/tools/sim/bridge/common.py
  • D2 · DriverMonitoring._update_events (cognitive 38) openpilot/selfdrive/monitoring/policy.py
  • D2 · serve.render_inline (cognitive 37) docs/serve.py
  • D2 · WifiManager._handle_state_change (cognitive 37) openpilot/system/ui/lib/wifi_manager.py
  • D2 · Keyboard._render (cognitive 37) openpilot/system/ui/widgets/keyboard.py
  • D2 · athenad.log_handler (cognitive 35) REDACTED
  • D2 · athenad.ws_manage (cognitive 35) REDACTED
  • D2 · registration.register (cognitive 34) openpilot/system/athena/registration.py
  • D2 · metadrive_process.metadrive_process (cognitive 33) openpilot/tools/sim/bridge/metadrive/metadrive_process.py
  • D2 · StateMachine.update (cognitive 32) openpilot/selfdrive/selfdrived/state.py
  • D2 · StreamSession.message_handler (cognitive 32) openpilot/system/webrtc/webrtcd.py
  • D2 · Generator.node_emits (cognitive 32) openpilot/tools/jotpluggler/generate_event_extractors.py
  • D2 · file_downloader.cmd_download (cognitive 32) openpilot/tools/lib/file_downloader.py
  • D2 · manager.manager_thread (cognitive 31) openpilot/system/manager/manager.py
  • D2 · ui.ui_thread (cognitive 31) openpilot/tools/replay/ui.py
  • D2 · check_shell.check_text (cognitive 31) scripts/lint/check_shell.py
  • D2 · DriverMonitoring._update_states (cognitive 30) openpilot/selfdrive/monitoring/policy.py
  • D2 · SelfdriveD.data_sample (cognitive 30) openpilot/selfdrive/selfdrived/selfdrived.py
  • D2 · wrap_text.wrap_text (cognitive 30) openpilot/system/ui/lib/wrap_text.py

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

Rebuild cost & value ~ Modeled — €18,000–€91,000
Cost to rebuild€18,000–€91,000 (0.2–0.6 person-years (302–959 h), ~1 engineer)
Domain complexityStandard — harder problems cost more per line
Quality factor0.7× (at 49% quality) — the last 20% of quality is most of the work
Size & shapeMedium · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)

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

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

Top priorities

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

1
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED.
+7.3 pts · Low effort · REDACTED Scanning
2
Add a SAST step to CI running what this repository's stack ships: bandit, `semgrep --config=p/python`, or CodeQL's python pack — so a security regression fails the build instead of landing.
+9.3 pts · Medium effort · Security & performance tooling
3
Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
+8.9 pts · Medium effort · Deployment & Rollback

Diagnosis — what's actually going on

Value concentrated against a weak lens · High · Value at risk
This is a Medium asset (~0.4 person-years to rebuild), and its weakest lens is Readiness at 40%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
Evidence: valuation: Medium, ~0.4 person-years rebuild (48,430 LoC) · weakest lens: Readiness 40%
→ Direct remediation budget at Readiness 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 1–3 engineer-days once. Not doing it costs about 23.5–141.2 engineer-days every year, paid as drag on the ~194,022 lines this team changes annually — a bill that arrives whether or not anyone books it. On those figures the fix breaks even in roughly 1–2 months and is free after that. Method, stated so this is not read as a quotation: debt from the ranked task's effort band; interest = annual changed lines (measured, annualised from the 90-day window) ÷ an ASSUMED 150–400 lines per engineer-day × the 5–11% 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: 47,841 line(s) changed over a 90-day window ⇒ ~194,022/year · D1/D2/D4 code quality: averaging 6.1/10 ⇒ a 5–11% drag on each change · top-ranked remediation: Low effort ⇒ about 1–3 engineer-day(s)
→ Do the top-ranked fix now if this code will still be yours in 2 months.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Add a SAST step to CI running what this repository's stack ships: bandit, `semgrep --config=p/python`, or CodeQL's python pack — so a security regression fails the build instead of landing. The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Add a SAST step to CI running what this repository's stack ships: bandit, `semgrep --config=p/python`, or CodeQL's python pack — so a security regression fails the build instead of landing.
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 6.1/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 5–11% 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 6.1/10 across the code-quality signals actually measured
→ Pay it down where churn is highest — the hotspots — not everywhere; that's where the tax is actually paid.

Architecture — module dependency matrix

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.)

315 modules, 220 dependencies. 1 dependency cycle across 2 modules, marked above the diagonal.

Showing the 40 most-connected modules; 275 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 cereal.messaging2 cereal.visionipc3 common.esim.base4 common.params5 selfdrive.controls.lib.latcontrol6 system.sensord.sensors.i2c_sensor7 system.ubloxd.binary_struct8 system.ui.lib.application9 system.ui.lib.wifi_manager10 tools.lib11 tools.sim.lib.common12 common13 common.hardware.base14 selfdrive.ui.tests.diff15 system.ui.lib16 system.ui.lib.cellular_manager17 system.ui.widgets.list_view18 system.webrtc.webrtcd19 system.ui.widgets20 selfdrive.ui.layouts.settings.settings21 selfdrive.ui.mici.onroad.cameraview22 selfdrive.ui.mici.widgets.button23 selfdrive.ui.mici.widgets.info24 selfdrive.ui.onroad.cameraview25 selfdrive.ui.widgets.ssh_key26 system.ui.widgets.nav_widget27 selfdrive.ui.mici.layouts.settings.network28 selfdrive.ui.mici.onroad.augmented_road_view29 selfdrive.ui.mici.onroad.cabin_camera_dialog30 system.ui.widgets.scroller31 selfdrive.ui.mici.layouts.onboarding32 selfdrive.ui.mici.layouts.settings.firehose33 selfdrive.ui.mici.layouts.settings.network.wifi_ui34 selfdrive.ui.mici.layouts.settings.software35 selfdrive.ui.mici.widgets.dialog36 system.ui.mici_setup37 selfdrive.ui.mici.layouts.settings.device.device_layout38 selfdrive.ui.mici.layouts.settings.network.esim_ui39 system.ui.mici_reset40 system.ui.mici_updater
1 cereal.messaging
2 cereal.visionipc
3 common.esim.base
4 common.params
5 selfdrive.controls.lib.latcontrol
6 system.sensord.sensors.i2c_sensor
7 system.ubloxd.binary_struct
8 system.ui.lib.application
9 system.ui.lib.wifi_manager
10 tools.lib
11 tools.sim.lib.common
12 common1
13 common.hardware.base1
14 selfdrive.ui.tests.diff1
15 system.ui.lib1
16 system.ui.lib.cellular_manager1
17 system.ui.widgets.list_view22
18 system.webrtc.webrtcd21
19 system.ui.widgets31
20 selfdrive.ui.layouts.settings.settings11
21 selfdrive.ui.mici.onroad.cameraview11
22 selfdrive.ui.mici.widgets.button61
23 selfdrive.ui.mici.widgets.info1
24 selfdrive.ui.onroad.cameraview11
25 selfdrive.ui.widgets.ssh_key111
26 system.ui.widgets.nav_widget12
27 selfdrive.ui.mici.layouts.settings.network112
28 selfdrive.ui.mici.onroad.augmented_road_view1211
29 selfdrive.ui.mici.onroad.cabin_camera_dialog111
30 system.ui.widgets.scroller32
31 selfdrive.ui.mici.layouts.onboarding1215
32 selfdrive.ui.mici.layouts.settings.firehose11
33 selfdrive.ui.mici.layouts.settings.network.wifi_ui24321
34 selfdrive.ui.mici.layouts.settings.software2312
35 selfdrive.ui.mici.widgets.dialog1111
36 system.ui.mici_setup2124
37 selfdrive.ui.mici.layouts.settings.device.device_layout13132
38 selfdrive.ui.mici.layouts.settings.network.esim_ui21211121
39 system.ui.mici_reset111
40 system.ui.mici_updater111
Dependency, pointing down the layeringAbove the diagonal — part of a cycleThe module itself
…ilot.cereal.messaging…ilot.cereal.visionipc…ilot.common.esim.base…enpilot.common.params…ntrols.lib.latcontrol…rd.sensors.i2c_sensor….ubloxd.binary_struct…em.ui.lib.application…m.ui.lib.wifi_manageropenpilot.tools.lib….tools.sim.lib.commonopenpilot.common….common.hardware.base…lfdrive.ui.tests.diff…enpilot.system.ui.lib….lib.cellular_manager….ui.widgets.list_view…system.webrtc.webrtcd…lot.system.ui.widgets…uts.settings.settings…ici.onroad.cameraview…i.mici.widgets.button….ui.mici.widgets.info….ui.onroad.cameraview…ve.ui.widgets.ssh_key…ui.widgets.nav_widget…outs.settings.network…d.augmented_road_view…d.cabin_camera_dialog…m.ui.widgets.scroller…ci.layouts.onboarding…uts.settings.firehose…tings.network.wifi_ui…uts.settings.software…i.mici.widgets.dialog….system.ui.mici_setup….device.device_layout…tings.network.esim_ui….system.ui.mici_reset…ystem.ui.mici_updater…ilot.cereal.messaging1…ilot.cereal.visionipc2…ilot.common.esim.base3…enpilot.common.params4…ntrols.lib.latcontrol5…rd.sensors.i2c_sensor6….ubloxd.binary_struct7…em.ui.lib.application8…m.ui.lib.wifi_manager9openpilot.tools.lib10….tools.sim.lib.common11openpilot.common12….common.hardware.base13…lfdrive.ui.tests.diff14…enpilot.system.ui.lib15….lib.cellular_manager16….ui.widgets.list_view17…system.webrtc.webrtcd18…lot.system.ui.widgets19…uts.settings.settings20…ici.onroad.cameraview21…i.mici.widgets.button22….ui.mici.widgets.info23….ui.onroad.cameraview24…ve.ui.widgets.ssh_key25…ui.widgets.nav_widget26…outs.settings.network27…d.augmented_road_view28…d.cabin_camera_dialog29…m.ui.widgets.scroller30…ci.layouts.onboarding31…uts.settings.firehose32…tings.network.wifi_ui33…uts.settings.software34…i.mici.widgets.dialog35….system.ui.mici_setup36….device.device_layout37…tings.network.esim_ui38….system.ui.mici_reset39…ystem.ui.mici_updater401111122213111116111111112112121111132121511243212312111121241313221211121111111+275 more modules (most-connected shown)

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

At a glance — Architecture · 99% · Exemplary ·

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

At a glance — Readiness · 40% · Weak · gated by D12, P3 ·

At a glance — Security · 65% · Adequate · gated by D28, D36 ·

At a glance — Accessibility · 47% · 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 — Injection46High / Critical
A02:2021 — Cryptographic Failures11High / Critical

Roadmap

First, resolve the leaked secret and integrate security scanning into the CI pipeline to prevent regressions from merging. Next, implement a draft release or approval gate to ensure no bad build reaches users without a human checkpoint. Finally, enforce accessibility standards in tests and correct page structure elements to meet compliance requirements.

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

Do thisHelpsEffortDimension
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED.+7.3 ptsLowREDACTED Scanning
Add a SAST step to CI running what this repository's stack ships: bandit, `semgrep --config=p/python`, or CodeQL's python pack — so a security regression fails the build instead of landing.+9.3 ptsMediumSecurity & performance tooling
Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.+8.9 ptsMediumDeployment & Rollback
Enforce accessibility in the test suite you already have: assert the accessibility invariants over the HTML your app renders — parse the rendered output in an existing test, or drive a real browser from one — and gate that test in CI so a regression blocks the merge.+5.8 ptsMediumA11y enforcement
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.+5.4 ptsMediumPage structure
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).+2.7 ptsMediumArchitecture documentation
Add a build/run (quick start) section to the root README — the first thing a newcomer needs.+2.7 ptsMediumDocumentation (README)
Resolve the 1 Documentation finding(s) in Documentation Quality — start with LIMITATIONS.md.+1.2 ptsLowDocumentation Quality

File quality

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

FileScoreBandWorst signal
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.4MixedREDACTED Scanning: Leaked secret: REDACTED
REDACTED4.4MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.8MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.8MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
openpilot/system/manager/test/test_manager.py5.3MixedTest Reliability: Test declared unreliable: test_clean_exit
REDACTED5.8MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.8MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.8MixedStatic Analysis (SAST): High: REDACTED
openpilot/selfdrive/selfdrived/selfdrived.py6.0MixedExplicit Debt: TodoComment
openpilot/system/qcomgpsd/qcomgpsd.py6.0MixedExplicit Debt: TodoComment
openpilot/selfdrive/car/car_events.py6.0MixedExplicit Debt: TodoComment
openpilot/system/ui/widgets/label.py6.0MixedExplicit Debt: TodoComment
openpilot/system/ui/lib/scroll_panel2.py6.0MixedExplicit Debt: TodoComment
openpilot/tools/lib/route.py6.0MixedExplicit Debt: TodoComment
openpilot/system/ui/lib/wifi_manager.py6.0MixedExplicit Debt: TodoComment
openpilot/tools/longitudinal_maneuvers/generate_report.py6.0MixedExplicit Debt: TodoComment

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

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

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

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

Could not be resolved — 40

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. 30 of 34 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 4 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.

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

What we checked — 34 dimensions across the health lenses
D1D2D3D4D9D12D13D14D15D16D17D19D21D22D28D29D30D34D35D36D37D43D44AC3AC7AX10M1M2M3M4P1P3P4P6

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

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

Tools & methods

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

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

Every finding is locatable in findings.md. Run 01a0dd18-39ff-7509-b227-ae6fae90ecc2.

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.

  • D4 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. The 70 duplicated block group(s) on this row were found in the languages this pass could tokenize, and they do NOT cover all of this repository's production source: .cc (31,788 lines, 36% of production source) went unread, because no language model this pass could load exposed a clone-unit token stream for those file kinds. Duplication in that source is UNMEASURED — its absence from the count above is a gap in this analyzer's language coverage, not a finding that the code is free of duplication.
  • D8 Code Coverage — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: test source is present (.py) but the built-in coverage collector has no runner for this repository's ecosystem — so this suite was never executed by it. Not scored — this is a gap in the analyzer's language coverage, not a defect in the repo. To have real coverage read, produce a coverage report in a standard format (`coverage run -m pytest` then `coverage xml`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures. You can widen what we reach: optional: produce a coverage report in a standard format (`coverage run -m pytest` then `coverage xml`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures — then the real number is read on the next scan.
  • D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This repository declares 3 of its own test(s) unreliable. The built-in reliability runner does not support this repository's ecosystem (.py), so the suite was not re-run and no reliability score is given — these are the repository's own declarations, not our measurement.
  • AX3 Project dependency cycles — 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 which project references which. That is a language-neutral question, but the project-reference graph is collected from MSBuild .csproj files only, and this repository commits none — so there was no graph to read, and re-running the same commit reads the same nothing. Its modules are declared as: Python distributions (REDACTED, setup.py, setup.cfg). A reader for that graph is the collector this check is missing. That is a COLLECTOR gap in this analyzer — no change to the scan image closes it — and not a finding that the repository is free of what this check looks for.
  • AX4 Dependency direction — 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 direction each project reference points. That is a language-neutral question, but the project-reference graph is collected from MSBuild .csproj files only, and this repository commits none — so there was no graph to read, and re-running the same commit reads the same nothing. Its modules are declared as: Python distributions (REDACTED, setup.py, setup.cfg). A reader for that graph is the collector this check is missing. That is a COLLECTOR gap in this analyzer — no change to the scan image closes it — and 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.
  • AX8 Test isolation — 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 which projects are test projects, and what they reference. That is a language-neutral question, but the project-reference graph is collected from MSBuild .csproj files only, and this repository commits none — so there was no graph to read, and re-running the same commit reads the same nothing. Its modules are declared as: Python distributions (REDACTED, setup.py, setup.cfg). A reader for that graph is the collector this check is missing. That is a COLLECTOR gap in this analyzer — no change to the scan image closes it — and 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.
  • P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
  • S1 Web-Security Posture — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
  • 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.
  • 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.

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

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • 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.
  • 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.
  • 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.
  • 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.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • 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.
  • 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.
  • M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

The LLM boundary

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

Dimensions

D1 · Cyclomatic Complexity5.5 / 10Adequate✓ Tool-verified

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

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

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

56 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was SelfdriveD.update_events at 156.

SelfdriveD.update_events (cyclomatic 156)openpilot/selfdrive/selfdrived/selfdrived.py:153
hardwared.hardware_thread (cyclomatic 63)openpilot/system/hardware/hardwared.py:197
qcomgpsd.main (cyclomatic 47)openpilot/system/qcomgpsd/qcomgpsd.py:182
serve._render_blocks (cyclomatic 46)docs/serve.py:283
CarEvents.create_common_events (cyclomatic 46)openpilot/selfdrive/car/car_events.py:96

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

What to do

  1. Resolve the 1 SelfdriveD.update_events (cyclomatic 156) finding(s) in Cyclomatic Complexity — start with selfdrived.py. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 hardwared.hardware_thread (cyclomatic 63) finding(s) in Cyclomatic Complexity — start with hardwared.py. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 qcomgpsd.main (cyclomatic 47) finding(s) in Cyclomatic Complexity — start with qcomgpsd.py. — One of this dimension's main actionable groups (1 warning-level).
  4. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D2 · Cognitive Complexity3.3 / 10Weak✓ Tool-verified

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

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

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

134 method(s) exceeded the cognitive complexity threshold of 15; the worst was SelfdriveD.update_events at 191.

SelfdriveD.update_events (cognitive 191)openpilot/selfdrive/selfdrived/selfdrived.py:153
generate_report.report (cognitive 126)openpilot/tools/lateral_maneuvers/generate_report.py:27
serve._render_blocks (cognitive 114)docs/serve.py:283
hardwared.hardware_thread (cognitive 110)openpilot/system/hardware/hardwared.py:197
qcomgpsd.main (cognitive 105)openpilot/system/qcomgpsd/qcomgpsd.py:182

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

What to do

  1. Resolve the 1 SelfdriveD.update_events (cognitive 191) finding(s) in Cognitive Complexity — start with selfdrived.py. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 generate_report.report (cognitive 126) finding(s) in Cognitive Complexity — start with generate_report.py. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 serve._render_blocks (cognitive 114) finding(s) in Cognitive Complexity — start with serve.py. — One of this dimension's main actionable groups (1 warning-level).
  4. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D3 · God Classes9.0 / 10Stronggated by 13 serious findings✓ Tool-verified

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

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

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

13 god class(es) detected.

FileTooLong: REDACTED · ×8REDACTED
TooManyMethods: WifiManager · ×5openpilot/system/ui/lib/wifi_manager.py:157

What to do

  1. Resolve the 8 FileTooLong finding(s) in God Classes — start with REDACTED, events.py, wifi_manager.py. — One of this dimension's main actionable groups (8 warning-level).
  2. Resolve the 5 TooManyMethods finding(s) in God Classes — start with wifi_manager.py, REDACTED, hardware.py. — One of this dimension's main actionable groups (5 warning-level).
  3. Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D4 · Code Duplication9.3 / 10Stronggated by 71 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.3 / 10 · rule-coverage 100% · ceiling Verified

70 duplicated block group(s) detected. One further row reports members as variants of one another; it aggregates block groups already counted above and is not itself counted. Measured on part of this repository only: .cc (36% of production source) was not exposed to the token comparison, so duplication there is unmeasured and is not in this count.

Duplicated block (6 lines × 2) · ×8openpilot/common/transformations/transformations.py:297
Duplicated block (14 lines × 2) · ×6openpilot/selfdrive/ui/mici/onroad/augmented_road_view.py:248
Duplicated block (10 lines × 2) · ×6openpilot/selfdrive/car/card.py:262
Duplicated block (12 lines × 2) · ×5openpilot/common/transformations/transformations.py:277
Duplicated block (11 lines × 2) · ×5openpilot/selfdrive/ui/mici/onroad/model_renderer.py:235

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

What to do

  1. Resolve the 8 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with transformations.py, lagd.py, REDACTED. — One of this dimension's main actionable groups (8 warning-level).
  2. Resolve the 6 Duplicated block (14 lines × 2) finding(s) in Code Duplication — start with model_renderer.py (2), augmented_road_view.py, cameraview.py. — One of this dimension's main actionable groups (6 warning-level).
  3. Resolve the 6 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with model_renderer.py (2), card.py, device.py. — One of this dimension's main actionable groups (6 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.

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

328 test methods: 328 unit, 0 integration, 0 BDD, 0 e2e. The Python suite contributes 328 test function(s) across 68 file(s) declaring at least one — every `def test…` in a file pytest or unittest would collect, which is those frameworks' own definition of a case; a parametrize table counts once, so this is a floor. Its tier split is read from file names and paths only.

✓ On the Gold path — maintain.

Detailed fixes: d9_recommendation.md.

D12 · Dependency Hygiene9.9 0.7 / 10Critical✓ Tool-verified

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

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

Maturity: Documented → Verified → Prevented · effective 0.7 / 10 · rule-coverage 7% · ceiling Verified

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

Outdated: pycapnp

What to do

  1. Enforce Dependency Hygiene in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

D13 · REDACTED Scanning5.0 / 10Adequate✓ Tool-verified

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

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

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

1 secret(s) detected.

REDACTED

What to do

  1. Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED. — One of this dimension's main actionable groups (1 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 25 shipped Python distribution(s) use a banned license. Licences were resolved from PyPI over the distributions a consumer installs — this repository's 15 declared runtime requirement(s) closed transitively over each distribution's published `requires_dist` (10 reached that way). Requirements it states ONLY under an extra, a PEP 735 dependency group, a Poetry dev group or a dev-named requirements file are excluded: pip does not install any of them for a consumer. ★ This repository commits no dependency lockfile that this pass reads, so each licence is the one PyPI publishes for the distribution's CURRENT release rather than for a pinned version. 10 of them publish no licence on PyPI this pass can read; that is missing data, not a violation, and none of them is charged. This repository publishes itself under MIT License, which is its own choice and is not judged here.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

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

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

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

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

Top hotspots: openpilot/selfdrive/selfdrived/selfdrived.py (19×156=2964); REDACTED (51×45=2295); openpilot/system/hardware/hardwared.py (17×63=1071)

Hotspot: openpilot/selfdrive/selfdrived/selfdrived.py · ×28openpilot/selfdrive/selfdrived/selfdrived.py:153

What to do

  1. Resolve the 28 Hotspot finding(s) in Churn × Complexity Hotspots — start with REDACTED (2), selfdrived.py, REDACTED. — One of this dimension's main actionable groups (28 warning-level).

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

D16 · Bus Factor8.9 / 10Strong✓ Tool-verified

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

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

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

25 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is REDACTED. Counted over 225 of the 393 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 · ×2

What to do

  1. Resolve the 2 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (2 recommendation-level).

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

D17 · Explicit Debt9.3 / 10Stronggated by 183 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 9.3 / 10 · rule-coverage 100% · ceiling Prevented

183 deducted task-comment markers across 48430 LoC (0.4/KLoC) → score 9.3. 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 · ×176openpilot/cereal/services.py:5
FixmeComment · ×7openpilot/selfdrive/test/process_replay/test_processes.py:35

What to do

  1. Resolve the 176 TodoComment finding(s) in Explicit Debt — start with wifi_manager.py (7), car_events.py (6), scroll_panel2.py (5). — One of this dimension's main actionable groups (176 warning-level).
  2. Resolve the 7 FixmeComment finding(s) in Explicit Debt — start with test_processes.py, onboarding.py, main.py. — One of this dimension's main actionable groups (7 warning-level).
  3. 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 QualityStrong◐ Sampled · advisory

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

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

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

The documentation is comprehensive and well-organized for a software project. It includes README files for each directory (e.g., LogReader, Lateral Maneuvers Testing Tool, Joystick) that describe what the directory does and how to use its contents, plus architecture/Docs markdown files covering design and transformation details. The openpilot/selfdrive/test/process_replay README is a good test guide with usage, forking, and API sections. However, there are two clear gaps: no overview of the project itself (what it does overall) in any document, and no installation/build instructions at all — only an index.html template and a root-level What-is-openpilot doc that says nothing about installing or building. The documentation is mostly focused on limitations of openpilot ALC/LDW/ACC/FCW components against real-world driving conditions (visibility, obstruction, curves, extreme weather) rather than an overview or installation guide. The READMEs are thin and the main architecture/design docs cover the scope; the visible Limitations documents give a strong operational context but no usage examples. (10 of 25 sampled documents could not be assessed: 1 of 3 evaluation groups failed.)

Documentation: no project overviewdocs/LIMITATIONS.md

What to do

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

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

D21 · Naming ConsistencyExemplary◐ Sampled · advisory

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

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

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

0 naming inconsistencies across 0 sampled symbols.

✓ On the Gold path — maintain.

Detailed fixes: d21_recommendation.md.

D22 · Internal API ConsistencyAdequate◐ 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 Adequate / 10 · rule-coverage 100% · ceiling Verified

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

Redundant operations with identical signatures and likely identical behavior. 'recv_one' and 'recv_one_or_none' are semantically equivalent in this context (returning a single message or None), creating unnecessary API surface duplication.
Overlap in intent. 'all_readers_updated' checks the current state, while 'wait_for_readers_to_update' waits for that state. While one is blocking and one is non-blocking, the naming convention is inconsistent with standard patterns (e.g., 'has_readers' vs 'wait_for_readers'). More critically, 'wait_for_readers_to_update' takes a 'dt' parameter which is ambiguous (is it a timeout? a delta time?).
Type hierarchy inconsistency. 'HardwareBase.get_sim_lpa' returns 'LPABase', but the concrete implementation 'LPA' is a subclass of 'LPABase'. However, the module 'openpilot.common.esim.lpa' exposes a module-level 'LPA' class that seems to duplicate the interface of 'LPABase' but is not clearly positioned in the hierarchy relative to the base class in the exposed surface. It's unclear if 'LPA' is the only implementation or if there are others, and the return type 'LPABase' suggests polymorphism that isn't fully reflected in the distinct 'LPA' class exposure.

What to do

  1. Resolve the 1 Redundant operations with identical signatures and likely identical… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 Overlap in intent. 'all_readers_updated' checks the current state, while… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 Type hierarchy inconsistency. 'HardwareBase.get_sim_lpa' returns… 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.

D28 · Secrets (history)1.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 1.0 / 10 · rule-coverage 100% · ceiling Documented

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

REDACTED
REDACTED

What to do

  1. Resolve the 9 REDACTED finding(s) in Secrets (history) — start with REDACTED (2), REDACTED, REDACTED. — One of this dimension's main actionable groups (9 issue-level).
  2. 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)4.5 / 10Weak✓ Tool-verified

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

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

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

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

46 finding(s): 0 critical, 30 high, 6 medium, 10 low. 28 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 6 file(s) — `openpilot/system/camerad/cameras/spectra.h` (line 123, line 127), `openpilot/system/camerad/sensors/sensor.h` (line 87), `openpilot/system/loggerd/loggerd.h` (line 85, line 86, line 87), `openpilot/tools/jotpluggler/dbc.h`, `openpilot/tools/replay/framereader.h` (line 72, line 73), … (+1 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 4 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

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

What to do

  1. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  3. No action in Static Analysis (SAST) — all 28 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 (28 issue-level, 0 of them charged here).

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

D30 · Dependency Vulnerabilities10.0 / 10Exemplary○ Nothing flagged

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

No known-vulnerable dependencies in any ecosystem this repository declares.

✓ On the Gold path — maintain.

Detailed fixes: d30_recommendation.md.

D34 · Knowledge Freshness9.8 / 10Exemplary✓ Tool-verified

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

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

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

4 of 225 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is openpilot/system/qcomgpsd/structs.py. Counted over 225 of the 393 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned files with no living knowledge

✓ On the Gold path — maintain.

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

D35 · Change Coupling9.8 / 10Adequategated by 1 critical finding✓ Tool-verified

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

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

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

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

Strongest change-coupling: latcontrol_pid.py↔latcontrol_torque.py 100%; latcontrol_angle.py↔latcontrol_pid.py 83%; latcontrol_angle.py↔latcontrol_torque.py 62%

Boundary-crossing change coupling: REDACTED ↔ qlog_size.pyREDACTED
Change coupling: manager.py ↔ REDACTED · ×2openpilot/system/manager/manager.py
Change coupling clique: latcontrol_angle.py, latcontrol_pid.py, latcontrol_torque.pyopenpilot/selfdrive/controls/lib/latcontrol_angle.py

What to do

  1. Resolve the 1 Boundary-crossing change coupling finding(s) in Change Coupling — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 2 Change coupling finding(s) in Change Coupling — start with manager.py, metadrive_bridge.py. — One of this dimension's main actionable groups (2 warning-level).
  3. Resolve the 1 Change coupling clique finding(s) in Change Coupling — start with latcontrol_angle.py. — One of this dimension's main actionable groups (1 warning-level).

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

D36 · Supply-chain Provenance & Signing0.0 / 10Critical✓ 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 0.0 / 10 · rule-coverage 100% · ceiling Documented

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

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

+ 1 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 warning-level).
  2. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.md.

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 2 platform declaration(s) and 15 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, 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.

AC3 · Page structure5.7 / 10Adequate✓ 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.

  • Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one. — openpilot/selfdrive/assets/offroad/fcc.html:10

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.
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 automated accessibility check runs over the HTML your app renders. Assert the accessibility invariants over that HTML in the test suite you already have (parse the output and assert, or drive a browser), and gate that test in CI so a regression blocks the merge. What was searched, so you can tell an absence from a miss: the 2 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 test suite you already have: assert the accessibility invariants over the HTML your app renders — parse the rendered output in an existing test, or drive a real browser from one — and gate that test in CI so a regression blocks the merge.
AX10 · Code composition9.9 / 10Exemplary✓ Tool-verified

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

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

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

What to do

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

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

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

What to do

  • Add a build/run (quick start) section to the root README — the first thing a newcomer needs.
  • Add a 'Testing' section to the root README — how to run the test suite.
  • Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
M2 · Architecture documentation2.0 / 10Weak✓ Tool-verified

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

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

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

What to do

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

  • Production code isn't grouped under a src/ folder — it all sits under openpilot/ alongside the root build files, so the conventional src/ boundary between the product and its tooling isn't drawn.

What to do

  • Group production code under src/ (or split deliberately, e.g. backend/ + frontend/) so production and tooling code aren't mixed at the root.
M4 · Documentation accuracy10.0 / 10Exemplary◐ Sampled · advisory

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

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

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

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

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

P3 · Security & performance tooling0.0 / 10Critical✓ Tool-verified

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

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

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

What to do

  • Add a SAST step to CI running what this repository's stack ships: bandit, `semgrep --config=p/python`, or CodeQL's python pack — so a security regression fails the build instead of landing.
  • Enable Dependabot/Renovate or a dependency-review gate.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback5.0 / 10Adequate✓ Tool-verified

Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.

Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.

What to do

  • Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
P6 · Release Hygiene10.0 / 10Exemplary✓ Tool-verified

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

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

WCAG coverage — what static analysis assessed

Statically assessed 6 of 55 WCAG 2.2 Level A/AA success criteria (11%; ≈12% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 49 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
AC3 · Page structure1.4.4, 2.2.1, 2.4.1, 2.4.2, 3.1.1, 4.1.2Partial signal
AC7 · A11y enforcementenforcement — no page criterionEnforcement posture (process)

Not statically assessed — these 49 Level A/AA criteria need runtime or manual evaluation (WCAG-EM): 1.1.1, 1.2.1, 1.2.2, 1.2.3, 1.2.4, 1.2.5, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.4.1, 1.4.2, 1.4.3, 1.4.5, 1.4.10, 1.4.11, 1.4.12, 1.4.13, 2.1.1, 2.1.2, 2.1.4, 2.2.2, 2.3.1, 2.4.3, 2.4.4, 2.4.5, 2.4.6, 2.4.7, 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.2, 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 Health79%Adequate — gated by D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture99%ExemplaryStrongest area.
Maturity59%Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness40%Weak — gated by D12, P3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security65%Adequate — gated by D28, D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility47%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.

  • D11 Test Reliability — 3 observation(s) recorded · This repository declares 3 of its own test(s) unreliable. The built-in reliability runner does not support this repository's ecosystem (.py), so the suite was not re-run and no reliability score is given — these are the repository's own declarations, not our measurement.
Not evidenced — 4 control(s) we could not find positive evidence for

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

  • C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 75 check(s) not relevant to this codebase

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

  • AC1 Text alternatives — No image/media element found in the parsed markup — AC1 not applicable here.
  • AC2 Forms & labels — No form control/button found in the parsed markup — AC2 not applicable here.
  • AC4 Keyboard semantics — No interactive element found in the parsed markup — AC4 not applicable here.
  • AC5 ARIA correctness — No ARIA usage found in the parsed markup — AC5 not applicable here.
  • AC6 Visual & motion safety — No styled element found in the parsed markup — AC6 not applicable here.
  • AX1 Captive dependencies — no DI registrations detected
  • AX2 Stateful singletons — no singleton implementations detected
  • AX3 Project dependency cycles — not assessed — project cycles and dependency direction are computed over a project-reference graph that was not loaded for this repository, because the repository commits no project file of a kind this check models. This is a gap in the analyzer, not a finding about this repository
  • AX4 Dependency direction — not assessed — project cycles and dependency direction are computed over a project-reference graph that was not loaded for this repository, because the repository commits no project file of a kind this check models. This is a gap in the analyzer, not a finding about this repository
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — not assessed — test isolation is computed from a project graph (which projects are test projects, and what they reference) that was not loaded for this repository, because the repository commits no project file of a kind this check models. This is a gap in the analyzer, not a finding about this repository
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • 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.
  • D10 Test Quality — ~10362 lines of test source are present (.py) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D20 ADR Quality — N/A — ADRs are expected on deployable products with a user-facing host, not consumed libraries; no ADR log is required here.
  • D23 Boundary Type-Coupling — Production source is present (.py) but bounded contexts are resolved over the C#/VB project set, which exposed none, so context scope could not be assessed. Not scored — this is a gap in the analyzer, not a verdict about this repository. Declaring the codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed — see the recommendation on this dimension for where. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — No inline comments to assess — comment value is not applicable here.
  • D25 ADR Conformance — no ADRs to check
  • D26 Project Cohesion — Project cohesion is assessed over the .NET project set; this target exposed no projects, so project size and spread could not be assessed. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
  • D27 Navigability — symbol resolution incomplete — navigability not assessed
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
  • D32 Data Compliance (PII/GDPR) — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
  • D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D5 Coupling — Inter-project coupling could not be assessed — no analyzable project graph was found for this repository. Not scored: a gap in the analyzer's reach, not a verdict about this repository. (Coupling here is Martin afferent/efferent/instability plus reference cycles across a project-reference graph, read today from .NET project files; other ecosystems' module graphs are not read yet.)
  • D6 Cohesion (LCOM4) — Cohesion (LCOM4) is measured over a CS/VB/GO/SCALA/SWIFT/DART class graph, and this repository's production source is .c, .cc, .py, which this pass does not read — so no class could be assessed. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage not included — suite not readable by the collector
  • DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (64 value object(s))
  • ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
  • 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.
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C# 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
  • 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'.
  • P2 Observability — Observability was not assessed: this check reads a source model that does not carry this repository's product — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of a logging idiom this check recognises is NOT evidence that this repo lacks structured logging (it may log through its own ecosystem's logger). This is a gap in the analyzer, not a finding about this repository.
  • P7 Outbound HTTP resilience — not measured — the application kind could not be determined for this repo
  • P8 Schema migrations — not assessed — schema-migration practice is read from a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (`coverage run -m pytest` then `coverage xml`) 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 — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
  • PF2 Allocation hygiene — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
  • PF3 Async & latency hygiene — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • X1 Async correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • 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
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

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

Critical — 44 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
  • + 3 more in this group — see findings.md.
D28 · Secrets (history) · REDACTED · ×9
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D11 · Test Reliability · Test declared unreliable · ×3
  • Test declared unreliable: test_clean_exit openpilot/system/manager/test/test_manager.py:53 — This test is disabled or skipped with a reason naming unreliability — the repository's own words: "this test is flaky the way it". A test that is skipped for flakiness is neither passing nor protecting the code it covers; either stabilise it or delete it, but do not leave it disabled indefinitely. (Found by reading the repository's own test source — the suite itself was not re-run, since the reliability runner does not support this ecosystem.)
  • Test declared unreliable: test_database openpilot/tools/lib/tests/test_comma_car_segments.py:10 — This test is disabled or skipped with a reason naming unreliability — the repository's own words: "huggingface is flaky, run this test manually to check for issues". A test that is skipped for flakiness is neither passing nor protecting the code it covers; either stabilise it or delete it, but do not leave it disabled indefinitely. (Found by reading the repository's own test source — the suite itself was not re-run, since the reliability runner does not support this ecosystem.)
  • Test declared unreliable: test_indirect_parsing openpilot/tools/lib/tests/test_logreader.py:115 — This test is disabled or skipped with a reason naming unreliability — the repository's own words: "this got flaky. internet tests are stupid.". A test that is skipped for flakiness is neither passing nor protecting the code it covers; either stabilise it or delete it, but do not leave it disabled indefinitely. (Found by reading the repository's own test source — the suite itself was not re-run, since the reliability runner does not support this ecosystem.)
D13 · REDACTED Scanning · Leaked secret · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D35 · Change Coupling · Boundary-crossing change coupling · ×1
  • Boundary-crossing change coupling: REDACTED ↔ qlog_size.py REDACTED — `REDACTED` (context openpilot) and `tools/scripts/qlog_size.py` (context tools) 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, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 `954b567b` merge a bunch of misc stuff into common.utils (#36463) (at that commit the files were still `REDACTED` and `selfdrive/debug/qlog_size.py`); `27c11eb5` athena upload: streaming file upload (#34559) (at that commit the files were still `REDACTED` and `selfdrive/debug/qlog_size.py`); `9bc35c09` Revert "athena upload: reduce memory usage and improve efficiency wit… (at that commit the files were still `REDACTED` and `selfdrive/debug/qlog_size.py`) — run `git show` on any of them.
Serious — 501 finding(s)
D17 · Explicit Debt · TodoComment · ×176
  • TodoComment openpilot/cereal/services.py:5 — # TODO: this should be automatically determined using the capnp schema — 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 openpilot/cereal/messaging/__init__.py:94 — # TODO: print when we drop packets? — 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 openpilot/cereal/messaging/__init__.py:159 — # TODO: Handle case where cur_time is less than prev_time — 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 openpilot/cereal/messaging/tests/test_pub_sub_master.py:47 — # TODO: break this test up to individually test SubMaster.update and SubMaster.update_msgs — 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 openpilot/cereal/messaging/tests/test_messaging.py:27 — # TODO: this should take any capnp struct and returrn a msg with random populated data — 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 openpilot/cereal/messaging/tests/test_messaging.py:36 — # TODO: this should compare any capnp structs — 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 openpilot/cereal/messaging/tests/test_messaging.py:39 — # TODO: check all types — 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 openpilot/common/swaglog.py:94 — # TODO suppresses warning about forking proc with zmq socket, fix root cause — 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 openpilot/common/api.py:54 — # TODO: add session to Api — 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 REDACTED:76 — # TODO: yield in smaller chunks. Yielding only block_sz is too slow. Largest observed data chunk is 252 MB. — 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 openpilot/selfdrive/car/cruise.py:67 — # handle button presses. TODO: this should be in state_control, but a decelCruise press — 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 openpilot/selfdrive/car/card.py:188 — # TODO: mirror the carState.cruiseState struct? — 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 openpilot/selfdrive/car/card.py:229 — # TODO: this can make us miss at least a few cycles when doing an ECU knockout — 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 openpilot/selfdrive/car/car_events.py:60 — # TODO: when we check for unexpected disengagement, check gear not S1, S2, S3 — 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 openpilot/selfdrive/car/car_events.py:76 — # TODO: verify 17 Volt can enable for the first time at a stop and allow for all GMs — 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 openpilot/selfdrive/car/car_events.py:90 — # TODO: this needs to be implemented generically in carState struct — 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 openpilot/selfdrive/car/car_events.py:100 — # TODO: cleanup the honda-specific logic — 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 openpilot/selfdrive/car/car_events.py:102 — # TODO: on some hyundai cars, the cancel button is also the pause/resume button, — 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 openpilot/selfdrive/car/car_events.py:158 — # TODO: only check the cancel button with openpilot longitudinal on all brands to match panda safety — 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 openpilot/selfdrive/car/tests/test_cruise_speed.py:47 — # TODO: test pcmCruise — 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 openpilot/selfdrive/car/tests/test_cruise_speed.py:134 — # TODO: fix skipping first run due to enabled on rising edge exception — 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 openpilot/selfdrive/car/tests/test_car_interfaces.py:62 — # TODO: wait until card refactor is merged to run controller a few times — 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 openpilot/selfdrive/controls/controlsd.py:187 — # TODO: both controlsState and carControl valids should be set by — 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 openpilot/selfdrive/controls/lib/longitudinal_planner.py:118 — # TODO counter is only needed because radar is glitchy, remove once radar is gone — 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 openpilot/selfdrive/controls/lib/longcontrol.py:64 — # TODO: can we just go straight to stopAccel? — 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.
  • + 151 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×28
  • Hotspot: openpilot/selfdrive/selfdrived/selfdrived.py openpilot/selfdrive/selfdrived/selfdrived.py:153 — openpilot/selfdrive/selfdrived/selfdrived.py changed 19 times in last 90 days, max cyclomatic complexity 156 in SelfdriveD.update_events at line 153. 2 of those changes were fix/bug commits, and the other 17 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-27..2026-09-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-27 16:15:25 -07:00' --until='2026-09-25 16:15:25 -07:00' --full-history --no-merges -- openpilot/selfdrive/selfdrived/selfdrived.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:229 — REDACTED changed 51 times in last 90 days, max cyclomatic complexity 45 in modeld.main at line 229. 9 of those changes were fix/bug commits, and the other 42 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-27..2026-09-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-27 16:15:25 -07:00' --until='2026-09-25 16:15:25 -07: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: openpilot/system/hardware/hardwared.py openpilot/system/hardware/hardwared.py:197 — openpilot/system/hardware/hardwared.py changed 17 times in last 90 days, max cyclomatic complexity 63 in hardwared.hardware_thread at line 197. 2 of those changes were fix/bug commits, and the other 15 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-27..2026-09-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-27 16:15:25 -07:00' --until='2026-09-25 16:15:25 -07:00' --full-history --no-merges -- openpilot/system/hardware/hardwared.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:104 — REDACTED changed 11 times in last 90 days, max cyclomatic complexity 22 in CheckUpdateButton._update_state at line 104. 2 of those changes were fix/bug commits, and the other 9 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-27..2026-09-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-27 16:15:25 -07:00' --until='2026-09-25 16:15:25 -07: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:838 — REDACTED changed 13 times in last 90 days, max cyclomatic complexity 16 in athenad.log_handler at line 838. 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-27..2026-09-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-27 16:15:25 -07:00' --until='2026-09-25 16:15:25 -07: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: openpilot/system/hardware/chestnut/status.py openpilot/system/hardware/chestnut/status.py:31 — openpilot/system/hardware/chestnut/status.py changed 5 times in last 90 days, max cyclomatic complexity 40 in ChestnutStatus.update at line 31. 1 of those changes was a fix/bug commit, and the other 4 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-27..2026-09-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-27 16:15:25 -07:00' --until='2026-09-25 16:15:25 -07:00' --full-history --no-merges -- openpilot/system/hardware/chestnut/status.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: openpilot/system/webrtc/webrtcd.py openpilot/system/webrtc/webrtcd.py:281 — openpilot/system/webrtc/webrtcd.py changed 8 times in last 90 days, max cyclomatic complexity 18 in StreamSession.message_handler at line 281. 1 of those changes was a fix/bug commit, and the other 7 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-27..2026-09-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-27 16:15:25 -07:00' --until='2026-09-25 16:15:25 -07:00' --full-history --no-merges -- openpilot/system/webrtc/webrtcd.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: openpilot/selfdrive/monitoring/policy.py openpilot/selfdrive/monitoring/policy.py:314 — openpilot/selfdrive/monitoring/policy.py changed 4 times in last 90 days, max cyclomatic complexity 32 in DriverMonitoring._update_events at line 314. 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-27..2026-09-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-27 16:15:25 -07:00' --until='2026-09-25 16:15:25 -07:00' --full-history --no-merges -- openpilot/selfdrive/monitoring/policy.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: openpilot/system/ui/widgets/label.py openpilot/system/ui/widgets/label.py:461 — openpilot/system/ui/widgets/label.py changed 4 times in last 90 days, max cyclomatic complexity 31 in UnifiedLabel._render at line 461. 1 of those changes was a fix/bug commit, and the other 3 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-27..2026-09-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-27 16:15:25 -07:00' --until='2026-09-25 16:15:25 -07:00' --full-history --no-merges -- openpilot/system/ui/widgets/label.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: openpilot/system/ui/lib/wifi_manager.py openpilot/system/ui/lib/wifi_manager.py:394 — openpilot/system/ui/lib/wifi_manager.py changed 4 times in last 90 days, max cyclomatic complexity 25 in WifiManager._handle_state_change at line 394. 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-27..2026-09-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-27 16:15:25 -07:00' --until='2026-09-25 16:15:25 -07:00' --full-history --no-merges -- openpilot/system/ui/lib/wifi_manager.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: openpilot/selfdrive/locationd/locationd.py openpilot/selfdrive/locationd/locationd.py:100 — openpilot/selfdrive/locationd/locationd.py changed 3 times in last 90 days, max cyclomatic complexity 33 in LocationEstimator.handle_log at line 100. 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-27..2026-09-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-27 16:15:25 -07:00' --until='2026-09-25 16:15:25 -07:00' --full-history --no-merges -- openpilot/selfdrive/locationd/locationd.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:603 — REDACTED changed 4 times in last 90 days, max cyclomatic complexity 24 in GuiApplication.render at line 603. 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-27..2026-09-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-27 16:15:25 -07:00' --until='2026-09-25 16:15:25 -07: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: openpilot/system/qcomgpsd/qcomgpsd.py openpilot/system/qcomgpsd/qcomgpsd.py:182 — openpilot/system/qcomgpsd/qcomgpsd.py changed 2 times in last 90 days, max cyclomatic complexity 47 in qcomgpsd.main at line 182. 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-27..2026-09-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-27 16:15:25 -07:00' --until='2026-09-25 16:15:25 -07:00' --full-history --no-merges -- openpilot/system/qcomgpsd/qcomgpsd.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: openpilot/common/qrcode.py openpilot/common/qrcode.py:425 — openpilot/common/qrcode.py changed 4 times in last 90 days, max cyclomatic complexity 23 in qrcode._parse_data at line 425. 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-27..2026-09-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-27 16:15:25 -07:00' --until='2026-09-25 16:15:25 -07:00' --full-history --no-merges -- openpilot/common/qrcode.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: openpilot/selfdrive/car/car_events.py openpilot/selfdrive/car/car_events.py:96 — openpilot/selfdrive/car/car_events.py changed 2 times in last 90 days, max cyclomatic complexity 46 in CarEvents.create_common_events at line 96. 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-27..2026-09-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-27 16:15:25 -07:00' --until='2026-09-25 16:15:25 -07:00' --full-history --no-merges -- openpilot/selfdrive/car/car_events.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: docs/serve.py docs/serve.py:283 — docs/serve.py changed 2 times in last 90 days, max cyclomatic complexity 46 in serve._render_blocks at line 283. 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-27..2026-09-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-27 16:15:25 -07:00' --until='2026-09-25 16:15:25 -07:00' --full-history --no-merges -- docs/serve.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: openpilot/tools/replay/ui.py openpilot/tools/replay/ui.py:32 — openpilot/tools/replay/ui.py changed 5 times in last 90 days, max cyclomatic complexity 17 in ui.ui_thread at line 32. 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-27..2026-09-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-27 16:15:25 -07:00' --until='2026-09-25 16:15:25 -07:00' --full-history --no-merges -- openpilot/tools/replay/ui.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: openpilot/tools/camerastream/compressed_vipc.py openpilot/tools/camerastream/compressed_vipc.py:27 — openpilot/tools/camerastream/compressed_vipc.py changed 4 times in last 90 days, max cyclomatic complexity 21 in compressed_vipc.decoder at line 27. 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-27..2026-09-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-27 16:15:25 -07:00' --until='2026-09-25 16:15:25 -07:00' --full-history --no-merges -- openpilot/tools/camerastream/compressed_vipc.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: openpilot/system/ui/widgets/__init__.py openpilot/system/ui/widgets/__init__.py:157 — openpilot/system/ui/widgets/__init__.py changed 4 times in last 90 days, max cyclomatic complexity 19 in Widget._process_mouse_events at line 157. 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-27..2026-09-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-27 16:15:25 -07:00' --until='2026-09-25 16:15:25 -07:00' --full-history --no-merges -- openpilot/system/ui/widgets/__init__.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: openpilot/system/updated/updated.py openpilot/system/updated/updated.py:413 — openpilot/system/updated/updated.py changed 4 times in last 90 days, max cyclomatic complexity 16 in updated.main at line 413. 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-27..2026-09-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-27 16:15:25 -07:00' --until='2026-09-25 16:15:25 -07:00' --full-history --no-merges -- openpilot/system/updated/updated.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: openpilot/selfdrive/ui/mici/layouts/offroad_alerts.py openpilot/selfdrive/ui/mici/layouts/offroad_alerts.py:271 — openpilot/selfdrive/ui/mici/layouts/offroad_alerts.py changed 4 times in last 90 days, max cyclomatic complexity 15 in MiciOffroadAlerts._refresh at line 271. 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-27..2026-09-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-27 16:15:25 -07:00' --until='2026-09-25 16:15:25 -07:00' --full-history --no-merges -- openpilot/selfdrive/ui/mici/layouts/offroad_alerts.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: openpilot/selfdrive/locationd/paramsd.py openpilot/selfdrive/locationd/paramsd.py:67 — openpilot/selfdrive/locationd/paramsd.py changed 3 times in last 90 days, max cyclomatic complexity 15 in VehicleParamsLearner.handle_log at line 67. 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-27..2026-09-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-27 16:15:25 -07:00' --until='2026-09-25 16:15:25 -07:00' --full-history --no-merges -- openpilot/selfdrive/locationd/paramsd.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: openpilot/selfdrive/ui/onroad/model_renderer.py openpilot/selfdrive/ui/onroad/model_renderer.py:84 — openpilot/selfdrive/ui/onroad/model_renderer.py changed 3 times in last 90 days, max cyclomatic complexity 15 in ModelRenderer._render at line 84. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-27..2026-09-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-27 16:15:25 -07:00' --until='2026-09-25 16:15:25 -07:00' --full-history --no-merges -- openpilot/selfdrive/ui/onroad/model_renderer.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: openpilot/tools/clip/run.py openpilot/tools/clip/run.py:285 — openpilot/tools/clip/run.py changed 3 times in last 90 days, max cyclomatic complexity 15 in run.clip at line 285. 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-27..2026-09-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-27 16:15:25 -07:00' --until='2026-09-25 16:15:25 -07:00' --full-history --no-merges -- openpilot/tools/clip/run.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: openpilot/system/manager/manager.py openpilot/system/manager/manager.py:100 — openpilot/system/manager/manager.py changed 2 times in last 90 days, max cyclomatic complexity 21 in manager.manager_thread at line 100. 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-27..2026-09-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-27 16:15:25 -07:00' --until='2026-09-25 16:15:25 -07:00' --full-history --no-merges -- openpilot/system/manager/manager.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • + 3 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×8
  • FileTooLong: REDACTED REDACTED — FileTooLong — 837 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 337 over it, 1.67× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: selfdrived/events.py openpilot/selfdrive/selfdrived/events.py — FileTooLong — 745 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 245 over it, 1.49× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: lib/wifi_manager.py openpilot/system/ui/lib/wifi_manager.py — FileTooLong — 682 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 182 over it, 1.36× 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: esim/lpa.py openpilot/common/esim/lpa.py — FileTooLong — 637 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 137 over it, 1.27× 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: common/qrcode.py openpilot/common/qrcode.py — FileTooLong — 577 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 77 over it, 1.15× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 552 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 52 over it, 1.10× 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: comma/modem.py openpilot/common/hardware/comma/modem.py — FileTooLong — 520 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 20 over it, 1.04× 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: webrtc/webrtcd.py openpilot/system/webrtc/webrtcd.py — FileTooLong — 510 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 10 over it, 1.02× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×8
  • Duplicated block (6 lines × 2) openpilot/common/transformations/transformations.py:297 — openpilot/common/transformations/transformations.py:297-302 | openpilot/common/transformations/transformations.py:337-342 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (6 lines × 2) openpilot/selfdrive/locationd/lagd.py:403 — openpilot/selfdrive/locationd/lagd.py:403-408 | openpilot/selfdrive/locationd/paramsd.py:260-265 — 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) openpilot/selfdrive/ui/layouts/settings/software.py:185 — openpilot/selfdrive/ui/layouts/settings/software.py:185-190 | REDACTED:201-206 — 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) openpilot/selfdrive/ui/mici/layouts/onboarding.py:32 — openpilot/selfdrive/ui/mici/layouts/onboarding.py:32-37 | openpilot/selfdrive/ui/mici/onroad/cabin_camera_dialog.py:75-80 — 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) openpilot/tools/jotpluggler/generate_event_extractors.py:335 — openpilot/tools/jotpluggler/generate_event_extractors.py:335-340 | openpilot/tools/jotpluggler/generate_event_extractors.py:355-360 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `openpilot/tools/jotpluggler/generate_event_extractors.py:362` calls `emit` and `openpilot/tools/jotpluggler/generate_event_extractors.py:342` 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 (6 lines × 2) openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:90 — openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:90-95 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:210-215 — both copies are in the same file, so extract the 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 `openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:90` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) openpilot/selfdrive/ui/mici/onroad/cameraview.py:388 — openpilot/selfdrive/ui/mici/onroad/cameraview.py:388-393 | openpilot/selfdrive/ui/onroad/cameraview.py:341-346 — before extracting anything, compare `openpilot/selfdrive/ui/mici/onroad/cameraview.py` and `openpilot/selfdrive/ui/onroad/cameraview.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 220 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 `openpilot/selfdrive/ui/mici/onroad/cameraview.py:388` 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 × 2) openpilot/system/ui/widgets/slider.py:189 — openpilot/system/ui/widgets/slider.py:189-194 | openpilot/system/ui/widgets/slider.py:199-204 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D17 · Explicit Debt · FixmeComment · ×7
  • FixmeComment openpilot/selfdrive/test/process_replay/test_processes.py:35 — # FIXME the sensor timings are bad in mazda segment, we're not fully testing it, but it should be replaced — 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.
  • FixmeComment openpilot/selfdrive/ui/mici/layouts/onboarding.py:330 — # FIXME: when nav stack sends hide event to widget 2 below on push, this needs to be moved — 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.
  • FixmeComment openpilot/selfdrive/ui/mici/layouts/main.py:122 — # FIXME: these two pops can interrupt user interacting in the settings — 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.
  • FixmeComment openpilot/selfdrive/ui/mici/tests/test_widget_leaks.py:5 — # FIXME: known small leaks not worth worrying about at the moment — 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.
  • FixmeComment REDACTED:995 — # FIXME: TCP_USER_TIMEOUT is effectively 2x for some reason (32s), so it's mostly unused — 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.
  • FixmeComment openpilot/system/ui/widgets/scroller.py:125 — # FIXME: the padding correction doesn't seem correct — 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.
  • FixmeComment openpilot/system/ui/widgets/nav_widget.py:137 — # FIXME: disabling this widget on new push_widget still causes this widget to track mouse events without mouse down — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×6
  • Duplicated block (14 lines × 2) openpilot/selfdrive/ui/mici/onroad/augmented_road_view.py:248 — openpilot/selfdrive/ui/mici/onroad/augmented_road_view.py:248-261 | openpilot/selfdrive/ui/onroad/augmented_road_view.py:113-126 — before extracting anything, compare `openpilot/selfdrive/ui/mici/onroad/augmented_road_view.py` and `openpilot/selfdrive/ui/onroad/augmented_road_view.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 47 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) openpilot/selfdrive/ui/mici/onroad/cameraview.py:166 — openpilot/selfdrive/ui/mici/onroad/cameraview.py:166-179 | openpilot/selfdrive/ui/onroad/cameraview.py:127-140 — before extracting anything, compare `openpilot/selfdrive/ui/mici/onroad/cameraview.py` and `openpilot/selfdrive/ui/onroad/cameraview.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 220 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 (14 lines × 2) openpilot/selfdrive/ui/mici/onroad/model_renderer.py:54 — openpilot/selfdrive/ui/mici/onroad/model_renderer.py:54-67 | openpilot/selfdrive/ui/onroad/model_renderer.py:47-60 — before extracting anything, compare `openpilot/selfdrive/ui/mici/onroad/model_renderer.py` and `openpilot/selfdrive/ui/onroad/model_renderer.py` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 237 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) openpilot/selfdrive/ui/mici/onroad/model_renderer.py:380 — openpilot/selfdrive/ui/mici/onroad/model_renderer.py:380-393 | openpilot/selfdrive/ui/onroad/model_renderer.py:321-334 — before extracting anything, compare `openpilot/selfdrive/ui/mici/onroad/model_renderer.py` and `openpilot/selfdrive/ui/onroad/model_renderer.py` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 237 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 (14 lines × 2) openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:90 — openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:90-103 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:118-131 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:90` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) openpilot/selfdrive/ui/mici/layouts/settings/developer.py:14 — openpilot/selfdrive/ui/mici/layouts/settings/developer.py:14-27 | openpilot/selfdrive/ui/mici/layouts/settings/toggles.py:17-37 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×6
  • Duplicated block (10 lines × 2) openpilot/selfdrive/car/card.py:262 — openpilot/selfdrive/car/card.py:262-271 | openpilot/selfdrive/selfdrived/selfdrived.py:577-586 — 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) openpilot/selfdrive/ui/layouts/settings/device.py:162 — openpilot/selfdrive/ui/layouts/settings/device.py:162-171 | openpilot/selfdrive/ui/layouts/settings/device.py:174-183 — both copies are in the same file, so extract the block into 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) openpilot/selfdrive/ui/mici/onroad/model_renderer.py:346 — openpilot/selfdrive/ui/mici/onroad/model_renderer.py:346-355 | openpilot/selfdrive/ui/onroad/model_renderer.py:291-300 — before extracting anything, compare `openpilot/selfdrive/ui/mici/onroad/model_renderer.py` and `openpilot/selfdrive/ui/onroad/model_renderer.py` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 237 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 `openpilot/selfdrive/ui/mici/onroad/model_renderer.py:346` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) openpilot/selfdrive/ui/mici/onroad/model_renderer.py:473 — openpilot/selfdrive/ui/mici/onroad/model_renderer.py:473-482 | openpilot/selfdrive/ui/onroad/model_renderer.py:425-434 — before extracting anything, compare `openpilot/selfdrive/ui/mici/onroad/model_renderer.py` and `openpilot/selfdrive/ui/onroad/model_renderer.py` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 237 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 `openpilot/selfdrive/ui/mici/onroad/model_renderer.py:473` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:220 — openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:220-229 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:243-252 — both copies are in the same file, so extract the 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 `openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:220` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) openpilot/selfdrive/ui/mici/onroad/hud_renderer.py:306 — openpilot/selfdrive/ui/mici/onroad/hud_renderer.py:306-315 | openpilot/selfdrive/ui/onroad/hud_renderer.py:171-180 — 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.
D3 · God Classes · TooManyMethods · ×5
  • TooManyMethods: WifiManager openpilot/system/ui/lib/wifi_manager.py:157 — TooManyMethods — 36 methods. The bar is 30 methods; this is 6 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: GuiApplication REDACTED:216 — TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.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: HardwareComma openpilot/common/hardware/comma/hardware.py:60 — TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: HardwareBase openpilot/common/hardware/base.py:57 — TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Modem openpilot/common/hardware/comma/modem.py:211 — TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×5
  • Duplicated block (12 lines × 2) openpilot/common/transformations/transformations.py:277 — openpilot/common/transformations/transformations.py:277-288 | openpilot/common/transformations/transformations.py:316-327 — both copies are in the same file, so extract the block into 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) openpilot/system/ui/lib/wifi_manager.py:433 — openpilot/system/ui/lib/wifi_manager.py:433-444 | openpilot/system/ui/lib/wifi_manager.py:470-481 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:126 — openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:126-137 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:240-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. Read the line range as the matched WINDOW rather than a finished unit: at `openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:126` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:148 — openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:148-159 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:217-228 — both copies are in the same file, so extract the 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 `openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:148` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) openpilot/selfdrive/ui/mici/onroad/model_renderer.py:150 — openpilot/selfdrive/ui/mici/onroad/model_renderer.py:150-161 | openpilot/selfdrive/ui/onroad/model_renderer.py:134-145 — before extracting anything, compare `openpilot/selfdrive/ui/mici/onroad/model_renderer.py` and `openpilot/selfdrive/ui/onroad/model_renderer.py` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 237 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 before the matched lines, `openpilot/selfdrive/ui/onroad/model_renderer.py:131` calls `_draw_lead_indicator` and `openpilot/selfdrive/ui/mici/onroad/model_renderer.py:144` 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 (11 lines × 2) · ×5
  • Duplicated block (11 lines × 2) openpilot/selfdrive/ui/mici/onroad/model_renderer.py:235 — openpilot/selfdrive/ui/mici/onroad/model_renderer.py:235-245 | openpilot/selfdrive/ui/onroad/model_renderer.py:204-214 — before extracting anything, compare `openpilot/selfdrive/ui/mici/onroad/model_renderer.py` and `openpilot/selfdrive/ui/onroad/model_renderer.py` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 237 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 × 2) openpilot/selfdrive/ui/mici/onroad/model_renderer.py:246 — openpilot/selfdrive/ui/mici/onroad/model_renderer.py:246-256 | openpilot/selfdrive/ui/onroad/model_renderer.py:215-225 — before extracting anything, compare `openpilot/selfdrive/ui/mici/onroad/model_renderer.py` and `openpilot/selfdrive/ui/onroad/model_renderer.py` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 237 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) openpilot/system/ui/mici_reset.py:104 — openpilot/system/ui/mici_reset.py:104-114 | openpilot/system/ui/tici_reset.py:48-58 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) openpilot/tools/lateral_maneuvers/generate_report.py:185 — openpilot/tools/lateral_maneuvers/generate_report.py:185-195 | openpilot/tools/longitudinal_maneuvers/generate_report.py:120-130 — `openpilot/tools/lateral_maneuvers/generate_report.py` and `openpilot/tools/longitudinal_maneuvers/generate_report.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 39 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 (11 lines × 2) openpilot/tools/lateral_maneuvers/generate_report.py:202 — openpilot/tools/lateral_maneuvers/generate_report.py:202-212 | openpilot/tools/longitudinal_maneuvers/generate_report.py:138-148 — `openpilot/tools/lateral_maneuvers/generate_report.py` and `openpilot/tools/longitudinal_maneuvers/generate_report.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 39 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 (5 lines × 2) · ×5
  • Duplicated block (5 lines × 2) openpilot/selfdrive/ui/mici/onroad/cameraview.py:313 — openpilot/selfdrive/ui/mici/onroad/cameraview.py:313-317 | openpilot/selfdrive/ui/onroad/cameraview.py:272-276 — before extracting anything, compare `openpilot/selfdrive/ui/mici/onroad/cameraview.py` and `openpilot/selfdrive/ui/onroad/cameraview.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 220 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, `openpilot/selfdrive/ui/mici/onroad/cameraview.py:318` calls `_update_texture_color_filtering` and `openpilot/selfdrive/ui/onroad/cameraview.py:277` 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 (5 lines × 2) openpilot/selfdrive/ui/mici/onroad/model_renderer.py:364 — openpilot/selfdrive/ui/mici/onroad/model_renderer.py:364-368 | openpilot/selfdrive/ui/onroad/model_renderer.py:305-309 — before extracting anything, compare `openpilot/selfdrive/ui/mici/onroad/model_renderer.py` and `openpilot/selfdrive/ui/onroad/model_renderer.py` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 237 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 (5 lines × 2) openpilot/selfdrive/ui/mici/onroad/model_renderer.py:373 — openpilot/selfdrive/ui/mici/onroad/model_renderer.py:373-377 | openpilot/selfdrive/ui/onroad/model_renderer.py:314-318 — before extracting anything, compare `openpilot/selfdrive/ui/mici/onroad/model_renderer.py` and `openpilot/selfdrive/ui/onroad/model_renderer.py` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 237 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 (5 lines × 2) openpilot/selfdrive/locationd/lagd.py:158 — openpilot/selfdrive/locationd/lagd.py:158-162 | openpilot/selfdrive/locationd/lagd.py:164-168 — both copies are in the same file, so extract the block into 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) openpilot/selfdrive/ui/mici/onroad/torque_bar.py:236 — openpilot/selfdrive/ui/mici/onroad/torque_bar.py:236-240 | openpilot/selfdrive/ui/mici/onroad/torque_bar.py:241-245 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×4
  • Duplicated block (7 lines × 2) openpilot/selfdrive/locationd/locationd.py:103 — openpilot/selfdrive/locationd/locationd.py:103-109 | openpilot/selfdrive/locationd/locationd.py:123-129 — both copies are in the same file, so extract the 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 (7 lines × 2) openpilot/selfdrive/locationd/locationd.py:265 — openpilot/selfdrive/locationd/locationd.py:265-271 | openpilot/selfdrive/locationd/paramsd.py:246-252 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) openpilot/selfdrive/ui/mici/onroad/model_renderer.py:402 — openpilot/selfdrive/ui/mici/onroad/model_renderer.py:402-408 | openpilot/selfdrive/ui/onroad/model_renderer.py:354-360 — before extracting anything, compare `openpilot/selfdrive/ui/mici/onroad/model_renderer.py` and `openpilot/selfdrive/ui/onroad/model_renderer.py` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 237 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) openpilot/selfdrive/ui/mici/onroad/model_renderer.py:463 — openpilot/selfdrive/ui/mici/onroad/model_renderer.py:463-469 | openpilot/selfdrive/ui/onroad/model_renderer.py:415-421 — before extracting anything, compare `openpilot/selfdrive/ui/mici/onroad/model_renderer.py` and `openpilot/selfdrive/ui/onroad/model_renderer.py` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 237 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 (18 lines × 2) · ×3
  • Duplicated block (18 lines × 2) openpilot/selfdrive/ui/mici/onroad/alert_renderer.py:127 — openpilot/selfdrive/ui/mici/onroad/alert_renderer.py:127-144 | openpilot/selfdrive/ui/onroad/alert_renderer.py:91-108 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (18 lines × 2) openpilot/selfdrive/ui/mici/onroad/augmented_road_view.py:267 — openpilot/selfdrive/ui/mici/onroad/augmented_road_view.py:267-284 | openpilot/selfdrive/ui/onroad/augmented_road_view.py:132-149 — before extracting anything, compare `openpilot/selfdrive/ui/mici/onroad/augmented_road_view.py` and `openpilot/selfdrive/ui/onroad/augmented_road_view.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 47 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 (18 lines × 2) openpilot/selfdrive/ui/mici/onroad/cameraview.py:329 — openpilot/selfdrive/ui/mici/onroad/cameraview.py:329-346 | openpilot/selfdrive/ui/onroad/cameraview.py:282-299 — before extracting anything, compare `openpilot/selfdrive/ui/mici/onroad/cameraview.py` and `openpilot/selfdrive/ui/onroad/cameraview.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 220 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 (16 lines × 2) · ×3
  • Duplicated block (16 lines × 2) openpilot/selfdrive/ui/mici/onroad/cameraview.py:110 — openpilot/selfdrive/ui/mici/onroad/cameraview.py:110-125 | openpilot/selfdrive/ui/onroad/cameraview.py:71-86 — before extracting anything, compare `openpilot/selfdrive/ui/mici/onroad/cameraview.py` and `openpilot/selfdrive/ui/onroad/cameraview.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 220 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) openpilot/selfdrive/ui/mici/onroad/cameraview.py:206 — openpilot/selfdrive/ui/mici/onroad/cameraview.py:206-221 | openpilot/selfdrive/ui/onroad/cameraview.py:166-181 — before extracting anything, compare `openpilot/selfdrive/ui/mici/onroad/cameraview.py` and `openpilot/selfdrive/ui/onroad/cameraview.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 220 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 (16 lines × 2) openpilot/selfdrive/ui/mici/onroad/cameraview.py:349 — openpilot/selfdrive/ui/mici/onroad/cameraview.py:349-364 | openpilot/selfdrive/ui/onroad/cameraview.py:302-317 — before extracting anything, compare `openpilot/selfdrive/ui/mici/onroad/cameraview.py` and `openpilot/selfdrive/ui/onroad/cameraview.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 220 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.
D35 · Change Coupling · Change coupling · ×2
  • Change coupling: manager.py ↔ REDACTED openpilot/system/manager/manager.py — `openpilot/system/manager/manager.py` 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, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 `6bbdf8ad` remove sentry (#38790); `cea5273f` move version to common/ (#38210) (at that commit the files were still `system/manager/manager.py` and `REDACTED`); `7a3e454d` move sentry/stats to system/ (#32490) (at that commit the files were still `selfdrive/manager/manager.py` and `REDACTED`) — run `git show` on any of them.
  • Change coupling: metadrive_bridge.py ↔ metadrive_process.py openpilot/tools/sim/bridge/metadrive/metadrive_bridge.py — `openpilot/tools/sim/bridge/metadrive/metadrive_bridge.py` and `openpilot/tools/sim/bridge/metadrive/metadrive_process.py` 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, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 8 shared commits counted here, the most recent 3 are `dc094792` Revert "ci: faster metadrive test (#33755)" (at that commit the files were still `tools/sim/bridge/metadrive/metadrive_bridge.py` and `tools/sim/bridge/metadrive/metadrive_process.py`); `d7c0906d` ci: faster metadrive test (#33755) (at that commit the files were still `tools/sim/bridge/metadrive/metadrive_bridge.py` and `tools/sim/bridge/metadrive/metadrive_process.py`); `b8fd64f3` CI: Drive a loop in MetaDrive (#32308) (at that commit the files were still `tools/sim/bridge/metadrive/metadrive_bridge.py` and `tools/sim/bridge/metadrive/metadrive_process.py`) — run `git show` on any of them.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×2
  • Duplicated block (19 lines × 2) openpilot/selfdrive/ui/mici/onroad/cameraview.py:367 — openpilot/selfdrive/ui/mici/onroad/cameraview.py:367-385 | openpilot/selfdrive/ui/onroad/cameraview.py:320-338 — before extracting anything, compare `openpilot/selfdrive/ui/mici/onroad/cameraview.py` and `openpilot/selfdrive/ui/onroad/cameraview.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 220 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) openpilot/selfdrive/ui/translations/potools.py:38 — openpilot/selfdrive/ui/translations/potools.py:38-56 | openpilot/system/ui/lib/multilang.py:54-72 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×2
  • Duplicated block (17 lines × 2) openpilot/selfdrive/ui/mici/onroad/model_renderer.py:263 — openpilot/selfdrive/ui/mici/onroad/model_renderer.py:263-279 | openpilot/selfdrive/ui/onroad/model_renderer.py:236-252 — before extracting anything, compare `openpilot/selfdrive/ui/mici/onroad/model_renderer.py` and `openpilot/selfdrive/ui/onroad/model_renderer.py` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 237 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) openpilot/tools/lateral_maneuvers/generate_report.py:28 — openpilot/tools/lateral_maneuvers/generate_report.py:28-44 | openpilot/tools/longitudinal_maneuvers/generate_report.py:23-39 — `openpilot/tools/lateral_maneuvers/generate_report.py` and `openpilot/tools/longitudinal_maneuvers/generate_report.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 39 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 (15 lines × 2) · ×2
  • Duplicated block (15 lines × 2) openpilot/selfdrive/ui/mici/onroad/augmented_road_view.py:314 — openpilot/selfdrive/ui/mici/onroad/augmented_road_view.py:314-328 | openpilot/selfdrive/ui/onroad/augmented_road_view.py:175-189 — before extracting anything, compare `openpilot/selfdrive/ui/mici/onroad/augmented_road_view.py` and `openpilot/selfdrive/ui/onroad/augmented_road_view.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 47 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) openpilot/selfdrive/ui/mici/onroad/model_renderer.py:77 — openpilot/selfdrive/ui/mici/onroad/model_renderer.py:77-91 | openpilot/selfdrive/ui/onroad/model_renderer.py:64-78 — before extracting anything, compare `openpilot/selfdrive/ui/mici/onroad/model_renderer.py` and `openpilot/selfdrive/ui/onroad/model_renderer.py` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 237 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 lines × 2) · ×2
  • Duplicated block (13 lines × 2) openpilot/selfdrive/ui/mici/onroad/cameraview.py:396 — openpilot/selfdrive/ui/mici/onroad/cameraview.py:396-408 | openpilot/selfdrive/ui/onroad/cameraview.py:349-361 — before extracting anything, compare `openpilot/selfdrive/ui/mici/onroad/cameraview.py` and `openpilot/selfdrive/ui/onroad/cameraview.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 220 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) openpilot/selfdrive/ui/mici/onroad/model_renderer.py:164 — openpilot/selfdrive/ui/mici/onroad/model_renderer.py:164-176 | openpilot/selfdrive/ui/onroad/model_renderer.py:148-160 — before extracting anything, compare `openpilot/selfdrive/ui/mici/onroad/model_renderer.py` and `openpilot/selfdrive/ui/onroad/model_renderer.py` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 237 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 × 3) · ×2
  • Duplicated block (11 lines × 3) openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:48 — openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:48-58 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:236-246 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:260-270 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (11 lines × 3) openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:125 — openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:125-135 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:239-249 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:263-273 — 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 `openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:125` 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 lines × 2) · ×2
  • Duplicated block (8 lines × 2) openpilot/selfdrive/ui/mici/onroad/cameraview.py:303 — openpilot/selfdrive/ui/mici/onroad/cameraview.py:303-310 | openpilot/selfdrive/ui/onroad/cameraview.py:262-269 — before extracting anything, compare `openpilot/selfdrive/ui/mici/onroad/cameraview.py` and `openpilot/selfdrive/ui/onroad/cameraview.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 220 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, `openpilot/selfdrive/ui/mici/onroad/cameraview.py:298` calls `_update_texture_color_filtering` and `openpilot/selfdrive/ui/onroad/cameraview.py:257` 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 × 2) openpilot/tools/jotpluggler/generate_event_extractors.py:320 — openpilot/tools/jotpluggler/generate_event_extractors.py:320-327 | openpilot/tools/jotpluggler/generate_event_extractors.py:341-348 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
AC3 · Page structure · Heading level jumps from h3 to h5 · ×1
  • Heading level jumps from h3 to h5 openpilot/selfdrive/assets/offroad/fcc.html:10 — 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 automated accessibility check runs over the HTML your app renders. Assert the accessibility invariants over that HTML in the test suite you already have (parse the output and assert, or drive a browser), and gate that test in CI so a regression blocks the merge. What was searched, so you can tell an absence from a miss: the 2 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 · SelfdriveD.update_events (cyclomatic 156) · ×1
  • SelfdriveD.update_events (cyclomatic 156) openpilot/selfdrive/selfdrived/selfdrived.py:153 — SelfdriveD.update_events has cyclomatic complexity 156 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · hardwared.hardware_thread (cyclomatic 63) · ×1
  • hardwared.hardware_thread (cyclomatic 63) openpilot/system/hardware/hardwared.py:197 — hardwared.hardware_thread 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 · qcomgpsd.main (cyclomatic 47) · ×1
  • qcomgpsd.main (cyclomatic 47) openpilot/system/qcomgpsd/qcomgpsd.py:182 — qcomgpsd.main has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · serve._render_blocks (cyclomatic 46) · ×1
  • serve._render_blocks (cyclomatic 46) docs/serve.py:283 — serve._render_blocks has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CarEvents.create_common_events (cyclomatic 46) · ×1
  • CarEvents.create_common_events (cyclomatic 46) openpilot/selfdrive/car/car_events.py:96 — CarEvents.create_common_events 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 · modeld.main (cyclomatic 45) · ×1
  • modeld.main (cyclomatic 45) REDACTED:229 — modeld.main 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 · generate_report.report (cyclomatic 41) · ×1
  • generate_report.report (cyclomatic 41) openpilot/tools/lateral_maneuvers/generate_report.py:27 — generate_report.report 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 · ChestnutStatus.update (cyclomatic 40) · ×1
  • ChestnutStatus.update (cyclomatic 40) openpilot/system/hardware/chestnut/status.py:31 — ChestnutStatus.update 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.
D1 · Cyclomatic Complexity · CarEvents.update (cyclomatic 37) · ×1
  • CarEvents.update (cyclomatic 37) openpilot/selfdrive/car/car_events.py:25 — CarEvents.update 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 · LocationEstimator.handle_log (cyclomatic 33) · ×1
  • LocationEstimator.handle_log (cyclomatic 33) openpilot/selfdrive/locationd/locationd.py:100 — LocationEstimator.handle_log 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 · DriverMonitoring._update_events (cyclomatic 32) · ×1
  • DriverMonitoring._update_events (cyclomatic 32) openpilot/selfdrive/monitoring/policy.py:314 — DriverMonitoring._update_events has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · UnifiedLabel._render (cyclomatic 31) · ×1
  • UnifiedLabel._render (cyclomatic 31) openpilot/system/ui/widgets/label.py:461 — UnifiedLabel._render 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 · SimulatorBridge._run (cyclomatic 30) · ×1
  • SimulatorBridge._run (cyclomatic 30) openpilot/tools/sim/bridge/common.py:100 — SimulatorBridge._run 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 · lateral_maneuversd.main (cyclomatic 29) · ×1
  • lateral_maneuversd.main (cyclomatic 29) openpilot/tools/lateral_maneuvers/lateral_maneuversd.py:103 — lateral_maneuversd.main 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 · DriverMonitoring._update_states (cyclomatic 27) · ×1
  • DriverMonitoring._update_states (cyclomatic 27) openpilot/selfdrive/monitoring/policy.py:247 — DriverMonitoring._update_states 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 · GuiScrollPanel2._handle_mouse_event (cyclomatic 27) · ×1
  • GuiScrollPanel2._handle_mouse_event (cyclomatic 27) openpilot/system/ui/lib/scroll_panel2.py:141 — GuiScrollPanel2._handle_mouse_event has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Route._get_segments_local (cyclomatic 26) · ×1
  • Route._get_segments_local (cyclomatic 26) openpilot/tools/lib/route.py:99 — Route._get_segments_local 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 · DesireHelper.update (cyclomatic 25) · ×1
  • DesireHelper.update (cyclomatic 25) openpilot/selfdrive/controls/lib/desire_helper.py:24 — DesireHelper.update 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 · StateMachine.update (cyclomatic 25) · ×1
  • StateMachine.update (cyclomatic 25) openpilot/selfdrive/selfdrived/state.py:17 — StateMachine.update 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 · WifiManager._handle_state_change (cyclomatic 25) · ×1
  • WifiManager._handle_state_change (cyclomatic 25) openpilot/system/ui/lib/wifi_manager.py:394 — WifiManager._handle_state_change 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 · serve.inject_glossary (cyclomatic 24) · ×1
  • serve.inject_glossary (cyclomatic 24) docs/serve.py:120 — serve.inject_glossary 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 · GuiApplication.render (cyclomatic 24) · ×1
  • GuiApplication.render (cyclomatic 24) REDACTED:603 — GuiApplication.render 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 · serve.render_inline (cyclomatic 23) · ×1
  • serve.render_inline (cyclomatic 23) docs/serve.py:208 — serve.render_inline 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 · qrcode._parse_data (cyclomatic 23) · ×1
  • qrcode._parse_data (cyclomatic 23) openpilot/common/qrcode.py:425 — qrcode._parse_data 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 · potools.extract_strings (cyclomatic 23) · ×1
  • potools.extract_strings (cyclomatic 23) openpilot/selfdrive/ui/translations/potools.py:193 — potools.extract_strings 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 · CheckUpdateButton._update_state (cyclomatic 22) · ×1
  • CheckUpdateButton._update_state (cyclomatic 22) REDACTED:104 — CheckUpdateButton._update_state 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 · UbloxMsgParser._parse_glonass_ephemeris (cyclomatic 22) · ×1
  • UbloxMsgParser._parse_glonass_ephemeris (cyclomatic 22) openpilot/system/ubloxd/ubloxd.py:305 — UbloxMsgParser._parse_glonass_ephemeris 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 · generate_report.report (cyclomatic 22) · ×1
  • generate_report.report (cyclomatic 22) openpilot/tools/longitudinal_maneuvers/generate_report.py:22 — generate_report.report 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 · potools.parse_po (cyclomatic 21) · ×1
  • potools.parse_po (cyclomatic 21) openpilot/selfdrive/ui/translations/potools.py:59 — potools.parse_po 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 · manager.manager_thread (cyclomatic 21) · ×1
  • manager.manager_thread (cyclomatic 21) openpilot/system/manager/manager.py:100 — manager.manager_thread 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 · compressed_vipc.decoder (cyclomatic 21) · ×1
  • compressed_vipc.decoder (cyclomatic 21) openpilot/tools/camerastream/compressed_vipc.py:27 — compressed_vipc.decoder 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 · ci_results.format_markdown (cyclomatic 21) · ×1
  • ci_results.format_markdown (cyclomatic 21) scripts/ci_results.py:117 — ci_results.format_markdown 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 · VCruiseHelper._update_v_cruise_non_pcm (cyclomatic 20) · ×1
  • VCruiseHelper._update_v_cruise_non_pcm (cyclomatic 20) openpilot/selfdrive/car/cruise.py:66 — VCruiseHelper._update_v_cruise_non_pcm has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · file_downloader.cmd_download (cyclomatic 20) · ×1
  • file_downloader.cmd_download (cyclomatic 20) openpilot/tools/lib/file_downloader.py:103 — file_downloader.cmd_download 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 · metadrive_process.metadrive_process (cyclomatic 20) · ×1
  • metadrive_process.metadrive_process (cyclomatic 20) openpilot/tools/sim/bridge/metadrive/metadrive_process.py:51 — metadrive_process.metadrive_process 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 · check_shell.check_text (cyclomatic 20) · ×1
  • check_shell.check_text (cyclomatic 20) scripts/lint/check_shell.py:104 — check_shell.check_text 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 · utils.tabulate (cyclomatic 19) · ×1
  • utils.tabulate (cyclomatic 19) REDACTED:174 — utils.tabulate 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 · registration.register (cyclomatic 19) · ×1
  • registration.register (cyclomatic 19) openpilot/system/athena/registration.py:25 — registration.register 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 · Widget._process_mouse_events (cyclomatic 19) · ×1
  • Widget._process_mouse_events (cyclomatic 19) openpilot/system/ui/widgets/__init__.py:157 — Widget._process_mouse_events 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 · qrcode._rs_correct (cyclomatic 18) · ×1
  • qrcode._rs_correct (cyclomatic 18) openpilot/common/qrcode.py:325 — qrcode._rs_correct 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 · Controls.state_control (cyclomatic 18) · ×1
  • Controls.state_control (cyclomatic 18) openpilot/selfdrive/controls/controlsd.py:73 — Controls.state_control 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 · locationd.main (cyclomatic 18) · ×1
  • locationd.main (cyclomatic 18) openpilot/selfdrive/locationd/locationd.py:264 — locationd.main has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SelfdriveD.data_sample (cyclomatic 18) · ×1
  • SelfdriveD.data_sample (cyclomatic 18) openpilot/selfdrive/selfdrived/selfdrived.py:466 — SelfdriveD.data_sample 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 · GuiScrollPanel2._update_state (cyclomatic 18) · ×1
  • GuiScrollPanel2._update_state (cyclomatic 18) openpilot/system/ui/lib/scroll_panel2.py:88 — GuiScrollPanel2._update_state has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Keyboard._render (cyclomatic 18) · ×1
  • Keyboard._render (cyclomatic 18) openpilot/system/ui/widgets/keyboard.py:147 — Keyboard._render 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 · StreamSession.message_handler (cyclomatic 18) · ×1
  • StreamSession.message_handler (cyclomatic 18) openpilot/system/webrtc/webrtcd.py:281 — StreamSession.message_handler 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 · Generator.node_emits (cyclomatic 18) · ×1
  • Generator.node_emits (cyclomatic 18) openpilot/tools/jotpluggler/generate_event_extractors.py:209 — Generator.node_emits 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 · SteeringAccuracyTool.update (cyclomatic 18) · ×1
  • SteeringAccuracyTool.update (cyclomatic 18) tools/car_porting/measure_steering_accuracy.py:40 — SteeringAccuracyTool.update 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 · binary_struct._parse_field (cyclomatic 17) · ×1
  • binary_struct._parse_field (cyclomatic 17) openpilot/system/ubloxd/binary_struct.py:240 — binary_struct._parse_field 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 · ui.ui_thread (cyclomatic 17) · ×1
  • ui.ui_thread (cyclomatic 17) openpilot/tools/replay/ui.py:32 — ui.ui_thread 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 · max_lat_accel.find_events (cyclomatic 17) · ×1
  • max_lat_accel.find_events (cyclomatic 17) tools/scripts/car/max_lat_accel.py:25 — max_lat_accel.find_events 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 · SelfdriveD.__init__ (cyclomatic 16) · ×1
  • SelfdriveD.__init__ (cyclomatic 16) openpilot/selfdrive/selfdrived/selfdrived.py:50 — SelfdriveD.__init__ has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SoftwareLayout._update_state (cyclomatic 16) · ×1
  • SoftwareLayout._update_state (cyclomatic 16) openpilot/selfdrive/ui/layouts/settings/software.py:89 — SoftwareLayout._update_state has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · athenad.log_handler (cyclomatic 16) · ×1
  • athenad.log_handler (cyclomatic 16) REDACTED:838 — athenad.log_handler 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 · structs.parse_struct (cyclomatic 16) · ×1
  • structs.parse_struct (cyclomatic 16) openpilot/system/qcomgpsd/structs.py:293 — structs.parse_struct 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 · updated.main (cyclomatic 16) · ×1
  • updated.main (cyclomatic 16) openpilot/system/updated/updated.py:413 — updated.main has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D2 · Cognitive Complexity · SelfdriveD.update_events (cognitive 191) · ×1
  • SelfdriveD.update_events (cognitive 191) openpilot/selfdrive/selfdrived/selfdrived.py:153 — SelfdriveD.update_events has cognitive complexity 191 (threshold 15). Drivers by points: if/else 81 (116 pts), boolean chains 61, ternaries 5 (13 pts), loops 1 (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 · generate_report.report (cognitive 126) · ×1
  • generate_report.report (cognitive 126) openpilot/tools/lateral_maneuvers/generate_report.py:27 — generate_report.report has cognitive complexity 126 (threshold 15). Drivers by points: if/else 26 (86 pts), loops 8 (24 pts), ternaries 3 (11 pts), boolean chains 5 (nesting depth added 84). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · serve._render_blocks (cognitive 114) · ×1
  • serve._render_blocks (cognitive 114) docs/serve.py:283 — serve._render_blocks has cognitive complexity 114 (threshold 15). Drivers by points: if/else 18 (50 pts), loops 10 (30 pts), ternaries 6 (22 pts), boolean chains 12 (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 · hardwared.hardware_thread (cognitive 110) · ×1
  • hardwared.hardware_thread (cognitive 110) openpilot/system/hardware/hardwared.py:197 — hardwared.hardware_thread has cognitive complexity 110 (threshold 15). Drivers by points: if/else 28 (64 pts), boolean chains 22, ternaries 7 (14 pts), error handling 3 (9 pts), loops 1 (nesting depth added 49). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · qcomgpsd.main (cognitive 105) · ×1
  • qcomgpsd.main (cognitive 105) openpilot/system/qcomgpsd/qcomgpsd.py:182 — qcomgpsd.main has cognitive complexity 105 (threshold 15). Drivers by points: if/else 21 (55 pts), loops 11 (46 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 71). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · modeld.main (cognitive 77) · ×1
  • modeld.main (cognitive 77) REDACTED:229 — modeld.main has cognitive complexity 77 (threshold 15). Drivers by points: if/else 20 (40 pts), ternaries 9 (16 pts), boolean chains 10, loops 6 (9 pts), error handling 1 (2 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.
D2 · Cognitive Complexity · potools.extract_strings (cognitive 67) · ×1
  • potools.extract_strings (cognitive 67) openpilot/selfdrive/ui/translations/potools.py:193 — potools.extract_strings has cognitive complexity 67 (threshold 15). Drivers by points: if/else 15 (49 pts), ternaries 2 (10 pts), boolean chains 3, loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SteeringAccuracyTool.update (cognitive 66) · ×1
  • SteeringAccuracyTool.update (cognitive 66) tools/car_porting/measure_steering_accuracy.py:40 — SteeringAccuracyTool.update has cognitive complexity 66 (threshold 15). Drivers by points: if/else 15 (43 pts), ternaries 2 (13 pts), loops 3 (9 pts), boolean chains 1 (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 · CarEvents.update (cognitive 59) · ×1
  • CarEvents.update (cognitive 59) openpilot/selfdrive/car/car_events.py:25 — CarEvents.update has cognitive complexity 59 (threshold 15). Drivers by points: if/else 20 (48 pts), boolean chains 11 (nesting depth added 28). 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 · compressed_vipc.decoder (cognitive 57) · ×1
  • compressed_vipc.decoder (cognitive 57) openpilot/tools/camerastream/compressed_vipc.py:27 — compressed_vipc.decoder has cognitive complexity 57 (threshold 15). Drivers by points: if/else 13 (44 pts), error handling 2 (7 pts), boolean chains 3, loops 2 (3 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 · UnifiedLabel._render (cognitive 53) · ×1
  • UnifiedLabel._render (cognitive 53) openpilot/system/ui/widgets/label.py:461 — UnifiedLabel._render has cognitive complexity 53 (threshold 15). Drivers by points: if/else 24 (44 pts), boolean chains 4, loops 3, ternaries 1 (2 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.
D2 · Cognitive Complexity · CarEvents.create_common_events (cognitive 52) · ×1
  • CarEvents.create_common_events (cognitive 52) openpilot/selfdrive/car/car_events.py:96 — CarEvents.create_common_events has cognitive complexity 52 (threshold 15). Drivers by points: if/else 34 (39 pts), boolean chains 11, loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · GuiScrollPanel2._handle_mouse_event (cognitive 52) · ×1
  • GuiScrollPanel2._handle_mouse_event (cognitive 52) openpilot/system/ui/lib/scroll_panel2.py:141 — GuiScrollPanel2._handle_mouse_event has cognitive complexity 52 (threshold 15). Drivers by points: if/else 19 (45 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 28). 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 · lateral_maneuversd.main (cognitive 51) · ×1
  • lateral_maneuversd.main (cognitive 51) openpilot/tools/lateral_maneuvers/lateral_maneuversd.py:103 — lateral_maneuversd.main has cognitive complexity 51 (threshold 15). Drivers by points: if/else 13 (27 pts), ternaries 4 (14 pts), boolean chains 9, loops 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Route._get_segments_local (cognitive 51) · ×1
  • Route._get_segments_local (cognitive 51) openpilot/tools/lib/route.py:99 — Route._get_segments_local has cognitive complexity 51 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 5 (13 pts), error handling 6 (12 pts), boolean chains 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 · generate_report.report (cognitive 50) · ×1
  • generate_report.report (cognitive 50) openpilot/tools/longitudinal_maneuvers/generate_report.py:22 — generate_report.report has cognitive complexity 50 (threshold 15). Drivers by points: if/else 10 (30 pts), loops 5 (10 pts), ternaries 2 (6 pts), boolean chains 4 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · serve.inject_glossary (cognitive 48) · ×1
  • serve.inject_glossary (cognitive 48) docs/serve.py:120 — serve.inject_glossary has cognitive complexity 48 (threshold 15). Drivers by points: if/else 10 (27 pts), ternaries 3 (9 pts), boolean chains 6, loops 3 (6 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · qrcode._parse_data (cognitive 48) · ×1
  • qrcode._parse_data (cognitive 48) openpilot/common/qrcode.py:425 — qrcode._parse_data has cognitive complexity 48 (threshold 15). Drivers by points: if/else 6 (15 pts), ternaries 6 (15 pts), loops 4 (10 pts), error handling 2 (7 pts), boolean chains 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ci_results.format_markdown (cognitive 47) · ×1
  • ci_results.format_markdown (cognitive 47) scripts/ci_results.py:117 — ci_results.format_markdown has cognitive complexity 47 (threshold 15). Drivers by points: if/else 11 (20 pts), ternaries 5 (17 pts), loops 4 (7 pts), boolean chains 3 (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 · ChestnutStatus.update (cognitive 46) · ×1
  • ChestnutStatus.update (cognitive 46) openpilot/system/hardware/chestnut/status.py:31 — ChestnutStatus.update has cognitive complexity 46 (threshold 15). Drivers by points: boolean chains 21, if/else 12 (13 pts), ternaries 7 (12 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · GuiApplication.render (cognitive 46) · ×1
  • GuiApplication.render (cognitive 46) REDACTED:603 — GuiApplication.render has cognitive complexity 46 (threshold 15). Drivers by points: if/else 18 (37 pts), loops 3 (5 pts), boolean chains 3, error handling 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LocationEstimator.handle_log (cognitive 45) · ×1
  • LocationEstimator.handle_log (cognitive 45) openpilot/selfdrive/locationd/locationd.py:100 — LocationEstimator.handle_log has cognitive complexity 45 (threshold 15). Drivers by points: if/else 18 (35 pts), boolean chains 10 (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 · locationd.main (cognitive 40) · ×1
  • locationd.main (cognitive 40) openpilot/selfdrive/locationd/locationd.py:264 — locationd.main has cognitive complexity 40 (threshold 15). Drivers by points: if/else 8 (24 pts), loops 4 (10 pts), ternaries 2 (4 pts), boolean chains 2 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · potools.parse_po (cognitive 40) · ×1
  • potools.parse_po (cognitive 40) openpilot/selfdrive/ui/translations/potools.py:59 — potools.parse_po has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (39 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 · Route._get_segments_remote (cognitive 40) · ×1
  • Route._get_segments_remote (cognitive 40) openpilot/tools/lib/route.py:67 — Route._get_segments_remote has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 12 (36 pts), if/else 2 (3 pts), 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 · SimulatorBridge._run (cognitive 40) · ×1
  • SimulatorBridge._run (cognitive 40) openpilot/tools/sim/bridge/common.py:100 — SimulatorBridge._run has cognitive complexity 40 (threshold 15). Drivers by points: if/else 9 (27 pts), ternaries 4 (9 pts), boolean chains 2, loops 2 (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DriverMonitoring._update_events (cognitive 38) · ×1
  • DriverMonitoring._update_events (cognitive 38) openpilot/selfdrive/monitoring/policy.py:314 — DriverMonitoring._update_events has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 15 (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 · serve.render_inline (cognitive 37) · ×1
  • serve.render_inline (cognitive 37) docs/serve.py:208 — serve.render_inline has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 10, ternaries 1 (4 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.
D2 · Cognitive Complexity · WifiManager._handle_state_change (cognitive 37) · ×1
  • WifiManager._handle_state_change (cognitive 37) openpilot/system/ui/lib/wifi_manager.py:394 — WifiManager._handle_state_change has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (32 pts), boolean chains 5 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Keyboard._render (cognitive 37) · ×1
  • Keyboard._render (cognitive 37) openpilot/system/ui/widgets/keyboard.py:147 — Keyboard._render has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (21 pts), ternaries 4 (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 · athenad.log_handler (cognitive 35) · ×1
  • athenad.log_handler (cognitive 35) REDACTED:838 — athenad.log_handler has cognitive complexity 35 (threshold 15). Drivers by points: if/else 7 (18 pts), error handling 4 (12 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · athenad.ws_manage (cognitive 35) · ×1
  • athenad.ws_manage (cognitive 35) REDACTED:982 — athenad.ws_manage has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 5 (23 pts), if/else 4 (11 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 · registration.register (cognitive 34) · ×1
  • registration.register (cognitive 34) openpilot/system/athena/registration.py:25 — registration.register has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (17 pts), error handling 3 (9 pts), boolean chains 4, loops 2 (4 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 · metadrive_process.metadrive_process (cognitive 33) · ×1
  • metadrive_process.metadrive_process (cognitive 33) openpilot/tools/sim/bridge/metadrive/metadrive_process.py:51 — metadrive_process.metadrive_process has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 6, loops 2 (4 pts), 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 · StateMachine.update (cognitive 32) · ×1
  • StateMachine.update (cognitive 32) openpilot/selfdrive/selfdrived/state.py:17 — StateMachine.update has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (29 pts), boolean chains 3 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · StreamSession.message_handler (cognitive 32) · ×1
  • StreamSession.message_handler (cognitive 32) openpilot/system/webrtc/webrtcd.py:281 — StreamSession.message_handler has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 2 (6 pts), match/switch 1 (2 pts), error handling 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 · Generator.node_emits (cognitive 32) · ×1
  • Generator.node_emits (cognitive 32) openpilot/tools/jotpluggler/generate_event_extractors.py:209 — Generator.node_emits has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (25 pts), ternaries 1 (3 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · file_downloader.cmd_download (cognitive 32) · ×1
  • file_downloader.cmd_download (cognitive 32) openpilot/tools/lib/file_downloader.py:103 — file_downloader.cmd_download has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (22 pts), error handling 3 (4 pts), loops 2 (3 pts), ternaries 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 · manager.manager_thread (cognitive 31) · ×1
  • manager.manager_thread (cognitive 31) openpilot/system/manager/manager.py:100 — manager.manager_thread has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 4, loops 2 (3 pts), error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ui.ui_thread (cognitive 31) · ×1
  • ui.ui_thread (cognitive 31) openpilot/tools/replay/ui.py:32 — ui.ui_thread has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (24 pts), loops 2 (3 pts), ternaries 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 · check_shell.check_text (cognitive 31) · ×1
  • check_shell.check_text (cognitive 31) scripts/lint/check_shell.py:104 — check_shell.check_text has cognitive complexity 31 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 11, loops 3 (6 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DriverMonitoring._update_states (cognitive 30) · ×1
  • DriverMonitoring._update_states (cognitive 30) openpilot/selfdrive/monitoring/policy.py:247 — DriverMonitoring._update_states has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 13, 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, 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 · SelfdriveD.data_sample (cognitive 30) · ×1
  • SelfdriveD.data_sample (cognitive 30) openpilot/selfdrive/selfdrived/selfdrived.py:466 — SelfdriveD.data_sample has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 5, 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 · wrap_text.wrap_text (cognitive 30) · ×1
  • wrap_text.wrap_text (cognitive 30) openpilot/system/ui/lib/wrap_text.py:43 — wrap_text.wrap_text has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HardwareComma.get_network_metered (cognitive 29) · ×1
  • HardwareComma.get_network_metered (cognitive 29) openpilot/common/hardware/comma/hardware.py:208 — HardwareComma.get_network_metered has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (20 pts), error handling 2 (5 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Car.__init__ (cognitive 28) · ×1
  • Car.__init__ (cognitive 28) openpilot/selfdrive/car/card.py:66 — Car.__init__ has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 2, error handling 1 (2 pts), 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 · CheckUpdateButton._update_state (cognitive 28) · ×1
  • CheckUpdateButton._update_state (cognitive 28) REDACTED:104 — CheckUpdateButton._update_state has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (25 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 · Uploader.list_upload_files (cognitive 28) · ×1
  • Uploader.list_upload_files (cognitive 28) openpilot/system/loggerd/uploader.py:88 — Uploader.list_upload_files has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (17 pts), error handling 2 (5 pts), loops 2 (3 pts), boolean chains 2, ternaries 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 · qrcode._rs_correct (cognitive 27) · ×1
  • qrcode._rs_correct (cognitive 27) openpilot/common/qrcode.py:325 — qrcode._rs_correct has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 6 (9 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 · MiciOffroadAlerts._refresh (cognitive 27) · ×1
  • MiciOffroadAlerts._refresh (cognitive 27) openpilot/selfdrive/ui/mici/layouts/offroad_alerts.py:271 — MiciOffroadAlerts._refresh has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 2, loops 2 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · monitoring.chestnut_state_thread (cognitive 27) · ×1
  • monitoring.chestnut_state_thread (cognitive 27) openpilot/system/hardware/chestnut/monitoring.py:26 — monitoring.chestnut_state_thread has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (14 pts), ternaries 2 (5 pts), error handling 1 (4 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 · sensord.interrupt_loop (cognitive 27) · ×1
  • sensord.interrupt_loop (cognitive 27) openpilot/system/sensord/sensord.py:22 — sensord.interrupt_loop has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (16 pts), error handling 2 (8 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.
D2 · Cognitive Complexity · GuiScrollPanel._handle_mouse_event (cognitive 27) · ×1
  • GuiScrollPanel._handle_mouse_event (cognitive 27) openpilot/system/ui/lib/scroll_panel.py:78 — GuiScrollPanel._handle_mouse_event has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (26 pts), boolean chains 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 · utils.tabulate (cognitive 26) · ×1
  • utils.tabulate (cognitive 26) REDACTED:174 — utils.tabulate has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (11 pts), loops 7 (11 pts), ternaries 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VCruiseHelper._update_v_cruise_non_pcm (cognitive 26) · ×1
  • VCruiseHelper._update_v_cruise_non_pcm (cognitive 26) openpilot/selfdrive/car/cruise.py:66 — VCruiseHelper._update_v_cruise_non_pcm has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 6, loops 2 (3 pts), ternaries 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 · UbloxMsgParser._parse_glonass_ephemeris (cognitive 26) · ×1
  • UbloxMsgParser._parse_glonass_ephemeris (cognitive 26) openpilot/system/ubloxd/ubloxd.py:305 — UbloxMsgParser._parse_glonass_ephemeris has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 5, loops 3 (4 pts), boolean chains 2, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · logreader.auto_source (cognitive 26) · ×1
  • logreader.auto_source (cognitive 26) openpilot/tools/lib/logreader.py:150 — logreader.auto_source has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (19 pts), error handling 1 (3 pts), loops 2 (3 pts), 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 · cycle_alerts.cycle_alerts (cognitive 26) · ×1
  • cycle_alerts.cycle_alerts (cognitive 26) tools/scripts/cycle_alerts.py:19 — cycle_alerts.cycle_alerts has cognitive complexity 26 (threshold 15). Drivers by points: loops 5 (12 pts), if/else 3 (10 pts), ternaries 1 (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 · DesireHelper.update (cognitive 25) · ×1
  • DesireHelper.update (cognitive 25) openpilot/selfdrive/controls/lib/desire_helper.py:24 — DesireHelper.update has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 13, if/else 7 (12 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 · DeviceLayout._update_calib_description (cognitive 25) · ×1
  • DeviceLayout._update_calib_description (cognitive 25) openpilot/selfdrive/ui/layouts/settings/device.py:113 — DeviceLayout._update_calib_description has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (13 pts), error handling 3 (6 pts), ternaries 2 (6 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Widget._process_mouse_events (cognitive 25) · ×1
  • Widget._process_mouse_events (cognitive 25) openpilot/system/ui/widgets/__init__.py:157 — Widget._process_mouse_events has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 5, 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 · Serial.readline (cognitive 24) · ×1
  • Serial.readline (cognitive 24) openpilot/common/serial.py:129 — Serial.readline has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (16 pts), error handling 2 (4 pts), ternaries 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Controls.state_control (cognitive 24) · ×1
  • Controls.state_control (cognitive 24) openpilot/selfdrive/controls/controlsd.py:73 — Controls.state_control has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 5, ternaries 2 (4 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GuiScrollPanel2._update_state (cognitive 24) · ×1
  • GuiScrollPanel2._update_state (cognitive 24) openpilot/system/ui/lib/scroll_panel2.py:88 — GuiScrollPanel2._update_state has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 7, ternaries 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 · can_printer.can_printer (cognitive 24) · ×1
  • can_printer.can_printer (cognitive 24) tools/scripts/car/can_printer.py:10 — can_printer.can_printer has cognitive complexity 24 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 4 (9 pts), ternaries 1 (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.
D2 · Cognitive Complexity · uploader.main (cognitive 23) · ×1
  • uploader.main (cognitive 23) openpilot/system/loggerd/uploader.py:227 — uploader.main has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 3 (9 pts), error handling 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · build.build (cognitive 23) · ×1
  • build.build (cognitive 23) openpilot/system/manager/build.py:11 — build.build has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (5 pts), error handling 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NetworkConnectivityMonitor._run (cognitive 23) · ×1
  • NetworkConnectivityMonitor._run (cognitive 23) REDACTED:72 — NetworkConnectivityMonitor._run has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (15 pts), error handling 2 (6 pts), boolean chains 1, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HtmlRenderer._render (cognitive 23) · ×1
  • HtmlRenderer._render (cognitive 23) openpilot/system/ui/widgets/html_render.py:179 — HtmlRenderer._render has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (19 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 · debug_fw_fingerprinting_offline.main (cognitive 23) · ×1
  • debug_fw_fingerprinting_offline.main (cognitive 23) tools/scripts/debug_fw_fingerprinting_offline.py:8 — debug_fw_fingerprinting_offline.main has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 2 (4 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 · AtClient.send_apdu (cognitive 22) · ×1
  • AtClient.send_apdu (cognitive 22) openpilot/common/esim/lpa.py:239 — AtClient.send_apdu has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 2 (3 pts), error handling 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 · lpa.iter_tlv (cognitive 22) · ×1
  • lpa.iter_tlv (cognitive 22) openpilot/common/esim/lpa.py:262 — lpa.iter_tlv has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (4 pts), ternaries 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · helpers.fft_next_good_size (cognitive 22) · ×1
  • helpers.fft_next_good_size (cognitive 22) openpilot/selfdrive/locationd/helpers.py:11 — helpers.fft_next_good_size has cognitive complexity 22 (threshold 15). Drivers by points: loops 5 (15 pts), ternaries 1 (6 pts), if/else 1 (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · SoftwareLayout._update_state (cognitive 22) · ×1
  • SoftwareLayout._update_state (cognitive 22) openpilot/selfdrive/ui/layouts/settings/software.py:89 — SoftwareLayout._update_state has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 9 (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 · tombstoned.report_tombstone_apport (cognitive 22) · ×1
  • tombstoned.report_tombstone_apport (cognitive 22) REDACTED:62 — tombstoned.report_tombstone_apport has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 2 (4 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 · UnifiedLabel._update_text_cache (cognitive 22) · ×1
  • UnifiedLabel._update_text_cache (cognitive 22) openpilot/system/ui/widgets/label.py:357 — UnifiedLabel._update_text_cache has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 2 (3 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · max_lat_accel.find_events (cognitive 22) · ×1
  • max_lat_accel.find_events (cognitive 22) tools/scripts/car/max_lat_accel.py:25 — max_lat_accel.find_events has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 7 (13 pts), if/else 3 (7 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 · watch_timings.monitor_services (cognitive 22) · ×1
  • watch_timings.monitor_services (cognitive 22) tools/scripts/watch_timings.py:55 — watch_timings.monitor_services has cognitive complexity 22 (threshold 15). Drivers by points: loops 6 (13 pts), if/else 2 (4 pts), ternaries 1 (4 pts), error handling 1 (nesting depth added 12). 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 · DriverStateRenderer._render (cognitive 21) · ×1
  • DriverStateRenderer._render (cognitive 21) openpilot/selfdrive/ui/mici/onroad/driver_state.py:95 — DriverStateRenderer._render has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 2 (5 pts), loops 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · athenad.upload_handler (cognitive 21) · ×1
  • athenad.upload_handler (cognitive 21) REDACTED:273 — athenad.upload_handler has cognitive complexity 21 (threshold 15). Drivers by points: error handling 5 (10 pts), if/else 5 (9 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 · HtmlRenderer.parse_html_content (cognitive 21) · ×1
  • HtmlRenderer.parse_html_content (cognitive 21) openpilot/system/ui/widgets/html_render.py:105 — HtmlRenderer.parse_html_content has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), ternaries 1 (4 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 · updated.main (cognitive 21) · ×1
  • updated.main (cognitive 21) openpilot/system/updated/updated.py:413 — updated.main has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (8 pts), error handling 4 (7 pts), boolean chains 3, ternaries 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · can_print_changes.update (cognitive 21) · ×1
  • can_print_changes.update (cognitive 21) tools/scripts/car/can_print_changes.py:14 — can_print_changes.update has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VehicleParamsLearner.handle_log (cognitive 20) · ×1
  • VehicleParamsLearner.handle_log (cognitive 20) openpilot/selfdrive/locationd/paramsd.py:67 — VehicleParamsLearner.handle_log has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 4, 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 · binary_struct._parse_field (cognitive 20) · ×1
  • binary_struct._parse_field (cognitive 20) openpilot/system/ubloxd/binary_struct.py:240 — binary_struct._parse_field has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (15 pts), error handling 1 (2 pts), ternaries 1 (2 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.
D2 · Cognitive Complexity · pigeond.run_receiving (cognitive 20) · ×1
  • pigeond.run_receiving (cognitive 20) openpilot/system/ubloxd/pigeond.py:274 — pigeond.run_receiving has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (4 pts), error handling 1 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NavWidget._handle_mouse_event (cognitive 20) · ×1
  • NavWidget._handle_mouse_event (cognitive 20) openpilot/system/ui/widgets/nav_widget.py:87 — NavWidget._handle_mouse_event has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (18 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.
D2 · Cognitive Complexity · lpa._parse_install_result (cognitive 19) · ×1
  • lpa._parse_install_result (cognitive 19) openpilot/common/esim/lpa.py:546 — lpa._parse_install_result has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Serial.read (cognitive 19) · ×1
  • Serial.read (cognitive 19) openpilot/common/serial.py:103 — Serial.read has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), error handling 2 (4 pts), 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 · pandad.main (cognitive 19) · ×1
  • pandad.main (cognitive 19) openpilot/selfdrive/pandad/pandad.py:54 — pandad.main has cognitive complexity 19 (threshold 15). Drivers by points: error handling 4 (7 pts), if/else 4 (7 pts), loops 3 (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.
D2 · Cognitive Complexity · WifiUIMici._update_buttons (cognitive 19) · ×1
  • WifiUIMici._update_buttons (cognitive 19) openpilot/selfdrive/ui/mici/layouts/settings/network/wifi_ui.py:308 — WifiUIMici._update_buttons has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 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 · UIState._update_status (cognitive 19) · ×1
  • UIState._update_status (cognitive 19) openpilot/selfdrive/ui/ui_state.py:183 — UIState._update_status has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 4, loops 2 (4 pts), ternaries 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VideoClips._available_ranges (cognitive 19) · ×1
  • VideoClips._available_ranges (cognitive 19) REDACTED:535 — VideoClips._available_ranges has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 4 (6 pts), boolean chains 3, 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 · tombstoned.main (cognitive 19) · ×1
  • tombstoned.main (cognitive 19) REDACTED:133 — tombstoned.main has cognitive complexity 19 (threshold 15). Drivers by points: error handling 2 (7 pts), if/else 3 (7 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GuiScrollPanel._update_state (cognitive 19) · ×1
  • GuiScrollPanel._update_state (cognitive 19) openpilot/system/ui/lib/scroll_panel.py:40 — GuiScrollPanel._update_state has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 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 · _Scroller._do_move_animation (cognitive 19) · ×1
  • _Scroller._do_move_animation (cognitive 19) openpilot/system/ui/widgets/scroller.py:227 — _Scroller._do_move_animation has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (19 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 · toyota_eps_factor.get_eps_factor (cognitive 19) · ×1
  • toyota_eps_factor.get_eps_factor (cognitive 19) tools/scripts/car/toyota_eps_factor.py:19 — toyota_eps_factor.get_eps_factor has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FaceAnimator.get_dots (cognitive 18) · ×1
  • FaceAnimator.get_dots (cognitive 18) openpilot/selfdrive/ui/body/animations.py:178 — FaceAnimator.get_dots has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 4, 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 · TogglesLayout._update_toggles (cognitive 18) · ×1
  • TogglesLayout._update_toggles (cognitive 18) openpilot/selfdrive/ui/layouts/settings/toggles.py:155 — TogglesLayout._update_toggles has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2, 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 · ManagerProcess.stop (cognitive 18) · ×1
  • ManagerProcess.stop (cognitive 18) openpilot/system/manager/process.py:74 — ManagerProcess.stop has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 1 (4 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 · multilang.load_translations (cognitive 18) · ×1
  • multilang.load_translations (cognitive 18) openpilot/system/ui/lib/multilang.py:75 — multilang.load_translations has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Label._update_text (cognitive 18) · ×1
  • Label._update_text (cognitive 18) openpilot/system/ui/widgets/label.py:117 — Label._update_text has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (4 pts), ternaries 1 (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 · Updater.set_params (cognitive 18) · ×1
  • Updater.set_params (cognitive 18) openpilot/system/updated/updated.py:273 — Updater.set_params has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 3, ternaries 1 (3 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LivestreamBitrateController.run (cognitive 18) · ×1
  • LivestreamBitrateController.run (cognitive 18) openpilot/system/webrtc/webrtcd.py:178 — LivestreamBitrateController.run 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 · run.iter_segment_frames (cognitive 18) · ×1
  • run.iter_segment_frames (cognitive 18) openpilot/tools/clip/run.py:139 — run.iter_segment_frames has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 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 · run.clip (cognitive 18) · ×1
  • run.clip (cognitive 18) openpilot/tools/clip/run.py:285 — run.clip has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 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, 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 · math_eval.main (cognitive 18) · ×1
  • math_eval.main (cognitive 18) openpilot/tools/jotpluggler/math_eval.py:53 — math_eval.main has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 4, loops 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · serve._parse_link (cognitive 17) · ×1
  • serve._parse_link (cognitive 17) docs/serve.py:174 — serve._parse_link has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (6 pts), boolean chains 4, loops 2 (4 pts), ternaries 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · markdown.parse_markdown (cognitive 17) · ×1
  • markdown.parse_markdown (cognitive 17) openpilot/common/markdown.py:6 — markdown.parse_markdown has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 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 · TorqueEstimator.handle_log (cognitive 17) · ×1
  • TorqueEstimator.handle_log (cognitive 17) openpilot/selfdrive/locationd/torqued.py:167 — TorqueEstimator.handle_log has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 3 (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 · Parser.parse_mdn (cognitive 17) · ×1
  • Parser.parse_mdn (cognitive 17) openpilot/selfdrive/modeld/parse_model_outputs.py:44 — Parser.parse_mdn has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 6 (7 pts) (nesting depth added 7). 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 · AlertRenderer.get_alert (cognitive 17) · ×1
  • AlertRenderer.get_alert (cognitive 17) openpilot/selfdrive/ui/onroad/alert_renderer.py:84 — AlertRenderer.get_alert has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 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 · ModelRenderer._render (cognitive 17) · ×1
  • ModelRenderer._render (cognitive 17) openpilot/selfdrive/ui/onroad/model_renderer.py:84 — ModelRenderer._render has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, ternaries 3 (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 · VideoClips._worker (cognitive 17) · ×1
  • VideoClips._worker (cognitive 17) REDACTED:473 — VideoClips._worker has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), error handling 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 · Uploader.upload (cognitive 17) · ×1
  • Uploader.upload (cognitive 17) openpilot/system/loggerd/uploader.py:163 — Uploader.upload has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 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 · nmeaport.process_nmea_port_messages (cognitive 17) · ×1
  • nmeaport.process_nmea_port_messages (cognitive 17) openpilot/system/qcomgpsd/nmeaport.py:95 — nmeaport.process_nmea_port_messages has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 2 (3 pts), match/switch 1 (3 pts), error handling 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 · sensord.main (cognitive 17) · ×1
  • sensord.main (cognitive 17) openpilot/system/sensord/sensord.py:94 — sensord.main has cognitive complexity 17 (threshold 15). Drivers by points: error handling 4 (7 pts), loops 6, if/else 2 (4 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · text.wrap_text (cognitive 17) · ×1
  • text.wrap_text (cognitive 17) openpilot/system/ui/text.py:29 — text.wrap_text has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (3 pts), ternaries 1 (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 · Label._render (cognitive 17) · ×1
  • Label._render (cognitive 17) openpilot/system/ui/widgets/label.py:149 — Label._render has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Scroller._layout (cognitive 17) · ×1
  • _Scroller._layout (cognitive 17) openpilot/system/ui/widgets/scroller.py:267 — _Scroller._layout has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 2 (3 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 · Generator.emit_node (cognitive 17) · ×1
  • Generator.emit_node (cognitive 17) openpilot/tools/jotpluggler/generate_event_extractors.py:96 — Generator.emit_node has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · joystickd.joystickd_thread (cognitive 17) · ×1
  • joystickd.joystickd_thread (cognitive 17) openpilot/tools/joystick/joystickd.py:18 — joystickd.joystickd_thread has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 6, ternaries 1 (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 · auth.login (cognitive 17) · ×1
  • auth.login (cognitive 17) openpilot/tools/lib/auth.py:113 — auth.login has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 2, error handling 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 · ci_results.get_jenkins_status (cognitive 17) · ×1
  • ci_results.get_jenkins_status (cognitive 17) scripts/ci_results.py:62 — ci_results.get_jenkins_status has cognitive complexity 17 (threshold 15). Drivers by points: if/else 2 (7 pts), error handling 2 (6 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 · fingerprint_from_route.get_fingerprint (cognitive 17) · ×1
  • fingerprint_from_route.get_fingerprint (cognitive 17) tools/scripts/fingerprint_from_route.py:7 — fingerprint_from_route.get_fingerprint has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 3 (6 pts), ternaries 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 · RadarD.update (cognitive 16) · ×1
  • RadarD.update (cognitive 16) openpilot/selfdrive/controls/radard.py:194 — RadarD.update has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 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 · lagd.main (cognitive 16) · ×1
  • lagd.main (cognitive 16) openpilot/selfdrive/locationd/lagd.py:387 — lagd.main has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 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 · AlertRenderer.get_alert (cognitive 16) · ×1
  • AlertRenderer.get_alert (cognitive 16) openpilot/selfdrive/ui/mici/onroad/alert_renderer.py:120 — AlertRenderer.get_alert has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3 (nesting depth added 7). 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 · AlertRenderer._draw_text (cognitive 16) · ×1
  • AlertRenderer._draw_text (cognitive 16) openpilot/selfdrive/ui/mici/onroad/alert_renderer.py:294 — AlertRenderer._draw_text has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 4 (5 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 · ModelRenderer._render (cognitive 16) · ×1
  • ModelRenderer._render (cognitive 16) openpilot/selfdrive/ui/mici/onroad/model_renderer.py:97 — ModelRenderer._render has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 3, ternaries 3 (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 · helpers.unblock_stdout (cognitive 16) · ×1
  • helpers.unblock_stdout (cognitive 16) openpilot/system/manager/helpers.py:15 — helpers.unblock_stdout has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), error handling 2 (6 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WifiManager._monitor_state (cognitive 16) · ×1
  • WifiManager._monitor_state (cognitive 16) openpilot/system/ui/lib/wifi_manager.py:332 — WifiManager._monitor_state has cognitive complexity 16 (threshold 15). Drivers by points: loops 6 (10 pts), if/else 1 (3 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 7). 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 · WifiManager._update_active_connection_info (cognitive 16) · ×1
  • WifiManager._update_active_connection_info (cognitive 16) openpilot/system/ui/lib/wifi_manager.py:905 — WifiManager._update_active_connection_info has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 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 · Keyboard.__init__ (cognitive 16) · ×1
  • Keyboard.__init__ (cognitive 16) openpilot/system/ui/widgets/keyboard.py:62 — Keyboard.__init__ has cognitive complexity 16 (threshold 15). Drivers by points: loops 3 (6 pts), if/else 2 (5 pts), ternaries 1 (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.
D22 · Internal API Consistency · Redundant operations with identical signatures and likely identical behavior. 'recv_one' and 'recv_one_or_none' are semantically equivalent in this context (returning a single message or None), creating unnecessary API surface duplication. · ×1
  • Redundant operations with identical signatures and likely identical behavior. 'recv_one' and 'recv_one_or_none' are semantically equivalent in this context (returning a single message or None), creating unnecessary API surface duplication. — Remove 'recv_one' and keep 'recv_one_or_none' (or vice versa, depending on naming preference for explicitness), or deprecate one. (signatures: messaging.recv_one(sock: SubSocket): _DynamicStructReader | None | messaging.recv_one_or_none(sock: SubSocket): _DynamicStructReader | None)
D22 · Internal API Consistency · Overlap in intent. 'all_readers_updated' checks the current state, while 'wait_for_readers_to_update' waits for that state. While one is blocking and one is non-blocking, the naming convention is inconsistent with standard patterns (e.g., 'has_readers' vs 'wait_for_readers'). More critically, 'wait_for_readers_to_update' takes a 'dt' parameter which is ambiguous (is it a timeout? a delta time?). · ×1
  • Overlap in intent. 'all_readers_updated' checks the current state, while 'wait_for_readers_to_update' waits for that state. While one is blocking and one is non-blocking, the naming convention is inconsistent with standard patterns (e.g., 'has_readers' vs 'wait_for_readers'). More critically, 'wait_for_readers_to_update' takes a 'dt' parameter which is ambiguous (is it a timeout? a delta time?). — Rename 'wait_for_readers_to_update' to 'wait_for_readers' or 'await_readers' to clearly distinguish it from the state-checking 'all_readers_updated'. Clarify the 'dt' parameter or remove it if it's redundant with 'timeout'. (signatures: PubMaster.wait_for_readers_to_update(self, s: str, timeout: int, dt: float): bool | PubMaster.all_readers_updated(self, s: str): bool)
D22 · Internal API Consistency · Type hierarchy inconsistency. 'HardwareBase.get_sim_lpa' returns 'LPABase', but the concrete implementation 'LPA' is a subclass of 'LPABase'. However, the module 'openpilot.common.esim.lpa' exposes a module-level 'LPA' class that seems to duplicate the interface of 'LPABase' but is not clearly positioned in the hierarchy relative to the base class in the exposed surface. It's unclear if 'LPA' is the only implementation or if there are others, and the return type 'LPABase' suggests polymorphism that isn't fully reflected in the distinct 'LPA' class exposure. · ×1
  • Type hierarchy inconsistency. 'HardwareBase.get_sim_lpa' returns 'LPABase', but the concrete implementation 'LPA' is a subclass of 'LPABase'. However, the module 'openpilot.common.esim.lpa' exposes a module-level 'LPA' class that seems to duplicate the interface of 'LPABase' but is not clearly positioned in the hierarchy relative to the base class in the exposed surface. It's unclear if 'LPA' is the only implementation or if there are others, and the return type 'LPABase' suggests polymorphism that isn't fully reflected in the distinct 'LPA' class exposure. — Ensure the relationship between 'LPABase' and 'LPA' is clear. If 'LPA' is the sole implementation, consider returning 'LPA' directly or documenting the polymorphism better. The current surface makes it look like 'LPABase' is a concrete type used for return values, which is confusing if it's an abstract base. (signatures: HardwareBase.get_sim_lpa(self): LPABase | LPA.__init__(self) | LPABase.__init__(self))
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D35 · Change Coupling · Change coupling clique · ×1
  • Change coupling clique: latcontrol_angle.py, latcontrol_pid.py, latcontrol_torque.py openpilot/selfdrive/controls/lib/latcontrol_angle.py — 3 files — `openpilot/selfdrive/controls/lib/latcontrol_angle.py`, `openpilot/selfdrive/controls/lib/latcontrol_pid.py`, `openpilot/selfdrive/controls/lib/latcontrol_torque.py` — all change together with no explicit dependency: a fully-connected co-change clique, not 3 separate couplings. They share one concern (thin parallel siblings over a common abstraction), so extract the shared part into ONE unit and the whole clique's coupling clears at once — you do not need to break each pair individually.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member pair (39 shared lines) · ×1
  • Near-duplicate member pair (39 shared lines) openpilot/tools/lateral_maneuvers/generate_report.py:28 — openpilot/tools/lateral_maneuvers/generate_report.py:28-212 | openpilot/tools/longitudinal_maneuvers/generate_report.py:23-148 — These two members are variants of one another: 39 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 · Duplicated block (49 lines × 2) · ×1
  • Duplicated block (49 lines × 2) openpilot/selfdrive/ui/mici/onroad/model_renderer.py:409 — openpilot/selfdrive/ui/mici/onroad/model_renderer.py:409-457 | openpilot/selfdrive/ui/onroad/model_renderer.py:361-409 — before extracting anything, compare `openpilot/selfdrive/ui/mici/onroad/model_renderer.py` and `openpilot/selfdrive/ui/onroad/model_renderer.py` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 237 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 (44 lines × 2) · ×1
  • Duplicated block (44 lines × 2) openpilot/selfdrive/ui/mici/onroad/cameraview.py:224 — openpilot/selfdrive/ui/mici/onroad/cameraview.py:224-267 | openpilot/selfdrive/ui/onroad/cameraview.py:184-227 — before extracting anything, compare `openpilot/selfdrive/ui/mici/onroad/cameraview.py` and `openpilot/selfdrive/ui/onroad/cameraview.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 220 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 (37 lines × 2) · ×1
  • Duplicated block (37 lines × 2) openpilot/selfdrive/ui/mici/onroad/model_renderer.py:103 — openpilot/selfdrive/ui/mici/onroad/model_renderer.py:103-139 | openpilot/selfdrive/ui/onroad/model_renderer.py:88-124 — before extracting anything, compare `openpilot/selfdrive/ui/mici/onroad/model_renderer.py` and `openpilot/selfdrive/ui/onroad/model_renderer.py` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 237 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 (32 lines × 2) · ×1
  • Duplicated block (32 lines × 2) REDACTED:515 — REDACTED:515-546 | REDACTED:360-391 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:511` calls `set_shown_callback`, `push_widget` and `REDACTED:357` 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 (24 lines × 2) · ×1
  • Duplicated block (24 lines × 2) openpilot/selfdrive/ui/mici/onroad/cameraview.py:274 — openpilot/selfdrive/ui/mici/onroad/cameraview.py:274-297 | openpilot/selfdrive/ui/onroad/cameraview.py:234-257 — before extracting anything, compare `openpilot/selfdrive/ui/mici/onroad/cameraview.py` and `openpilot/selfdrive/ui/onroad/cameraview.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 220 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `openpilot/selfdrive/ui/mici/onroad/cameraview.py:298` calls `_update_texture_color_filtering` and `openpilot/selfdrive/ui/onroad/cameraview.py:258` 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 (21 lines × 2) · ×1
  • Duplicated block (21 lines × 2) openpilot/selfdrive/ui/mici/onroad/cameraview.py:131 — openpilot/selfdrive/ui/mici/onroad/cameraview.py:131-151 | openpilot/selfdrive/ui/onroad/cameraview.py:88-108 — before extracting anything, compare `openpilot/selfdrive/ui/mici/onroad/cameraview.py` and `openpilot/selfdrive/ui/onroad/cameraview.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 220 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 lines × 3) · ×1
  • Duplicated block (13 lines × 3) openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:67 — openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:67-79 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:186-198 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:210-222 — 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 `openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:67` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–13 lines × 3) · ×1
  • Duplicated block (11–13 lines × 3) openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:130 — openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:130-142 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:152-164 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:170-180 — 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 `openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:170` 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 × 4) · ×1
  • Duplicated block (9 lines × 4) openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:51 — openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:51-59 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:125-133 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:239-247 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:263-271 — 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 `openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:51` 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 × 3) · ×1
  • Duplicated block (9 lines × 3) openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:43 — openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:43-51 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:255-263 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:279-287 — 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 `openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:43` 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 lines × 6) · ×1
  • Duplicated block (7 lines × 6) openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:45 — openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:45-51 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:141-147 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:163-169 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:233-239 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:257-263 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:281-287 — 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 `openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:45` 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 lines × 4) · ×1
  • Duplicated block (7 lines × 4) openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:44 — openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:44-50 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:66-72 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:256-262 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:280-286 — 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 `openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:44` 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 (5 lines × 3) · ×1
  • Duplicated block (5 lines × 3) openpilot/selfdrive/ui/mici/layouts/onboarding.py:32 — openpilot/selfdrive/ui/mici/layouts/onboarding.py:32-36 | openpilot/selfdrive/ui/mici/layouts/settings/network/esim_ui.py:122-126 | openpilot/selfdrive/ui/mici/onroad/cabin_camera_dialog.py:75-79 — 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.
Minor — 22 finding(s)
D29 · Static Analysis (SAST) · REDACTED · ×7
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D16 · Bus Factor · Off-boarding risk · ×2
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 21 significant file(s) lose their only recent owner: openpilot/system/ubloxd/ubloxd.py, openpilot/tools/jotpluggler/generate_event_extractors.py, openpilot/tools/lib/vidindex.py, openpilot/system/ubloxd/pigeond.py, openpilot/selfdrive/ui/translations/potools.py, openpilot/tools/camerastream/ffmpeg_decoder.py, openpilot/common/fuzzy.py, scripts/ci_results.py (+13 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 4 significant file(s) lose their only recent owner: REDACTED, openpilot/selfdrive/ui/mici/layouts/settings/network/wifi_ui.py, openpilot/system/ui/widgets/nav_widget.py, openpilot/system/ui/widgets/slider.py. Pair on, review, or document these before any departure.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D19 · Documentation Quality · Documentation · ×1
  • Documentation: no project overview docs/LIMITATIONS.md — The document is entirely limitations content with no description of what openpilot ALC/LDW/ACC/FCW does or what the project is for. Add a one-paragraph overview stating that this document explains the known operational limits and driver responsibilities of each component.
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D34 · Knowledge Freshness · Orphaned files with no living knowledge · ×1
  • Orphaned files with no living knowledge — 4 of 225 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 225 of the 393 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: openpilot/system/qcomgpsd/structs.py, openpilot/common/logging_extra.py, openpilot/tools/sim/lib/keyboard_ctrl.py, openpilot/tools/lib/azure_container.py. Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
M3 · Folder & project structure · No src/ separation · ×1
  • No src/ separation — Production code isn't grouped under a src/ folder — it all sits under openpilot/ alongside the root build files, so the conventional src/ boundary between the product and its tooling isn't drawn.
P3 · Security & performance tooling · No SAST · ×1
  • No SAST — No static application security testing detected. For this repository's stack, add bandit, `semgrep --config=p/python`, or CodeQL's python pack as a CI step. What was searched, so you can tell an absence from a miss: the 42916 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
Minor — 1 finding(s)
D12 · Dependency Hygiene · Outdated · ×1
  • Outdated: pycapnp — `pycapnp` is pinned to 2.1.0, but 2.2.4 is the current stable release on PyPI. An exact pin never moves on its own, so this repository installs 2.1.0 until the declaration is edited.

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-a43446843f8c4025ac2472e93b94015d/history.json --exit-code 0 --source .13artifacts/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-a43446843f8c4025ac2472e93b94015d/tree.json --exit-code 0 --source .1artifacts/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 .46artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesosv-scanner—osv-scanner --format json --recursive .0artifacts/raw/osv-scanner.json
D31 · IaC & Container Securitytrivy—trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.0—
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciesosv-scanner—osv-scanner --format json --recursive .0artifacts/raw/osv-scanner.json

Run 01a0dd18-39ff-7509-b227-ae6fae90ecc2 · 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