microsoft / PSRule
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 1,828 units with 16,835 lines of code in units (62.8% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (47 lines of code)
    • 35 medium complex units (1,130 lines of code)
    • 191 simple units (3,730 lines of code)
    • 1,601 very simple units (11,928 lines of code)
0% | <1% | 6% | 22% | 70%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
cs0% | <1% | 6% | 22% | 70%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/PSRule/Runtime0% | 1% | 8% | 32% | 57%
src/PSRule/Common0% | 0% | 7% | 30% | 61%
src/PSRule/Parser0% | 0% | 16% | 23% | 60%
src/PSRule/Configuration0% | 0% | 14% | 14% | 71%
src/PSRule/Pipeline0% | 0% | 2% | 14% | 83%
src/PSRule/Commands0% | 0% | 17% | 32% | 49%
src/PSRule/Definitions0% | 0% | 2% | 20% | 77%
src/PSRule.Benchmark0% | 0% | 14% | 0% | 85%
src/PSRule/Host0% | 0% | 0% | 26% | 73%
src/PSRule/Rules0% | 0% | 0% | 14% | 85%
src/PSRule/Data0% | 0% | 0% | 7% | 92%
src/PSRule.Badges0% | 0% | 0% | 0% | 100%
src/PSRule.BuildTool0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
private static string DetectLinePrefix()
in src/PSRule/Runtime/Assert.cs
47 36 1
protected override void ProcessRecord()
in src/PSRule/Commands/AssertWithinCommand.cs
63 22 0
private InvokeResult ProcessTargetObject()
in src/PSRule/Pipeline/InvokeRulePipeline.cs
71 19 1
private void TryConsumeComparisonOperator()
in src/PSRule/Runtime/ObjectPath/PathTokenizer.cs
28 19 2
public int CompareTo()
in src/PSRule/Runtime/SemanticVersion.cs
32 19 1
private static string UnwrapStyleMarkers()
in src/PSRule/Parser/MarkdownReader.cs
47 17 2
private static PSObject ReadObject()
in src/PSRule/Common/JsonConverters.cs
50 16 3
private IResource MapResource()
in src/PSRule/Common/JsonConverters.cs
68 15 2
private static void RunDebug()
in src/PSRule.Benchmark/Program.cs
46 14 0
private void Text()
in src/PSRule/Parser/MarkdownReader.cs
21 14 0
private static string ReadText()
in src/PSRule/Parser/RuleLexer.cs
41 14 2
private PathExpressionFn BuildSelector()
in src/PSRule/Runtime/ObjectPath/PathExpressionBuilder.cs
29 14 1
private static PathExpressionFilterFn BinaryCondition()
in src/PSRule/Runtime/ObjectPath/PathExpressionBuilder.cs
28 14 3
public bool Equals()
in src/PSRule/Runtime/SemanticVersion.cs
26 14 1
internal static void Load()
in src/PSRule/Configuration/BaselineOption.cs
28 13 2
internal static bool Subset()
in src/PSRule/Definitions/Expressions/LanguageExpressions.cs
22 13 4
public AssertResult FileHeader()
in src/PSRule/Runtime/Assert.cs
24 13 4
internal static bool CompareNumeric()
in src/PSRule/Common/ExpressionHelpers.cs
38 12 5
private void MapProperty()
in src/PSRule/Common/JsonConverters.cs
45 12 3
public bool Equals()
in src/PSRule/Configuration/PSRuleOption.cs
15 12 1