microsoft / moodle-local_onenote
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 54 units with 1,088 lines of code in units (83.4% of code).
    • 1 very long units (103 lines of code)
    • 7 long units (411 lines of code)
    • 8 medium size units (265 lines of code)
    • 10 small units (153 lines of code)
    • 28 very small units (156 lines of code)
9% | 37% | 24% | 14% | 14%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
php9% | 37% | 24% | 14% | 14%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
classes/api11% | 39% | 25% | 13% | 9%
db0% | 100% | 0% | 0% | 0%
classes/privacy0% | 0% | 28% | 14% | 57%
classes0% | 0% | 0% | 72% | 27%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public function get_items_list()
in classes/api/base.php
103 20 1
public function get_page()
in classes/api/base.php
82 26 6
public function download_page()
in classes/api/base.php
58 11 2
56 17 0
56 10 3
54 10 1
53 8 4
52 18 2
44 10 0
44 8 3
protected function process_tags()
in classes/api/base.php
42 11 2
34 5 6
public static function get_metadata()
in classes/privacy/provider.php
31 3 1
25 4 5
protected function sync_sections()
in classes/api/base.php
24 5 3
protected function get_section()
in classes/api/base.php
21 7 2
19 2 3
19 5 1
19 4 1
16 1 7