Repository navigation
Open
Labels
dev-leadFor dev-lead agent pickupFor dev-lead agent pickupdev-lead:hands-offOpt an item out of the dev-lead persona automation entirelyOpt an item out of the dev-lead persona automation entirelyenhancementFeature requestsFeature requests
Description
SonarCloud org-wide debt reduction & rule tuning
Roll-up initiative from the 2026-07-03 org-wide SonarCloud review. 310 open issues, 0 bugs — health is fundamentally good; the volume is maintainability noise concentrated in a few rules, plus supply-chain hardening findings. This initiative tracks the tuning (config) and automation (mechanical fixes) work to drive it down and keep it down.
Snapshot
| Dimension | Breakdown |
|---|---|
| Type | 258 code smell · 52 vulnerability · 0 bug |
| Severity | 10 critical · 151 major · 145 minor · 4 info |
| Language | 167 js · 71 shell · 50 githubactions · 10 py · 6 ts |
| Top project | google-app-scripts 194 (63%), broodly 29, TalkTerm 18, markets 17, .github 15 |
Three rules = half the backlog: javascript:S5906 (96), shelldre:S7688 (48), githubactions:S7635 (18).
Scope note: pulled via anonymous SonarCloud API — public projects only.
petry-projects_.github-privateis not included and should be reviewed separately with a token.
Tier 1 — Tuning (config; ~110 issues, near-zero risk)
- De-provision the
broodminder-exportlegacy SonarCloud project. It duplicate-scans the same repo asbroodminder-export2(identical fingerprints: S3776×3, S8707×2, S7688, S7682). Inflates org metrics and double-counts 3 CRITICALs. Delete the legacy project in SonarCloud admin. (manual; needs Sonar admin) - S5906 test-assertion rewrite → tracked in Rewrite Jest assertions to specific matchers (SonarCloud S5906 ×96) google-app-scripts#416 (rewrite generic Jest assertions to specific matchers; clears all 96). User decision: rewrite tests, not suppress/exclude.
Tier 2 — Automation (mechanical fixes via PRs, per PR-workflow rule)
- S7635 (
secrets:inherit, ×18) — apply the established# NOSONAR(githubactions:S7635)inline marker (seeinitiative_pipeline_s7635_gapplaybook) to the remaining caller stubs: markets×5, broodminder-export2×4, repo-template×4, bmad-bgreat-suite×3, TalkTerm×2. - Shell hygiene codemod (~68) — batch per repo: S7688
[ → [[(48), S7677 redirect-to-stderr>&2(8), S7682 explicit-return (7), S7679 assign positional to local (5). Repos: broodly, google-app-scripts, TalkTerm, bmad, broodminder. - GitHub Actions / dependency hardening (~28) — fix at the source in
.githubreusables where possible so callers inherit: S6505--ignore-scripts(9), S8543 exact-version (7), S8541--only-binary :all:(6), S8544/S8545 lockfile-enforcing install (6). Concentrated inmarketsand.github.
Tier 3 — Real work (human/agent review, not automatable)
- S3776 cognitive-complexity refactors (10 CRITICAL) — worst is a broodminder
discover.pyfunction at complexity 85 (limit 15); also 4 google-app-scripts functions. Genuine refactors. -
pythonsecurity:S8707path-traversal review (×4) — LLM/CLI arg file-system escape in broodminder-export discover.py. Only security findings here needing code judgment; the other 48 "vulnerabilities" are supply-chain lockfile/version hardening (Tier 2).
Keep-it-down (prevent regression)
- Once counts are low, consider a quality-gate on new code (Sonar's "Clean as You Code") so PRs can't add new S5906/S7688/S7635 debt.
- Fold the S7635 marker and shell
[[conventions into.github/standardsso new repos start clean (repo-template already shows 4 S7635 — the template itself leaks the pattern).
Related memory / playbooks
initiative_pipeline_s7635_gap— canonical S7635 NOSONAR-marker fixring_rollout_870— S7637 channel-pin exemption context (multicriteria, notsonar.exclusions)rulesets_relocation_575— SonarCloud config now lives under.github/standards
Metadata
Metadata
Assignees
Labels
dev-leadFor dev-lead agent pickupFor dev-lead agent pickupdev-lead:hands-offOpt an item out of the dev-lead persona automation entirelyOpt an item out of the dev-lead persona automation entirelyenhancementFeature requestsFeature requests
Activity
don-petry commentedon Jul 3, 2026
Child issues filed (per-repo-per-workstream)
The 2026-07-03 review's remaining work is now filed as discrete, dev-lead-pickable issues. Checklist tracks them.
Tier 1 — Tuning
petry-projects_broodminder-export(display name broodminder-export-legacy) — duplicate scan of the same GitHub repo as the live_broodminder-export2project. Manual Sonar-admin action, no repo issue.Tier 3 — Real work (human/agent judgment)
Tier 2 — Automation (mechanical / hardening)
S7635 (
secrets: inherit):GitHub Actions / dependency hardening:
Shell script hygiene:
JavaScript modernization:
Misc long-tail:
Note:
broodminder-export2in the tables is a SonarCloud project key; the underlying GitHub repo ispetry-projects/broodminder-export— issues were filed there..github-privateis public and has 0 SonarCloud findings (clean), so the 310-issue pull was already org-complete.don-petry commentedon Jul 4, 2026
Config hygiene: enforcement-layer drift (added to scope)
While confirming the SonarCloud gate is actually blocking, I surveyed how it's enforced. The authoritative layer is the repo-level
code-qualityruleset (requiresSonarCloud · CodeQL · agent-shield · dependency-audit · build-and-test · coverage). Two drift problems sit alongside it:1.⚠️ (highest-leverage)
repo-templateis MISSING thecode-qualityrulesetEvery other scanned repo has it active; the template that seeds new repos does not. So new repos start unprotected until the ruleset applier catches them — and the template can't model the standard it's supposed to propagate. Compounds the existing repo-template S7635 leak (see #600). Fix the template first.
2. Legacy classic branch-protection is a partial, inconsistent second layer
Four repos still carry old classic
required_status_checksthat disagree with each other and with the ruleset. GitHub takes the union, so SonarCloud is still required everywhere — but the drift is confusing and should be retired in favor of rulesets-only:SonarCloudbuild-and-testAnalyze (python)SonarCloudTasks
code-qualityruleset torepo-templateso new repos are born protected (coordinate with the ruleset applier /.github/standards/rulesets).repo-templategoing forward (prevent regression).Context (not a bug, for the record)
The gate is "Sonar way" (Clean-as-You-Code) — all conditions are
new_*(new security/reliability/maintainability rating, new coverage ≥80%, new dup ≤3%, new hotspots reviewed). It blocks PRs that introduce new findings (new vulns like S7635/S8707 are effectively hard-blocked) but does not block on the pre-existing backlog — which is exactly why the 22 drawdown issues above are needed. Enforcement is correct; no gate change recommended.Filed from the 2026-07-03 SonarCloud review follow-up.