gitlabhq/gitlabhq

View on GitHub

Showing 1,432 of 2,076 total issues

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

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

    Class ProjectsController has 40 methods (exceeds 20 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 5 hrs to fix

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

      module API
        module Helpers
          include Gitlab::Utils
          include Helpers::Pagination
      
      
      Severity: Minor
      Found in lib/api/helpers.rb - About 5 hrs to fix

        File operation_service.rb has 386 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 5 hrs to fix

          Method each_pair has 131 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  def each_pair
                    state = :key
                    key = StringIO.new
                    value = StringIO.new
                    hex_buffer = ""
          Severity: Major
          Found in lib/gitlab/auth/ldap/dn.rb - About 5 hrs to fix

            boardsStore has 39 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 5 hrs to fix

              Class ProjectPresenter has 39 methods (exceeds 20 allowed). Consider refactoring.
              Open

              class ProjectPresenter < Gitlab::View::Presenter::Delegated
                include ActionView::Helpers::NumberHelper
                include ActionView::Helpers::UrlHelper
                include GitlabRoutingHelper
                include StorageHelper
              Severity: Minor
              Found in app/presenters/project_presenter.rb - About 5 hrs to fix

                Class Config has 39 methods (exceeds 20 allowed). Consider refactoring.
                Open

                      class Config
                        NET_LDAP_ENCRYPTION_METHOD = {
                          simple_tls: :simple_tls,
                          start_tls:  :start_tls,
                          plain:      nil
                Severity: Minor
                Found in lib/gitlab/auth/ldap/config.rb - About 5 hrs to fix

                  Function tabShown has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                  Open

                    tabShown(action, href) {
                      if (action !== this.currentTab && this.mergeRequestTabs) {
                        this.currentTab = action;
                  
                        if (this.mergeRequestTabPanesAll) {
                  Severity: Minor
                  Found in app/assets/javascripts/merge_request_tabs.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

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

                  import Vue from 'vue';
                  import $ from 'jquery';
                  import axios from '~/lib/utils/axios_utils';
                  import Visibility from 'visibilityjs';
                  import TaskList from '../../task_list';
                  Severity: Minor
                  Found in app/assets/javascripts/notes/stores/actions.js - About 5 hrs to fix

                    Class RepositoryService has 38 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                        class RepositoryService
                          include Gitlab::EncodingHelper
                    
                          MAX_MSG_SIZE = 128.kilobytes.freeze
                    
                    
                    Severity: Minor
                    Found in lib/gitlab/gitaly_client/repository_service.rb - About 5 hrs to fix

                      Function createPropertiesHashmap has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                      Open

                      module.exports.createPropertiesHashmap = (
                        ruleRoot,
                        result,
                        ruleName,
                        messages,
                      Severity: Minor
                      Found in scripts/frontend/stylelint/stylelint-utils.js - 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_requests.rb has 369 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      module API
                        class MergeRequests < Grape::API
                          include PaginationParams
                      
                          before { authenticate_non_get! }
                      Severity: Minor
                      Found in lib/api/merge_requests.rb - About 4 hrs to fix

                        Function ContributorsMasterGraph has 119 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export const ContributorsMasterGraph = (function(superClass) {
                          extend(ContributorsMasterGraph, superClass);
                        
                          function ContributorsMasterGraph(data1) {
                            const $parentElement = $('#contributors-master');

                          Class IssuableBaseService has 36 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

                            Class MergeRequestPresenter has 36 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

                              Class Base has 36 methods (exceeds 20 allowed). Consider refactoring.
                              Open

                                class Base
                                  # A map of ability => list of rules together with :enable
                                  # or :prevent actions. Used to look up which rules apply to
                                  # a given ability. See Base.ability_map
                                  class AbilityMap
                              Severity: Minor
                              Found in lib/declarative_policy/base.rb - About 4 hrs to fix

                                Method visible_attributes has 116 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_service.rb has 360 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

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