aws / aws-iot-device-sdk-cpp
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 350 units with 5,194 lines of code in units (56.2% of code).
    • 6 very long units (864 lines of code)
    • 11 long units (756 lines of code)
    • 53 medium size units (1,682 lines of code)
    • 70 small units (989 lines of code)
    • 210 very small units (903 lines of code)
16% | 14% | 32% | 19% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp17% | 14% | 33% | 19% | 15%
hpp0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
network/WebSocket32% | 11% | 30% | 14% | 11%
common93% | 0% | 0% | 0% | 6%
network/MbedTLS59% | 0% | 30% | 5% | 4%
src/mqtt10% | 14% | 27% | 28% | 18%
src/discovery42% | 25% | 13% | 4% | 13%
src/shadow0% | 36% | 40% | 12% | 10%
cli0% | 41% | 26% | 26% | 5%
network/OpenSSL0% | 14% | 79% | 3% | 3%
src/util0% | 12% | 27% | 23% | 37%
src0% | 0% | 57% | 18% | 23%
src/jobs0% | 0% | 24% | 55% | 19%
include/mqtt0% | 0% | 0% | 0% | 100%
include0% | 0% | 0% | 0% | 100%
include/util0% | 0% | 0% | 0% | 100%
include/discovery0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
183 31 1
ResponseCode MbedTLSConnection::ConnectInternal()
in network/MbedTLS/MbedTLSConnection.cpp
157 24 0
155 34 2
ssize_t wslay_frame_send()
in network/WebSocket/wslay/wslay_frame.cpp
131 26 2
ssize_t wslay_frame_recv()
in network/WebSocket/wslay/wslay_frame.cpp
125 32 2
113 32 4
ResponseCode WebSocketConnection::InitializeCanonicalQueryString()
in network/WebSocket/WebSocketConnection.cpp
93 6 1
90 17 1
78 16 2
70 21 5
68 15 2
ResponseCode DiscoveryResponse::GetParsedResponse()
in src/discovery/DiscoveryResponse.cpp
67 15 3
62 13 2
ResponseCode JsonParser::DiffValues()
in src/util/JsonParser.cpp
61 15 4
ResponseCode OpenSSLConnection::ConnectTCPSocket()
in network/OpenSSL/OpenSSLConnection.cpp
61 10 0
55 4 0
51 9 2
ResponseCode JsonParser::MergeValues()
in src/util/JsonParser.cpp
50 13 3
ResponseCode OpenSSLConnection::ReadInternal()
in network/OpenSSL/OpenSSLConnection.cpp
49 13 4
48 9 1