awslabs / aws-iot-device-client
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 262 units with 5,962 lines of code in units (71.8% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 19 medium complex units (1,663 lines of code)
    • 39 simple units (1,717 lines of code)
    • 204 very simple units (2,582 lines of code)
0% | 0% | 27% | 28% | 43%
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
cpp0% | 0% | 28% | 29% | 42%
h0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
source/fleetprovisioning0% | 0% | 77% | 8% | 14%
source/config0% | 0% | 24% | 44% | 31%
source/jobs0% | 0% | 28% | 27% | 44%
source/shadow0% | 0% | 21% | 38% | 39%
source0% | 0% | 26% | 34% | 38%
source/util0% | 0% | 23% | 23% | 53%
source/tunneling0% | 0% | 17% | 0% | 82%
source/logging0% | 0% | 0% | 18% | 81%
source/devicedefender0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
int main()
in source/main.cpp
161 24 2
void PlainJobDocument::LoadFromJobDocument()
in source/jobs/JobDocument.cpp
81 23 1
bool PlainConfig::Validate()
in source/config/Config.cpp
83 22 0
bool PlainConfig::LoadFromJson()
in source/config/Config.cpp
117 19 1
bool FleetProvisioning::CreateCertificateAndKey()
in source/fleetprovisioning/FleetProvisioning.cpp
148 17 1
96 17 1
bool Retry::exponentialBackoff()
in source/util/Retry.cpp
50 16 3
void ConfigShadow::resetClientConfigWithJSON()
in source/shadow/ConfigShadow.cpp
97 16 3
bool FleetProvisioning::CreateCertificateUsingCSR()
in source/fleetprovisioning/FleetProvisioning.cpp
142 15 1
bool FleetProvisioning::ProvisionDevice()
in source/fleetprovisioning/FleetProvisioning.cpp
63 14 2
bool FleetProvisioning::RegisterThing()
in source/fleetprovisioning/FleetProvisioning.cpp
113 13 1
bool PlainConfig::LoadFromCliArgs()
in source/config/Config.cpp
27 13 1
int JobEngine::exec_cmd()
in source/jobs/JobEngine.cpp
81 13 2
void SampleShadowFeature::runFileMonitor()
in source/shadow/SampleShadowFeature.cpp
70 13 0
void SecureTunnelingFeature::OnSubscribeToTunnelsNotifyResponse()
in source/tunneling/SecureTunnelingFeature.cpp
71 12 2
44 12 0
35 12 1
int EnvUtils::AppendCwdToPath()
in source/util/EnvUtils.cpp
74 11 0
110 11 3
53 10 1