microsoft / pict
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 288 units with 5,105 lines of code in units (61.5% of code).
    • 7 very long units (1,055 lines of code)
    • 18 long units (1,214 lines of code)
    • 44 medium size units (1,398 lines of code)
    • 57 small units (861 lines of code)
    • 162 very small units (577 lines of code)
20% | 23% | 27% | 16% | 11%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp21% | 24% | 28% | 17% | 7%
h0% | 0% | 11% | 0% | 88%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cli25% | 22% | 26% | 18% | 7%
api13% | 23% | 30% | 14% | 17%
api-usage0% | 100% | 0% | 0% | 0%
clidll0% | 0% | 0% | 100% | 0%
clidll-usage0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
void Model::gcd()
in api/model.cpp
259 59 1
bool parseArg()
in cli/cmdline.cpp
189 32 2
145 30 1
122 26 2
116 21 0
115 14 1
109 17 1
94 22 1
88 22 1
75 16 2
void __cdecl wmain()
in api-usage/pictapi-sample.cpp
74 5 0
72 19 0
int Parameter::PickValue()
in api/parameter.cpp
70 17 0
68 10 0
68 17 0
void CTerm::Print()
in cli/ccommon.cpp
67 16 0
64 12 0
64 14 0
61 12 0
60 12 0