org.sonar.l10n.delphi.rules.community-delphi.RoutineNestingDepth.html Maven / Gradle / Ivy
Why is this an issue?
Deeply nested routines make for code that is difficult to navigate and understand.
While nested routines can be helpful for small units of work specific to a particular routine,
their ambiguous syntax and non-linear control flow make them confusing when containing large
amounts of functionality.
How to fix it
Extract the nested routines out into one or more top-level routines:
procedure DoThing;
procedure DoSubThing;
procedure DoSubSubThing;
begin
// ...
end;
begin
// ...
end;
begin
// ...
end;
procedure DoSubThing;
procedure DoSubSubThing;
begin
// ...
end;
begin
// ...
end;
procedure DoThing;
begin
// ...
end;
© 2015 - 2024 Weber Informatics LLC | Privacy Policy