Back

LL069

Hardcoded path

Object Pascal — Delphi & Free Pascal
Warning
Maintainability

Hardcoded Windows paths break portability and complicate deployment

hardcoded Windows paths break portability and complicate deployment.

Why this severity

hardcoded Windows paths break portability and complicate deployment.


Known false positives

paths in unit tests pointing to test fixture directories.

Remediation example

DataDir := TPath.Combine(TPath.GetHomePath, 'AppData');
// instead of: DataDir := 'C:\MyApp\Data';

Reconnecting… Connection lost. Reload