gitlabhq/gitlabhq

View on GitHub

Showing 2,852 of 2,852 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  computed: {
    hasValidVersion() {
      return (
        this.$route.query.version &&
        this.allVersions &&
app/assets/javascripts/design_management/mixins/all_versions.js on lines 27..54

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 250.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  computed: {
    hasValidVersion() {
      return (
        this.$route.query.version &&
        this.allVersions &&
app/assets/javascripts/design_management_new/mixins/all_versions.js on lines 26..53

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 250.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

File projects_helper.rb has 600 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module ProjectsHelper
  def project_incident_management_setting
    @project_incident_management_setting ||= @project.incident_management_setting ||
      @project.build_incident_management_setting
  end
Severity: Major
Found in app/helpers/projects_helper.rb - About 1 day to fix

    Class Commit has 70 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class Commit
      extend ActiveModel::Naming
      extend Gitlab::Cache::RequestCache
    
      include ActiveModel::Conversion
    Severity: Major
    Found in app/models/commit.rb - About 1 day to fix

      Class File has 69 methods (exceeds 20 allowed). Consider refactoring.
      Open

          class File
            include Gitlab::Utils::StrongMemoize
      
            attr_reader :diff, :repository, :diff_refs, :fallback_diff_refs, :unique_identifier
      
      
      Severity: Major
      Found in lib/gitlab/diff/file.rb - About 1 day to fix

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

        export default {
          mixins: [allVersionsMixin],
          apollo: {
            designs: {
              query: getDesignListQuery,
        app/assets/javascripts/design_management_new/mixins/all_designs.js on lines 9..49

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 238.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

        export default {
          mixins: [allVersionsMixin],
          apollo: {
            designs: {
              query: getDesignListQuery,
        app/assets/javascripts/design_management/mixins/all_designs.js on lines 9..49

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 238.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        File file_icon_map.js has 588 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        const fileExtensionIcons = {
          html: 'html',
          htm: 'html',
          html_vm: 'html',
          asp: 'html',

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

          export const designUploadOptimisticResponse = files => {
            const designs = files.map(file => ({
              // False positive i18n lint: https://gitlab.com/gitlab-org/frontend/eslint-plugin-i18n/issues/26
              // eslint-disable-next-line @gitlab/require-i18n-strings
              __typename: 'Design',
          app/assets/javascripts/design_management_new/utils/design_management_utils.js on lines 51..97

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 228.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

          export const designUploadOptimisticResponse = files => {
            const designs = files.map(file => ({
              // False positive i18n lint: https://gitlab.com/gitlab-org/frontend/eslint-plugin-i18n/issues/26
              // eslint-disable-next-line @gitlab/require-i18n-strings
              __typename: 'Design',
          app/assets/javascripts/design_management/utils/design_management_utils.js on lines 51..97

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 228.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          File utils.js has 552 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import { property, isEqual } from 'lodash';
          import { truncatePathMiddleToLength } from '~/lib/utils/text_utility';
          import { diffModes, diffViewerModes } from '~/ide/constants';
          import {
            LINE_POSITION_LEFT,
          Severity: Major
          Found in app/assets/javascripts/diffs/store/utils.js - About 1 day to fix

            File common_utils.js has 545 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /**
             * @module common-utils
             */
            
            import { GlBreakpointInstance as breakpointInstance } from '@gitlab/ui/dist/utils';
            Severity: Major
            Found in app/assets/javascripts/lib/utils/common_utils.js - About 1 day to fix

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

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

                Class ApplicationController has 62 methods (exceeds 20 allowed). Consider refactoring.
                Open

                class ApplicationController < ActionController::Base
                  include Gitlab::GonHelper
                  include Gitlab::NoCacheHeaders
                  include GitlabRoutingHelper
                  include PageLayoutHelper
                Severity: Major
                Found in app/controllers/application_controller.rb - About 1 day to fix

                  Class Parser has 61 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                        class Parser
                          # keys represent the trailing digit in color changing command (30-37, 40-47, 90-97. 100-107)
                          COLOR = {
                            0 => 'black', # not that this is gray in the intense color table
                            1 => 'red',
                  Severity: Major
                  Found in lib/gitlab/ci/ansi2json/parser.rb - About 1 day to fix

                    Function init has 214 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      static init(els, options) {
                        let $els = $(els);
                    
                        if (!els) {
                          $els = $('.js-milestone-select');
                    Severity: Major
                    Found in app/assets/javascripts/milestone_select.js - About 1 day to fix

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

                      class ProjectPolicy < BasePolicy
                        include CrudPolicyHelpers
                      
                        READONLY_FEATURES_WHEN_ARCHIVED = %i[
                          issue
                      Severity: Major
                      Found in app/policies/project_policy.rb - About 1 day to fix

                        File labels_select.js has 503 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        /* eslint-disable no-useless-return, func-names, no-underscore-dangle, no-new, consistent-return, no-shadow, no-param-reassign, no-lonely-if, dot-notation, no-empty */
                        /* global Issuable */
                        /* global ListLabel */
                        
                        import $ from 'jquery';
                        Severity: Major
                        Found in app/assets/javascripts/labels_select.js - About 1 day to fix

                          Class Commit has 56 methods (exceeds 20 allowed). Consider refactoring.
                          Open

                              class Commit
                                include Gitlab::EncodingHelper
                                prepend Gitlab::Git::RuggedImpl::Commit
                                extend Gitlab::Git::WrapsGitalyErrors
                                include Gitlab::Utils::StrongMemoize
                          Severity: Major
                          Found in lib/gitlab/git/commit.rb - About 1 day to fix

                            Similar blocks of code found in 2 locations. Consider refactoring.
                            Open

                            export default function subscriptionSelect() {
                              $('.js-subscription-event').each((i, element) => {
                                const fieldName = $(element).data('fieldName');
                            
                                return $(element).glDropdown({
                            Severity: Major
                            Found in app/assets/javascripts/subscription_select.js and 1 other location - About 7 hrs to fix
                            app/assets/javascripts/issue_status_select.js on lines 4..26

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 194.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Severity
                            Category
                            Status
                            Source
                            Language