TLOC
Questi contenuti non sono ancora disponibili nella tua lingua.
TLOC - Guida Rapida
Section titled “TLOC - Guida Rapida”Analisi struttura e salute del codebase (Total Lines Of Code).
Comandi
Section titled “Comandi”| Dico a Cursor | Cosa fa | Modifica? |
|---|---|---|
| “leggi tloc” | Report struttura + semaforo | ❌ No (read-only) |
Semaforo
Section titled “Semaforo”JavaScript
Section titled “JavaScript”| Colore | Righe | Significato |
|---|---|---|
| 🟢 Verde | < 150 | Ottimo (manutenibile) |
| 🟡 Giallo | 150-300 | Possibile refactory |
| 🔴 Rosso | > 300 | Da refactorizzare |
| Colore | Righe | Significato |
|---|---|---|
| 🟢 Verde | < 200 | Ottimo |
| 🟡 Giallo | 200-400 | Considerare split |
| 🔴 Rosso | > 400 | Da refactorizzare |
Metriche Target
Section titled “Metriche Target”| Metrica | Target | Status |
|---|---|---|
| Media righe/file JS | < 100 | 🟢 Ottimo |
| File JS > 300 righe | 0 | 🟢 Zero problemi |
| File JS > 200 righe | < 5 | 🟡 Monitorare |
| Health Score | > 80/100 | 🟢 Sano |
Calcolo Health Score
Section titled “Calcolo Health Score”Base: 100 punti
Penalità:
- -10 punti per ogni file > 300 righe
- -5 punti per ogni file > 200 righe
- -10 punti se media > 150 righe/file
- -5 punti se media > 100 righe/file
Interpretazione:
- 90-100: 🟢 Ottimo (codebase sano)
- 70-89: 🟡 Buono (alcune aree da migliorare)
- 50-69: 🟠 Da migliorare (refactoring consigliato)
- < 50: 🔴 Critico (refactoring necessario)
Output Report
Section titled “Output Report”Il report include:
- Totali: File e righe per tipo (.js, .css, .ejs, .md)
- Struttura cartelle: Breakdown per directory
- Semaforo: File classificati per colore (🟢🟡🔴)
- Dipendenze: Lista package.json
- Health Score: Valutazione 0-100
- Top 10: File più grandi
- Azioni suggerite: Refactoring concreti
Esempio Output
Section titled “Esempio Output”================================================================ REPORT TLOC================================================================
TOTALI----------------------------------------------------------------| Tipo | File | Righe | Media ||-------|------|-------|-------|| .js | 42 | 4,230 | 100 || .css | 8 | 1,540 | 192 || .ejs | 15 | 890 | 59 |----------------------------------------------------------------
SEMAFORO FILE JAVASCRIPT----------------------------------------------------------------🟢 VERDE (< 150 righe) - 35 file🟡 GIALLO (150-300 righe) - 5 file🔴 ROSSO (> 300 righe) - 2 file
HEALTH SCORE: 75/100 - Buono----------------------------------------------------------------
AZIONI SUGGERITE:1. server.js (450 righe) - Split in moduli routing2. auth.js (320 righe) - Estrarre validation in utilsFile Correlati
Section titled “File Correlati”PLATFORM
Section titled “PLATFORM”AGENTS/cursor/LEGGI-TLOC.md- Runbook completopackage.json- Dipendenze progetto
- 01-project-map.md - Struttura progetto (Truth Zone)
Quando Usare
Section titled “Quando Usare”Usa “leggi tloc” quando:
- Inizi refactoring importante
- Vuoi overview salute codebase
- Cerchi file da ottimizzare
- Devi documentare struttura progetto
- Vuoi trend crescita codebase
Frequenza consigliata:
- Dopo feature importanti
- Prima di major refactoring
- Mensilmente per monitoring
Prossimi Step
Section titled “Prossimi Step”Dopo “leggi tloc”, se trovi file rossi:
- Analizza file con “leggi file [path]”
- Identifica moduli da estrarre
- Crea nuovi file per split
- Testa refactoring
- Ri-run “leggi tloc” per verificare
Ultimo aggiornamento: 2025-12-25
Maintainer: Francesco Pelosio
AI Agent: Cursor (con runbook LEGGI-TLOC.md)