gitlabhq/gitlabhq

View on GitHub

Showing 1,391 of 2,006 total issues

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

      File merge_requests.rb has 384 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 application_controller.rb has 382 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

          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 actions.js has 381 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

                File utils.js has 377 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 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

                  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 369 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import Vue from 'vue';
                  import axios from '~/lib/utils/axios_utils';
                  import Cookies from 'js-cookie';
                  import createFlash from '~/flash';
                  import { s__ } from '~/locale';
                  Severity: Minor
                  Found in app/assets/javascripts/diffs/store/actions.js - About 4 hrs to fix

                    Class RepositoryService has 37 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

                      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 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 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

                                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

                                  File merge_conflict_store.js has 355 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

                                    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
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language