awslabs / aws-for-wordpress
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 513 units with 6,626 lines of code in units (89.4% of code).
    • 3 very long units (378 lines of code)
    • 12 long units (871 lines of code)
    • 61 medium size units (1,931 lines of code)
    • 121 small units (1,717 lines of code)
    • 316 very small units (1,729 lines of code)
5% | 13% | 29% | 25% | 26%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
php6% | 14% | 31% | 25% | 22%
js0% | 0% | 8% | 25% | 66%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
admin7% | 10% | 33% | 27% | 21%
public0% | 67% | 7% | 21% | 3%
admin/partials0% | 60% | 35% | 0% | 3%
includes0% | 17% | 15% | 14% | 51%
admin/js0% | 0% | 8% | 25% | 66%
ROOT0% | 0% | 0% | 0% | 100%
public/js0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public function define_template()
in admin/AmazonAI-Cloudformation.php
153 4 2
public function amazon_polly_register_settings()
in admin/class-amazonpolly-admin.php
114 7 0
public function convert_to_audio()
in admin/AmazonAI-PollyService.php
111 12 6
public function customize_register()
in public/class-amazonpolly-public.php
100 1 1
private function convert_to_audio()
in admin/class-amazonpolly-admin.php
91 13 6
public function content_filter()
in public/class-amazonpolly-public.php
86 20 1
public function ajax_translate()
in admin/AmazonAI-Translator.php
85 12 0
public function display_stack_creation_options()
in admin/AmazonAI-CloudFrontConfiguration.php
83 8 0
public function amazon_polly_ajax_translate()
in admin/class-amazonpolly-admin.php
75 13 0
function display_options()
in admin/AmazonAI-PollyConfiguration.php
65 4 0
function display_polly_gui()
in admin/partials/amazonpolly-metabox.php
64 14 1
private function show_translate_option()
in admin/AmazonAI-TranslateConfiguration.php
56 13 6
public function ajax_bulk_synthesize()
in admin/AmazonAI-PollyService.php
56 5 0
public function amazon_polly_ajax_transcribe()
in admin/class-amazonpolly-admin.php
55 5 0
private function define_admin_hooks()
in includes/class-amazonpolly.php
55 1 0
public function display_polly_gui()
in admin/AmazonAI-PostMetaBox.php
50 10 1
public function break_text()
in admin/AmazonAI-Common.php
49 8 1
48 7 0
function display_options()
in admin/AmazonAI-TranslateConfiguration.php
48 5 0
private function get_price_message_for_update_all()
in admin/class-amazonpolly-admin.php
47 7 0