microsoft / moodle-block_microsoft
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 22 units with 534 lines of code in units (48.4% of code).
    • 1 very long units (127 lines of code)
    • 2 long units (153 lines of code)
    • 3 medium size units (74 lines of code)
    • 7 small units (117 lines of code)
    • 9 very small units (63 lines of code)
23% | 28% | 13% | 21% | 11%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
php24% | 28% | 13% | 22% | 10%
js0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT24% | 29% | 14% | 22% | 8%
db0% | 0% | 0% | 0% | 100%
js0% | 0% | 0% | 0% | 100%
classes/privacy0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
127 36 0
95 29 0
58 14 0
public function get_content()
in block_microsoft.php
31 9 0
22 5 1
21 6 1
20 2 0
20 2 0
19 5 0
15 2 2
15 5 1
15 3 2
13 1 0
10 2 0
10 4 1
10 3 2
9 1 1
9 3 1
5 1 2
public function init()
in block_microsoft.php
4 1 0