gitlabhq/gitlabhq

View on GitHub

Showing 1,313 of 1,834 total issues

Class IssuableFinder has 52 methods (exceeds 20 allowed). Consider refactoring.
Open

class IssuableFinder
  prepend FinderWithCrossProjectAccess
  include FinderMethods
  include CreatedAtFilter

Severity: Major
Found in app/finders/issuable_finder.rb - About 7 hrs to fix

    Class Event has 51 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class Event < ActiveRecord::Base
      include Sortable
      include IgnorableColumn
      include FromUnion
      default_scope { reorder(nil) }
    Severity: Major
    Found in app/models/event.rb - About 7 hrs to fix

      Function GitLabDropdown has 172 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function GitLabDropdown(el1, options) {
          var searchFields, selector, self;
          this.el = el1;
          this.options = options;
          this.updateLabel = this.updateLabel.bind(this);
      Severity: Major
      Found in app/assets/javascripts/gl_dropdown.js - About 6 hrs to fix

        Class Commit has 48 methods (exceeds 20 allowed). Consider refactoring.
        Open

            class Commit
              include Gitlab::EncodingHelper
              extend Gitlab::Git::WrapsGitalyErrors
        
              attr_accessor :raw_commit, :head
        Severity: Minor
        Found in lib/gitlab/git/commit.rb - About 6 hrs to fix

          Method each_pair has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
          Open

                        def each_pair
                          state = :key
                          key = StringIO.new
                          value = StringIO.new
                          hex_buffer = ""
          Severity: Minor
          Found in lib/gitlab/background_migration/normalize_ldap_extern_uids_range.rb - About 6 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 each_pair has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
          Open

                  def each_pair
                    state = :key
                    key = StringIO.new
                    value = StringIO.new
                    hex_buffer = ""
          Severity: Minor
          Found in lib/gitlab/auth/ldap/dn.rb - About 6 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 projects_helper.rb has 439 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          module ProjectsHelper
            def link_to_project(project)
              link_to [project.namespace.becomes(Namespace), project], title: h(project.name) do
                title = content_tag(:span, project.name, class: 'project-name')
          
          
          Severity: Minor
          Found in app/helpers/projects_helper.rb - About 6 hrs to fix

            File common_utils.js has 433 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import $ from 'jquery';
            import axios from './axios_utils';
            import { getLocationHash } from './url_utility';
            import { convertToCamelCase } from './text_utility';
            import { isObject } from './type_utility';
            Severity: Minor
            Found in app/assets/javascripts/lib/utils/common_utils.js - About 6 hrs to fix

              File projects.rb has 428 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              require_dependency 'declarative_policy'
              
              module API
                class Projects < Grape::API
                  include PaginationParams
              Severity: Minor
              Found in lib/api/projects.rb - About 6 hrs to fix

                File search_autocomplete.js has 419 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /* eslint-disable no-return-assign, one-var, no-var, no-unused-vars, consistent-return, object-shorthand, prefer-template, class-methods-use-this, no-lonely-if, vars-on-top */
                
                import $ from 'jquery';
                import { escape, throttle } from 'underscore';
                import { s__, sprintf } from '~/locale';
                Severity: Minor
                Found in app/assets/javascripts/search_autocomplete.js - About 6 hrs to fix

                  File copy_as_gfm.js has 417 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /* eslint-disable object-shorthand, no-unused-vars, no-use-before-define, no-restricted-syntax, guard-for-in, no-continue */
                  
                  import $ from 'jquery';
                  import _ from 'underscore';
                  import { insertText, getSelectedFragment, nodeMatchesSelector } from '~/lib/utils/common_utils';
                  Severity: Minor
                  Found in app/assets/javascripts/behaviors/markdown/copy_as_gfm.js - About 6 hrs to fix

                    Class TodoService has 43 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                    class TodoService
                      # When create an issue we should:
                      #
                      #  * create a todo for assignee if issue is assigned
                      #  * create a todo for each mentioned user on issue
                    Severity: Minor
                    Found in app/services/todo_service.rb - About 5 hrs to fix

                      Function types.SET_LINE_DISCUSSIONS_FOR_FILE has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                      Open

                        [types.SET_LINE_DISCUSSIONS_FOR_FILE](state, { discussion, diffPositionByLineCode }) {
                          const { latestDiff } = state;
                      
                          const discussionLineCode = discussion.line_code;
                          const fileHash = discussion.diff_file.file_hash;
                      Severity: Minor
                      Found in app/assets/javascripts/diffs/store/mutations.js - About 5 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

                      Function postComment has 143 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        postComment(e) {
                          e.preventDefault();
                      
                          // Get Form metadata
                          const $submitBtn = $(e.target);
                      Severity: Major
                      Found in app/assets/javascripts/notes.js - About 5 hrs to fix

                        Class Member has 41 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                        class Member < ActiveRecord::Base
                          include AfterCommitQueue
                          include Sortable
                          include Importable
                          include Expirable
                        Severity: Minor
                        Found in app/models/member.rb - About 5 hrs to fix

                          Class GitAccess has 41 methods (exceeds 20 allowed). Consider refactoring.
                          Open

                            class GitAccess
                              include Gitlab::Utils::StrongMemoize
                          
                              UnauthorizedError = Class.new(StandardError)
                              NotFoundError = Class.new(StandardError)
                          Severity: Minor
                          Found in lib/gitlab/git_access.rb - About 5 hrs to fix

                            File create_merge_request_dropdown.js has 391 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            /* eslint-disable no-new */
                            import _ from 'underscore';
                            import axios from './lib/utils/axios_utils';
                            import Flash from './flash';
                            import DropLab from './droplab/drop_lab';
                            Severity: Minor
                            Found in app/assets/javascripts/create_merge_request_dropdown.js - About 5 hrs to fix

                              Class Service has 40 methods (exceeds 20 allowed). Consider refactoring.
                              Open

                              class Service < ActiveRecord::Base
                                include Sortable
                                include Importable
                                include ProjectServicesLoggable
                              
                              
                              Severity: Minor
                              Found in app/models/service.rb - About 5 hrs to fix

                                File notification_service.rb has 388 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                class NotificationService
                                  class Async
                                    attr_reader :parent
                                    delegate :respond_to_missing, to: :parent
                                
                                
                                Severity: Minor
                                Found in app/services/notification_service.rb - About 5 hrs to fix

                                  File application_setting.rb has 387 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  class ApplicationSetting < ActiveRecord::Base
                                    include CacheableAttributes
                                    include CacheMarkdownField
                                    include TokenAuthenticatable
                                    include IgnorableColumn
                                  Severity: Minor
                                  Found in app/models/application_setting.rb - About 5 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language