awslabs / amazon-kinesis-video-streams-pic
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 804 units with 15,672 lines of code in units (38.9% of code).
    • 8 very long units (1,270 lines of code)
    • 38 long units (2,608 lines of code)
    • 210 medium size units (6,271 lines of code)
    • 253 small units (3,608 lines of code)
    • 295 very small units (1,915 lines of code)
8% | 16% | 40% | 23% | 12%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c7% | 20% | 41% | 20% | 9%
h17% | 0% | 10% | 24% | 47%
cpp6% | 0% | 40% | 35% | 17%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/client14% | 17% | 40% | 20% | 6%
src/mkvgen5% | 41% | 35% | 13% | 3%
src/utils2% | 6% | 35% | 29% | 26%
src/heap0% | 8% | 47% | 26% | 16%
src/view0% | 11% | 56% | 26% | 5%
src/trace0% | 26% | 63% | 5% | 4%
src/duration0% | 0% | 82% | 8% | 8%
src/state0% | 0% | 28% | 58% | 13%
Alternative Visuals
Longest Units
Top 20 longest 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 createStream()
in src/client/src/Stream.c
166 17 3
void initTestMembers()
in src/client/tst/ClientTestFixture.h
150 2 0
STATUS parseFragmentAck()
in src/client/src/AckParser.c
143 46 4
VOID ClientApiFunctionalityTest::authIntegrationTest()
in src/client/tst/ClientApiFunctionalityTest.cpp
127 8 1
STATUS mkvgenPackageFrame()
in src/mkvgen/src/MkvGenerator.c
108 23 6
STATUS traverseDirectory()
in src/utils/src/Directory.c
101 23 4
STATUS parseH264SpsGetResolution()
in src/mkvgen/src/SpsParser.c
100 33 4
STATUS createMkvGenerator()
in src/mkvgen/src/MkvGenerator.c
100 19 11
STATUS mkvgenEbmlEncodeTrackInfo()
in src/mkvgen/src/MkvGenerator.c
93 10 4
STATUS streamTerminatedEvent()
in src/client/src/StreamEvent.c
89 15 4
STATUS parseH265Sps()
in src/mkvgen/src/SpsParser.c
87 12 3
STATUS createKinesisVideoClient()
in src/client/src/Client.c
85 10 3
STATUS serviceCallResultCheck()
in src/client/src/StreamEvent.c
85 43 1
STATUS hybridCreateHeap()
in src/heap/src/HybridHeap.c
83 9 4
STATUS streamFragmentAckEvent()
in src/client/src/StreamEvent.c
81 24 3
STATUS adaptH265CpdNalsFromAnnexBToHvcc()
in src/mkvgen/src/NalAdapter.c
75 8 4
STATUS freeKinesisVideoClientInternal()
in src/client/src/Client.c
74 19 2
STATUS resetStream()
in src/client/src/Stream.c
73 6 1