gitlabhq/gitlabhq

View on GitHub

Showing 1,988 of 1,988 total issues

Class Project has 257 methods (exceeds 20 allowed). Consider refactoring.
Open

class Project < ActiveRecord::Base
  include Gitlab::ConfigHelper
  include Gitlab::ShellAdapter
  include Gitlab::VisibilityLevel
  include AccessRequestable
Severity: Major
Found in app/models/project.rb - About 5 days to fix

    File project.rb has 1658 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'carrierwave/orm/activerecord'
    
    class Project < ActiveRecord::Base
      include Gitlab::ConfigHelper
      include Gitlab::ShellAdapter
    Severity: Major
    Found in app/models/project.rb - About 4 days to fix

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

      class User < ApplicationRecord
        extend Gitlab::ConfigHelper
      
        include Gitlab::ConfigHelper
        include Gitlab::SQL::Pattern
      Severity: Major
      Found in app/models/user.rb - About 3 days to fix

        File notes.js has 1325 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /* eslint-disable no-restricted-properties, func-names, no-var, camelcase,
        no-unused-expressions, one-var, default-case,
        prefer-template, consistent-return, no-alert, no-return-assign,
        no-param-reassign, prefer-arrow-callback, no-else-return, vars-on-top,
        no-unused-vars, no-shadow, no-useless-escape, class-methods-use-this */
        Severity: Major
        Found in app/assets/javascripts/notes.js - About 3 days to fix

          File entities.rb has 1277 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          module API
            module Entities
              class WikiPageBasic < Grape::Entity
                expose :format
                expose :slug
          Severity: Major
          Found in lib/api/entities.rb - About 3 days to fix

            Class MergeRequest has 156 methods (exceeds 20 allowed). Consider refactoring.
            Open

            class MergeRequest < ActiveRecord::Base
              include AtomicInternalId
              include IidRoutes
              include Issuable
              include Noteable
            Severity: Major
            Found in app/models/merge_request.rb - About 3 days to fix

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

                      module Auth
                        module LDAP
                          class DN
                            FormatError = Class.new(StandardError)
                            MalformedError = Class.new(FormatError)
              lib/gitlab/auth/ldap/dn.rb on lines 24..299

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

              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

                module Auth
                  module LDAP
                    class DN
                      FormatError = Class.new(StandardError)
                      MalformedError = Class.new(FormatError)
              Severity: Major
              Found in lib/gitlab/auth/ldap/dn.rb and 1 other location - About 2 days to fix
              lib/gitlab/background_migration/normalize_ldap_extern_uids_range.rb on lines 18..293

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

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

              require 'carrierwave/orm/activerecord'
              
              class User < ApplicationRecord
                extend Gitlab::ConfigHelper
              
              
              Severity: Major
              Found in app/models/user.rb - About 2 days to fix

                Class Repository has 134 methods (exceeds 20 allowed). Consider refactoring.
                Open

                class Repository
                  REF_MERGE_REQUEST = 'merge-requests'.freeze
                  REF_KEEP_AROUND = 'keep-around'.freeze
                  REF_ENVIRONMENTS = 'environments'.freeze
                  MAX_DIVERGING_COUNT = 1000
                Severity: Major
                Found in app/models/repository.rb - About 2 days to fix

                  File merge_request.rb has 1018 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  class MergeRequest < ActiveRecord::Base
                    include AtomicInternalId
                    include IidRoutes
                    include Issuable
                    include Noteable
                  Severity: Major
                  Found in app/models/merge_request.rb - About 2 days to fix

                    File gl_dropdown.js has 923 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /* eslint-disable func-names, no-underscore-dangle, no-var, one-var, vars-on-top, no-unused-vars, no-shadow, no-cond-assign, prefer-arrow-callback, no-return-assign, no-else-return, camelcase, no-lonely-if, guard-for-in, no-restricted-syntax, consistent-return, prefer-template, no-param-reassign, no-loop-func */
                    /* global fuzzaldrinPlus */
                    
                    import $ from 'jquery';
                    import _ from 'underscore';
                    Severity: Major
                    Found in app/assets/javascripts/gl_dropdown.js - About 2 days to fix

                      Class Repository has 116 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                          class Repository
                            include Gitlab::Git::RepositoryMirroring
                            include Gitlab::Git::WrapsGitalyErrors
                            include Gitlab::EncodingHelper
                            include Gitlab::Utils::StrongMemoize
                      Severity: Major
                      Found in lib/gitlab/git/repository.rb - About 2 days to fix

                        Function constructor has 399 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          constructor(els, options = {}) {
                            var _this, $els;
                            _this = this;
                        
                            $els = $(els);
                        Severity: Major
                        Found in app/assets/javascripts/labels_select.js - About 1 day to fix

                          File services.rb has 828 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          module API
                            class Services < Grape::API
                              CHAT_NOTIFICATION_SETTINGS = [
                                {
                                  required: true,
                          Severity: Major
                          Found in lib/api/services.rb - About 1 day to fix

                            Class Build has 100 methods (exceeds 20 allowed). Consider refactoring.
                            Open

                              class Build < CommitStatus
                                prepend ArtifactMigratable
                                include Ci::Processable
                                include Ci::Metadatable
                                include Ci::Contextable
                            Severity: Major
                            Found in app/models/ci/build.rb - About 1 day to fix

                              File repository.rb has 805 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              require 'securerandom'
                              
                              class Repository
                                REF_MERGE_REQUEST = 'merge-requests'.freeze
                                REF_KEEP_AROUND = 'keep-around'.freeze
                              Severity: Major
                              Found in app/models/repository.rb - About 1 day to fix

                                File repository.rb has 726 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                require 'tempfile'
                                require 'forwardable'
                                require "rubygems/package"
                                
                                module Gitlab
                                Severity: Major
                                Found in lib/gitlab/git/repository.rb - About 1 day to fix

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

                                      const memoizedLocale = () => {
                                        const cache = [];
                                  
                                        const timeAgoLocale = [
                                          () => [s__('Timeago|just now'), s__('Timeago|right now')],
                                  Severity: Major
                                  Found in app/assets/javascripts/lib/utils/datetime_utility.js and 1 other location - About 1 day to fix
                                  app/assets/javascripts/lib/utils/datetime_utility.js on lines 90..117

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

                                  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

                                      const memoizedLocaleRemaining = () => {
                                        const cache = [];
                                  
                                        const timeAgoLocaleRemaining = [
                                          () => [s__('Timeago|just now'), s__('Timeago|right now')],
                                  Severity: Major
                                  Found in app/assets/javascripts/lib/utils/datetime_utility.js and 1 other location - About 1 day to fix
                                  app/assets/javascripts/lib/utils/datetime_utility.js on lines 119..146

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

                                  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