====== Checklist Core ====== **Merge-Gate** - Questa checklist viene applicata ad **ogni** modifica. Il codice con violazioni di questa checklist **non** viene accettato. ===== Production-Ready (Zero Tolerance) ===== ==== Pattern Vietati ==== ^ Vietato ^ Richiesto ^ | Commenti ''%%// TODO:%%'' | Implementazione completa | | Commenti ''%%// FIXME:%%'' | Codice corretto | | Funzioni stub | Implementazioni reali | | Implementazioni mock | Codice di produzione | | Valori placeholder | Valori reali | | ''raise ENotImplemented'' | Codice funzionante | ==== Checklist ==== [ ] Nessun commento TODO nel codice di produzione [ ] Nessun commento FIXME nel codice di produzione [ ] Nessuna funzione stub o placeholder [ ] Nessuna implementazione mock [ ] Ogni funzione completamente implementata [ ] Tutti i casi di errore gestiti [ ] Tutti i casi limite coperti ===== Qualità Generale ===== [ ] Nessun codice duplicato (principio DRY) [ ] Nessun Magic Number (usare costanti nominate) [ ] Formattazione coerente in tutto il file [ ] Tutti i metodi pubblici hanno messaggi di errore significativi ==== Esempio: Magic Numbers ==== (* VIETATO - Magic Number *) if Length(Name) > 64 then raise EValidationError.Create('Name too long'); (* CORRETTO - Costante nominata *) const MAX_NAME_LENGTH = 64; if Length(Name) > MAX_NAME_LENGTH then raise EValidationError.Create(Format(rsNameTooLong, [MAX_NAME_LENGTH])); ===== Gestione Errori Base ===== [ ] Nessun blocco catch/except vuoto [ ] Gli errori vengono registrati PRIMA di essere gestiti [ ] Exception specifiche prima di quelle generali [ ] Stack-Trace preservato nel re-throw [ ] Risorse rilasciate in modo deterministico (try-finally) ==== Esempio: Gestione Errori Corretta ==== (* VIETATO - Handler di exception vuoto *) try DoSomething; except // Non fare nulla - VIETATO! end; (* VIETATO - Exception generale prima *) try DoSomething; except on E: Exception do // Troppo generico! HandleError(E); on E: EFileNotFound do // Non verrà mai raggiunto! HandleFileNotFound(E); end; (* CORRETTO - Specifico, registrato, risorse rilasciate *) var Resource: TResource; begin Resource := TResource.Create; try try DoSomething; except on E: EFileNotFound do begin Logger.Error(rsFileNotFound, [E.Message]); (* Prima registrare *) raise; (* Poi rilanciare - Stack-Trace preservato *) end; on E: EAccessDenied do begin Logger.Error(rsAccessDenied, [E.Message]); raise; end; end; finally Resource.Free; (* SEMPRE rilasciare *) end; end; ===== Logging Base ===== [ ] Formato e verbosità del logging seguono la policy [ ] Nessun secret o dato sensibile nei log [ ] Formato strutturato: [Timestamp] [Level] [Source] Message ==== Linee Guida Log-Level ==== ^ Livello ^ Utilizzo ^ | ''DEBUG'' | Solo in build debug, informazioni dettagliate sul flusso | | ''INFO'' | Operazioni normali, milestone importanti | | ''WARN'' | Situazioni inattese ma gestibili | | ''ERROR'' | Errori che compromettono la funzionalità | ==== Vietato nei Log ==== (* VIETATO - Dati sensibili *) Logger.Info('User authenticated with token: %s', [Token]); Logger.Debug('Password: %s', [Password]); Logger.Info('API Key: %s', [ApiKey]); (* CORRETTO - Nessun dato sensibile *) Logger.Info('User %s authenticated successfully', [Username]); Logger.Debug('Processing request for user %s', [Username]); ===== Struttura Progetto ===== [ ] Struttura progetto conforme alla baseline WvdS [ ] Configurazione build corretta [ ] Triade documentazione esistente (README, API, CHANGELOG) ===== Checklist Rapida da Copiare ===== Checklist Review (Core): Production-Ready: - [ ] Nessun commento TODO - [ ] Nessun commento FIXME - [ ] Nessuna funzione stub - [ ] Nessuna implementazione mock - [ ] Tutte le funzioni complete Qualità: - [ ] Nessun codice duplicato (DRY) - [ ] Nessun Magic Number - [ ] Formattazione coerente Gestione Errori: - [ ] Nessun blocco except vuoto - [ ] Errori registrati prima della gestione - [ ] Exception specifiche prima delle generali - [ ] Risorse rilasciate in finally Logging: - [ ] Nessun dato sensibile nei log - [ ] Formato log strutturato ===== Vedi anche ===== * [[.:qualitaetssicherung|Panoramica Garanzia Qualità]] * [[.:audit-sicherheit|Checklist Sicurezza]] * [[.:audit-codequalitaet|Checklist Qualità Codice]] * [[.:debugging|Debugging]]