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

commaai/openpilot

Measured 25 October 2026, 02:41 UTC, at code version 9fba666

Regression: 1 dimension fell since the last survey Test reliability: not measured

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

Test reliability is not measured: The suite could not be re-run, but the repository declares tests of its own unreliable.

CAI score 48out of 100 At risk No change since the last survey

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

A medium codebase: 49,112 lines of product code in 3 projects, tests not counted · Estimated rebuild effort: about 0.4 person-years · Weakest lens: Production Readiness, 39

Findings by how serious they are

52 critical 529 serious 79 minor

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

This survey was produced by

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
25 October 2026, 02:41 UTC

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

A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.

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

55of 59 dimensions measured by tools. The other 4 are advisory notes from an AI model, which explain the code but don't count towards the score.
640of 660 findings point to an exact file and line, so you can open each one in the code. The other 20 concern the repository as a whole, such as missing documentation.
59dimensions across 7 lenses, read from 49,112 lines of product code in 3 projects.
Chapters

Executive summary

commaai/openpilot scores 48 out of 100, but it is rated At risk while a critical security finding is open; the score itself is unchanged. The project hasn't declared a stable release yet, so its lenses are rated against a lower bar than a released product's, while the score itself is worked out as for any repository.

The weakest lens counts most in the score, and here that is Production Readiness, which scores 39 and is rated Weak. Its Security & performance tooling dimension scores 0 out of 10, and until that reaches 4, Production Readiness can't be rated higher than Adequate. The first actions are to resolve the 1 Leaked secret finding(s) in REDACTED Scanning and to 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, and if Production Readiness rose to 70, the score would rise from 48 to about 56.

52 findings are critical: 30 in Static Analysis (SAST), 15 in Secrets (history), three in Dependency Vulnerabilities, two in Test Reliability, one in Change Coupling and one in REDACTED Scanning.

Watchdog couldn't measure 12 dimensions in this code, among them Code Coverage, Navigability and Data Protection, so they are left out of the score. The product code is 49,112 lines, which would take an estimated 0.4 person-years, around €55,000, to rebuild.

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

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

If Production Readiness rose from 39 to 70, the lowest score rated Strong, the score would rise from 48 to about 56.

Code composition: what the lines of code are
Product code 82%Tests 18%
New since the last survey: 37 findings

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

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

Fixed since the last survey: 31 findings

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

  • Cyclomatic Complexity · SelfdriveD.__init__ (cyclomatic 16) openpilot/selfdrive/selfdrived/selfdrived.py
  • Cognitive Complexity · pandad.main (cognitive 19) openpilot/selfdrive/pandad/pandad.py
  • Cognitive Complexity · TogglesLayout._update_toggles (cognitive 18) openpilot/selfdrive/ui/layouts/settings/toggles.py
  • God Classes · FileTooLong: comma/modem.py openpilot/common/hardware/comma/modem.py
  • God Classes · TooManyMethods: Modem openpilot/common/hardware/comma/modem.py
  • Code Duplication · Duplicated block (34 lines × 2) openpilot/selfdrive/ui/mici/onroad/model_renderer.py
  • Code Duplication · Duplicated block (15 lines × 2) openpilot/selfdrive/ui/mici/onroad/model_renderer.py
  • Code Duplication · Duplicated block (14 lines × 2) openpilot/selfdrive/ui/mici/onroad/augmented_road_view.py
  • Code Duplication · Duplicated block (11–13 lines × 3) openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py
  • Code Duplication · Duplicated block (10 lines × 2) openpilot/selfdrive/ui/mici/onroad/model_renderer.py
  • Code Duplication · Duplicated block (10 lines × 2) openpilot/selfdrive/ui/mici/onroad/model_renderer.py
  • Code Duplication · Duplicated block (10 lines × 2) openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py
  • Code Duplication · Duplicated block (9 lines × 3) openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py
  • Code Duplication · Duplicated block (7 lines × 6) openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py
  • Code Duplication · Duplicated block (7 lines × 4) openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py
  • Code Duplication · Duplicated block (6 lines × 2) openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py
  • Test Reliability · Test declared unreliable: test_clean_exit openpilot/system/manager/test/test_manager.py
  • Churn × Complexity Hotspots · Hotspot: openpilot/tools/lib/file_downloader.py openpilot/tools/lib/file_downloader.py
  • Explicit Debt · TodoComment openpilot/common/swaglog.py
  • Explicit Debt · TodoComment openpilot/selfdrive/pandad/pandad.py
  • Explicit Debt · TodoComment openpilot/selfdrive/pandad/tests/test_pandad_spi.py
  • Explicit Debt · TodoComment openpilot/selfdrive/test/process_replay/test_fuzzy.py
  • Explicit Debt · TodoComment openpilot/system/manager/test/test_manager.py
  • Explicit Debt · TodoComment openpilot/system/manager/test/test_manager.py
  • Explicit Debt · TodoComment openpilot/system/ui/lib/scroll_panel2.py
  • Explicit Debt · TodoComment openpilot/tools/lib/log_time_series.py
  • Explicit Debt · TodoComment openpilot/tools/lib/log_time_series.py
  • Supply-chain Provenance & Signing REDACTED
  • Exception handling · Swallowed exception (empty catch) openpilot/common/hardware/comma/modem.py
  • Exception handling · Swallowed exception (caught, then discarded) openpilot/common/hardware/comma/modem.py
  • Exception handling · Swallowed exception (caught, then discarded) tools/scripts/filter_log_message.py
Rebuild cost: about €55,000 · Estimate
Cost to rebuild€18,000 to €92,000, for 304 to 964 hours of work, about 0.4 person-years for one engineer
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.7 at a score of 48. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeMedium: 49,112 lines of product code

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

Top priorities

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

1
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED.
Raises the score by about 7 points · 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.
Raises the score by about 6 points · Medium effort · Security & performance tooling
3
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.
Raises the score by about 4 points · Medium effort · A11y enforcement

Diagnosis: what the measurements show together

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

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

Architecture: which parts of the code depend on which

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

326 modules, with 227 dependencies between them. One loop runs through 2 of the modules, marked above the diagonal.

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

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 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 common11 common.hardware.base12 selfdrive.ui.tests.diff13 system.ui.lib14 system.ui.lib.cellular_manager15 system.ui.widgets.list_view16 system.webrtc.webrtcd17 system.ui.widgets18 selfdrive.ui.layouts.settings.settings19 selfdrive.ui.mici.onroad.cameraview20 selfdrive.ui.mici.widgets.button21 selfdrive.ui.mici.widgets.info22 selfdrive.ui.onroad.cameraview23 selfdrive.ui.widgets.ssh_key24 system.ui.widgets.button25 system.ui.widgets.nav_widget26 selfdrive.ui.mici.layouts.settings.network27 selfdrive.ui.mici.onroad.augmented_road_view28 selfdrive.ui.mici.onroad.cabin_camera_dialog29 system.ui.widgets.scroller30 selfdrive.ui.mici.layouts.onboarding31 selfdrive.ui.mici.layouts.settings.firehose32 selfdrive.ui.mici.layouts.settings.network.wifi_ui33 selfdrive.ui.mici.layouts.settings.software34 selfdrive.ui.mici.widgets.dialog35 system.ui.mici_setup36 selfdrive.ui.mici.layouts.settings.device.device_layout37 selfdrive.ui.mici.layouts.settings.initial_cruise_speed38 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 common1
11 common.hardware.base1
12 selfdrive.ui.tests.diff1
13 system.ui.lib1
14 system.ui.lib.cellular_manager1
15 system.ui.widgets.list_view22
16 system.webrtc.webrtcd21
17 system.ui.widgets31
18 selfdrive.ui.layouts.settings.settings12
19 selfdrive.ui.mici.onroad.cameraview11
20 selfdrive.ui.mici.widgets.button61
21 selfdrive.ui.mici.widgets.info1
22 selfdrive.ui.onroad.cameraview11
23 selfdrive.ui.widgets.ssh_key111
24 system.ui.widgets.button23
25 system.ui.widgets.nav_widget12
26 selfdrive.ui.mici.layouts.settings.network112
27 selfdrive.ui.mici.onroad.augmented_road_view1211
28 selfdrive.ui.mici.onroad.cabin_camera_dialog111
29 system.ui.widgets.scroller32
30 selfdrive.ui.mici.layouts.onboarding1215
31 selfdrive.ui.mici.layouts.settings.firehose11
32 selfdrive.ui.mici.layouts.settings.network.wifi_ui24321
33 selfdrive.ui.mici.layouts.settings.software2312
34 selfdrive.ui.mici.widgets.dialog1111
35 system.ui.mici_setup2124
36 selfdrive.ui.mici.layouts.settings.device.device_layout13132
37 selfdrive.ui.mici.layouts.settings.initial_cruise_speed111
38 selfdrive.ui.mici.layouts.settings.network.esim_ui21211121
39 system.ui.mici_reset111
40 system.ui.mici_updater111
Uses a module listed above itPart of a loopThe module itself
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 common11 common.hardware.base12 selfdrive.ui.tests.diff13 system.ui.lib14 system.ui.lib.cellular_manager15 system.ui.widgets.list_view16 system.webrtc.webrtcd17 system.ui.widgets18 selfdrive.ui.layouts.settings.settings19 selfdrive.ui.mici.onroad.cameraview20 selfdrive.ui.mici.widgets.button21 selfdrive.ui.mici.widgets.info22 selfdrive.ui.onroad.cameraview23 selfdrive.ui.widgets.ssh_key24 system.ui.widgets.button25 system.ui.widgets.nav_widget26 selfdrive.ui.mici.layouts.settings.network27 selfdrive.ui.mici.onroad.augmented_road_view28 selfdrive.ui.mici.onroad.cabin_camera_dialog29 system.ui.widgets.scroller30 selfdrive.ui.mici.layouts.onboarding31 selfdrive.ui.mici.layouts.settings.firehose32 selfdrive.ui.mici.layouts.settings.network.wifi_ui33 selfdrive.ui.mici.layouts.settings.software34 selfdrive.ui.mici.widgets.dialog35 system.ui.mici_setup36 selfdrive.ui.mici.layouts.settings.device.device_layout37 selfdrive.ui.mici.layouts.settings.initial_cruise_speed38 selfdrive.ui.mici.layouts.settings.network.esim_ui39 system.ui.mici_reset40 system.ui.mici_updatercereal.messaging1cereal.visionipc2common.esim.base3common.params4selfdrive.controls.lib.latcontrol5system.sensord.sensors.i2c_sensor6system.ubloxd.binary_struct7system.ui.lib.application8system.ui.lib.wifi_manager9common10common.hardware.base11selfdrive.ui.tests.diff12system.ui.lib13system.ui.lib.cellular_manager14system.ui.widgets.list_view15system.webrtc.webrtcd16system.ui.widgets17selfdrive.ui.layouts.settings.settings18selfdrive.ui.mici.onroad.cameraview19selfdrive.ui.mici.widgets.button20selfdrive.ui.mici.widgets.info21selfdrive.ui.onroad.cameraview22selfdrive.ui.widgets.ssh_key23system.ui.widgets.button24system.ui.widgets.nav_widget25selfdrive.ui.mici.layouts.settings.network26selfdrive.ui.mici.onroad.augmented_road_view27selfdrive.ui.mici.onroad.cabin_camera_dialog28system.ui.widgets.scroller29selfdrive.ui.mici.layouts.onboarding30selfdrive.ui.mici.layouts.settings.firehose31selfdrive.ui.mici.layouts.settings.network.wifi_ui32selfdrive.ui.mici.layouts.settings.software33selfdrive.ui.mici.widgets.dialog34system.ui.mici_setup35selfdrive.ui.mici.layouts.settings.device.device_layout36selfdrive.ui.mici.layouts.settings.initial_cruise_speed37selfdrive.ui.mici.layouts.settings.network.esim_ui38system.ui.mici_reset39system.ui.mici_updater40111112221311211611111112312112121111132121511243212312111121241313211121211121111111+286 more modules (most-connected shown)

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

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

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

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

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

At a glance — Accessibility · 47% · Adequate ·

At a glance — Performance · 100% · Exemplary ·

Security & Compliance — OWASP Top-10 mapping

Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).

OWASP categoryFindingsSeverity
A05:2025 — Injection46High / Critical
A07:2025 — Authentication Failures17High / Critical
A03:2025 — Software Supply Chain Failures14High / Critical

Roadmap

Immediately resolve the leaked secret, specifically the REDACTED file, to eliminate critical exposure. Integrate static analysis into the CI pipeline to block security regressions and enforce accessibility standards within existing tests to prevent future violations. Finally, establish a draft release process to allow for safe rollbacks before any build reaches users.

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.0 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.+5.6 ptsMediumSecurity & performance tooling
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.+3.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.+3.4 ptsMediumPage structure
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.+2.4 ptsMediumDeployment & Rollback
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.+2.0 ptsMediumObservability
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.+1.1 ptsMediumArchitecture documentation
Resolve the 8 REDACTED finding(s) in Secrets (history) — start with REDACTED (2), REDACTED, REDACTED.+0.5 ptsLowSecrets (history)

File quality

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

FileScoreBandWorst signal
REDACTED2.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.3SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED3.0MixedStatic Analysis (SAST): High: REDACTED
REDACTED3.7MixedStatic Analysis (SAST): High: REDACTED
REDACTED3.7MixedStatic Analysis (SAST): High: REDACTED
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.8MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.8MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.8MixedSecrets (history): High secret: REDACTED
REDACTED5.8MixedSecrets (history): High secret: REDACTED
REDACTED5.8MixedSecrets (history): High secret: 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

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

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

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

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

Could not be resolved — 13

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

Methodology & how to trust this report

Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 55 of 59 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 — 59 dimensions across the health lenses
D1D2D3D4D6D9D12D13D14D15D16D17D19D21D22D26D28D29D30D34D35D36D37D43D44AC3AC7AX10AX3AX4M1M2M3M4P1P10P2P3P4P6PF3X1X12X13X14X15X17X19X21X22X23X24X25X26X27X28X3X30X4

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, 640 of 660 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 01a170ef-633e-7ade-8adf-b72295f3c4b8.

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 63 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,799 lines, 36% of production source), .c (8,494 lines, 10% 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 2 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.
  • D26 Project Cohesion — 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. Project size and spread are measured over build units whose source a code model reads. This repository's .cc, .c source is a material share of its production lines and was read by none, so the score is a verdict about the units that were read. Not a finding that the unread source is cohesive — it is unmeasured.
  • D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • AX6 Interface segregation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • AXB1 Runtime evidence locked — no reproducible boot — 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. Subject: 2 markup document(s) — HTML, Razor, JSX, Vue, Svelte or server templates. The Runtime Evidence tier boots an app only via docker-compose, an Aspire AppHost, a Dockerfile, an npm dev script, a web service's own toolchain entry point (cargo, go, dotnet, Python, Spring Boot), or an Android app's own Gradle wrapper (run on an emulator); an Apple or Flutter app needs a host it lacks. None applied, so no live runtime a11y/egress/header evidence was collected. You can widen what we reach: add a docker-compose.yml (or an Aspire AppHost) that brings the app up with its dependencies. Watchdog then boots it in an isolated sandbox and gathers real runtime evidence — you change nothing in your pipeline (no CI step, no SDK).
  • C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
  • GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and no C#, F#, JavaScript/TypeScript, Dart, Ruby or Scala was found, and this repository's Python, c, cpp is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and no C#, JavaScript/TypeScript, Java, Dart, Ruby or Scala was found, and this repository's Python, c, cpp is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
  • S1 Web-Security Posture — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
  • X16 Unfloored truncation loop — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X18 Disposal-pattern correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala or PHP was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X29 Per-element action decided by a fixed element — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Rust, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, Rust, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X3 Exception handling — 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. 1 further occurrence(s) are not listed individually; the score already reflects all 41.
  • X5 Nullable reference types — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax and MSBuild project configuration, TypeScript source and its tsconfig files, Java source and its package and module declarations, PHP source and its PHPStan and Psalm configuration, Dart source and its pubspec language version, Ruby source and its Sorbet and Steep configuration, Scala source and its build's explicit-nulls, WartRemover and Scalafix settings, and Kotlin source only, and no C# was loaded, no TypeScript was found, and this repository's C, Cpp, Python is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.

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

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
  • 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.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • 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

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

SelfdriveD.update_events (cyclomatic 157)openpilot/selfdrive/selfdrived/selfdrived.py:150
hardwared.hardware_thread (cyclomatic 64)openpilot/system/hardware/hardwared.py:202
modeld.main (cyclomatic 48)REDACTED:231
qcomgpsd.main (cyclomatic 47)openpilot/system/qcomgpsd/qcomgpsd.py:182
serve._render_blocks (cyclomatic 46)docs/serve.py:283

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

What to do

  1. Bring the 2 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with SelfdriveD.update_events (cyclomatic 157), hardwared.hardware_thread (cyclomatic 64). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 2 together lifts Cyclomatic Complexity from 5.5 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
  2. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D2 · Cognitive Complexity3.2 / 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.2 / 10 · rule-coverage 100% · ceiling Prevented

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

SelfdriveD.update_events (cognitive 192)openpilot/selfdrive/selfdrived/selfdrived.py:150
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 111)openpilot/system/hardware/hardwared.py:202
qcomgpsd.main (cognitive 105)openpilot/system/qcomgpsd/qcomgpsd.py:182

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

What to do

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

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

D3 · God Classes9.1 / 10Stronggated by 11 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.1 / 10 · rule-coverage 100% · ceiling Prevented

11 god class(es) detected.

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

What to do

  1. Resolve the 7 FileTooLong finding(s) in God Classes — start with REDACTED, events.py, wifi_manager.py. — One of this dimension's main actionable groups (7 warning-level).
  2. Resolve the 4 TooManyMethods finding(s) in God Classes — start with wifi_manager.py, REDACTED, hardware.py. — One of this dimension's main actionable groups (4 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.4 / 10Stronggated by 64 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.4 / 10 · rule-coverage 100% · ceiling Verified

63 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, .c (45% 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 (11 lines × 2) · ×6openpilot/selfdrive/ui/mici/onroad/model_renderer.py:53
Duplicated block (12 lines × 2) · ×5openpilot/common/transformations/transformations.py:277
Duplicated block (10 lines × 2) · ×4openpilot/selfdrive/car/card.py:262
Duplicated block (7 lines × 2) · ×4openpilot/selfdrive/locationd/locationd.py:103

+ 23 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 (11 lines × 2) finding(s) in Code Duplication — start with model_renderer.py (3), generate_report.py (2), mici_reset.py. — One of this dimension's main actionable groups (6 warning-level).
  3. Resolve the 5 Duplicated block (12 lines × 2) finding(s) in Code Duplication — start with mpc_longitudinal_tuning_report.py (2), transformations.py, wifi_manager.py. — One of this dimension's main actionable groups (5 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.

D6 · Cohesion (LCOM4)9.9 / 10Stronggated by 3 serious findings✓ Tool-verified

What it measures: Whether a class's methods are focused on a single responsibility.

Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.

Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.

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

3 of 255 classes have LCOM4 above 3.

Low cohesion: OnboardingWindow (LCOM4 5) · ×3openpilot/selfdrive/ui/mici/layouts/onboarding.py:305

What to do

  1. Resolve the 3 Low cohesion finding(s) in Cohesion (LCOM4) — start with onboarding.py, device.py, ui_state.py. — One of this dimension's main actionable groups (3 warning-level).
  2. Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

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

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

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

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

349 test methods: 349 unit, 0 integration, 0 BDD, 0 e2e. The Python suite contributes 349 test function(s) across 69 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 14 shipped distributions were graded against pypi.org (0 not published there, 13 declared without an exact pin, which installs the newest release the declaration admits and so cannot be behind one). Only EXACT pins are graded for currency: a floor or a range already installs the newest release it admits, so reporting one would report this repository for being current. Whether a deliberate upper cap has itself gone stale is a different and weaker question, and is not asked. Whether any distribution is UNMAINTAINED is not graded — PyPI publishes no maintenance status, and release age does not stand in for one. Lockfiles are not read (poetry.lock, REDACTED, Pipfile.lock, pdm.lock), so a lock-resolved install is outside this verdict. Known CVEs in this dependency graph are D30's question.

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 24 shipped Python distribution(s) use a banned license. Licences were resolved from PyPI over the distributions a consumer installs — this repository's 14 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. 9 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.4 / 10Stronggated by 13 serious findings✓ Tool-verified

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

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

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

Top hotspots: openpilot/selfdrive/selfdrived/selfdrived.py (19×157=2983); REDACTED (41×48=1968); openpilot/system/hardware/hardwared.py (16×64=1024)

Hotspot: openpilot/selfdrive/selfdrived/selfdrived.py · ×13openpilot/selfdrive/selfdrived/selfdrived.py:150

What to do

  1. Resolve the 13 Hotspot finding(s) in Churn × Complexity Hotspots — start with selfdrived.py, REDACTED, hardwared.py. — One of this dimension's main actionable groups (13 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

27 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is REDACTED. Counted over 237 of the 405 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
Further sole-owners (lower concentration)

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).
  2. Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).

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

D17 · Explicit Debt9.3 / 10Stronggated by 177 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

177 deducted task-comment markers across 49112 LoC (0.3/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 · ×170openpilot/cereal/services.py:5
FixmeComment · ×7openpilot/selfdrive/test/process_replay/test_processes.py:35

What to do

  1. Resolve the 170 TodoComment finding(s) in Explicit Debt — start with wifi_manager.py (7), car_events.py (6), __init__.py (4). — One of this dimension's main actionable groups (170 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 repository's root README is excellent: it states what openpilot is (an operating system for robotics upgrading the driver-assistance system in 300+ supported cars), links to docs/CONTRIBUTING and community, shows a quick start with a shell command, and includes a video. The docs/README documents that directory (the docs tree) rather than the repository as a whole; it is clear from context which files are about the project. All READMEs in the set are well written for their directories: tools/* READMEs cover setup, native Linux/macOS, WSL on Windows, CTF, and directory structure, while cereal/README.md dives into messaging specs, backwards-compatibility, custom forks, and DO/NOT rename fields; none is missing. The only unstructured element is the docs/README itself (no headings), but it is a single-file README rather than an unorganized wall of text. The repository is well documented with a strong root CONTRIBUTING.md guide covering installation, what gets merged, what doesn't get merged, and the safety workflow for debugging Panda via replay drive plus LLDB. The READMEs of each tool directory (lateral_maneuvers, lib, longitudinal_maneuvers, plotjuggler, replay, sim) are focused on that directory rather than the repository as a whole but each is clear about its purpose and contains usage examples for what it exposes. All visible documents are complete per their outlines: missing-overview, missing-installation, or missing-usage only apply to the root README. The documentation is excellent for its focus on safety and limitations. The README files are thin but the real depth lies in LIMITATIONS.md (727 words) covering ALC/LDW, ACC/FCW, and DM components with a detailed failure-mode list plus driver alertness requirements, and SAFETY.md explaining openpilot's failsafe passive design, NHTSA compliance, ISO26262, MISRA C coding guidelines, and two safety requirements. The architecture/design docs are also present but not shown in the summary. The visible content is clear, complete, well-structured, and scoped to its own directory; no defects.

Documentation: contradicts the codedocs/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 808 exposed types.

Redundant naming for identical operations. Both methods appear to retrieve a single message from a socket, returning None if no message is available. The distinction between 'one' and 'one_or_none' is semantically unclear and likely confusing to users.
Overlap in intent. `all_readers_updated` checks if readers have updated, while `wait_for_readers_to_update` waits for them. However, `wait_for_readers_to_update` takes a `dt` parameter which is unusual for a 'wait' function (usually timeout is sufficient), and the naming suggests `wait` implies blocking while `all` implies checking. If `wait` is non-blocking, it should be named `check`. If it is blocking, the `dt` parameter is redundant with `timeout` or unclear.
Method duplication in inheritance hierarchy. `HardwareComma` inherits from `HardwareBase` (implied by context of other methods like `get_serial`, `reboot`, etc. being present in both). `get_modem_state` is defined in both, suggesting either a lack of polymorphism or redundant implementation in the subclass without overriding behavior.

What to do

  1. Resolve the 1 Redundant naming for identical operations. Both methods appear to… 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 if readers have updated,… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 Method duplication in inheritance hierarchy. `HardwareComma` inherits… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).

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

D26 · Project Cohesion0.0 / 10Critical✓ Tool-verified

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

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

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

2 of 3 build units (Python) flagged as possibly oversized/incoherent. This repository's .cc, .c source was read by no build unit, so this covers part of the tree, not all of it.

Projects may be oversized for their cohesion

What to do

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

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

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

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

REDACTED
REDACTED
REDACTED

What to do

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

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

D29 · Static Analysis (SAST)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 Vulnerabilities6.6 / 10Adequate✓ Tool-verified

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

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

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

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

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

What to do

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

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

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

12 of 237 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 237 of the 405 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned file · ×12openpilot/system/qcomgpsd/structs.py:1
Orphaned files with no living knowledge

✓ On the Gold path — maintain.

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

D35 · Change 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:1
Change coupling: manager.py ↔ REDACTED · ×3openpilot/system/manager/manager.py:1
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 3 Change coupling finding(s) in Change Coupling — start with manager.py, metadrive_bridge.py, developer.py. — One of this dimension's main actionable groups (3 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

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

What to do

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

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.md.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

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

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.
AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

M1 · Documentation (README)6.0 / 10Adequate✓ Tool-verified

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

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

What to do

  • Add a build/run (quick start) section to the root README — the first thing a newcomer needs.
  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
  • Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
M2 · Architecture 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 your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
M3 · Folder & project 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 accuracy9.5 / 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.

  • docs/SAFETY.md links to `For`, but `docs/For` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/SAFETY.md:32
  • docs/concepts/safety.md links to `For`, but `docs/concepts/For` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/concepts/safety.md:32
  • docs/how-to/car-port.md names `radar_interface.py`, but no file or folder `radar_interface.py` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/how-to/car-port.md:22
  • docs/how-to/car-port.md names `openpilot/selfdrive/car/car_specific.py`, but no file or folder `openpilot/selfdrive/car/car_specific.py` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/how-to/car-port.md:33

What to do

  • Reconcile the README with reality: docs/SAFETY.md links to `For`, but `docs/For` does not exist; docs/concepts/safety.md links to `For`, but `docs/concepts/For` does not exist; docs/how-to/car-port.md names `radar_interface.py`, but no file or folder `radar_interface.py` exists; docs/how-to/car-port.md names `openpilot/selfdrive/car/car_specific.py`, but no file or folder `openpilot/selfdrive/car/car_specific.py` exists.
P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

P2 · Observability5.5 / 10Adequate✓ Tool-verified

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

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

  • Only 1/2 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `openpilot/system/ui`.

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
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 43326 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.

PF3 · Async & latency hygiene10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

X17 · Uncapped recursion over a caller-supplied document2.7 / 10Weak✓ Tool-verified

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

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

  • `capnp_random_dict` is public, takes a document from its caller (line 195) and hands it to `rec`, which calls itself at line 220 (`rec`) with a piece of `field_type` — and nowhere in `rec` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `rec` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — openpilot/common/fuzzy.py:220
  • `to_json` is public and takes `msg_content: Any` from its caller, and it calls itself at line 93 (`self.to_json`) with a piece of `msg_content` — and nowhere in `to_json` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `to_json` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — openpilot/system/webrtc/webrtcd.py:93

What to do

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

X3 · Exception handling5.5 / 10Adequate✓ Tool-verified

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

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

  • `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×18) — REDACTED:51, openpilot/common/hardware/base.py:69, openpilot/common/hardware/comma/hardware.py:302, …
  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×21) — openpilot/common/esim/lpa.py:184, openpilot/common/esim/lpa.py:223, openpilot/common/esim/lpa.py:629, …
  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. On a teardown path letting it propagate is not an option (throwing out of `__del__()` masks the failure already in flight and abandons the rest of the cleanup), so make the swallow deliberate instead: narrow the catch to the exception this release can actually raise, and record it through whatever this codebase already uses to report problems — or, if it truly cannot matter, say why in a comment on the catch. — openpilot/selfdrive/ui/mici/layouts/settings/firehose.py:65

What to do

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

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

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

X4 · Structured logging4.8 / 10Adequate✓ Tool-verified

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

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

  • `warning` at line 284 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — REDACTED:284
  • `info` at line 626 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — openpilot/system/webrtc/webrtcd.py:626
  • `info` at line 103 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — openpilot/tools/clip/run.py:103
  • `info` at line 298 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — openpilot/tools/clip/run.py:298
  • `info` at line 360 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — openpilot/tools/clip/run.py:360
  • `info` at line 361 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — openpilot/tools/clip/run.py:361

What to do

  • Interpolated log message defeats structured logging

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 Health65%Adequate — gated by D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture85%Adequate — gated by D26Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity59%Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness39%Weak — gated by D12, P3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security59%Adequate — gated by D28, D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility47%AdequateAcceptable, with room to improve.
Performance100%ExemplaryStrongest area.
Unscored — 3 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 — 2 observation(s) recorded · This repository declares 2 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.
  • X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 5 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 control(s) we could not find positive evidence for

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

  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 56 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 — Not applicable: this repository's Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads.
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • AXB1 Runtime evidence locked — no reproducible boot — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C2 Access Controls — No access-control surface detected in the analyzed source — this repository registers no route and starts no server another machine can reach (no Flask/FastAPI/Starlette route, Django urlpatterns or class-based view, Tornado handler). Access control is therefore N/A here — a library or command-line tool is authorized by the application that serves it, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
  • C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Django, SQLAlchemy, SQLModel, Peewee, Tortoise or MongoEngine model, a migration or a SQL schema — and no database or data-store client (Django ORM, SQLAlchemy, psycopg, PyMongo, …) in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a store configured outside this repository, for instance), the trail belongs to wherever that data is stored.
  • C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential on a Django, SQLAlchemy, SQLModel, Peewee, Tortoise or mongoengine model, in a migration or in a SQL schema — and no database or data-store client (django.db, sqlalchemy, psycopg2, pymongo, sqlite3, …) imported either, so this repository keeps no personal data whose lifetime a retention limit would bound.
  • C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential on a Django, SQLAlchemy, SQLModel, Peewee, Tortoise or mongoengine model, in a migration or in a SQL schema — and no database or data-store client (django.db, sqlalchemy, psycopg2, pymongo, sqlite3, …) imported either, so this repository keeps no personal data for a data subject to erase, export or consent over.
  • D10 Test Quality — ~10710 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 — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ projects each declaring an entity of their own. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — No inline comments to assess — comment value is not applicable here.
  • D25 ADR Conformance — no ADRs to check
  • D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.py), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • 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 — Not applicable — this Python build ships 1 production module(s), so there is no coupling BETWEEN modules to measure. (Its test and non-production modules are not part of the shipped graph.)
  • 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 (28 value object(s))
  • ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the Python source, so there is no service whose uptime a failing dependency could take down
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (`coverage run -m pytest` then `coverage xml`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for a pytest-benchmark or pytest-codspeed dependency with tests taking the `benchmark` fixture, an asv.conf.json with its `time_`/`mem_`/`peakmem_` benchmarks, or a pyperf Runner, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
  • PF2 Allocation hygiene — Not applicable: Python runs on a garbage-collected runtime that gives a program no allocation-control idiom to choose on a hot path — no pools, stack allocation or value types — so allocation awareness is not something this code can be rated on.
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • X16 Unfloored truncation loop — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X18 Disposal-pattern correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X2 Cancellation propagation — no C# was loaded; this repository's Python was read, and no request in it can be cancelled by a caller — a Python request takes no token: asyncio cancels the task and trio or anyio the scope that made it, from outside the call, and requests, httpx, aiohttp and gRPC take a timeout, not a cancellation
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X29 Per-element action decided by a fixed element — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

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

Critical — 52 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 · ×8
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D28 · Secrets (history) · High secret · ×7
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D11 · Test Reliability · Test declared unreliable · ×2
  • 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
D30 · Dependency Vulnerabilities · Critical CVE · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Critical vulnerability · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · High CVE · ×1
  • REDACTED
D35 · Change Coupling · Boundary-crossing change coupling · ×1
  • Boundary-crossing change coupling: REDACTED ↔ qlog_size.py REDACTED:1 — `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 — 529 finding(s)
D17 · Explicit Debt · TodoComment · ×170
  • 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:88 — # 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:153 — # 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/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:66 — # 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:45 — # 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:132 — # 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:86 — # 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.
  • TodoComment openpilot/selfdrive/controls/lib/latcontrol_torque.py:101 — # TODO: log lat accel? — 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.
  • + 145 more in this group — see findings.md.
X3 · Exception handling · Swallowed exception (empty catch) · ×22
  • Swallowed exception (empty catch) openpilot/common/esim/lpa.py:184 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) openpilot/common/esim/lpa.py:223 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) openpilot/common/esim/lpa.py:629 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) openpilot/common/esim/lpa.py:633 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) openpilot/common/hardware/comma/hardware.py:130 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) openpilot/common/hardware/comma/hardware.py:204 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) openpilot/common/hardware/comma/hardware.py:242 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) openpilot/common/hardware/comma/hardware.py:281 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) openpilot/common/hardware/comma/hardware.py:292 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) openpilot/selfdrive/car/card.py:127 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) openpilot/selfdrive/modeld/helpers.py:29 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) openpilot/selfdrive/ui/mici/layouts/settings/firehose.py:65 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. On a teardown path letting it propagate is not an option (throwing out of `__del__()` masks the failure already in flight and abandons the rest of the cleanup), so make the swallow deliberate instead: narrow the catch to the exception this release can actually raise, and record it through whatever this codebase already uses to report problems — or, if it truly cannot matter, say why in a comment on the catch.
  • Swallowed exception (empty catch) REDACTED:34 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) REDACTED:150 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) openpilot/system/hardware/hardwared.py:405 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) openpilot/system/manager/manager.py:161 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) openpilot/system/manager/manager.py:217 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) openpilot/system/manager/build.py:41 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) openpilot/system/qcomgpsd/qcomgpsd.py:177 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) openpilot/system/webrtc/webrtcd.py:351 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) openpilot/system/webrtc/webrtcd.py:451 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) openpilot/system/webrtc/webrtcd.py:515 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×18
  • Swallowed exception (caught, then discarded) REDACTED:51 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) openpilot/common/hardware/base.py:69 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) openpilot/common/hardware/comma/hardware.py:302 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) openpilot/common/hardware/comma/hardware.py:343 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) openpilot/system/ubloxd/ubloxd.py:197 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) openpilot/system/ubloxd/ubloxd.py:365 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) openpilot/system/ubloxd/ubloxd.py:378 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) openpilot/system/ubloxd/ubloxd.py:391 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) openpilot/system/ubloxd/ubloxd.py:404 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) openpilot/system/ubloxd/ubloxd.py:421 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) openpilot/system/ubloxd/ubloxd.py:529 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) openpilot/system/ui/tici_updater.py:76 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) openpilot/system/ui/mici_updater.py:128 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) REDACTED:396 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) openpilot/system/updated/updated.py:89 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) openpilot/system/webrtc/webrtcd.py:504 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) openpilot/tools/lib/auth_config.py:16 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) openpilot/tools/lib/auth.py:142 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
D15 · Churn × Complexity Hotspots · Hotspot · ×13
  • Hotspot: openpilot/selfdrive/selfdrived/selfdrived.py openpilot/selfdrive/selfdrived/selfdrived.py:150 — openpilot/selfdrive/selfdrived/selfdrived.py changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 157 in SelfdriveD.update_events at line 150. 4 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-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 13:01:07 -07:00' --until='2026-10-24 13:01:07 -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:231 — REDACTED changed 41 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in modeld.main at line 231. 6 of those changes were fix/bug commits, and the other 35 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 13:01:07 -07:00' --until='2026-10-24 13:01:07 -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:202 — openpilot/system/hardware/hardwared.py changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 64 in hardwared.hardware_thread at line 202. 2 of those changes were fix/bug commits, and the other 14 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 13:01:07 -07:00' --until='2026-10-24 13:01:07 -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: openpilot/system/hardware/chestnut/status.py openpilot/system/hardware/chestnut/status.py:31 — openpilot/system/hardware/chestnut/status.py changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in ChestnutStatus.update at line 31. 2 of those changes were fix/bug commits, 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-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 13:01:07 -07:00' --until='2026-10-24 13:01:07 -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/selfdrive/ui/ui_state.py openpilot/selfdrive/ui/ui_state.py:217 — openpilot/selfdrive/ui/ui_state.py changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in UIState._update_chestnut_state at line 217. 1 of those changes was a fix/bug commit, and the other 14 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 13:01:07 -07:00' --until='2026-10-24 13:01:07 -07:00' --full-history --no-merges -- openpilot/selfdrive/ui/ui_state.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: openpilot/system/ui/lib/scroll_panel2.py openpilot/system/ui/lib/scroll_panel2.py:143 — openpilot/system/ui/lib/scroll_panel2.py changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in GuiScrollPanel2._handle_mouse_event at line 143. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 13:01:07 -07:00' --until='2026-10-24 13:01:07 -07:00' --full-history --no-merges -- openpilot/system/ui/lib/scroll_panel2.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:297 — openpilot/system/webrtc/webrtcd.py changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in StreamSession.message_handler at line 297. 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-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 13:01:07 -07:00' --until='2026-10-24 13:01:07 -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/tools/replay/ui.py openpilot/tools/replay/ui.py:32 — openpilot/tools/replay/ui.py changed 5 times in last 90 days, and the most complex body those changes touched has 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-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 13:01:07 -07:00' --until='2026-10-24 13:01:07 -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/system/ui/widgets/label.py openpilot/system/ui/widgets/label.py:461 — openpilot/system/ui/widgets/label.py changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in UnifiedLabel._render at line 461. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 13:01:07 -07:00' --until='2026-10-24 13:01:07 -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/selfdrive/locationd/paramsd.py openpilot/selfdrive/locationd/paramsd.py:66 — openpilot/selfdrive/locationd/paramsd.py changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in VehicleParamsLearner.handle_log at line 66. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 13:01:07 -07:00' --until='2026-10-24 13:01:07 -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/locationd/locationd.py openpilot/selfdrive/locationd/locationd.py:264 — openpilot/selfdrive/locationd/locationd.py changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in locationd.main at line 264. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 13:01:07 -07:00' --until='2026-10-24 13:01:07 -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: openpilot/selfdrive/ui/onroad/model_renderer.py openpilot/selfdrive/ui/onroad/model_renderer.py:74 — openpilot/selfdrive/ui/onroad/model_renderer.py changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in ModelRenderer._render at line 74. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 13:01:07 -07:00' --until='2026-10-24 13:01:07 -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/selfdrive/car/card.py openpilot/selfdrive/car/card.py:66 — openpilot/selfdrive/car/card.py changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in Car.__init__ at line 66. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 13:01:07 -07:00' --until='2026-10-24 13:01:07 -07:00' --full-history --no-merges -- openpilot/selfdrive/car/card.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
D4 · Code Duplication · Duplicated block (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:259-264 — 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/selfdrive/ui/mici/onroad/model_renderer.py:213 — openpilot/selfdrive/ui/mici/onroad/model_renderer.py:213-218 | openpilot/selfdrive/ui/onroad/model_renderer.py:167-172 — 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 11 separate duplicated blocks between them, totalling at least 166 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:213` 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/tools/jotpluggler/generate_event_extractors.py:343 — openpilot/tools/jotpluggler/generate_event_extractors.py:343-348 | openpilot/tools/jotpluggler/generate_event_extractors.py:363-368 — both copies are in the same file, so extract the 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:370` calls `emit` and `openpilot/tools/jotpluggler/generate_event_extractors.py:350` 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/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:1006 — # 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.
D3 · God Classes · FileTooLong · ×7
  • FileTooLong: REDACTED REDACTED — FileTooLong — 844 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 344 over it, 1.69× 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 — 553 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 53 over it, 1.11× 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 — 529 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 29 over it, 1.06× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×6
  • Duplicated block (11 lines × 2) openpilot/selfdrive/ui/mici/onroad/model_renderer.py:53 — openpilot/selfdrive/ui/mici/onroad/model_renderer.py:53-63 | openpilot/selfdrive/ui/onroad/model_renderer.py:40-50 — 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 11 separate duplicated blocks between them, totalling at least 166 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/model_renderer.py:66` calls `FirstOrderFilter` and `openpilot/selfdrive/ui/onroad/model_renderer.py:54` 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 (11 lines × 2) openpilot/selfdrive/ui/mici/onroad/model_renderer.py:238 — openpilot/selfdrive/ui/mici/onroad/model_renderer.py:238-248 | openpilot/selfdrive/ui/onroad/model_renderer.py:191-201 — 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 11 separate duplicated blocks between them, totalling at least 166 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:249 — openpilot/selfdrive/ui/mici/onroad/model_renderer.py:249-259 | openpilot/selfdrive/ui/onroad/model_renderer.py:202-212 — 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 11 separate duplicated blocks between them, totalling at least 166 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 (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:122 — openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:122-133 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:231-242 — both copies are in the same file, so extract the 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:122` 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:143 — openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:143-154 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:209-220 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:143` 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:141 — openpilot/selfdrive/ui/mici/onroad/model_renderer.py:141-152 | openpilot/selfdrive/ui/onroad/model_renderer.py:122-133 — 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 11 separate duplicated blocks between them, totalling at least 166 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.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D3 · God Classes · TooManyMethods · ×4
  • 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:61 — TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: 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.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×4
  • Duplicated block (10 lines × 2) openpilot/selfdrive/car/card.py:262 — openpilot/selfdrive/car/card.py:262-271 | openpilot/selfdrive/selfdrived/selfdrived.py:573-582 — 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/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:212 — openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:212-221 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:234-243 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:212` 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:303 — openpilot/selfdrive/ui/mici/onroad/hud_renderer.py:303-312 | openpilot/selfdrive/ui/onroad/hud_renderer.py:158-167 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
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:245-251 — 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:342 — openpilot/selfdrive/ui/mici/onroad/model_renderer.py:342-348 | openpilot/selfdrive/ui/onroad/model_renderer.py:326-332 — 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 11 separate duplicated blocks between them, totalling at least 166 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:403 — openpilot/selfdrive/ui/mici/onroad/model_renderer.py:403-409 | openpilot/selfdrive/ui/onroad/model_renderer.py:387-393 — 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 11 separate duplicated blocks between them, totalling at least 166 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 (5 lines × 2) · ×4
  • 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:329 — openpilot/selfdrive/ui/mici/onroad/model_renderer.py:329-333 | openpilot/selfdrive/ui/onroad/model_renderer.py:286-290 — 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 11 separate duplicated blocks between them, totalling at least 166 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.
D35 · Change Coupling · Change coupling · ×3
  • Change coupling: manager.py ↔ REDACTED openpilot/system/manager/manager.py:1 — `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:1 — `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.
  • Change coupling: developer.py ↔ toggles.py openpilot/selfdrive/ui/mici/layouts/settings/developer.py:1 — `openpilot/selfdrive/ui/mici/layouts/settings/developer.py` and `openpilot/selfdrive/ui/mici/layouts/settings/toggles.py` change together 50% of the time (7 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, 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 7 shared commits counted here, the most recent 3 are `f50108b4` A New Dawn; `0cf294d8` ui: add descriptions for settings (#38867); `b6f3692b` NavWidget: standardize back callback (#37479) (at that commit the files were still `selfdrive/ui/mici/layouts/settings/developer.py` and `selfdrive/ui/mici/layouts/settings/toggles.py`) — run `git show` on any of them.
D36 · Supply-chain Provenance & Signing REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
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:302 — openpilot/selfdrive/ui/mici/onroad/augmented_road_view.py:302-319 | 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×3
  • Low cohesion: OnboardingWindow (LCOM4 5) openpilot/selfdrive/ui/mici/layouts/onboarding.py:305 — OnboardingWindow's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: DeviceLayout (LCOM4 4) openpilot/selfdrive/ui/layouts/settings/device.py:30 — DeviceLayout's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: UIState (LCOM4 4) openpilot/selfdrive/ui/ui_state.py:38 — UIState's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
D4 · Code Duplication · Duplicated block (32 lines × 2) · ×2
  • Duplicated block (32 lines × 2) openpilot/selfdrive/ui/mici/onroad/model_renderer.py:95 — openpilot/selfdrive/ui/mici/onroad/model_renderer.py:95-126 | openpilot/selfdrive/ui/onroad/model_renderer.py:78-109 — 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 11 separate duplicated blocks between them, totalling at least 166 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/model_renderer.py:92` calls `update` and `openpilot/selfdrive/ui/onroad/model_renderer.py:75` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (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 (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 (15 lines × 2) · ×2
  • Duplicated block (15 lines × 2) openpilot/selfdrive/ui/mici/onroad/augmented_road_view.py:349 — openpilot/selfdrive/ui/mici/onroad/augmented_road_view.py:349-363 | 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:69 — openpilot/selfdrive/ui/mici/onroad/model_renderer.py:69-83 | openpilot/selfdrive/ui/onroad/model_renderer.py:54-68 — 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 11 separate duplicated blocks between them, totalling at least 166 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/mici/onroad/model_renderer.py:66` calls `FirstOrderFilter` and `openpilot/selfdrive/ui/onroad/model_renderer.py:51` 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 (14 lines × 2) · ×2
  • Duplicated block (14 lines × 2) openpilot/selfdrive/ui/mici/onroad/augmented_road_view.py:283 — openpilot/selfdrive/ui/mici/onroad/augmented_road_view.py:283-296 | 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.
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/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:88 — openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:88-100 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:115-127 — both copies are in the same file, so extract the 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:88` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×2
  • Duplicated block (11 lines × 3) openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:47 — openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:47-57 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:227-237 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:250-260 — 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:121 — openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:121-131 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:230-240 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:253-263 — 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:121` 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:328 — openpilot/tools/jotpluggler/generate_event_extractors.py:328-335 | openpilot/tools/jotpluggler/generate_event_extractors.py:349-356 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
X17 · Uncapped recursion over a caller-supplied document · Recursive walk over a caller-supplied document has no depth cap · ×2
  • Recursive walk over a caller-supplied document has no depth cap openpilot/common/fuzzy.py:220 — `capnp_random_dict` is public, takes a document from its caller (line 195) and hands it to `rec`, which calls itself at line 220 (`rec`) with a piece of `field_type` — and nowhere in `rec` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `rec` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap openpilot/system/webrtc/webrtcd.py:93 — `to_json` is public and takes `msg_content: Any` from its caller, and it calls itself at line 93 (`self.to_json`) with a piece of `msg_content` — and nowhere in `to_json` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `to_json` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
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 157) · ×1
  • SelfdriveD.update_events (cyclomatic 157) openpilot/selfdrive/selfdrived/selfdrived.py:150 — SelfdriveD.update_events has cyclomatic complexity 157 (threshold 15). To reduce it, separate the cases: extract each independent branch into its 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 64) · ×1
  • hardwared.hardware_thread (cyclomatic 64) openpilot/system/hardware/hardwared.py:202 — hardwared.hardware_thread has cyclomatic complexity 64 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · modeld.main (cyclomatic 48) · ×1
  • modeld.main (cyclomatic 48) REDACTED:231 — modeld.main has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · 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 · 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 · vector_tile.decode_roads (cyclomatic 33) · ×1
  • vector_tile.decode_roads (cyclomatic 33) openpilot/selfdrive/navigation/vector_tile.py:92 — vector_tile.decode_roads 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 · GuiScrollPanel2._handle_mouse_event (cyclomatic 28) · ×1
  • GuiScrollPanel2._handle_mouse_event (cyclomatic 28) openpilot/system/ui/lib/scroll_panel2.py:143 — GuiScrollPanel2._handle_mouse_event has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · 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 · 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 · GuiApplication.render (cyclomatic 25) · ×1
  • GuiApplication.render (cyclomatic 25) REDACTED:603 — GuiApplication.render 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 · 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 · file_downloader.resolve_route_files (cyclomatic 23) · ×1
  • file_downloader.resolve_route_files (cyclomatic 23) openpilot/tools/lib/file_downloader.py:106 — file_downloader.resolve_route_files 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:307 — 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 · StreamSession.message_handler (cyclomatic 21) · ×1
  • StreamSession.message_handler (cyclomatic 21) openpilot/system/webrtc/webrtcd.py:297 — StreamSession.message_handler 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:26 — 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:65 — 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 · Generator.node_emits (cyclomatic 20) · ×1
  • Generator.node_emits (cyclomatic 20) openpilot/tools/jotpluggler/generate_event_extractors.py:217 — Generator.node_emits 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:200 — 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:159 — 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:464 — 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:90 — 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 · SteeringAccuracyTool.update (cyclomatic 18) · ×1
  • SteeringAccuracyTool.update (cyclomatic 18) tools/car_porting/measure_steering_accuracy.py:39 — 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 · 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:849 — 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:415 — 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 192) · ×1
  • SelfdriveD.update_events (cognitive 192) openpilot/selfdrive/selfdrived/selfdrived.py:150 — SelfdriveD.update_events has cognitive complexity 192 (threshold 15). Drivers by points: if/else 81 (116 pts), boolean chains 62, 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 111) · ×1
  • hardwared.hardware_thread (cognitive 111) openpilot/system/hardware/hardwared.py:202 — hardwared.hardware_thread has cognitive complexity 111 (threshold 15). Drivers by points: if/else 28 (64 pts), boolean chains 23, 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 84) · ×1
  • modeld.main (cognitive 84) REDACTED:231 — modeld.main has cognitive complexity 84 (threshold 15). Drivers by points: if/else 23 (46 pts), ternaries 9 (16 pts), boolean chains 11, loops 6 (9 pts), error handling 1 (2 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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:39 — 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 · vector_tile.decode_roads (cognitive 65) · ×1
  • vector_tile.decode_roads (cognitive 65) openpilot/selfdrive/navigation/vector_tile.py:92 — vector_tile.decode_roads has cognitive complexity 65 (threshold 15). Drivers by points: if/else 15 (41 pts), boolean chains 10, loops 4 (9 pts), ternaries 1 (5 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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:26 — 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 · GuiScrollPanel2._handle_mouse_event (cognitive 55) · ×1
  • GuiScrollPanel2._handle_mouse_event (cognitive 55) openpilot/system/ui/lib/scroll_panel2.py:143 — GuiScrollPanel2._handle_mouse_event has cognitive complexity 55 (threshold 15). Drivers by points: if/else 20 (48 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · 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 · 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 · GuiApplication.render (cognitive 49) · ×1
  • GuiApplication.render (cognitive 49) REDACTED:603 — GuiApplication.render has cognitive complexity 49 (threshold 15). Drivers by points: if/else 18 (38 pts), loops 4 (7 pts), boolean chains 3, error handling 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 · 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 13 (14 pts), ternaries 6 (11 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 · 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 · file_downloader.resolve_route_files (cognitive 42) · ×1
  • file_downloader.resolve_route_files (cognitive 42) openpilot/tools/lib/file_downloader.py:106 — file_downloader.resolve_route_files has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (31 pts), loops 5 (8 pts), boolean chains 1, error handling 1, ternaries 1 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · 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 · StreamSession.message_handler (cognitive 36) · ×1
  • StreamSession.message_handler (cognitive 36) openpilot/system/webrtc/webrtcd.py:297 — StreamSession.message_handler has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 2 (6 pts), match/switch 1 (2 pts), boolean chains 1, error handling 1, ternaries 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · athenad.log_handler (cognitive 35) · ×1
  • athenad.log_handler (cognitive 35) REDACTED:849 — 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:993 — 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 · Generator.node_emits (cognitive 34) · ×1
  • Generator.node_emits (cognitive 34) openpilot/tools/jotpluggler/generate_event_extractors.py:217 — Generator.node_emits has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 4, ternaries 1 (3 pts), loops 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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 · file_downloader.cmd_download (cognitive 32) · ×1
  • file_downloader.cmd_download (cognitive 32) openpilot/tools/lib/file_downloader.py:200 — 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 · HardwareComma.get_network_metered (cognitive 31) · ×1
  • HardwareComma.get_network_metered (cognitive 31) openpilot/common/hardware/comma/hardware.py:209 — HardwareComma.get_network_metered has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (22 pts), error handling 2 (5 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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:464 — 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 · 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:159 — 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:65 — 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:307 — 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:90 — 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:270 — 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:415 — 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:66 — 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 · vector_tile.decode_lines (cognitive 20) · ×1
  • vector_tile.decode_lines (cognitive 20) openpilot/selfdrive/navigation/vector_tile.py:64 — vector_tile.decode_lines has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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:306 — 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 · Generator.emit_node (cognitive 20) · ×1
  • Generator.emit_node (cognitive 20) openpilot/tools/jotpluggler/generate_event_extractors.py:96 — Generator.emit_node has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 pts), 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 · 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 · 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:188 — 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:532 — 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 · MapsD.update (cognitive 18) · ×1
  • MapsD.update (cognitive 18) openpilot/selfdrive/navigation/mapsd.py:28 — MapsD.update has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 1 (3 pts), boolean chains 1, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pmtiles.decode_directory (cognitive 18) · ×1
  • pmtiles.decode_directory (cognitive 18) openpilot/selfdrive/navigation/pmtiles.py:40 — pmtiles.decode_directory has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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 · BookmarkIcon._handle_mouse_event (cognitive 18) · ×1
  • BookmarkIcon._handle_mouse_event (cognitive 18) openpilot/selfdrive/ui/mici/onroad/augmented_road_view.py:103 — BookmarkIcon._handle_mouse_event has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 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 · ManagerProcess.stop (cognitive 18) · ×1
  • ManagerProcess.stop (cognitive 18) openpilot/system/manager/process.py:70 — 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:275 — 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:193 — 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 · vector_tile.fields (cognitive 17) · ×1
  • vector_tile.fields (cognitive 17) openpilot/selfdrive/navigation/vector_tile.py:18 — vector_tile.fields has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 1 (4 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 · 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:74 — 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:470 — 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 · 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:89 — ModelRenderer._render has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 3, ternaries 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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._update_leads (cognitive 16) · ×1
  • ModelRenderer._update_leads (cognitive 16) openpilot/selfdrive/ui/mici/onroad/model_renderer.py:154 — ModelRenderer._update_leads has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 5, ternaries 2 (3 pts), loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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.
D2 · Cognitive Complexity · MiciKeyboard._handle_mouse_event (cognitive 16) · ×1
  • MiciKeyboard._handle_mouse_event (cognitive 16) openpilot/system/ui/widgets/mici_keyboard.py:247 — MiciKeyboard._handle_mouse_event has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D22 · Internal API Consistency · Redundant naming for identical operations. Both methods appear to retrieve a single message from a socket, returning None if no message is available. The distinction between 'one' and 'one_or_none' is semantically unclear and likely confusing to users. · ×1
  • Redundant naming for identical operations. Both methods appear to retrieve a single message from a socket, returning None if no message is available. The distinction between 'one' and 'one_or_none' is semantically unclear and likely confusing to users. — Remove `recv_one` or `recv_one_or_none` and keep only one standard name (e.g., `recv_one_or_none` is more explicit about the return type). (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 if readers have updated, while `wait_for_readers_to_update` waits for them. However, `wait_for_readers_to_update` takes a `dt` parameter which is unusual for a 'wait' function (usually timeout is sufficient), and the naming suggests `wait` implies blocking while `all` implies checking. If `wait` is non-blocking, it should be named `check`. If it is blocking, the `dt` parameter is redundant with `timeout` or unclear. · ×1
  • Overlap in intent. `all_readers_updated` checks if readers have updated, while `wait_for_readers_to_update` waits for them. However, `wait_for_readers_to_update` takes a `dt` parameter which is unusual for a 'wait' function (usually timeout is sufficient), and the naming suggests `wait` implies blocking while `all` implies checking. If `wait` is non-blocking, it should be named `check`. If it is blocking, the `dt` parameter is redundant with `timeout` or unclear. — Clarify if `wait_for_readers_to_update` is blocking or non-blocking. If non-blocking, rename to `check_readers_updated`. If blocking, remove `dt` or clarify its role vs `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 · Method duplication in inheritance hierarchy. `HardwareComma` inherits from `HardwareBase` (implied by context of other methods like `get_serial`, `reboot`, etc. being present in both). `get_modem_state` is defined in both, suggesting either a lack of polymorphism or redundant implementation in the subclass without overriding behavior. · ×1
  • Method duplication in inheritance hierarchy. `HardwareComma` inherits from `HardwareBase` (implied by context of other methods like `get_serial`, `reboot`, etc. being present in both). `get_modem_state` is defined in both, suggesting either a lack of polymorphism or redundant implementation in the subclass without overriding behavior. — Remove `get_modem_state` from `HardwareComma` if it delegates to the base class, or ensure it provides distinct functionality and is clearly an override. (signatures: HardwareBase.get_modem_state(self): dict | HardwareComma.get_modem_state(self): dict)
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Medium CVE · ×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:349 — openpilot/selfdrive/ui/mici/onroad/model_renderer.py:349-397 | openpilot/selfdrive/ui/onroad/model_renderer.py:333-381 — 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 11 separate duplicated blocks between them, totalling at least 166 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 (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 (17 lines × 2) · ×1
  • 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 (11–13 lines × 3) · ×1
  • Duplicated block (11–13 lines × 3) openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:125 — openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:125-137 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:146-158 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:164-174 — 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:164` 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 (12 lines × 3) · ×1
  • Duplicated block (12 lines × 3) openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:66 — openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:66-77 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:180-191 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:203-214 — 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:66` 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 (9 lines × 4) · ×1
  • Duplicated block (9 lines × 4) openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:50 — openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:50-58 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:121-129 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:230-238 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:253-261 — 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:50` 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 × 3) · ×1
  • Duplicated block (8 lines × 3) openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:43 — openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:43-50 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:246-253 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:269-276 — 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 (6 lines × 6) · ×1
  • Duplicated block (6 lines × 6) openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:45 — openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:45-50 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:137-142 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:158-163 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:225-230 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:248-253 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:271-276 — 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 (6 lines × 4) · ×1
  • Duplicated block (6 lines × 4) openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:44 — openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:44-49 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:65-70 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:247-252 | openpilot/tools/longitudinal_maneuvers/mpc_longitudinal_tuning_report.py:270-275 — 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 — 78 finding(s)
X10 · Duplicated predicate · Duplicated predicate · ×25
  • Duplicated predicate openpilot/selfdrive/ui/mici/onroad/alert_renderer.py:135 — `COMMA_HARDWARE and not waiting_for_startup` appears character-identically in 2 files — openpilot/selfdrive/ui/mici/onroad/alert_renderer.py, openpilot/selfdrive/ui/onroad/alert_renderer.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate tools/scripts/fingerprint_from_route.py:21 — `c.src % 0x80 == 0 and c.address < 0x800 and c.address not in (0x7df, 0x7e0, 0x7e8)` appears character-identically in 2 files — tools/scripts/fingerprint_from_route.py, tools/scripts/get_fingerprint.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate openpilot/selfdrive/ui/mici/onroad/augmented_road_view.py:330 — `cache_key == self._matrix_cache_key and self._cached_matrix is not None` appears character-identically in 2 files — openpilot/selfdrive/ui/mici/onroad/augmented_road_view.py, openpilot/selfdrive/ui/onroad/augmented_road_view.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate openpilot/selfdrive/ui/mici/layouts/settings/network/esim_ui.py:368 — `front_btn_idx is not None and front_btn_idx > 0` appears character-identically in 2 files — openpilot/selfdrive/ui/mici/layouts/settings/network/esim_ui.py, openpilot/selfdrive/ui/mici/layouts/settings/network/wifi_ui.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate openpilot/selfdrive/ui/mici/onroad/augmented_road_view.py:317 — `hasattr(calib, 'wideFromDeviceEuler') and len(calib.wideFromDeviceEuler) == 3` appears character-identically in 2 files — openpilot/selfdrive/ui/mici/onroad/augmented_road_view.py, openpilot/selfdrive/ui/onroad/augmented_road_view.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate openpilot/selfdrive/ui/mici/onroad/augmented_road_view.py:309 — `len(calib.rpyCalib) != 3 or calib.calStatus != CALIBRATED` appears character-identically in 2 files — openpilot/selfdrive/ui/mici/onroad/augmented_road_view.py, openpilot/selfdrive/ui/onroad/augmented_road_view.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate openpilot/selfdrive/ui/mici/onroad/model_renderer.py:118 — `model_updated or sm.updated['radarState'] or self._transform_dirty` appears character-identically in 2 files — openpilot/selfdrive/ui/mici/onroad/model_renderer.py, openpilot/selfdrive/ui/onroad/model_renderer.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:559 — `not PC and not Params().get_bool("IsOffroad")` appears character-identically in 2 files — REDACTED, openpilot/tools/joystick/joystick_control.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate openpilot/selfdrive/ui/mici/onroad/model_renderer.py:391 — `not allow_invert and left_screen.shape[1] > 1` appears character-identically in 2 files — openpilot/selfdrive/ui/mici/onroad/model_renderer.py, openpilot/selfdrive/ui/onroad/model_renderer.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate openpilot/selfdrive/ui/lib/prime_state.py:63 — `not dongle_id or dongle_id == UNREGISTERED_DONGLE_ID` appears character-identically in 2 files — openpilot/selfdrive/ui/lib/prime_state.py, openpilot/selfdrive/ui/mici/layouts/settings/firehose.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate openpilot/selfdrive/ui/mici/onroad/cameraview.py:350 — `not self._target_client or not self._switching` appears character-identically in 2 files — openpilot/selfdrive/ui/mici/onroad/cameraview.py, openpilot/selfdrive/ui/onroad/cameraview.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate openpilot/selfdrive/ui/mici/onroad/cameraview.py:355 — `not self._target_client.connect(False) or not self._target_client.num_buffers` appears character-identically in 2 files — openpilot/selfdrive/ui/mici/onroad/cameraview.py, openpilot/selfdrive/ui/onroad/cameraview.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate openpilot/selfdrive/ui/mici/onroad/cameraview.py:339 — `not self.client.connect(False) or not self.client.num_buffers` appears character-identically in 2 files — openpilot/selfdrive/ui/mici/onroad/cameraview.py, openpilot/selfdrive/ui/onroad/cameraview.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate openpilot/selfdrive/ui/mici/onroad/augmented_road_view.py:301 — `not self.device_camera and sm.seen['narrowRoadCameraState'] and sm.seen['deviceState']` appears character-identically in 2 files — openpilot/selfdrive/ui/mici/onroad/augmented_road_view.py, openpilot/selfdrive/ui/onroad/augmented_road_view.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate openpilot/selfdrive/ui/mici/onroad/cameraview.py:304 — `not self.texture_y or not self.texture_uv or self.frame is None` appears character-identically in 2 files — openpilot/selfdrive/ui/mici/onroad/cameraview.py, openpilot/selfdrive/ui/onroad/cameraview.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate openpilot/selfdrive/ui/layouts/settings/toggles.py:145 — `personality != ui_state.personality and ui_state.started` appears character-identically in 2 files — openpilot/selfdrive/ui/layouts/settings/toggles.py, openpilot/selfdrive/ui/mici/layouts/settings/toggles.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate openpilot/selfdrive/ui/layouts/onboarding.py:188 — `self._accepted_terms and self._training_done` appears character-identically in 2 files — openpilot/selfdrive/ui/layouts/onboarding.py, openpilot/selfdrive/ui/mici/layouts/onboarding.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate openpilot/selfdrive/ui/mici/onroad/model_renderer.py:114 — `self._longitudinal_control and radar_state is not None` appears character-identically in 2 files — openpilot/selfdrive/ui/mici/onroad/model_renderer.py, openpilot/selfdrive/ui/onroad/model_renderer.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate openpilot/selfdrive/ui/mici/onroad/cameraview.py:169 — `self._switching and self._target_stream_type == stream_type` appears character-identically in 2 files — openpilot/selfdrive/ui/mici/onroad/cameraview.py, openpilot/selfdrive/ui/onroad/cameraview.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate openpilot/selfdrive/ui/mici/onroad/cameraview.py:374 — `self._target_client is not None and self._target_stream_type is not None` appears character-identically in 2 files — openpilot/selfdrive/ui/mici/onroad/cameraview.py, openpilot/selfdrive/ui/onroad/cameraview.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:176 — `self._thread is None or not self._thread.is_alive()` appears character-identically in 2 files — REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate openpilot/selfdrive/ui/mici/onroad/augmented_road_view.py:334 — `self.device_camera or DEFAULT_DEVICE_CAMERA` appears character-identically in 2 files — openpilot/selfdrive/ui/mici/onroad/augmented_road_view.py, openpilot/selfdrive/ui/onroad/augmented_road_view.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate openpilot/selfdrive/ui/mici/onroad/cameraview.py:275 — `self.frame is None or self.egl_texture is None` appears character-identically in 2 files — openpilot/selfdrive/ui/mici/onroad/cameraview.py, openpilot/selfdrive/ui/onroad/cameraview.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate openpilot/selfdrive/ui/mici/onroad/hud_renderer.py:279 — `self.is_cruise_set and not ui_state.is_metric` appears character-identically in 2 files — openpilot/selfdrive/ui/mici/onroad/hud_renderer.py, openpilot/selfdrive/ui/onroad/hud_renderer.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate openpilot/selfdrive/ui/mici/onroad/hud_renderer.py:175 — `self.v_ego_cluster_seen or v_ego_cluster != 0.0` appears character-identically in 2 files — openpilot/selfdrive/ui/mici/onroad/hud_renderer.py, openpilot/selfdrive/ui/onroad/hud_renderer.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
D34 · Knowledge Freshness · Orphaned file · ×12
  • Orphaned file openpilot/system/qcomgpsd/structs.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file openpilot/tools/lib/vidindex.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file openpilot/tools/sim/bridge/common.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file openpilot/common/logging_extra.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file tools/scripts/car/hyundai_enable_radar_points.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file openpilot/system/ui/lib/egl.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file openpilot/tools/sim/bridge/metadrive/metadrive_world.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file openpilot/tools/sim/lib/simulated_car.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file tools/scripts/live_cpu_and_temp.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file openpilot/tools/sim/lib/keyboard_ctrl.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file tools/scripts/dump.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file openpilot/tools/lib/azure_container.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
D29 · Static Analysis (SAST) · REDACTED · ×7
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
X4 · Structured logging · Interpolated log message defeats structured logging · ×6
  • Interpolated log message defeats structured logging REDACTED:284 — `warning` at line 284 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging openpilot/system/webrtc/webrtcd.py:626 — `info` at line 626 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging openpilot/tools/clip/run.py:103 — `info` at line 103 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging openpilot/tools/clip/run.py:298 — `info` at line 298 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging openpilot/tools/clip/run.py:360 — `info` at line 360 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging openpilot/tools/clip/run.py:361 — `info` at line 361 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
M4 · Documentation accuracy · README/code drift · ×4
  • README/code drift docs/SAFETY.md:32 — docs/SAFETY.md links to `For`, but `docs/For` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/concepts/safety.md:32 — docs/concepts/safety.md links to `For`, but `docs/concepts/For` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/how-to/car-port.md:22 — docs/how-to/car-port.md names `radar_interface.py`, but no file or folder `radar_interface.py` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/how-to/car-port.md:33 — docs/how-to/car-port.md names `openpilot/selfdrive/car/car_specific.py`, but no file or folder `openpilot/selfdrive/car/car_specific.py` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
X7 · Silent fallback defaults · Silent fallback default in catch · ×3
  • Silent fallback default in catch openpilot/common/hardware/comma/hardware.py:302 — `get_screen_brightness` swallows every exception into `return 0` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch openpilot/common/hardware/comma/hardware.py:343 — `get_gpu_usage_percent` swallows every exception into `return 0` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch REDACTED:51 — `sudo_read` swallows every exception into `return ''` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
D16 · Bus Factor · Off-boarding risk · ×2
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 17 significant file(s) lose their only recent owner: openpilot/tools/jotpluggler/generate_event_extractors.py, openpilot/selfdrive/ui/translations/potools.py, openpilot/tools/camerastream/ffmpeg_decoder.py, openpilot/common/fuzzy.py, scripts/ci_results.py, openpilot/system/proclogd.py, openpilot/system/ubloxd/binary_struct.py, openpilot/system/sensord/sensors/lsm6ds3_accel.py (+9 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
X7 · Silent fallback defaults · Silent fallback default on parse failure · ×2
  • Silent fallback default on parse failure openpilot/common/hardware/comma/hardware.py:82 — `get_modem_state` returns `{}` when `(FileNotFoundError, json.JSONDecodeError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure openpilot/common/hardware/usb.py:35 — `read_int` returns `0` when `(OSError, ValueError, TypeError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 4 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (27 single-owned of 237 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 237 of the 405 production source files in this repository met that bar). They are anonymized user #3 (2 file(s)), anonymized user #4 (2 file(s)), anonymized user #5 (1 file(s)), anonymized user #6 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: openpilot/selfdrive/ui/mici/layouts/settings/network/esim_ui.py, openpilot/system/ui/lib/cellular_manager.py, openpilot/system/hardware/chestnut/status.py, openpilot/selfdrive/controls/lib/latcontrol_curvature.py, openpilot/selfdrive/ui/mici/layouts/settings/device/prime.py, openpilot/selfdrive/ui/mici/onroad/confidence_ball.py.
D19 · Documentation Quality · Documentation · ×1
  • Documentation: contradicts the code docs/LIMITATIONS.md — The limitations list describes situations that may interfere with openpilot ALC/LDW but the document is about ACC/FCW and DM, so the reader cannot tell which applies to which component. Reclassify or delete this entry for ACC/FCW/DMS; it is a subset of the file's content.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 2 of 3 project(s) overshoot their size bounds, lowering Project Cohesion to 0.0/10. The most over is `(repository root)` (40564 LoC, 657 module-visible types across 74 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Low vulnerability · ×1
  • REDACTED
D34 · Knowledge Freshness · Orphaned files with no living knowledge · ×1
  • Orphaned files with no living knowledge — 12 of 237 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; 237 of the 405 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/tools/lib/vidindex.py, openpilot/tools/sim/bridge/common.py, openpilot/common/logging_extra.py, tools/scripts/car/hyundai_enable_radar_points.py, openpilot/system/ui/lib/egl.py, openpilot/tools/sim/bridge/metadrive/metadrive_world.py, openpilot/tools/sim/lib/simulated_car.py (and 4 more). 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.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 1/2 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `openpilot/system/ui`.
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 43326 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-5a297cb6cf644fee8b55ba39e78afe0a/history.json --exit-code 0 --source .12artifacts/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-5a297cb6cf644fee8b55ba39e78afe0a/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 --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .5artifacts/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 --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .0artifacts/raw/osv-scanner.json

Run 01a170ef-633e-7ade-8adf-b72295f3c4b8 · 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