microsoft / cpprestsdk
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 2,089 units with 23,389 lines of code in units (62.6% of code).
    • 21 very long units (3,369 lines of code)
    • 42 long units (2,851 lines of code)
    • 205 medium size units (6,582 lines of code)
    • 310 small units (4,412 lines of code)
    • 1,511 very small units (6,175 lines of code)
14% | 12% | 28% | 18% | 26%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp24% | 17% | 31% | 15% | 11%
h0% | 5% | 18% | 25% | 49%
hpp0% | 1% | 35% | 20% | 41%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Release/src/http28% | 16% | 30% | 16% | 8%
Release/src/utilities34% | 22% | 21% | 9% | 10%
Release/src/websockets43% | 14% | 24% | 8% | 9%
Release/src/uri21% | 9% | 42% | 14% | 11%
Release/src/json9% | 21% | 26% | 17% | 26%
Release/src/streams0% | 22% | 50% | 16% | 9%
Release/include/cpprest0% | 4% | 23% | 23% | 49%
Release/include/pplx0% | 6% | 24% | 24% | 44%
Release/src/pplx0% | 0% | 16% | 34% | 48%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
static void CALLBACK completion_callback()
in Release/src/http/client/http_client_winhttp.cpp
506 82 5
datetime __cdecl datetime::from_string_maximum_error()
in Release/src/utilities/asyncrt_utils.cpp
307 97 2
void send_request()
in Release/src/http/client/http_client_winhttp.cpp
254 39 1
static void _transfer_encoding_chunked_write_data()
in Release/src/http/client/http_client_winhttp.cpp
244 40 1
void start_request()
in Release/src/http/client/http_client_asio.cpp
141 32 0
pplx::task connect_impl()
in Release/src/websockets/client/ws_client_wspp.cpp
139 21 0
unsigned long open()
in Release/src/http/client/http_client_winhttp.cpp
137 26 0
virtual void send_request()
in Release/src/http/client/http_client_winrt.cpp
136 20 1
bool process_buffer()
in Release/src/http/client/http_client_winhttp.cpp
128 31 4
std::unique_ptr get_compressor_from_header()
in Release/src/http/common/http_compression.cpp
128 31 3
void windows_request_context::transmit_body()
in Release/src/http/listener/http_server_httpsys.cpp
127 15 0
void handle_read_content()
in Release/src/http/client/http_client_asio.cpp
122 13 1
void windows_request_context::async_process_response()
in Release/src/http/listener/http_server_httpsys.cpp
117 16 0
void send_msg()
in Release/src/websockets/client/ws_client_wspp.cpp
116 16 1
bool parse_from()
in Release/src/uri/uri.cpp
115 35 1
static bool handle_authentication_failure()
in Release/src/http/client/http_client_winhttp.cpp
113 21 3
bool JSON_Parser::CompleteNumberLiteral()
in Release/src/json/json_parsing.cpp
112 26 2
void send_msg()
in Release/src/websockets/client/ws_client_winrt.cpp
111 16 1
will_deref_and_erase_t asio_server_connection::handle_http_line()
in Release/src/http/listener/http_server_asio.cpp
106 19 1
void windows_request_context::read_headers_io_completion()
in Release/src/http/listener/http_server_httpsys.cpp
105 16 2