Decrease threshold ABC size step by step (from 60 to 35)
Description
Complex (according to ABC metric) methods are hard to read, especially for early contributors.
Current threshold ABC size in rubocop is about 60
Rubocop default level is 15
=> 575 offenses
Some statistics on different benchmarks:
- ABC size
35
=> 45 offences - ABC size
40
=> 22 offences - ABC size
50
=> 5 offences - ABC size
55
=> 3 offences (2 in CE, 1 in EE)
Proposal
I think that level 35
is achievable in the nearest future. So I prepared checklist for first steps.
Decrease it step by step (values in TODO were checked on 31 Aug 2017):
-
Step to 57.08 - gitlab-foss!10724 (merged) -
refactor lib/backup/manager.rb:109:5
ABC = 58.63
-
-
Step to 56.96 - gitlab-foss!11227 (merged) -
refactor app/controllers/admin/projects_controller.rb:5:3
ABC = 57.08
-
-
Step to 55.25 - gitlab-foss!13904 (merged) -
refactor lib/github/import.rb:223:5
ABC = 56.96
-
-
Step to 55.24 - gitlab-foss!13969 -
refactor lib/github/import.rb:167:5
ABC = 55.25 -
refactor app/controllers/autocomplete_controller.rb:6:3
ABC = 55.25 - EE (51.21 in CE) - will be reduced after gitlab-foss!13778 (merged)
-
-
Step to 55 -
refactor app/services/projects/create_service.rb:7:5
ABC = 55.24 - EE (54.28 in CE)
-
-
Step to 50 -
refactor lib/backup/manager.rb:103:5
ABC = 54.63 -
refactor app/services/merge_requests/update_service.rb:24:5
ABC = 51.58 - EE (50.61 in CE) -
refactor app/services/merge_requests/squash_service.rb:15:5
ABC = 53.3 - EE -
refactor app/controllers/projects/blob_controller.rb:197:3
ABC = 50.13 -
refactor lib/gitlab/google_code_import/importer.rb:81:7
ABC = 50.01 -
check files in EE
-
-
Step to 45 -
check files in EE -
check files in CE
-
-
Step to 40 -
check files in EE -
check files in CE
-
Links / references
/cc @rymai
@rymai, could it be meta in GitLab FOSS issue?
Edited by username-removed-864731