awslabs / aws-crt-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 457 units with 3,512 lines of code in units (39.7% of code).
    • 0 very long units (0 lines of code)
    • 4 long units (250 lines of code)
    • 25 medium size units (719 lines of code)
    • 79 small units (1,097 lines of code)
    • 349 very small units (1,446 lines of code)
0% | 7% | 20% | 31% | 41%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp0% | 8% | 20% | 32% | 38%
h0% | 0% | 21% | 24% | 54%
py0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
source/mqtt0% | 20% | 34% | 33% | 11%
source/http0% | 14% | 39% | 20% | 25%
source/iot0% | 60% | 35% | 0% | 3%
source/io0% | 0% | 21% | 35% | 43%
include/aws0% | 0% | 21% | 24% | 54%
source/auth0% | 0% | 14% | 48% | 36%
source0% | 0% | 3% | 26% | 69%
source/crypto0% | 0% | 0% | 65% | 34%
codebuild0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
bool HttpClientConnection::CreateConnection()
in source/http/HttpConnection.cpp
69 11 2
67 14 0
uint16_t MqttConnection::Subscribe()
in source/mqtt/MqttClient.cpp
62 8 3
bool MqttConnection::Connect()
in source/mqtt/MqttClient.cpp
52 8 5
uint16_t MqttConnection::Subscribe()
in source/mqtt/MqttClient.cpp
43 6 4
uint16_t MqttConnection::Publish()
in source/mqtt/MqttClient.cpp
41 5 5
40 3 1
39 9 1
37 6 3
35 7 2
35 4 2
34 8 0
bool Sigv4HttpRequestSigner::SignRequest()
in source/auth/Sigv4Signing.cpp
33 5 3
void MqttConnection::s_onMultiSubAck()
in source/mqtt/MqttClient.cpp
31 4 5
std::shared_ptr MqttClient::NewConnection()
in source/mqtt/MqttClient.cpp
29 3 5
27 1 3
void HttpClientConnectionManager::s_onConnectionSetup()
in source/http/HttpConnectionManager.cpp
27 3 3
25 5 2
size_type find_last_of()
in include/aws/crt/StringView.h
24 6 3
uint16_t MqttConnection::Unsubscribe()
in source/mqtt/MqttClient.cpp
23 4 2