gitlabhq/gitlabhq

View on GitHub

Showing 1,533 of 2,160 total issues

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

    class Commit
      include Gitlab::EncodingHelper
      prepend Gitlab::Git::RuggedImpl::Commit
      extend Gitlab::Git::WrapsGitalyErrors

Severity: Major
Found in lib/gitlab/git/commit.rb - About 7 hrs to fix

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

    class MergeRequestDiff < ApplicationRecord
      include Sortable
      include Importable
      include ManualInverseAssociation
      include EachBatch
    Severity: Major
    Found in app/models/merge_request_diff.rb - About 7 hrs to fix

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

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

        Function GitLabDropdown has 173 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

          Function bindEvents has 171 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const bindEvents = () => {
            const $newProjectForm = $('#new_project');
            const $projectImportUrl = $('#project_import_url');
            const $projectPath = $('.tab-pane.active #project_path');
            const $useTemplateBtn = $('.template-button > input');
          Severity: Major
          Found in app/assets/javascripts/projects/project_new.js - About 6 hrs to fix

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

              [types.SET_LINE_DISCUSSIONS_FOR_FILE](state, { discussion, diffPositionByLineCode, hash }) {
                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 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 sorting_helper.rb has 447 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            module SortingHelper
              def sort_options_hash
                {
                  sort_value_created_date      => sort_title_created_date,
                  sort_value_downvotes         => sort_title_downvotes,
            Severity: Minor
            Found in app/helpers/sorting_helper.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/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.rb has 437 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 create_merge_request_dropdown.js has 426 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 6 hrs to fix

                  File utils.js has 424 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import _ from 'underscore';
                  import { truncatePathMiddleToLength } from '~/lib/utils/text_utility';
                  import { diffModes, diffViewerModes } from '~/ide/constants';
                  import {
                    LINE_POSITION_LEFT,
                  Severity: Minor
                  Found in app/assets/javascripts/diffs/store/utils.js - About 6 hrs to fix

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

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

                      Function insertMarkdownText has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export function insertMarkdownText({
                        textArea,
                        text,
                        tag,
                        cursorOffset,
                      Severity: Minor
                      Found in app/assets/javascripts/lib/utils/text_markdown.js - 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 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

                        boardsStore has 44 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        const boardsStore = {
                          disabled: false,
                          timeTracking: {
                            limitToHours: false,
                          },
                        Severity: Minor
                        Found in app/assets/javascripts/boards/stores/boards_store.js - About 6 hrs to fix

                          File actions.js has 414 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import Vue from 'vue';
                          import axios from '~/lib/utils/axios_utils';
                          import Cookies from 'js-cookie';
                          import createFlash from '~/flash';
                          import { s__ } from '~/locale';
                          Severity: Minor
                          Found in app/assets/javascripts/diffs/store/actions.js - About 5 hrs to fix

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

                            class Namespace < ApplicationRecord
                              include CacheMarkdownField
                              include Sortable
                              include Gitlab::VisibilityLevel
                              include Routable
                            Severity: Minor
                            Found in app/models/namespace.rb - About 5 hrs to fix

                              Class GitAccess has 43 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 issuable_finder.rb has 409 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                class IssuableFinder
                                  prepend FinderWithCrossProjectAccess
                                  include FinderMethods
                                  include CreatedAtFilter
                                  include Gitlab::Utils::StrongMemoize
                                Severity: Minor
                                Found in app/finders/issuable_finder.rb - About 5 hrs to fix

                                  File notification_service.rb has 408 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
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language