microsoft / RIoT
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 771 units with 18,932 lines of code in units (51.0% of code).
    • 10 very long units (1,659 lines of code)
    • 72 long units (4,860 lines of code)
    • 245 medium size units (7,986 lines of code)
    • 186 small units (2,712 lines of code)
    • 258 very small units (1,715 lines of code)
8% | 25% | 42% | 14% | 9%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c9% | 27% | 40% | 14% | 8%
cs4% | 18% | 47% | 15% | 13%
cpp26% | 20% | 33% | 8% | 10%
java0% | 0% | 72% | 10% | 16%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Simulation/RIoT9% | 27% | 40% | 14% | 7%
Reference/RIoT9% | 27% | 40% | 14% | 7%
Tools/RIoT8% | 15% | 44% | 17% | 13%
Tools/TlsClient42% | 0% | 41% | 0% | 16%
Tools/RIoTDemo0% | 39% | 42% | 0% | 18%
Simulation/DICE0% | 57% | 29% | 0% | 12%
Tools/DICETest0% | 12% | 63% | 15% | 7%
Pkgs/NuGet0% | 23% | 35% | 21% | 18%
Pkgs/Maven0% | 0% | 72% | 10% | 16%
Simulation/FW0% | 0% | 65% | 34% | 0%
Reference0% | 0% | 32% | 57% | 10%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
int mbedtls_aes_self_test()
in Reference/RIoT/RIoTCrypt/aes.c
315 73 1
int mbedtls_aes_self_test()
in Simulation/RIoT/Core/RIoTCrypt/aes.c
315 73 1
int mbedtls_internal_sha1_process()
in Reference/RIoT/RIoTCrypt/sha1.c
143 2 2
int mbedtls_internal_sha1_process()
in Simulation/RIoT/Core/RIoTCrypt/sha1.c
143 2 2
static void Main()
in Tools/RIoT/Main.cs
143 21 1
int mbedtls_mpi_exp_mod()
in Reference/RIoT/RIoTCrypt/bignum.c
129 33 5
int mbedtls_mpi_exp_mod()
in Simulation/RIoT/Core/RIoTCrypt/bignum.c
129 33 5
int mbedtls_mpi_self_test()
in Reference/RIoT/RIoTCrypt/bignum.c
117 26 1
int mbedtls_mpi_self_test()
in Simulation/RIoT/Core/RIoTCrypt/bignum.c
117 26 1
int main()
in Tools/TlsClient/TlsClient.cpp
108 16 2
int mbedtls_ecp_self_test()
in Reference/RIoT/RIoTCrypt/ecp.c
97 18 1
int mbedtls_ecp_self_test()
in Simulation/RIoT/Core/RIoTCrypt/ecp.c
97 18 1
int mbedtls_mpi_div_mpi()
in Reference/RIoT/RIoTCrypt/bignum.c
94 17 4
int mbedtls_mpi_div_mpi()
in Simulation/RIoT/Core/RIoTCrypt/bignum.c
94 17 4
private async void Timer1_Tick()
in Tools/RIoTDemo/MainPage.cs
92 20 2
int mbedtls_aes_setkey_enc()
in Reference/RIoT/RIoTCrypt/aes.c
91 17 3
static int ecp_precompute_comb()
in Reference/RIoT/RIoTCrypt/ecp.c
91 28 6
int mbedtls_aes_setkey_enc()
in Simulation/RIoT/Core/RIoTCrypt/aes.c
91 17 3
static int ecp_precompute_comb()
in Simulation/RIoT/Core/RIoTCrypt/ecp.c
91 28 6
static int ecdsa_sign_restartable()
in Reference/RIoT/RIoTCrypt/ecdsa.c
90 18 7