awslabs / smithy
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 5,955 units with 38,190 lines of code in units (69.8% of code).
    • 0 very complex units (0 lines of code)
    • 3 complex units (258 lines of code)
    • 40 medium complex units (2,110 lines of code)
    • 171 simple units (3,979 lines of code)
    • 5,741 very simple units (31,843 lines of code)
0% | <1% | 5% | 10% | 83%
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
java0% | <1% | 5% | 10% | 83%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
smithy-jmespath0% | 4% | 12% | 14% | 68%
smithy-model0% | <1% | 4% | 12% | 82%
smithy-jsonschema0% | 5% | 7% | 7% | 78%
smithy-utils0% | 0% | 16% | 11% | 71%
smithy-openapi0% | 0% | 8% | 2% | 89%
smithy-aws-apigateway-openapi0% | 0% | 13% | 10% | 75%
smithy-diff0% | 0% | 6% | 13% | 79%
smithy-build0% | 0% | 2% | 5% | 91%
smithy-cli0% | 0% | 4% | 22% | 73%
smithy-aws-cloudformation0% | 0% | 3% | 1% | 94%
smithy-codegen-core0% | 0% | 1% | 9% | 88%
smithy-aws-traits0% | 0% | 0% | 11% | 88%
smithy-waiters0% | 0% | 0% | 9% | 90%
smithy-mqtt-traits0% | 0% | 0% | 11% | 88%
smithy-aws-apigateway-traits0% | 0% | 0% | 5% | 94%
smithy-aws-cloudformation-traits0% | 0% | 0% | 4% | 95%
smithy-aws-iam-traits0% | 0% | 0% | 2% | 97%
smithy-linters0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
public Builder disableProperty()
in smithy-jsonschema/src/main/java/software/amazon/smithy/jsonschema/Schema.java
75 35 1
TokenIterator doTokenize()
in smithy-jmespath/src/main/java/software/amazon/smithy/jmespath/Lexer.java
95 33 0
private void parseShape()
in smithy-model/src/main/java/software/amazon/smithy/model/loader/IdlModelParser.java
88 26 1
private static String parseStringContents()
in smithy-model/src/main/java/software/amazon/smithy/model/loader/IdlTextParser.java
80 25 3
private String consumeInsideString()
in smithy-jmespath/src/main/java/software/amazon/smithy/jmespath/Lexer.java
83 24 0
public static int levenshteinDistance()
in smithy-utils/src/main/java/software/amazon/smithy/utils/StringUtils.java
123 24 3
private Optional validateTarget()
in smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/TargetValidator.java
61 24 4
private void loadShape()
in smithy-model/src/main/java/software/amazon/smithy/model/loader/AstModelLoader.java
73 23 4
public AbstractShapeBuilder createBuilderForType()
in smithy-model/src/main/java/software/amazon/smithy/model/shapes/ShapeType.java
50 23 0
public static String wrap()
in smithy-utils/src/main/java/software/amazon/smithy/utils/StringUtils.java
87 22 5
static OpenApiMapper compose()
in smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/OpenApiMapper.java
153 22 1
private void readValue()
in smithy-model/src/main/java/software/amazon/smithy/model/node/internal/JsonParser.java
37 18 0
private JmespathExpression led()
in smithy-jmespath/src/main/java/software/amazon/smithy/jmespath/Parser.java
44 16 1
static Node parseNode()
in smithy-model/src/main/java/software/amazon/smithy/model/loader/IdlNodeParser.java
33 16 1
private InternalSelector createSelector()
in smithy-model/src/main/java/software/amazon/smithy/model/selector/SelectorParser.java
62 16 0
static OpenApiMapper wrap()
in smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/ApiGatewayMapper.java
133 16 1
private void visitLiteral()
in smithy-jmespath/src/main/java/software/amazon/smithy/jmespath/ExpressionSerializer.java
57 15 2
private static DiffStrategy fromTag()
in smithy-diff/src/main/java/software/amazon/smithy/diff/evaluators/ModifiedTrait.java
32 15 2
private AttributeComparator parseComparator()
in smithy-model/src/main/java/software/amazon/smithy/model/selector/SelectorParser.java
65 15 1
private boolean pushMatch()
in smithy-model/src/main/java/software/amazon/smithy/model/selector/TopDownSelector.java
26 15 5