aws-samples / aws-iot-chat-example
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 77 units with 883 lines of code in units (28.7% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 3 medium complex units (145 lines of code)
    • 2 simple units (64 lines of code)
    • 72 very simple units (674 lines of code)
0% | 0% | 16% | 7% | 76%
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
js0% | 0% | 16% | 7% | 76%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
client/src/reducers0% | 0% | 53% | 17% | 28%
client/src/lib0% | 0% | 7% | 0% | 92%
client/src/components0% | 0% | 0% | 6% | 93%
client/src0% | 0% | 0% | 0% | 100%
api/src/user0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
export default()
in client/src/reducers/authReducer.js
60 13 2
initClient()
in client/src/lib/iot-client.js
16 12 1
export default()
in client/src/reducers/chatReducer.js
69 12 2
export default()
in client/src/reducers/iotReducer.js
42 8 2
componentWillReceiveProps()
in client/src/components/App.js
22 6 1
function buildCanonicalQueryString()
in client/src/lib/sigV4Client.js
21 5 1
export default function register()
in client/src/registerServiceWorker.js
16 5 0
function buildCanonicalHeaders()
in client/src/lib/sigV4Client.js
15 4 1
constructor()
in client/src/lib/iot-client.js
12 4 2
export default()
in client/src/reducers/unreadsReducer.js
16 4 2
function buildCanonicalSignedHeaders()
in client/src/lib/sigV4Client.js
10 3 1
export default()
in client/src/reducers/roomsReducer.js
14 3 2
render()
in client/src/components/Auth/Login.js
51 3 0
function registerValidSW()
in client/src/registerServiceWorker.js
21 3 1
function checkValidServiceWorker()
in client/src/registerServiceWorker.js
22 3 1
identityId: decodeURIComponent()
in api/src/user/get.js
6 2 1
export default()
in client/src/reducers/roomReducer.js
12 2 2
export default()
in client/src/reducers/usersReducer.js
11 2 2
export default()
in client/src/reducers/messagesReducer.js
16 2 2
onChange()
in client/src/components/Rooms/CreateRoom.js
6 2 3