aws-samples / aws-alien-attack
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 371 units with 6,490 lines of code in units (75.9% of code).
    • 1 very complex units (12 lines of code)
    • 2 complex units (297 lines of code)
    • 11 medium complex units (447 lines of code)
    • 45 simple units (1,251 lines of code)
    • 312 very simple units (4,483 lines of code)
<1% | 4% | 6% | 19% | 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
js<1% | 6% | 9% | 24% | 58%
ts0% | 0% | 0% | 6% | 93%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
application/resources/libs<1% | 14% | 18% | 26% | 39%
application/game/js0% | 0% | 9% | 17% | 72%
infrastructure/cdk/lambdas0% | 0% | 0% | 22% | 77%
application/resources/js0% | 0% | 0% | 30% | 69%
application/scoreboard/js0% | 0% | 0% | 25% | 74%
infrastructure/cdk/lib0% | 0% | 0% | 6% | 93%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
this.D=!0}},stopCollectors:function()
in application/resources/libs/sjcl.js
12 71 0
ClientImpl.prototype._handleMessage = function()
in application/resources/libs/paho-mqtt.js
161 48 1
WireMessage.prototype.encode = function()
in application/resources/libs/paho-mqtt.js
136 39 0
function bnModInverse()
in application/resources/libs/jsbn2.js
40 22 1
function bnModPow()
in application/resources/libs/jsbn2.js
52 21 2
ClientImpl.prototype._disconnected = function()
in application/resources/libs/paho-mqtt.js
66 19 2
function bnpFromString()
in application/resources/libs/jsbn.js
37 17 2
function bnpDivRemTo()
in application/resources/libs/jsbn.js
45 17 3
function decodeMessage()
in application/resources/libs/paho-mqtt.js
65 16 2
function bnToString()
in application/resources/libs/jsbn.js
28 14 1
RegisterState.prototype.register = function()
in application/game/js/alienattack.js
32 13 0
function bnToByteArray()
in application/resources/libs/jsbn2.js
23 11 0
function bnIsProbablePrime()
in application/resources/libs/jsbn2.js
17 11 1
Game.prototype.userCanPlay = function()
in application/game/js/alienattack.js
42 11 0
const allocateSeatForGamer = function()
in infrastructure/cdk/lambdas/allocateGamer/index.js
56 10 4
retrieveData()
in application/scoreboard/js/scoreboard.kinesisinherited.js
50 10 1
login()
in application/scoreboard/js/scoreboard.js
39 10 3
makeAPIGatewayRequest()
in application/resources/js/awsfacade.js
27 10 3
function bnGCD()
in application/resources/libs/jsbn2.js
26 10 1
function bnpMillerRabin()
in application/resources/libs/jsbn2.js
23 10 1