org.sonar.l10n.delphi.rules.community-delphi.ConsecutiveVisibilitySection.html Maven / Gradle / Ivy
Why is this an issue?
Having consecutive visibility sections with the same visibility is useless and negatively
impacts readability.
Combining the sections into one larger section is more concise and easier to understand.
Exceptions
This rule does not apply for visibility sections with only one const
or
type
section, such as in the example below:
type
TFoo = class(TObject)
private type
TBar = Double;
TBaz = Integer;
private const
CMyStr = 'abc';
private
FMyInt: Integer;
end;
How to fix it
Combine the consecutive visibility sections together:
type
TFoo = class(TObject)
private
FMyInt: Integer;
private
procedure Bar;
end;
type
TFoo = class(TObject)
private
FMyInt: Integer;
procedure Bar;
end;
© 2015 - 2024 Weber Informatics LLC | Privacy Policy