gitlabhq/gitlabhq

View on GitHub

Showing 1,520 of 2,143 total issues

Class RemoteMirror has 31 methods (exceeds 20 allowed). Consider refactoring.
Open

class RemoteMirror < ApplicationRecord
  include AfterCommitQueue
  include MirrorAuthentication

  MAX_FIRST_RUNTIME = 3.hours
Severity: Minor
Found in app/models/remote_mirror.rb - About 3 hrs to fix

    Class Environment has 31 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class Environment < ApplicationRecord
      include Gitlab::Utils::StrongMemoize
      include ReactiveCaching
    
      belongs_to :project, required: true
    Severity: Minor
    Found in app/models/environment.rb - About 3 hrs to fix

      Class MergeRequestsController has 31 methods (exceeds 20 allowed). Consider refactoring.
      Open

      class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationController
        include ToggleSubscriptionAction
        include IssuableActions
        include RendersNotes
        include RendersCommits
      Severity: Minor
      Found in app/controllers/projects/merge_requests_controller.rb - About 3 hrs to fix

        Class RelationFactory has 31 methods (exceeds 20 allowed). Consider refactoring.
        Open

            class RelationFactory
              OVERRIDES = { snippets: :project_snippets,
                            ci_pipelines: 'Ci::Pipeline',
                            pipelines: 'Ci::Pipeline',
                            stages: 'Ci::Stage',
        Severity: Minor
        Found in lib/gitlab/import_export/relation_factory.rb - About 3 hrs to fix

          File boards_store.js has 326 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /* eslint-disable no-shadow */
          /* global List */
          
          import $ from 'jquery';
          import _ from 'underscore';
          Severity: Minor
          Found in app/assets/javascripts/boards/stores/boards_store.js - About 3 hrs to fix

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

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

              Function initDiffsApp has 94 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 3 hrs to fix

                File branch_graph.js has 323 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /* eslint-disable func-names, no-var, one-var, no-loop-func, consistent-return, no-unused-vars, prefer-template, prefer-arrow-callback, camelcase */
                
                import $ from 'jquery';
                import { __ } from '../locale';
                import axios from '../lib/utils/axios_utils';
                Severity: Minor
                Found in app/assets/javascripts/network/branch_graph.js - About 3 hrs to fix

                  Class Issue has 30 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  class Issue < ApplicationRecord
                    include AtomicInternalId
                    include IidRoutes
                    include Issuable
                    include Noteable
                  Severity: Minor
                  Found in app/models/issue.rb - About 3 hrs to fix

                    Class Label has 30 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                    class Label < ApplicationRecord
                      include CacheMarkdownField
                      include Referable
                      include Subscribable
                      include Gitlab::SQL::Pattern
                    Severity: Minor
                    Found in app/models/label.rb - About 3 hrs to fix

                      Class Milestone has 30 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                      class Milestone < ApplicationRecord
                        # Represents a "No Milestone" state used for filtering Issues and Merge
                        # Requests that have no milestone assigned.
                        MilestoneStruct = Struct.new(:title, :name, :id)
                        None = MilestoneStruct.new('No Milestone', 'No Milestone', 0)
                      Severity: Minor
                      Found in app/models/milestone.rb - About 3 hrs to fix

                        Class ProjectWiki has 30 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                        class ProjectWiki
                          include Gitlab::ShellAdapter
                          include Storage::LegacyProjectWiki
                        
                          MARKUPS = {
                        Severity: Minor
                        Found in app/models/project_wiki.rb - About 3 hrs to fix

                          File gitaly_client.rb has 319 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          require 'base64'
                          
                          require 'gitaly'
                          require 'grpc/health/v1/health_pb'
                          require 'grpc/health/v1/health_services_pb'
                          Severity: Minor
                          Found in lib/gitlab/gitaly_client.rb - About 3 hrs to fix

                            Function clicked has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    clicked: clickEvent => {
                                      const { $el, e } = clickEvent;
                                      let selected = clickEvent.selectedObj;
                            
                                      let data, modalStoreFilter;
                            Severity: Major
                            Found in app/assets/javascripts/milestone_select.js - About 3 hrs to fix

                              Function ContributorsAuthorGraph has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export const ContributorsAuthorGraph = (function(superClass) {
                                extend(ContributorsAuthorGraph, superClass);
                              
                                function ContributorsAuthorGraph(data1) {
                                  const $parentElements = $('.person');

                                Method fabricate! has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                                Open

                                      def fabricate!
                                        @project.visit!
                                
                                        Page::Project::Menu.perform(
                                          &:go_to_operations_kubernetes)
                                Severity: Minor
                                Found in qa/qa/resource/kubernetes_cluster.rb - About 3 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 object_storage.rb has 315 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                require 'fog/aws'
                                require 'carrierwave/storage/fog'
                                
                                #
                                # This concern should add object storage support
                                Severity: Minor
                                Found in app/uploaders/object_storage.rb - About 3 hrs to fix

                                  File git_access.rb has 314 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  module Gitlab
                                    class GitAccess
                                      include Gitlab::Utils::StrongMemoize
                                  
                                      UnauthorizedError = Class.new(StandardError)
                                  Severity: Minor
                                  Found in lib/gitlab/git_access.rb - About 3 hrs to fix

                                    Function getData has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      getData(term, callback) {
                                        if (!term) {
                                          const contents = this.getCategoryContents();
                                          if (contents) {
                                            const glDropdownInstance = this.searchInput.data('glDropdown');
                                    Severity: Major
                                    Found in app/assets/javascripts/search_autocomplete.js - About 3 hrs to fix

                                      Method defaults has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          def defaults
                                            {
                                              after_sign_up_text: nil,
                                              akismet_enabled: false,
                                              allow_local_requests_from_web_hooks_and_services: false,
                                      Severity: Major
                                      Found in app/models/application_setting_implementation.rb - About 3 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language