aws / smithy-go
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,442 units with 13,623 lines of code in units (77.9% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (247 lines of code)
    • 29 medium complex units (1,610 lines of code)
    • 77 simple units (2,361 lines of code)
    • 1,334 very simple units (9,405 lines of code)
0% | 1% | 11% | 17% | 69%
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% | 2% | 10% | 19% | 68%
go0% | <1% | 14% | 14% | 70%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
codegen0% | 2% | 10% | 19% | 68%
document0% | 4% | 32% | 27% | 34%
testing0% | 0% | 29% | 4% | 65%
encoding0% | 0% | 16% | 17% | 66%
transport0% | 0% | 15% | 26% | 58%
middleware0% | 0% | 0% | 6% | 93%
waiter0% | 0% | 0% | 71% | 28%
ROOT0% | 0% | 0% | 13% | 86%
ptr0% | 0% | 0% | 0% | 100%
time0% | 0% | 0% | 0% | 100%
io0% | 0% | 0% | 0% | 100%
rand0% | 0% | 0% | 0% | 100%
logging0% | 0% | 0% | 0% | 100%
sync0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
private void generateOperationEventStreamStructure()
in codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/EventStreamGenerator.java
206 33 2
func isValidJSONNumber()
in document/json/encoder.go
41 26 1
private void generateShapeValidationFunctions()
in codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/integration/ValidationGenerator.java
147 24 5
private String generateHttpHeaderValue()
in codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/integration/HttpBindingProtocolGenerator.java
125 22 5
func sortFlattenedNodes()
in testing/xml/xmlToStruct.go
84 22 1
func()
in document/json/decoder.go
83 19 1
func Indirect()
in document/internal/serde/serde.go
34 17 2
private void writePaginator()
in codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/integration/Paginators.java
179 17 7
func escapeStringBytes()
in encoding/json/escape.go
61 16 2
func()
in document/json/decoder.go
46 15 1
public static void writeIfNonZeroValue()
in codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/GoValueAccessUtils.java
33 15 7
public static void writeIfZeroValue()
in codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/GoValueAccessUtils.java
37 15 7
func XMLToStruct()
in testing/xml/xmlToStruct.go
55 15 3
func escapeString()
in encoding/xml/escape.go
40 15 2
func escapeText()
in encoding/xml/escape.go
40 15 2
func enumFields()
in document/internal/serde/field.go
46 14 1
func StructToXML()
in testing/xml/xmlToStruct.go
49 14 3
func()
in document/json/decoder.go
51 13 1
protected void writeScalarPointerInline()
in codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/ShapeValueGenerator.java
41 13 3
private void writeHttpBindingSetter()
in codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/integration/HttpBindingProtocolGenerator.java
51 13 6