Skip to content
GitLab
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
    Projects Groups Topics Snippets
  • Register
  • Sign in
  • GitLab FOSS GitLab FOSS
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 1,668
    • Issues 1,668
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Jira
    • Jira
  • Merge requests 487
    • Merge requests 487
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

Do not update/delete: Banner broadcast message test data

Do not update/delete: Notification broadcast message test data

  • GitLab.orgGitLab.org
  • GitLab FOSSGitLab FOSS
  • Issues
  • #31362
Closed (moved) (moved)
Open
Issue created Apr 24, 2017 by username-removed-864731@innerwhisperContributor

Decrease CyclomaticComplexity threshold step by step (from 17 to 10)

Description

By analogy with #28202 (moved) and #31358 (moved) let's planning decreasing CyclomaticComplexity step by step (from 17 to 10)

2017-04-24 data:

Rubocop default level is 6 => 146 offenses Some statistics on different benchmarks:

  • CyclomaticComplexity size 10 => 30 offences
  • CyclomaticComplexity size 12 => 11 offences
  • CyclomaticComplexity size 14 => 4 offences
  • CyclomaticComplexity size 16 => 1 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 2 Oct 2017):

  • Step to 16
    • refactor lib/gitlab/google_code_import/importer.rb:163:7 CyclomaticComplexity = 17 - !10928 (merged)
  • Step to 15 - !13905 (merged)
    • no offences in CE and EE
  • Step to 14 - !13972 (merged)
    • refactor app/helpers/projects_helper.rb:21:3 CyclomaticComplexity = 15
    • refactor app/services/ci/create_pipeline_service.rb:50:5 - EE CyclomaticComplexity = 15
  • Step to 13 - !14152 (merged)
    • refactor lib/gitlab/conflict/parser.rb:14:7 CyclomaticComplexity = 14
    • refactor lib/gitlab/mail_room.rb:22:7 CyclomaticComplexity = 14
    • refactor app/helpers/license_helper.rb:15:3 - EE CyclomaticComplexity = 14 - https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/2874
  • Step to 12 - !14232
    • refactor app/helpers/projects_helper.rb:30:3 CyclomaticComplexity = 13 - !14231
    • refactor app/services/merge_requests/update_service.rb:24:5 CyclomaticComplexity = 13
    • refactor app/controllers/autocomplete_controller.rb:8:3 - EE CyclomaticComplexity = 13 - !13778 (merged)
    • refactor app/controllers/concerns/issuable_collections.rb:133:3 - EE CyclomaticComplexity = 13
    • refactor app/finders/autocomplete_users_finder.rb:23:3 - EE CyclomaticComplexity = 13
    • refactor lib/gitlab/checks/change_access.rb:145:7 - EE CyclomaticComplexity = 13
  • Step to 11
    • refactor app/helpers/nav_helper.rb:10:3 CyclomaticComplexity = 12
    • refactor app/services/issues/update_service.rb:16:5 CyclomaticComplexity = 12
    • refactor app/services/projects/create_service.rb:7:5 CyclomaticComplexity = 12
    • refactor app/services/system_hooks_service.rb:14:3 CyclomaticComplexity = 12
    • refactor app/workers/email_receiver_worker.rb:17:3 CyclomaticComplexity = 12
    • refactor lib/declarative_policy/runner.rb:75:5 CyclomaticComplexity = 12
    • refactor lib/gitlab/diff/parser.rb:6:7 CyclomaticComplexity = 12
    • refactor lib/gitlab/google_code_import/importer.rb:235:7 CyclomaticComplexity = 12
    • refactor app/helpers/dropdowns_helper.rb:2:3 - EE CyclomaticComplexity = 12
    • refactor app/helpers/license_helper.rb:15:3 - EE CyclomaticComplexity = 12

Links / references

Documentation blurb

(Write the start of the documentation of this feature here, include:

  1. Why should someone use it; what's the underlying problem.
  2. What is the solution.
  3. How does someone use this

During implementation, this can then be copied and used as a starter for the documentation.)

/cc @rymai @grzesiek

Possible labels: Edge backstage meta

Edited Oct 02, 2017 by username-removed-864731
Assignee
Assign to
Time tracking