Monica
Unit Size

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 2,084 units with 25,183 lines of code in units (32.8% of code).
    • 6 very long units (1,111 lines of code)
    • 18 long units (1,255 lines of code)
    • 187 medium size units (5,233 lines of code)
    • 711 small units (10,551 lines of code)
    • 1,162 very small units (7,033 lines of code)
4% | 4% | 20% | 41% | 27%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
php4% | 4% | 20% | 42% | 27%
js0% | 0% | 0% | 0% | 100%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Logical Component
primary logical decomposition
database16% | 8% | 21% | 32% | 20%
app<1% | 3% | 20% | 45% | 30%
resources0% | 0% | 0% | 0% | 100%
Legend:
101+
51-100
21-50
11-20
1-10
app logical decomposition
Models5% | 0% | 9% | 24% | 60%
Http0% | 5% | 20% | 53% | 21%
Console0% | 13% | 36% | 29% | 20%
Services0% | 2% | 21% | 47% | 28%
Helpers0% | 0% | 25% | 43% | 30%
Providers0% | 0% | 41% | 16% | 41%
Jobs0% | 0% | 9% | 52% | 38%
Traits0% | 0% | 10% | 25% | 63%
Notifications0% | 0% | 0% | 50% | 50%
Listeners0% | 0% | 0% | 37% | 62%
ViewHelpers0% | 0% | 0% | 100% | 0%
Exceptions0% | 0% | 0% | 0% | 100%
Events0% | 0% | 0% | 0% | 100%
Legend:
101+
51-100
21-50
11-20
1-10
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
public function up()
in database/migrations/2018_08_31_020908_create_life_events_table.php
365 2 0
public function up()
in database/migrations/2018_07_03_204220_create_default_activity_type_groups_table.php
198 6 0
public function up()
in database/migrations/2018_12_09_023232_add_emotions_table.php
187 1 0
public function up()
in database/migrations/2018_03_18_085815_populate_default_relationship_type_tables.php
139 1 0
public function getNameAttribute()
in app/Models/Contact/Contact.php
118 37 0
public function up()
in database/migrations/2016_06_08_005413_create_contacts_table.php
104 1 0
public function up()
in database/migrations/2017_12_04_165421_move_ages_data.php
96 11 0
protected function toArrayInternal()
in app/Http/Resources/Contact/ContactBase.php
95 19 2
public function up()
in database/migrations/2018_07_08_104306_update-timestamps-timezone.php
82 9 0
public function up()
in database/migrations/2017_11_10_174654_create_contact_fields_table.php
80 1 0
private function csvToContact()
in app/Console/Commands/ImportCSV.php
80 16 3
public function up()
in database/migrations/2018_05_07_070458_create_terms_table.php
78 14 0
public function up()
in database/migrations/2018_04_04_220850_create_default_modules_table.php
77 1 0
public function update()
in app/Http/Controllers/ContactsController.php
71 9 2
private function contacts()
in app/Http/Controllers/ContactsController.php
68 9 2
private function writeExport()
in app/Services/Account/Settings/ExportAccount.php
67 1 2
public function index()
in app/Http/Controllers/DashboardController.php
65 3 0
public function show()
in app/Http/Controllers/ContactsController.php
64 4 1
public function up()
in database/migrations/2017_11_10_181043_migrate_contacts_information.php
60 7 0
public function seed()
in app/Console/Commands/SetupTest.php
60 7 0
public function up()
in database/migrations/2017_08_06_153253_move_kids_to_contacts.php
57 3 0
private function exportContact()
in app/Services/Account/Settings/ExportAccount.php
52 1 1
public function handle()
in app/Console/Commands/PingVersionServer.php
52 10 0
public function list()
in app/Http/Controllers/ContactsController.php
51 9 1
public function up()
in database/migrations/2019_12_21_100315_change_gift_status.php
50 8 0
public function up()
in database/migrations/2019_01_05_202938_add_foreign_key_to_contacts.php
50 7 0
public function up()
in database/migrations/2017_07_26_220021_change_contacts_table.php
48 3 0
public function up()
in database/migrations/2017_10_14_083556_change_gift_column_structure.php
48 5 0
public function up()
in database/migrations/2018_12_22_200413_add_reminder_initial_date_to_reminders.php
48 3 0
public function handle()
in app/Console/Commands/Update.php
46 15 0
public function handle()
in app/Console/Commands/ImportCSV.php
46 10 0
public function up()
in database/migrations/2018_01_15_105858_create_additional_reminders_table.php
45 3 0
public function up()
in database/migrations/2018_03_03_204440_create_relationship_type_table.php
44 1 0
private function importSocialProfile()
in app/Services/VCard/ImportVCard.php
43 10 2
public function up()
in database/migrations/2019_05_27_000000_populate_relationship_type_tables_with_stepparent_values.php
42 4 0
private function setRegionalParameters()
in app/Services/User/CreateUser.php
42 10 2
private function importTel()
in app/Services/VCard/ImportVCard.php
42 7 2
public function toArray()
in app/Http/Resources/Contact/ContactShort.php
41 7 1
private function validateAndGetDatas()
in app/Http/Controllers/Contacts/RelationshipsController.php
40 4 1
public function populateRelationships()
in app/Console/Commands/SetupTest.php
40 6 0
public function getEmoji()
in app/Models/Account/Weather.php
39 11 0
public function index()
in app/Http/Controllers/SettingsController.php
39 3 0
private function importAddress()
in app/Services/VCard/ImportVCard.php
39 5 2
private function importEmail()
in app/Services/VCard/ImportVCard.php
39 6 2
public function up()
in database/migrations/2018_01_27_014146_add_custom_gender.php
38 7 0
public function update()
in app/Http/Controllers/Contacts/ConversationsController.php
38 6 3
public function populateContactFields()
in app/Console/Commands/SetupTest.php
38 9 0
public function up()
in database/migrations/2018_03_18_090345_migrate_current_relationship_table_to_new_relationship_structure.php
36 6 0
public function up()
in database/migrations/2019_01_11_142944_add_foreign_keys_to_activities.php
35 5 0
public function __construct()
in app/Http/Controllers/Api/ApiController.php
35 10 0