microsoft / macos-cookbook
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 128 units with 622 lines of code in units (21.8% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 0 medium size units (0 lines of code)
    • 10 small units (152 lines of code)
    • 118 very small units (470 lines of code)
0% | 0% | 0% | 24% | 75%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
rb0% | 0% | 0% | 24% | 75%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
libraries0% | 0% | 0% | 28% | 71%
resources0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
20 8 1
type_to_commandline_string
in libraries/plist.rb
20 8 1
plistbuddy_command
in libraries/plist.rb
19 4 4
18 7 2
install_certificate
in libraries/security_cmd.rb
16 4 2
full_privileges
in libraries/remote_management.rb
14 1 0
find_apple_id
in libraries/developer_account.rb
12 4 2
setting_from_plist
in libraries/plist.rb
11 2 2
initialize
in libraries/xcode.rb
11 4 1
xcode_list_title
in libraries/xcode.rb
11 5 0
initialize
in libraries/developer_account.rb
10 2 3
initialize
in libraries/xcode.rb
10 2 3
catalog_recommendation_label
in libraries/command_line_tools.rb
9 2 0
kcpassword_hash
in libraries/macos_user.rb
9 1 1
latest_xcode_revision
in libraries/xcode.rb
9 2 1
initialize
in libraries/metadata_util.rb
8 1 1
import
in libraries/security_cmd.rb
8 1 2
minimum_required_os
in libraries/xcode.rb
8 7 0
setup_assistant_keypair_values
in resources/macos_user.rb
8 1 0
initialize
in libraries/command_line_tools.rb
7 2 0