awslabs / amazon-kinesis-video-streams-webrtc-sdk-c
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 562 units with 17,433 lines of code in units (59.7% of code).
    • 3 very complex units (741 lines of code)
    • 12 complex units (1,792 lines of code)
    • 65 medium complex units (4,187 lines of code)
    • 121 simple units (4,419 lines of code)
    • 361 very simple units (6,294 lines of code)
4% | 10% | 24% | 25% | 36%
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
c3% | 10% | 24% | 25% | 35%
h38% | 0% | 22% | 5% | 33%
cpp0% | 0% | 0% | 40% | 59%
py0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/source/Stun53% | 0% | 5% | 4% | 35%
src/source/PeerConnection5% | 16% | 21% | 24% | 32%
src/source/Signaling0% | 18% | 33% | 17% | 31%
src/source/Ice0% | 8% | 31% | 34% | 25%
src/source/Rtp0% | 17% | 37% | 16% | 28%
src/source/Crypto0% | 0% | 7% | 36% | 55%
src/source/Rtcp0% | 0% | 22% | 15% | 62%
src/source/Sdp0% | 0% | 21% | 19% | 59%
src/source/Metrics0% | 0% | 23% | 0% | 76%
tst0% | 0% | 0% | 28% | 71%
src/source/Sctp0% | 0% | 0% | 36% | 63%
bench0% | 0% | 0% | 80% | 19%
src/source/Srtp0% | 0% | 0% | 41% | 58%
scripts0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
STATUS deserializeStunPacket()
in src/source/Stun/Stun.c
321 74 5
JSMN_API int jsmn_parse()
in src/source/PeerConnection/jsmn.h
172 74 5
STATUS serializeStunPacket()
in src/source/Stun/Stun.c
248 65 7
INT32 lwsHttpCallbackRoutine()
in src/source/Signaling/LwsApiCalls.c
198 45 5
STATUS receiveLwsMessage()
in src/source/Signaling/LwsApiCalls.c
191 44 3
STATUS turnConnectionStepState()
in src/source/Ice/TurnConnection.c
174 44 1
INT32 lwsWssCallbackRoutine()
in src/source/Signaling/LwsApiCalls.c
161 39 5
STATUS depayH264FromRtpPayload()
in src/source/Rtp/Codecs/RtpH264Payloader.c
135 34 5
STATUS populateSingleMediaSection()
in src/source/PeerConnection/SessionDescription.c
214 32 7
STATUS getLocalhostIpAddresses()
in src/source/Ice/Network.c
109 29 4
STATUS writeFrame()
in src/source/PeerConnection/Rtp.c
172 28 2
STATUS iceAgentAddRemoteCandidate()
in src/source/Ice/IceAgent.c
120 28 2
STATUS createValidateChannelInfo()
in src/source/Signaling/ChannelInfo.c
138 27 2
STATUS setRemoteDescription()
in src/source/PeerConnection/PeerConnection.c
79 27 2
STATUS setPayloadTypesFromOffer()
in src/source/PeerConnection/SessionDescription.c
101 26 3
STATUS lwsCompleteSync()
in src/source/Signaling/LwsApiCalls.c
101 24 1
PVOID connectionListenerReceiveDataRoutine()
in src/source/Ice/ConnectionListener.c
117 24 1
STATUS deserializeSignalingCacheEntries()
in src/source/Signaling/FileCache.c
75 23 5
static int jsmn_parse_string()
in src/source/PeerConnection/jsmn.h
57 23 5
STATUS handleStunPacket()
in src/source/Ice/IceAgent.c
161 23 6