
org.sonar.plugins.csharp.S1227.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sonarlint-omnisharp-plugin Show documentation
Show all versions of sonarlint-omnisharp-plugin Show documentation
Code Analyzer based on Omnisharp
Why is this an issue?
break;
is an unstructured control flow statement which makes code harder to read.
Ideally, every loop should have a single termination condition.
Noncompliant code example
int i = 0;
while (true)
{
if (i == 10)
{
break; // Non-Compliant
}
Console.WriteLine(i);
i++;
}
Compliant solution
int i = 0;
while (i != 10) // Compliant
{
Console.WriteLine(i);
i++;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy