awslabs / amazon-kinesis-video-streams-webrtc-sdk-c
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 562 units with 17,433 lines of code in units (59.7% of code).
    • 22 very long units (3,379 lines of code)
    • 53 long units (3,516 lines of code)
    • 227 medium size units (7,136 lines of code)
    • 194 small units (2,960 lines of code)
    • 66 very small units (442 lines of code)
19% | 20% | 40% | 16% | 2%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c19% | 19% | 41% | 17% | 1%
h38% | 12% | 25% | 12% | 11%
cpp0% | 33% | 31% | 17% | 17%
py0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/source/Signaling30% | 15% | 35% | 18% | <1%
src/source/Ice15% | 28% | 42% | 11% | 1%
src/source/PeerConnection22% | 24% | 35% | 15% | 1%
src/source/Stun53% | 5% | 20% | 19% | <1%
src/source/Rtp17% | 23% | 54% | 4% | 0%
src/source/Crypto0% | 10% | 57% | 28% | 2%
tst0% | 18% | 38% | 24% | 18%
bench0% | 80% | 0% | 0% | 19%
src/source/Sdp0% | 21% | 27% | 50% | 0%
src/source/Metrics0% | 23% | 64% | 7% | 4%
src/source/Rtcp0% | 0% | 71% | 23% | 4%
src/source/Sctp0% | 0% | 74% | 13% | 12%
src/source/Srtp0% | 0% | 59% | 40% | 0%
scripts0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
STATUS deserializeStunPacket()
in src/source/Stun/Stun.c
321 74 5
STATUS serializeStunPacket()
in src/source/Stun/Stun.c
248 65 7
STATUS populateSingleMediaSection()
in src/source/PeerConnection/SessionDescription.c
214 32 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
JSMN_API int jsmn_parse()
in src/source/PeerConnection/jsmn.h
172 74 5
STATUS writeFrame()
in src/source/PeerConnection/Rtp.c
172 28 2
INT32 lwsWssCallbackRoutine()
in src/source/Signaling/LwsApiCalls.c
161 39 5
STATUS handleStunPacket()
in src/source/Ice/IceAgent.c
161 23 6
STATUS createValidateChannelInfo()
in src/source/Signaling/ChannelInfo.c
138 27 2
STATUS depayH264FromRtpPayload()
in src/source/Rtp/Codecs/RtpH264Payloader.c
135 34 5
STATUS createSignalingSync()
in src/source/Signaling/Signaling.c
132 18 5
STATUS iceAgentAddRemoteCandidate()
in src/source/Ice/IceAgent.c
120 28 2
PVOID connectionListenerReceiveDataRoutine()
in src/source/Ice/ConnectionListener.c
117 24 1
STATUS getLocalhostIpAddresses()
in src/source/Ice/Network.c
109 29 4
STATUS turnConnectionHandleStun()
in src/source/Ice/TurnConnection.c
106 20 3
STATUS describeChannelLws()
in src/source/Signaling/LwsApiCalls.c
103 17 2
STATUS getChannelEndpointLws()
in src/source/Signaling/LwsApiCalls.c
103 22 2
STATUS parseRtcpTwccPacket()
in src/source/PeerConnection/Rtcp.c
102 17 2