Created
February 21, 2013 10:35
-
-
Save anonymous/5003799 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// <Name>Avoid making complex methods even more complex (Source CC)</Name> | |
// To visualize changes in code, right-click a matched method and select: | |
// - Compare older and newer versions of source file | |
// - Compare older and newer versions disassembled with Reflector | |
warnif count > 0 | |
from m in JustMyCode.Methods where | |
!m.IsAbstract && | |
context.CompareContext.IsPresentInBothBuilds(m) && | |
context.CompareContext.CodeWasChanged(m) | |
let oldCC = context.CompareContext.OlderVersion(m).CyclomaticComplexity | |
where oldCC > 6 && m.CyclomaticComplexity > oldCC | |
select new { m, | |
oldCC , | |
newCC = m.CyclomaticComplexity , | |
oldLoc = context.CompareContext.OlderVersion(m).NbLinesOfCode, | |
newLoc = m.NbLinesOfCode, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment