gitlabhq/gitlabhq

View on GitHub

Showing 1,396 of 1,988 total issues

File commit_service.rb has 359 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 visible_attributes has 115 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def visible_attributes
        [
          :admin_notification_email,
          :after_sign_out_path,
          :after_sign_up_text,
    Severity: Major
    Found in app/helpers/application_settings_helper.rb - About 4 hrs to fix

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

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

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

        class JiraService < IssueTrackerService
          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

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

          class WikiPage
            PageChangedError = Class.new(StandardError)
            PageRenameError = Class.new(StandardError)
          
            include ActiveModel::Validations
          Severity: Minor
          Found in app/models/wiki_page.rb - About 4 hrs to fix

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

            class IssuableBaseService < BaseService
              private
            
              attr_accessor :params, :skip_milestone_email
            
            
            Severity: Minor
            Found in app/services/issuable_base_service.rb - About 4 hrs to fix

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

              /* eslint-disable object-shorthand, no-param-reassign, 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

                File issuables_helper.rb has 349 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                module IssuablesHelper
                  include GitlabRoutingHelper
                
                  def sidebar_gutter_toggle_icon
                    sidebar_gutter_collapsed? ? icon('angle-double-left', { 'aria-hidden': 'true' }) : icon('angle-double-right', { 'aria-hidden': 'true' })
                Severity: Minor
                Found in app/helpers/issuables_helper.rb - About 4 hrs to fix

                  Class NotifyPreview has 34 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 4 hrs to fix

                    File note.rb has 346 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

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

                      File projects_controller.rb has 344 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      class ProjectsController < Projects::ApplicationController
                        include API::Helpers::RelatedResourcesHelpers
                        include IssuableCollections
                        include ExtractsPath
                        include PreviewMarkdown
                      Severity: Minor
                      Found in app/controllers/projects_controller.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 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.unchanged?
                                  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

                        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

                        File operation_service.rb has 342 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

                          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

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

                            class Import::GithubController < Import::BaseController
                              include ImportHelper
                            
                              before_action :verify_import_enabled
                              before_action :provider_auth, only: [:status, :realtime_changes, :create]
                            Severity: Minor
                            Found in app/controllers/import/github_controller.rb - About 4 hrs to fix

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

                                  class Repository
                                    include Scenario::Actable
                                    RepositoryCommandError = Class.new(StandardError)
                              
                                    attr_writer :use_lfs
                              Severity: Minor
                              Found in qa/qa/git/repository.rb - About 4 hrs to fix

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

                                    class CommitService
                                      include Gitlab::EncodingHelper
                                
                                      def initialize(repository)
                                        @gitaly_repo = repository.gitaly_repository
                                Severity: Minor
                                Found in lib/gitlab/gitaly_client/commit_service.rb - About 4 hrs to fix

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

                                    class EeCompatCheck
                                      CANONICAL_CE_PROJECT_URL = 'https://gitlab.com/gitlab-org/gitlab-ce'.freeze
                                      CANONICAL_EE_REPO_URL = 'https://gitlab.com/gitlab-org/gitlab-ee.git'.freeze
                                      CHECK_DIR = Rails.root.join('ee_compat_check')
                                      IGNORED_FILES_REGEX = /VERSION|CHANGELOG\.md/i.freeze
                                  Severity: Minor
                                  Found in lib/gitlab/ee_compat_check.rb - About 4 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language