gitlabhq/gitlabhq

View on GitHub

Showing 1,859 of 2,672 total issues

Class MergeRequestsController has 38 methods (exceeds 20 allowed). Consider refactoring.
Open

class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationController
  include ToggleSubscriptionAction
  include IssuableActions
  include RendersNotes
  include RendersCommits
Severity: Minor
Found in app/controllers/projects/merge_requests_controller.rb - About 5 hrs to fix

    Class NotifyPreview has 38 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class NotifyPreview < ActionMailer::Preview
      def note_merge_request_email_for_individual_note
        note_email(:note_merge_request_email) do
          note = <<-MD.strip_heredoc
            This is an individual note on a merge request :smiley:
    Severity: Minor
    Found in app/mailers/previews/notify_preview.rb - About 5 hrs to fix

      Class RelationFactory has 38 methods (exceeds 20 allowed). Consider refactoring.
      Open

            class RelationFactory
              include Gitlab::Utils::StrongMemoize
      
              IMPORTED_OBJECT_MAX_RETRIES = 5.freeze
      
      
      Severity: Minor
      Found in lib/gitlab/import_export/base/relation_factory.rb - About 5 hrs to fix

        File operation_service.rb has 372 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        module Gitlab
          module GitalyClient
            class OperationService
              include Gitlab::EncodingHelper
        
        
        Severity: Minor
        Found in lib/gitlab/gitaly_client/operation_service.rb - About 4 hrs to fix

          File repository_service.rb has 372 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          module Gitlab
            module GitalyClient
              class RepositoryService
                include Gitlab::EncodingHelper
          
          
          Severity: Minor
          Found in lib/gitlab/gitaly_client/repository_service.rb - About 4 hrs to fix

            Function createPropertiesHashmap has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
            Open

            module.exports.createPropertiesHashmap = (
              ruleRoot,
              result,
              ruleName,
              messages,
            Severity: Minor
            Found in scripts/frontend/stylelint/stylelint-utils.js - About 4 hrs to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Method defaults has 120 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def defaults
                  {
                    after_sign_up_text: nil,
                    akismet_enabled: false,
                    allow_local_requests_from_web_hooks_and_services: false,
            Severity: Major
            Found in app/models/application_setting_implementation.rb - About 4 hrs to fix

              FilteredSearchManager has 36 functions (exceeds 20 allowed). Consider refactoring.
              Open

              export default class FilteredSearchManager {
                constructor({
                  page,
                  isGroup = false,
                  isGroupAncestor = true,
              Severity: Minor
              Found in app/assets/javascripts/filtered_search/filtered_search_manager.js - About 4 hrs to fix

                Class Cluster has 36 methods (exceeds 20 allowed). Consider refactoring.
                Open

                  class Cluster < ApplicationRecord
                    include Presentable
                    include Gitlab::Utils::StrongMemoize
                    include FromUnion
                    include ReactiveCaching
                Severity: Minor
                Found in app/models/clusters/cluster.rb - About 4 hrs to fix

                  Class PagesDomain has 36 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  class PagesDomain < ApplicationRecord
                    include Presentable
                    include FromUnion
                  
                    VERIFICATION_KEY = 'gitlab-pages-verification-code'
                  Severity: Minor
                  Found in app/models/pages_domain.rb - About 4 hrs to fix

                    Class Base has 36 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                      class Base
                        # A map of ability => list of rules together with :enable
                        # or :prevent actions. Used to look up which rules apply to
                        # a given ability. See Base.ability_map
                        class AbilityMap
                    Severity: Minor
                    Found in lib/declarative_policy/base.rb - About 4 hrs to fix

                      File repeater_spec.rb has 359 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      require 'logger'
                      require 'timecop'
                      require 'active_support/core_ext/integer/time'
                      
                      describe QA::Support::Repeater do
                      Severity: Minor
                      Found in qa/spec/support/repeater_spec.rb - About 4 hrs to fix

                        File usage_data.rb has 358 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        module Gitlab
                          class UsageData
                            BATCH_SIZE = 100
                            FALLBACK = -1
                        
                        
                        Severity: Minor
                        Found in lib/gitlab/usage_data.rb - About 4 hrs to fix

                          Function saveNote has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                          Open

                          export const saveNote = ({ commit, dispatch }, noteData) => {
                            // For MR discussuions we need to post as `note[note]` and issue we use `note.note`.
                            // For batch comments, we use draft_note
                            const note = noteData.data.draft_note || noteData.data['note[note]'] || noteData.data.note.note;
                            let placeholderText = note;
                          Severity: Minor
                          Found in app/assets/javascripts/notes/stores/actions.js - About 4 hrs to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          File merge_conflict_store.js has 355 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          /* eslint-disable no-param-reassign, babel/camelcase, no-nested-ternary, no-continue */
                          
                          import $ from 'jquery';
                          import Vue from 'vue';
                          import Cookies from 'js-cookie';
                          Severity: Minor
                          Found in app/assets/javascripts/merge_conflicts/merge_conflict_store.js - About 4 hrs to fix

                            Class Issue has 35 methods (exceeds 20 allowed). Consider refactoring.
                            Open

                            class Issue < ApplicationRecord
                              include AtomicInternalId
                              include IidRoutes
                              include Issuable
                              include Noteable
                            Severity: Minor
                            Found in app/models/issue.rb - About 4 hrs to fix

                              File cluster.rb has 353 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              module Clusters
                                class Cluster < ApplicationRecord
                                  include Presentable
                                  include Gitlab::Utils::StrongMemoize
                                  include FromUnion
                              Severity: Minor
                              Found in app/models/clusters/cluster.rb - About 4 hrs to fix

                                File project_presenter.rb has 351 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                class ProjectPresenter < Gitlab::View::Presenter::Delegated
                                  include ActionView::Helpers::NumberHelper
                                  include ActionView::Helpers::UrlHelper
                                  include GitlabRoutingHelper
                                  include StorageHelper
                                Severity: Minor
                                Found in app/presenters/project_presenter.rb - About 4 hrs to fix

                                  File event.rb has 350 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  class Event < ApplicationRecord
                                    include Sortable
                                    include FromUnion
                                    include Presentable
                                    include DeleteWithLimit
                                  Severity: Minor
                                  Found in app/models/event.rb - About 4 hrs to fix

                                    File gitaly_client.rb has 348 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    require 'base64'
                                    
                                    require 'gitaly'
                                    require 'grpc/health/v1/health_pb'
                                    require 'grpc/health/v1/health_services_pb'
                                    Severity: Minor
                                    Found in lib/gitlab/gitaly_client.rb - About 4 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language