awslabs / amazon-kinesis-video-streams-pic
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 804 units with 15,672 lines of code in units (38.9% of code).
    • 2 very complex units (475 lines of code)
    • 6 complex units (521 lines of code)
    • 40 medium complex units (2,362 lines of code)
    • 99 simple units (3,462 lines of code)
    • 657 very simple units (8,852 lines of code)
3% | 3% | 15% | 22% | 56%
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% | 4% | 18% | 22% | 50%
cpp0% | 0% | 0% | 24% | 75%
h0% | 0% | 0% | 3% | 96%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/client6% | 4% | 16% | 21% | 50%
src/mkvgen0% | 9% | 29% | 32% | 28%
src/utils0% | 0% | 9% | 17% | 73%
src/view0% | 0% | 26% | 8% | 65%
src/duration0% | 0% | 29% | 34% | 35%
src/heap0% | 0% | 3% | 32% | 63%
src/trace0% | 0% | 0% | 18% | 81%
src/state0% | 0% | 0% | 8% | 91%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
STATUS getStreamData()
in src/client/src/Stream.c
249 73 5
STATUS putFrame()
in src/client/src/Stream.c
226 54 2
STATUS parseFragmentAck()
in src/client/src/AckParser.c
143 46 4
STATUS serviceCallResultCheck()
in src/client/src/StreamEvent.c
85 43 1
BOOL serviceCallResultRetry()
in src/client/src/StreamEvent.c
50 43 1
STATUS adaptFrameNalsFromAnnexBToAvcc()
in src/mkvgen/src/NalAdapter.c
73 33 5
STATUS parseH264SpsGetResolution()
in src/mkvgen/src/SpsParser.c
100 33 4
STATUS validateClientCallbacks()
in src/client/src/InputValidator.c
70 27 2
32 24 1
STATUS streamFragmentAckEvent()
in src/client/src/StreamEvent.c
81 24 3
STATUS traverseDirectory()
in src/utils/src/Directory.c
101 23 4
STATUS mkvgenPackageFrame()
in src/mkvgen/src/MkvGenerator.c
108 23 6
STATUS frameOrderCoordinatorPutFrame()
in src/client/src/FrameOrderCoordinator.c
67 21 2
STATUS mkvgenAdaptCodecPrivateData()
in src/mkvgen/src/MkvGenerator.c
70 20 8
STATUS freeKinesisVideoClientInternal()
in src/client/src/Client.c
74 19 2
STATUS createMkvGenerator()
in src/mkvgen/src/MkvGenerator.c
100 19 11
36 18 2
STATUS createStream()
in src/client/src/Stream.c
166 17 3
STATUS stopStream()
in src/client/src/Stream.c
67 17 1
STATUS streamFragmentPersistedAck()
in src/client/src/Stream.c
67 17 3