gitlabhq/gitlabhq

View on GitHub

Showing 1,396 of 1,988 total issues

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

class Service < ActiveRecord::Base
  include Sortable
  include Importable
  include ProjectServicesLoggable

Severity: Minor
Found in app/models/service.rb - About 5 hrs to fix

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

      class Shell
        GITLAB_SHELL_ENV_VARS = %w(GIT_TERMINAL_PROMPT).freeze
    
        Error = Class.new(StandardError)
    
    
    Severity: Minor
    Found in lib/gitlab/shell.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/background_migration/normalize_ldap_extern_uids_range.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

          File helpers.rb has 385 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

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

            class ApplicationSetting < ActiveRecord::Base
              include CacheableAttributes
              include CacheMarkdownField
              include TokenAuthenticatable
              include IgnorableColumn
            Severity: Minor
            Found in app/models/application_setting.rb - About 5 hrs to fix

              Class ProjectsController has 39 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

                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

                    File application_controller.rb has 378 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    require 'gon'
                    require 'fogbugz'
                    
                    class ApplicationController < ActionController::Base
                      include Gitlab::GonHelper
                    Severity: Minor
                    Found in app/controllers/application_controller.rb - About 5 hrs to fix

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

                        File utils.js has 372 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 4 hrs to fix

                          File sorting_helper.rb has 372 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 4 hrs to fix

                            Function tabShown has a Cognitive Complexity of 33 (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 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 actions.js has 367 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 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');

                                File project_policy.rb has 363 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                class ProjectPolicy < BasePolicy
                                  extend ClassMethods
                                  include ClusterableActions
                                
                                  READONLY_FEATURES_WHEN_ARCHIVED = %i[
                                Severity: Minor
                                Found in app/policies/project_policy.rb - About 4 hrs to fix

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

                                      Class RepositoryService has 36 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 4 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language