detectors judge their own pattern tables and the law registry text as project code (M3)

Aperta
#426 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
testing-qa

Direzione di ricerca

Start with the code-only view of M1, then read the named detectors and data modules, including encryption-implementation-configuration.ts, environment-variables-usage-configuration.ts, authentication-checker.ts, and src/data/*-laws.ts. Reproduce the self-audit described in the issue and trace how pattern tables, law text, and data-only modules reach each check. Done means detector data and prose are excluded by general rules, with the listed self-findings gone and the intended checks still running.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

Found in the 8.0.0 self-audit triage: RoC 7.29.1 (npm, 5fc54afe) on a clean clone of develop at 2d2fa9a, with typescript resolvable (verdict compliance, 0 failed / 46 warnings). The bucket method and per-law tables are kept by QA; counts are from that run.

What happens

Run on a repository that contains detectors (RoC itself, or any project with lint/security tooling), the detectors flag their own data:

  • Data Encryption: WEAK_ALGORITHMS = ['MD5','SHA1','DES','RC4'] (encryption-implementation-configuration.ts:23) flags its own line; 26 of 29 findings are pattern tables or law text.
  • Environment Security: BEST_PRACTICES.bad contains 'process.env.SECRET_KEY without validation' (environment-variables-usage-configuration.ts:128-132); doc-reference URLs in the serverless registry are "hardcoded URLs".
  • Authentication Security: /md5.*password/ matches its own source (authentication-checker.ts:129-133). Note: two of its checks pass today only because of the detector's own /AuthService/ and /refreshToken/ patterns, so fixing scope makes them fire (see the gating issue).
  • Code Documentation: the law registries src/data/*-laws.ts are "under-commented" because their prose lives in fields (28 files).
  • Typed HTTP Boundaries: its only match is law prose describing its own false positive (code-quality-laws.ts:462).
  • Async Cache Single-Flight: a file is selected by the law card's own example text (cache-harness-laws.ts:83-85).

Suggested direction

A general rule, not an ignore list for RoC: string contents of pattern/data tables are not code (covered by the code-only view of M1), and data-only modules (no function bodies) are skipped by ratio-style checks.

Lingua principale
TypeScript
Stelle
0
Fork
0
Merge medio
38m
PR unite (30g)
96

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Rule-Of-Code/RoC

Tutte le issue di Rule-Of-Code/RoC

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.