Decrease PerceivedComplexity threshold step by step (from 18 to 10)
Description
By analogy with gitlab-ce#28202 let's planning decreasing PerceivedComplexity step by step (from 18 to 10)
2017-04-24 data:
Rubocop default level is 7
=> 112 offenses
Some statistics on different benchmarks:
- PerceivedComplexity size
10
=> 33 offences - PerceivedComplexity size
12
=> 11 offences - PerceivedComplexity size
14
=> 6 offences - PerceivedComplexity size
16
=> 3 offences
Proposal
I think that level 10
is achievable in the nearest future. So I prepared checklist for first steps.
Decrease it step by step (values in TODO were checked on 22 Oct 2017):
-
Step to 17 - gitlab-ce!13947 - no offences in CE and EE
-
Step to 16 - https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/2874 -
refactor app/helpers/license_helper.rb:15:3
- EE - PerceivedComplexity = 17 -
refactor app/helpers/tree_helper.rb:111:3
- EE PerceivedComplexity = 17
-
-
Step to 15 - gitlab-ce!14160 -
refactor app/models/event.rb:242:3
- PerceivedComplexity = 16
-
-
Step to 14 - gitlab-ce!14231 -
refactor app/helpers/projects_helper.rb:30:3
- PerceivedComplexity = 15
-
-
Step to 13 -
refactor app/helpers/nav_helper.rb:10:3
- PerceivedComplexity = 14 -
refactor app/services/projects/create_service.rb:7:5
- PerceivedComplexity = 14 -
refactor lib/gitlab/diff/file.rb:250:7
- PerceivedComplexity = 14 -
refactor lib/gitlab/utils/merge_hash.rb:58:7
- PerceivedComplexity = 14 -
refactor lib/gitlab/checks/change_access.rb:149:7
- EE PerceivedComplexity = 14
-
-
Step to 12 -
refactor app/services/merge_requests/update_service.rb:24:5
- PerceivedComplexity = 13 -
refactor app/finders/autocomplete_users_finder.rb:23:3
- EE PerceivedComplexity = 13 -
refactor app/helpers/license_helper.rb:15:3
- EE PerceivedComplexity = 13
-
Links / references
Documentation blurb
(Write the start of the documentation of this feature here, include:
- Why should someone use it; what's the underlying problem.
- What is the solution.
- How does someone use this
During implementation, this can then be copied and used as a starter for the documentation.)
Possible labels: Edge gitlab-ce3011727 gitlab-ce~41076781
Edited by Maxim Rydkin