All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.l10n.delphi.rules.community-delphi.RoutineNestingDepth.html Maven / Gradle / Ivy

There is a newer version: 1.12.1
Show newest version

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