microsoft / libHttpClient
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 1,066 units with 16,081 lines of code in units (33.9% of code).
    • 12 very long units (1,946 lines of code)
    • 39 long units (2,427 lines of code)
    • 169 medium size units (5,302 lines of code)
    • 201 small units (2,940 lines of code)
    • 645 very small units (3,466 lines of code)
12% | 15% | 32% | 18% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp9% | 19% | 39% | 19% | 12%
hpp10% | 10% | 30% | 17% | 30%
h30% | 0% | 11% | 15% | 42%
cs26% | 36% | 27% | 7% | 2%
mm0% | 33% | 18% | 27% | 20%
java0% | 0% | 0% | 32% | 67%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Source/WebSocket28% | 17% | 36% | 9% | 7%
Source/Task17% | 11% | 29% | 23% | 17%
Source/HTTP11% | 21% | 43% | 16% | 7%
Include/json_cpp7% | 8% | 27% | 19% | 36%
Utilities/CMake26% | 36% | 27% | 7% | 2%
Source/Global0% | 29% | 18% | 24% | 27%
Source/Common0% | 12% | 44% | 19% | 24%
Source/Mock0% | 39% | 40% | 19% | 0%
Source/Logger0% | 24% | 11% | 21% | 42%
Build/libHttpClient.Android0% | 0% | 0% | 32% | 67%
Include/httpClient0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
class alignas()
in Source/Task/LocklessQueue.h
477 48 1
HRESULT connect_impl()
in Source/WebSocket/Websocketpp/websocketpp_websocket.cpp
214 29 1
datetime __cdecl datetime::from_string()
in Include/json_cpp/details/asyncrt_utils.hpp
167 23 2
static bool verify_X509_cert_chain()
in Source/WebSocket/Websocketpp/x509_cert_utilities.hpp
147 3 2
void xmlhttp_http_task::perform_async()
in Source/HTTP/XMLHttp/xmlhttp_http_task.cpp
138 17 2
void CALLBACK WinHttpConnection::completion_callback()
in Source/HTTP/WinHttp/winhttp_connection.cpp
133 20 5
HRESULT WinHttpConnection::Initialize()
in Source/HTTP/WinHttp/winhttp_connection.cpp
127 19 0
bool JSON_Parser::CompleteNumberLiteral()
in Include/json_cpp/details/json_parsing.hpp
115 26 2
HRESULT WebsocketConnectDoWork()
in Source/WebSocket/WinRT/winrt_websocket.cpp
113 15 2
utility::string_t datetime::to_string()
in Include/json_cpp/details/asyncrt_utils.hpp
106 14 1
HRESULT HC_WEBSOCKET::Connect()
in Source/WebSocket/hcwebsocket.cpp
106 14 3
static void Main()
in Utilities/CMake/ProjectFileProcessor/Program.cs
103 8 1
void JSON_Parser::GetNextToken()
in Include/json_cpp/details/json_parsing.hpp
90 34 1
bool http_call_should_retry()
in Source/HTTP/httpcall.cpp
86 22 2
void retry_http_call_until_done()
in Source/HTTP/httpcall.cpp
86 14 1
HRESULT Initialize()
in Source/Task/ThreadPool_stl.cpp
86 17 2
STDAPI XAsyncGetResult()
in Source/Task/AsyncLib.cpp
81 12 5
75 8 0
private static void DiffFiles()
in Utilities/CMake/ProjectFileProcessor/Program.cs
75 10 3
void WinHttpConnection::callback_status_request_error()
in Source/HTTP/WinHttp/winhttp_connection.cpp
74 8 3