Skip to content

chore: arreglar MINOR mecanicos de SonarCloud#48

Merged
DevOtter97 merged 1 commit into
mainfrom
chore/sonar-minor
May 2, 2026
Merged

chore: arreglar MINOR mecanicos de SonarCloud#48
DevOtter97 merged 1 commit into
mainfrom
chore/sonar-minor

Conversation

@DevOtter97

Copy link
Copy Markdown
Owner

Resumen

Sustituciones mecanicas que arreglan ~80 issues MINOR de SonarCloud sin cambiar comportamiento. Continuacion natural de #46 (bugs/critical) y #47 (MAJOR a11y/cleanup).

Reglas arregladas

# Regla Cambio
54 S7764 window.XglobalThis.X
12 S4325 non-null assertions (!) redundantes refactorizadas
5 S7773 parseInt / parseFloat / isNaNNumber.*
4 S7781 String#replace(/.../g, ...)String#replaceAll
2 S6353 regex [a-zA-Z0-9_]\w
2 S6759 props inline marcadas como Readonly<>
1 S7755 arr[arr.length - 1]arr.at(-1)

Lo que NO entra (queda para una segunda pasada)

  • S7735 (7): condiciones negadas (if (!x) A else Bif (x) B else A). Requiere criterio caso a caso.
  • S6551 (1): err se stringifica como [object Object] en ReadingForm.tsx:193 — fix real, no mecanico.
  • S1135 (2 INFO): TODOs en FirebaseAuthService.ts:226 y PublicListView.tsx:54 — decidir si arreglarlos o // NOSONAR.

Test plan

  • npx tsc --noEmit — limpio salvo el error pre-existente de ReadingMeasureUnit en ReadingList.tsx
  • npm run test:run — 60/60 tests pasando
  • CI verde (Vitest + Playwright + build + SonarCloud)
  • Quality Gate de SonarCloud no se rompe (los MINOR no cuentan para gating, solo metricas)

Sustituciones automaticas que no cambian comportamiento:
- S7764 (54): window.X -> globalThis.X (tests/setup, theme, hooks, components)
- S4325 (12): assertions redundantes (!) reescritas o eliminadas
- S7773 (5): parseInt/parseFloat/isNaN -> Number.parseInt/parseFloat/isNaN
- S7781 (4): String#replace global -> String#replaceAll
- S6353 (2): regex [a-zA-Z0-9_] -> \w
- S6759 (2): props inline marcadas como Readonly
- S7755 (1): arr[arr.length-1] -> arr.at(-1)

30 archivos tocados. Quedan los MINOR que requieren criterio (S7735
condiciones negadas y S6551 stringificacion de Error) para una segunda
pasada. tsc limpio (salvo el error pre-existente de ReadingMeasureUnit
en ReadingList.tsx) y vitest 60/60 verde.
@vercel

vercel Bot commented May 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
gororeads Ignored Ignored May 2, 2026 9:21am

@sonarqubecloud

sonarqubecloud Bot commented May 2, 2026

Copy link
Copy Markdown

@DevOtter97 DevOtter97 merged commit 8c56e49 into main May 2, 2026
6 checks passed
@DevOtter97 DevOtter97 deleted the chore/sonar-minor branch May 2, 2026 09:22
DevOtter97 added a commit that referenced this pull request May 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant