aws / opsworks-cookbooks
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 154 units with 1,468 lines of code in units (10.7% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (67 lines of code)
    • 16 medium size units (445 lines of code)
    • 28 small units (409 lines of code)
    • 109 very small units (547 lines of code)
0% | 4% | 30% | 27% | 37%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 70% | 0% | 20% | 9%
rb0% | 0% | 32% | 27% | 39%
pl0% | 0% | 0% | 100% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
opsworks_ganglia0% | 33% | 13% | 15% | 38%
scm_helper0% | 0% | 96% | 0% | 3%
ebs0% | 0% | 35% | 49% | 14%
s3_file0% | 0% | 28% | 47% | 23%
rails0% | 0% | 82% | 0% | 17%
opsworks_commons0% | 0% | 8% | 20% | 70%
ssh_users0% | 0% | 28% | 28% | 43%
ssh_host_keys0% | 0% | 0% | 100% | 0%
apache20% | 0% | 0% | 100% | 0%
opsworks_berkshelf0% | 0% | 0% | 29% | 70%
opsworks_cloudwatchlogs0% | 0% | 0% | 100% | 0%
opsworks_ecs0% | 0% | 0% | 0% | 100%
gem_support0% | 0% | 0% | 0% | 100%
opsworks_custom_cookbooks0% | 0% | 0% | 0% | 100%
haproxy0% | 0% | 0% | 0% | 100%
deploy0% | 0% | 0% | 0% | 100%
opsworks_nodejs0% | 0% | 0% | 0% | 100%
opsworks_initial_setup0% | 0% | 0% | 0% | 100%
packages0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def metric_init()
in opsworks_ganglia/files/default/apache.py
67 1 1
self.assemble_raid
in ebs/libraries/block_device.rb
35 8 2
self.determine_database_adapter
in rails/libraries/rails_configuration.rb
34 8 4
self.wait_for_logical_volumes
in ebs/libraries/block_device.rb
33 8 1
self.parse_uri
in scm_helper/libraries/s3.rb
32 8 1
prepare_git_checkouts
in scm_helper/libraries/git.rb
31 4 1
prepare_svn_checkouts
in scm_helper/libraries/svn.rb
27 5 1
prepare_s3_checkouts
in scm_helper/libraries/s3.rb
27 1 1
self.get_from_s3
in s3_file/libraries/s3_file.rb
27 5 7
report
in opsworks_ganglia/files/default/haproxy.rb
27 7 0
ensure_scm_package_installed
in scm_helper/libraries/package.rb
26 8 1
prepare_archive_checkouts
in scm_helper/libraries/archive.rb
26 3 1
self.sign
in s3_file/libraries/s3_file.rb
26 4 6
local_asset
in opsworks_commons/providers/assets_installer.rb
26 12 0
setup_user
in ssh_users/libraries/user.rb
25 3 1
self.device_name
in ebs/libraries/ebs_volume.rb
22 5 1
self.volume_id
in ebs/libraries/ebs_volume.rb
21 5 1
self.aes256_decrypt
in s3_file/libraries/s3_file.rb
19 5 2
def update_stats()
in opsworks_ganglia/files/default/apache.py
19 2 0
self.with_region_detect
in s3_file/libraries/s3_file.rb
18 5 4