Skip to content

SonarCloud: JavaScript/TypeScript code quality #428

Description

@don-petry

SonarCloud: JavaScript/TypeScript code quality

56 open SonarCloud finding(s) in petry-projects/google-app-scripts, worst severity MAJOR. Generated by the org SonarCloud Audit.

View in SonarCloud →

Findings

Rule Count Representative message
javascript:S6582 10 Prefer using an optional chain expression instead, as it's more concise and easier to read
javascript:S7781 9 Prefer String#replaceAll() over String#replace().
javascript:S7773 5 Prefer Number.parseInt over parseInt.
javascript:S7772 4 Prefer node:fs over fs.
javascript:S8786 4 Simplify this regular expression to reduce its runtime, as it has super-linear performance
javascript:S5869 3 Remove duplicates in this character class.
javascript:S3358 2 Extract this nested ternary operation into an independent statement.
javascript:S6557 2 Use the 'String#endsWith' method instead.
javascript:S6644 2 Unnecessary use of conditional expression for default assignment.
javascript:S7759 2 Prefer Date.now() over Date#getTime().
javascript:S1481 1 Remove the declaration of the unused 'safeId' variable.
javascript:S1788 1 Default parameters should be last.
javascript:S1854 1 Remove this useless assignment to variable "safeId".
javascript:S2486 1 Handle this exception or don't catch it at all.
javascript:S2925 1 Replace this fixed wait with a synchronization on an observable condition.
javascript:S4043 1 Move this array "sort" operation to a separate statement or replace it with "toSorted".
javascript:S4138 1 Expected a for-of loop instead of a for loop with this simple iteration.
javascript:S4624 1 Refactor this code to not use nested template literals.
javascript:S5976 1 Replace these 3 tests with a single Parameterized one.
javascript:S6353 1 Use concise character class syntax '\w' instead of '[a-zA-Z0-9_]'.
javascript:S7744 1 The empty object is useless.
javascript:S7765 1 Use .includes(), rather than .lastIndexOf(), when checking for existence.
javascript:S7786 1 new Error() is too unspecific for a type check. Use new TypeError() instead.

Affected files

  • deploy/index.html (16)
  • src/gas-utils.js (7)
  • src/gmail-to-drive-by-labels/src/index.js (7)
  • src/calendar-to-briefing-doc/src/index.js (5)
  • gas-installer/Index.html (4)
  • src/calendar-to-sheets/src/index.js (4)
  • gas-installer/src/index.js (3)
  • scripts/check-coverage.js (3)
  • test-utils/mocks.js (3)
  • deploy/tests/ui.spec.js (1)
  • src/calendar-to-briefing-doc/tests/index.test.js (1)
  • src/deploy/index.js (1)
  • test-utils/setup.js (1)

Priority

Labeled priority:major — mapped from this bucket's worst SonarCloud severity (MAJOR).

Acceptance

  • All findings in this workstream resolved to zero in SonarCloud
  • No behavior change; CI green
  • Real fixes (no blanket NOSONAR unless a confirmed false positive, noted inline)

Idempotent issue — updated automatically each audit run; auto-closed when the finding count reaches zero.

Metadata

Metadata

Assignees

No one assigned

    Labels

    dev-leadFor dev-lead agent pickuppriority:majorSonarCloud MAJOR severitysonarcloud-auditSonarCloud audit finding (idempotent marker)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions