gitlabhq/gitlabhq

View on GitHub

Showing 1,131 of 1,537 total issues

Notes has 69 functions (exceeds 20 allowed). Consider refactoring.
Open

export default class Notes {
  static initialize(notes_url, note_ids, last_fetched_at, view, enableGFM = true) {
    if (!this.instance) {
      this.instance = new Notes(notes_url, note_ids, last_fetched_at, view, enableGFM);
    }
Severity: Major
Found in app/assets/javascripts/notes.js - About 1 day to fix

    Class Converter has 69 methods (exceeds 20 allowed). Consider refactoring.
    Open

          class Converter
            def on_0(s) reset()                            end
    
            def on_1(s) enable(STYLE_SWITCHES[:bold])      end
    
    
    Severity: Major
    Found in lib/gitlab/ci/ansi2html.rb - About 1 day to fix

      File file_icon_map.js has 587 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      const fileExtensionIcons = {
        html: 'html',
        htm: 'html',
        html_vm: 'html',
        asp: 'html',

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

        class Commit
          extend ActiveModel::Naming
          extend Gitlab::Cache::RequestCache
        
          include ActiveModel::Conversion
        Severity: Major
        Found in app/models/commit.rb - About 1 day to fix

          Class Pipeline has 59 methods (exceeds 20 allowed). Consider refactoring.
          Open

            class Pipeline < ActiveRecord::Base
              extend Gitlab::Ci::Model
              include HasStatus
              include Importable
              include AfterCommitQueue
          Severity: Major
          Found in app/models/ci/pipeline.rb - About 1 day to fix

            Function jumpToNextUnresolvedDiscussion has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
            Open

                jumpToNextUnresolvedDiscussion: function () {
                  let discussionsSelector;
                  let discussionIdsInScope;
                  let firstUnresolvedDiscussionId;
                  let nextUnresolvedDiscussionId;
            Severity: Minor
            Found in app/assets/javascripts/diff_notes/components/jump_to_discussion.js - About 1 day 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 interpret_service.rb has 516 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            module QuickActions
              class InterpretService < BaseService
                include Gitlab::QuickActions::Dsl
            
                attr_reader :issuable
            Severity: Major
            Found in app/services/quick_actions/interpret_service.rb - About 1 day to fix

              Function dropzoneInput has 209 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function dropzoneInput(form) {
                const divHover = '<div class="div-dropzone-hover"></div>';
                const iconPaperclip = '<i class="fa fa-paperclip div-dropzone-icon"></i>';
                const $attachButton = form.find('.button-attach-file');
                const $attachingFileMessage = form.find('.attaching-file-message');
              Severity: Major
              Found in app/assets/javascripts/dropzone_input.js - About 1 day to fix

                File filtered_search_manager.js has 507 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import _ from 'underscore';
                import {
                  getParameterByName,
                  getUrlParamsArray,
                } from '~/lib/utils/common_utils';
                Severity: Major
                Found in app/assets/javascripts/filtered_search/filtered_search_manager.js - About 1 day to fix

                  Function init has 194 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    init(els, options) {
                      let $els = $(els);
                  
                      if (!els) {
                        $els = $('.js-milestone-select');
                  Severity: Major
                  Found in app/assets/javascripts/milestone_select.js - About 7 hrs to fix

                    Function Keyboard has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
                    Open

                    const Keyboard = function () {
                      var currentKey;
                      var currentFocus;
                      var isUpArrow = false;
                      var isDownArrow = false;
                    Severity: Minor
                    Found in app/assets/javascripts/droplab/keyboard.js - About 7 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 inject_rblineprof has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
                    Open

                          def inject_rblineprof
                            ret = nil
                            profile = lineprof(rblineprof_profiler_regex) do
                              ret = yield
                            end
                    Severity: Minor
                    Found in lib/peek/rblineprof/custom_controller_helpers.rb - About 7 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 481 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 7 hrs to fix

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

                          class Commit
                            include Gitlab::EncodingHelper
                      
                            attr_accessor :raw_commit, :head
                      
                      
                      Severity: Major
                      Found in lib/gitlab/git/commit.rb - About 7 hrs to fix

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

                        class Note < ActiveRecord::Base
                          extend ActiveModel::Naming
                          include Participable
                          include Mentionable
                          include Awardable
                        Severity: Major
                        Found in app/models/note.rb - About 7 hrs to fix

                          File build.rb has 471 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          module Ci
                            class Build < CommitStatus
                              prepend ArtifactMigratable
                              include TokenAuthenticatable
                              include AfterCommitQueue
                          Severity: Minor
                          Found in app/models/ci/build.rb - About 7 hrs to fix

                            Class File has 49 methods (exceeds 20 allowed). Consider refactoring.
                            Open

                                class File
                                  attr_reader :diff, :repository, :diff_refs, :fallback_diff_refs
                            
                                  delegate :new_file?, :deleted_file?, :renamed_file?,
                                    :old_path, :new_path, :a_mode, :b_mode, :mode_changed?,
                            Severity: Minor
                            Found in lib/gitlab/diff/file.rb - About 6 hrs to fix

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

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

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

                                class IssuableFinder
                                  include CreatedAtFilter
                                
                                  NONE = '0'.freeze
                                
                                
                                Severity: Minor
                                Found in app/finders/issuable_finder.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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language