Skip to content
ptittof57 edited this page Aug 15, 2015 · 6 revisions
<title>SA1507: CodeMustNotContainMultipleBlankLinesInARow</title> <script src="script/helpstudio.js" type="text/javascript"></script> <script src="script/StandardText.js" type="text/jscript"></script>
<script type="text/jscript">WritePageTop(document.title);</script>

TypeName

CodeMustNotContainMultipleBlankLinesInARow

CheckId

SA1507

Category

Layout Rules

Cause

The C# code contains multiple blank lines in a row.

Rule Description

To improve the readability of the code, StyleCop requires blank lines in certain situations, and prohibits blank lines in other situations. This results in a consistent visual pattern across the code, which can improve recognition and readability of unfamiliar code.

A violation of this rule occurs when the code contains more than one blank line in a row. For example:

public bool Enabled

{

get

{

Console.WriteLine("Getting the enabled flag.");

return this.enabled;

}

}

The code above would generate an instance of this violation, since it contains blank multiple lines in a row.

How to Fix Violations

To fix a violation of this rule, remove the extra blank lines.

How to Suppress Violations

[SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1507:CodeMustNotContainMultipleBlankLinesInARow", Justification = "Reviewed.")]
Clone this wiki locally