JavaScript code-quality modernization
SonarCloud open findings in petry-projects/google-app-scripts — 68 issue(s) grouped as one workstream. Part of the org SonarCloud tuning initiative petry-projects/.github#593.
Findings
Affected files
deploy/index.html (20)
src/gmail-to-drive-by-labels/src/index.js (9)
src/gas-utils.js (8)
src/calendar-to-briefing-doc/src/index.js (6)
test-utils/setup.js (6)
gas-installer/Index.html (5)
src/calendar-to-sheets/src/index.js (4)
test-utils/mocks.js (3)
gas-installer/src/index.js (3)
scripts/check-coverage.js (3)
src/deploy/index.js (1)
Approach
Apply the flagged idiom fixes: optional chaining (S6582), replaceAll (S7781), globalThis over window (S7764), Number.parseInt (S7773), and the other per-line suggestions. Each carries SonarCloud's exact recommendation. Mechanical; behavior identical.
Acceptance
Filed from the 2026-07-03 org SonarCloud review.
JavaScript code-quality modernization
SonarCloud open findings in
petry-projects/google-app-scripts— 68 issue(s) grouped as one workstream. Part of the org SonarCloud tuning initiative petry-projects/.github#593.Findings
String#replaceAll()overString#replace().globalThisoverwindow.Number.parseIntoverparseInt.node:fsoverfs.Date.now()overDate#getTime().new Error()is too unspecific for a type check. Usenew TypeError()instead.for-ofloop instead of aforloop with this simple iteration..includes(), rather than.lastIndexOf(), when checking for existence.Affected files
deploy/index.html(20)src/gmail-to-drive-by-labels/src/index.js(9)src/gas-utils.js(8)src/calendar-to-briefing-doc/src/index.js(6)test-utils/setup.js(6)gas-installer/Index.html(5)src/calendar-to-sheets/src/index.js(4)test-utils/mocks.js(3)gas-installer/src/index.js(3)scripts/check-coverage.js(3)src/deploy/index.js(1)Approach
Apply the flagged idiom fixes: optional chaining (S6582),
replaceAll(S7781),globalThisoverwindow(S7764),Number.parseInt(S7773), and the other per-line suggestions. Each carries SonarCloud's exact recommendation. Mechanical; behavior identical.Acceptance
NOSONARunless a confirmed false positive, noted inline)Filed from the 2026-07-03 org SonarCloud review.