gitlabhq/gitlabhq

View on GitHub

Showing 1,859 of 2,672 total issues

Class MergeRequestPresenter has 34 methods (exceeds 20 allowed). Consider refactoring.
Open

class MergeRequestPresenter < Gitlab::View::Presenter::Delegated
  include ActionView::Helpers::UrlHelper
  include GitlabRoutingHelper
  include MarkupHelper
  include TreeHelper
Severity: Minor
Found in app/presenters/merge_request_presenter.rb - About 4 hrs to fix

    File application_setting_implementation.rb has 347 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    module ApplicationSettingImplementation
      extend ActiveSupport::Concern
      include Gitlab::Utils::StrongMemoize
    
      STRING_LIST_SEPARATOR = %r{\s*[,;]\s*     # comma or semicolon, optionally surrounded by whitespace
    Severity: Minor
    Found in app/models/application_setting_implementation.rb - About 4 hrs to fix

      File commit_service.rb has 347 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

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

        Method run has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

            def run(debug = nil)
              @state = State.new
        
              steps_by_score do |step, score|
                break if !debug && @state.prevented?
        Severity: Minor
        Found in lib/declarative_policy/runner.rb - 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 parse has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

              def parse(lines, diff_file: nil)
                return [] if lines.blank?
        
                @lines = lines
                line_obj_index = 0
        Severity: Minor
        Found in lib/gitlab/diff/parser.rb - 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 unfold_required? has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

              def unfold_required?
                strong_memoize(:unfold_required) do
                  next false unless @diff_file.text?
                  next false unless @position.unfoldable?
                  next false if @diff_file.new_file? || @diff_file.deleted_file?
        Severity: Minor
        Found in lib/gitlab/diff/lines_unfolder.rb - 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

        Function initDiffsApp has 106 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default function initDiffsApp(store) {
          const fileFinderEl = document.getElementById('js-diff-file-finder');
        
          if (fileFinderEl) {
            // eslint-disable-next-line no-new
        Severity: Major
        Found in app/assets/javascripts/diffs/index.js - About 4 hrs to fix

          File jira_service.rb has 343 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          class JiraService < IssueTrackerService
            extend ::Gitlab::Utils::Override
            include Gitlab::Routing
            include ApplicationHelper
            include ActionView::Helpers::AssetUrlHelper
          Severity: Minor
          Found in app/models/project_services/jira_service.rb - About 4 hrs to fix

            Function Keyboard has 105 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const Keyboard = function() {
              var currentKey;
              var currentFocus;
              var isUpArrow = false;
              var isDownArrow = false;
            Severity: Major
            Found in app/assets/javascripts/droplab/keyboard.js - About 4 hrs to fix

              Function setData has 105 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                setData(data, isRebased) {
                  if (isRebased) {
                    this.sha = data.diff_head_sha;
                  }
              
              

                Class SessionsController has 33 methods (exceeds 20 allowed). Consider refactoring.
                Open

                class SessionsController < Devise::SessionsController
                  include InternalRedirect
                  include AuthenticatesWithTwoFactor
                  include Devise::Controllers::Rememberable
                  include Recaptcha::ClientHelper
                Severity: Minor
                Found in app/controllers/sessions_controller.rb - About 4 hrs to fix

                  Class OmniauthCallbacksController has 33 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  class OmniauthCallbacksController < Devise::OmniauthCallbacksController
                    include AuthenticatesWithTwoFactor
                    include Authenticates2FAForAdminMode
                    include Devise::Controllers::Rememberable
                    include AuthHelper
                  Severity: Minor
                  Found in app/controllers/omniauth_callbacks_controller.rb - About 4 hrs to fix

                    File mutations.js has 340 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
                    import {
                      findDiffFile,
                      addLineReferences,
                      removeMatchLine,
                    Severity: Minor
                    Found in app/assets/javascripts/diffs/store/mutations.js - About 4 hrs to fix

                      File issuable.rb has 339 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      module Issuable
                        extend ActiveSupport::Concern
                        include Gitlab::SQL::Pattern
                        include Redactable
                        include CacheMarkdownField
                      Severity: Minor
                      Found in app/models/concerns/issuable.rb - About 4 hrs to fix

                        File member.rb has 339 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

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

                          Function jumpToNextUnresolvedDiscussion has 103 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              jumpToNextUnresolvedDiscussion() {
                                let discussionsSelector;
                                let discussionIdsInScope;
                                let firstUnresolvedDiscussionId;
                                let nextUnresolvedDiscussionId;
                          Severity: Major
                          Found in app/assets/javascripts/diff_notes/components/jump_to_discussion.js - About 4 hrs to fix

                            Method dropdown_tag has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                            Open

                              def dropdown_tag(toggle_text, options: {}, &block)
                                content_tag :div, class: "dropdown #{options[:wrapper_class] if options.key?(:wrapper_class)}" do
                                  data_attr = { toggle: "dropdown" }
                            
                                  if options.key?(:data)
                            Severity: Minor
                            Found in app/helpers/dropdowns_helper.rb - 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 call has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                            Open

                                  def call
                                    return doc unless project || group
                            
                                    ref_pattern = object_class.reference_pattern
                                    link_pattern = object_class.link_reference_pattern
                            Severity: Minor
                            Found in lib/banzai/filter/abstract_reference_filter.rb - 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_request_tabs.js has 336 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            /* eslint-disable no-new, class-methods-use-this */
                            
                            import $ from 'jquery';
                            import { GlBreakpointInstance as bp } from '@gitlab/ui/dist/utils';
                            import Cookies from 'js-cookie';
                            Severity: Minor
                            Found in app/assets/javascripts/merge_request_tabs.js - About 4 hrs to fix

                              CreateMergeRequestDropdown has 32 functions (exceeds 20 allowed). Consider refactoring.
                              Open

                              export default class CreateMergeRequestDropdown {
                                constructor(wrapperEl) {
                                  this.wrapperEl = wrapperEl;
                                  this.availableButton = this.wrapperEl.querySelector('.available');
                                  this.branchInput = this.wrapperEl.querySelector('.js-branch-name');
                              Severity: Minor
                              Found in app/assets/javascripts/create_merge_request_dropdown.js - About 4 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language