Steeltoe icon indicating copy to clipboard operation
Steeltoe copied to clipboard

Address S138: Functions should not have too many lines of code

Open bart-vmware opened this issue 3 years ago • 0 comments

Address existing violations of S138: Functions should not have too many lines of code in the codebase and set severity to Warning in Steeltoe.Debug.ruleset and Steeltoe.Release.ruleset.

To find existing violations, enable the rule (see above) and rebuild src/Steeltoe.All.sln to make them appear in the Output window.

To address the violations, choose from the following on a case-by-case basis:

  • Fix the violation by changing the code to not violate the rule (usually extract method)
  • Suppress the violation in code using #pragma warning disable/restore, preceded by a justification comment if not obvious

To be decided: the guideline that tests should contain everything relevant to understand the test supersedes this rule, so we may want to turn off this rule for test projects (using NoWarn in sharedtest.props).

bart-vmware avatar Jul 28 '22 10:07 bart-vmware