원클릭으로
delphi-code-review
Delphi code review checklist — quality, security, performance, SOLID, memory
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Delphi code review checklist — quality, security, performance, SOLID, memory
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Pragmatic clean code standards for Delphi — concise, direct, no over-engineering
Good memory management practices, memory leak prevention and exception handling in Delphi
SOLID implementation patterns for Delphi projects — Repository, Service, Factory, Strategy with constructor injection and interfaces
Implementation of the 23 GoF (Gang of Four) patterns in Object Pascal / Delphi with interfaces, TInterfacedObject and SOLID principles. Covers Creational, Structural and Behavioral patterns.
Standards for using DevExpress (DEXT) components in Delphi VCL applications
Architectural patterns, Entity ORM, Minimal APIs and dependency injection for projects created with Dext Framework (cesarliws/dext).
| name | Delphi Code Review |
| description | Delphi code review checklist — quality, security, performance, SOLID, memory |
Format or concatenation in queriesTObjectList with OwnsObjects configured correctlytry/finally with Free for temporary objectsAssigned() before accessing references that may be nilDestroy with override freeing owned fieldsT in classes, I in interfaces, E in exceptionsF in private fields, A in parameters, L in local variablesProjeto.Camada.Dominio.Funcionalidade.pasbtn, edt, lbl, etc.)//❌ Magic numbers
if ACustomer.Age > 18 then
//✅ Named constants
const MINIMUM_AGE = 18;
if ACustomer.Age > MINIMUM_AGE then
//❌ with statement
with AQuery do begin
SQL.Text := '...';
Open;
end;
//✅ Explicit reference
AQuery.SQL.Text := '...';
AQuery.Open;
//❌ Generic Catch
except
on E: Exception do ShowMessage(E.Message);
//✅ Specific exceptions
except
on E: EFDDBEngineException do
raise EDatabaseException.Create('Falha: ' + E.Message);
//❌ Logic in OnClick
procedure TfrmMain.btnSaveClick(Sender: TObject);
begin
//50 lines of business logic here
end;
//✅ Delegate for Service
procedure TfrmMain.btnSaveClick(Sender: TObject);
begin
FService.SaveCustomer(GetFormData);
end;
// ❌ Memory leak
function GetItems: TStringList;
begin
Result := TStringList.Create;
LoadItems(Result); //if LoadItems throws exception, leak!
end;
//✅ Safe
function GetItems: TStringList;
begin
Result := TStringList.Create;
try
LoadItems(Result);
except
Result.Free;
raise;
end;
end;
🔴 BLOQUEANTE: Memory leak — objeto não liberado em caso de exception
🔴 BLOQUEANTE: SQL injection — query usando concatenação de string
🟡 SUGESTÃO: Extrair método — este bloco tem 35 linhas
🟡 SUGESTÃO: Usar interface em vez de classe concreta (DIP)
🟢 NIT: Renomear variável 'S' para nome descritivo
🟢 NIT: Preferir guard clause a nesting
❓ PERGUNTA: O que acontece se ACustomer for nil aqui?
❓ PERGUNTA: Este objeto é liberado por quem?
| Principle | Check |
|---|---|
| SRP | Does class have ONE responsibility? Service does not access data? |
| OCP | Do new features add classes, not modify existing ones? |
| LSP | Does either implementation of the interface work in place of the other? |
| ISP | Doesn't interface have methods that implementers don't use? |
| DIP | Constructor takes interfaces, not concrete classes? |