gitlabhq/gitlabhq

View on GitHub

Showing 1,405 of 2,015 total issues

File stat_graph_contributors_graph.js has 335 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* eslint-disable func-names, no-restricted-syntax, no-use-before-define, no-param-reassign, new-cap, no-underscore-dangle, no-return-assign, prefer-arrow-callback, prefer-template, no-else-return, no-shadow */

import $ from 'jquery';
import _ from 'underscore';
import { extent, max } from 'd3-array';

    CreateMergeRequestDropdown has 32 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export default class CreateMergeRequestDropdown {
      constructor(wrapperEl) {
        this.wrapperEl = wrapperEl;
        this.availableButton = this.wrapperEl.querySelector('.available');
        this.branchInput = this.wrapperEl.querySelector('.js-branch-name');
    Severity: Minor
    Found in app/assets/javascripts/create_merge_request_dropdown.js - About 4 hrs to fix

      FilteredSearchManager has 32 functions (exceeds 20 allowed). Consider refactoring.
      Open

      export default class FilteredSearchManager {
        constructor({
          page,
          isGroup = false,
          isGroupAncestor = true,
      Severity: Minor
      Found in app/assets/javascripts/filtered_search/filtered_search_manager.js - About 4 hrs to fix

        Class MergeRequestsController has 32 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 4 hrs to fix

          Class User has 32 methods (exceeds 20 allowed). Consider refactoring.
          Open

                class User
                  SignupDisabledError = Class.new(StandardError)
                  SigninDisabledForProviderError = Class.new(StandardError)
          
                  attr_accessor :auth_hash, :gl_user
          Severity: Minor
          Found in lib/gitlab/auth/o_auth/user.rb - About 4 hrs to fix

            Class RefService has 32 methods (exceeds 20 allowed). Consider refactoring.
            Open

                class RefService
                  include Gitlab::EncodingHelper
            
                  # 'repository' is a Gitlab::Git::Repository
                  def initialize(repository)
            Severity: Minor
            Found in lib/gitlab/gitaly_client/ref_service.rb - About 4 hrs to fix

              File merge_request_tabs.js has 333 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /* eslint-disable no-new, class-methods-use-this */
              
              import $ from 'jquery';
              import Vue from 'vue';
              import Cookies from 'js-cookie';
              Severity: Minor
              Found in app/assets/javascripts/merge_request_tabs.js - About 4 hrs to fix

                `` has 31 functions (exceeds 20 allowed). Consider refactoring.
                Open

                export default {
                  [types.SET_BASE_CONFIG](state, options) {
                    const { endpoint, projectPath } = options;
                    Object.assign(state, { endpoint, projectPath });
                  },
                Severity: Minor
                Found in app/assets/javascripts/diffs/store/mutations.js - About 3 hrs to fix

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

                    class Runner < ApplicationRecord
                      extend Gitlab::Ci::Model
                      include Gitlab::SQL::Pattern
                      include IgnorableColumn
                      include RedisCacheable
                  Severity: Minor
                  Found in app/models/ci/runner.rb - About 3 hrs to fix

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

                        class Base
                          prepend Support::Page::Logging if Runtime::Env.debug?
                          include Capybara::DSL
                          include Scenario::Actable
                          extend Validatable
                    Severity: Minor
                    Found in qa/qa/page/base.rb - About 3 hrs to fix

                      File group.rb has 324 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      require 'carrierwave/orm/activerecord'
                      
                      class Group < Namespace
                        include Gitlab::ConfigHelper
                        include AfterCommitQueue
                      Severity: Minor
                      Found in app/models/group.rb - 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

                          File member.rb has 323 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

                            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 RelationFactory has 30 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

                                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 initDiffsApp has 90 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

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

                                      import Visibility from 'visibilityjs';
                                      import Vue from 'vue';
                                      import AccessorUtilities from '~/lib/utils/accessor';
                                      import { GlToast } from '@gitlab/ui';
                                      import PersistentUserCallout from '../persistent_user_callout';
                                      Severity: Minor
                                      Found in app/assets/javascripts/clusters/clusters_bundle.js - About 3 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language