| Property | Value |
|---|---|
| Package | Philips.CodeAnalysis.MaintainabilityAnalyzers |
| Diagnostic ID | PH2114 |
| Category | Maintainability |
| Analyzer | AvoidEmptyStatementBlocksAnalyzer |
| CodeFix | Yes |
| Severity | Error |
| Enabled By Default | Yes |
Avoid empty statements. These can happen if 2 semicolons are directly after each other. The empty statement hurts the readability of the code.
As this is usually just a mistake or merge artifact, its safe to remove. This is exactly what the CodeFixer does.
Code that triggers a diagnostic:
class BadExample
{
public int BadMethod()
{
return 0; ;
}
}And the replacement code:
class GoodExample
{
public void GoodMethod()
{
return 0;
}
}This analyzer does not offer any special configuration. The general ways of suppressing diagnostics apply.