Cleanup: class-level Halstead and cyclomatic metrics are computed but never output

Aperta
#96 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
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
php
Ambito
backend, data

Direzione di ricerca

Start by reading storeClassMetrics() and getMetrics() in src/PhpParser/HalsteadMetricsVisitor.php, then check how CombinedMetricsVisitor.php consumes the results and how CyclomaticComplexityCalculator.php builds classSummary(). Trace the report and console output paths to decide whether class metrics should be exposed in class-grouped views or removed. Done means class-level calculations are either shown in the relevant output or deleted, with tests covering the chosen behavior.

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

Descrizione

enhancement

Where

  • src/PhpParser/HalsteadMetricsVisitor.php:241-247 (storeClassMetrics()) and :279-289 (getMetrics() returns classes)
  • src/PhpParser/CombinedMetricsVisitor.php:142-146 (reads only methods)
  • src/Business/Cyclomatic/CyclomaticComplexityCalculator.php:144-158 (classSummary() fills classes)

Observed

Class-level Halstead and cyclomatic metrics are calculated, but no code reads the classes keys. They never reach any report or console output.

Expected

Either the class-level values are output, for example in the class-grouped views, or the calculation is removed.

Repro

grep -rn "'classes'\]" src

The only reads are inside the calculator itself.

Lingua principale
PHP
Stelle
55
Fork
3
Merge medio
25m
PR unite (30g)
22

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 Phauthentic/cognitive-code-analysis

Tutte le issue di Phauthentic/cognitive-code-analysis

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.