gitlabhq/gitlabhq

View on GitHub

Similar code found in 2 other locations

# Generated from:
# SVG element list: https://www.w3.org/TR/SVG/eltindex.html
# SVG Attribute list: https://www.w3.org/TR/SVG/attindex.html
module Gitlab
  module Sanitizers
Found in Gitlab::Sanitizers::SVG::Whitelist and 2 other locations - About 1 day to fix
lib/gitlab/sanitizers/svg/whitelist.rb on lines 31..31
lib/gitlab/sanitizers/svg/whitelist.rb on lines 95..95

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

Refactorings

Further Reading

Complex class definition

module API
  class Variables < Grape::API
    include PaginationParams

    before { authenticate! }
Found in API::Variables - About 1 day to fix

    Complex class definition

    module API
      class GroupVariables < Grape::API
        include PaginationParams
    
        before { authenticate! }
    Found in API::GroupVariables - About 1 day to fix

      Very high overall complexity: 285

      class Event < ActiveRecord::Base
        include Sortable
        include IgnorableColumn
        default_scope { reorder(nil) }
      
      
      Found in Event - About 1 day to fix

      When classes take on too many responsibilities, they grow. A large number of instance variables or methods can make a class hard to understand. Large classes tend to have lower cohesion and higher churn.

      Often large classes have methods that do not operate on all of the class state. Identifying the groups of data that are used together can point to seams to split out additional collaborator classes or value objects.

      Another trick is to look for repeated prefixes or suffixes in method and variable names, or repeated parameter names, and use them to guide extractions.

      Refactorings

      Further Reading

      Complex class definition

      module API
        module V3
          class Services < Grape::API
            services = {
              'asana' => [
      Found in API::V3::Services - About 1 day to fix

        Complex class definition

        module API
          module V3
            class Environments < Grape::API
              include ::API::Helpers::CustomValidators
              include PaginationParams
        Found in API::V3::Environments - About 1 day to fix

          Very high overall complexity: 281

          require 'yaml'
          
          module Backup
            class Repository
              # rubocop:disable Metrics/AbcSize
          Found in Backup::Repository - About 1 day to fix

          When classes take on too many responsibilities, they grow. A large number of instance variables or methods can make a class hard to understand. Large classes tend to have lower cohesion and higher churn.

          Often large classes have methods that do not operate on all of the class state. Identifying the groups of data that are used together can point to seams to split out additional collaborator classes or value objects.

          Another trick is to look for repeated prefixes or suffixes in method and variable names, or repeated parameter names, and use them to guide extractions.

          Refactorings

          Further Reading

          Complex class definition

          module API
            class ProtectedBranches < Grape::API
              include PaginationParams
          
              BRANCH_ENDPOINT_REQUIREMENTS = API::PROJECT_ENDPOINT_REQUIREMENTS.merge(branch: API::NO_SLASH_URL_PART_REGEX)
          Found in API::ProtectedBranches - About 1 day to fix

            Complex class definition

            module API
              class Events < Grape::API
                include PaginationParams
            
                helpers do
            Found in API::Events - About 1 day to fix

              Identical code found in 1 other location

              module API
                class Groups < Grape::API
                  include PaginationParams
              
                  before { authenticate_non_get! }
              Found in API::Groups and 1 other location - About 1 day to fix
              lib/api/v3/groups.rb on lines 170..181

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

              Refactorings

              Further Reading

              Identical code found in 1 other location

              module API
                class Services < Grape::API
                  services = {
                    'asana' => [
                      {
              Found in API::Services and 1 other location - About 1 day to fix
              lib/api/v3/services.rb on lines 428..457

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

              Refactorings

              Further Reading

              Identical code found in 1 other location

              module API
                class Templates < Grape::API
                  include PaginationParams
              
                  GLOBAL_TEMPLATE_TYPES = {
              Found in API::Templates and 1 other location - About 1 day to fix
              lib/api/v3/templates.rb on lines 31..41

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

              Refactorings

              Further Reading

              Identical code found in 1 other location

              module API
                module V3
                  class Groups < Grape::API
                    include PaginationParams
              
              
              Found in API::V3::Groups and 1 other location - About 1 day to fix
              lib/api/groups.rb on lines 168..179

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

              Refactorings

              Further Reading

              Identical code found in 1 other location

              module API
                module V3
                  class Services < Grape::API
                    services = {
                      'asana' => [
              Found in API::V3::Services and 1 other location - About 1 day to fix
              lib/api/services.rb on lines 415..444

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

              Refactorings

              Further Reading

              Identical code found in 1 other location

              module API
                module V3
                  class Templates < Grape::API
                    GLOBAL_TEMPLATE_TYPES = {
                      gitignores: {
              Found in API::V3::Templates and 1 other location - About 1 day to fix
              lib/api/templates.rb on lines 31..41

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

              Refactorings

              Further Reading

              Similar code found in 1 other location

              # Generated from:
              # SVG element list: https://www.w3.org/TR/SVG/eltindex.html
              # SVG Attribute list: https://www.w3.org/TR/SVG/attindex.html
              module Gitlab
                module Sanitizers
              Found in Gitlab::Sanitizers::SVG::Whitelist and 1 other location - About 1 day to fix
              lib/gitlab/sanitizers/svg/whitelist.rb on lines 103..103

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

              Refactorings

              Further Reading

              Similar code found in 1 other location

              # Generated from:
              # SVG element list: https://www.w3.org/TR/SVG/eltindex.html
              # SVG Attribute list: https://www.w3.org/TR/SVG/attindex.html
              module Gitlab
                module Sanitizers
              Found in Gitlab::Sanitizers::SVG::Whitelist and 1 other location - About 1 day to fix
              lib/gitlab/sanitizers/svg/whitelist.rb on lines 101..101

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

              Refactorings

              Further Reading

              Very complex method in #seed_metrics!

                def seed_metrics!
                  @issue_count.times do |index|
                    # Issue
                    Timecop.travel 5.days.from_now
                    title = "#{FFaker::Product.brand}-#{FFaker::Product.brand}-#{rand(1000)}"
              Found in Gitlab::Seeder::CycleAnalytics - About 1 day to fix

              Long or complex methods can make code harder to understand. In most circumstances, methods are best as a small chunk of code (the "how") with a clear, understandable name (the "what"). Long methods can also lead to duplication, as it's harder to reuse logic that is tightly coupled to surrounding code.

              Refactorings

              Read More

              Very high overall complexity: 275

              module API
                class Groups < Grape::API
                  include PaginationParams
              
                  before { authenticate_non_get! }
              Found in API::Groups - About 1 day to fix

              When classes take on too many responsibilities, they grow. A large number of instance variables or methods can make a class hard to understand. Large classes tend to have lower cohesion and higher churn.

              Often large classes have methods that do not operate on all of the class state. Identifying the groups of data that are used together can point to seams to split out additional collaborator classes or value objects.

              Another trick is to look for repeated prefixes or suffixes in method and variable names, or repeated parameter names, and use them to guide extractions.

              Refactorings

              Further Reading

              Complex class definition

              module API
                class BroadcastMessages < Grape::API
                  include PaginationParams
              
                  before { authenticate! }
              Found in API::BroadcastMessages - About 1 day to fix

                Very high overall complexity: 273

                class HipchatService < Service
                  include ActionView::Helpers::SanitizeHelper
                
                  MAX_COMMITS = 3
                  HIPCHAT_ALLOWED_TAGS = %w[
                Found in HipchatService - About 1 day to fix

                When classes take on too many responsibilities, they grow. A large number of instance variables or methods can make a class hard to understand. Large classes tend to have lower cohesion and higher churn.

                Often large classes have methods that do not operate on all of the class state. Identifying the groups of data that are used together can point to seams to split out additional collaborator classes or value objects.

                Another trick is to look for repeated prefixes or suffixes in method and variable names, or repeated parameter names, and use them to guide extractions.

                Refactorings

                Further Reading

                Very high overall complexity: 272

                module API
                  module V3
                    class Groups < Grape::API
                      include PaginationParams
                
                
                Found in API::V3::Groups - About 1 day to fix

                When classes take on too many responsibilities, they grow. A large number of instance variables or methods can make a class hard to understand. Large classes tend to have lower cohesion and higher churn.

                Often large classes have methods that do not operate on all of the class state. Identifying the groups of data that are used together can point to seams to split out additional collaborator classes or value objects.

                Another trick is to look for repeated prefixes or suffixes in method and variable names, or repeated parameter names, and use them to guide extractions.

                Refactorings

                Further Reading

                Similar code found in 1 other location

                # Generated from:
                # SVG element list: https://www.w3.org/TR/SVG/eltindex.html
                # SVG Attribute list: https://www.w3.org/TR/SVG/attindex.html
                module Gitlab
                  module Sanitizers
                Found in Gitlab::Sanitizers::SVG::Whitelist and 1 other location - About 1 day to fix
                lib/gitlab/sanitizers/svg/whitelist.rb on lines 102..102

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

                Refactorings

                Further Reading

                Similar code found in 1 other location

                # Generated from:
                # SVG element list: https://www.w3.org/TR/SVG/eltindex.html
                # SVG Attribute list: https://www.w3.org/TR/SVG/attindex.html
                module Gitlab
                  module Sanitizers
                Found in Gitlab::Sanitizers::SVG::Whitelist and 1 other location - About 1 day to fix
                lib/gitlab/sanitizers/svg/whitelist.rb on lines 90..90

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

                Refactorings

                Further Reading

                Very high overall complexity: 268

                module API
                  module V3
                    class Users < Grape::API
                      include PaginationParams
                      include APIGuard
                Found in API::V3::Users - About 1 day to fix

                When classes take on too many responsibilities, they grow. A large number of instance variables or methods can make a class hard to understand. Large classes tend to have lower cohesion and higher churn.

                Often large classes have methods that do not operate on all of the class state. Identifying the groups of data that are used together can point to seams to split out additional collaborator classes or value objects.

                Another trick is to look for repeated prefixes or suffixes in method and variable names, or repeated parameter names, and use them to guide extractions.

                Refactorings

                Further Reading

                Complex class definition

                module API
                  module CustomAttributesEndpoints
                    extend ActiveSupport::Concern
                
                    included do
                Found in API::CustomAttributesEndpoints - About 1 day to fix

                  Identical code found in 1 other location

                  require 'thread'
                  
                  class RenameMoreReservedProjectNames < ActiveRecord::Migration
                    include Gitlab::Database::MigrationHelpers
                    include Gitlab::ShellAdapter
                  Found in RenameMoreReservedProjectNames and 1 other location - About 1 day to fix
                  db/post_migrate/20161221153951_rename_reserved_project_names.rb on lines 108..121

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

                  Refactorings

                  Further Reading

                  Identical code found in 1 other location

                  require 'thread'
                  
                  class RenameReservedProjectNames < ActiveRecord::Migration
                    include Gitlab::Database::MigrationHelpers
                    include Gitlab::ShellAdapter
                  Found in RenameReservedProjectNames and 1 other location - About 1 day to fix
                  db/post_migrate/20170313133418_rename_more_reserved_project_names.rb on lines 50..63

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

                  Refactorings

                  Further Reading

                  Similar code found in 1 other location

                  module API
                    class ProjectHooks < Grape::API
                      include PaginationParams
                  
                      before { authenticate! }
                  Found in API::ProjectHooks and 1 other location - About 1 day to fix
                  lib/api/v3/project_hooks.rb on lines 9..23

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

                  Refactorings

                  Further Reading

                  Similar code found in 1 other location

                  module API
                    module V3
                      class ProjectHooks < Grape::API
                        include PaginationParams
                  
                  
                  Found in API::V3::ProjectHooks and 1 other location - About 1 day to fix
                  lib/api/project_hooks.rb on lines 8..22

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

                  Refactorings

                  Further Reading

                  Similar code found in 2 other locations

                  # Generated from:
                  # SVG element list: https://www.w3.org/TR/SVG/eltindex.html
                  # SVG Attribute list: https://www.w3.org/TR/SVG/attindex.html
                  module Gitlab
                    module Sanitizers
                  Found in Gitlab::Sanitizers::SVG::Whitelist and 2 other locations - About 1 day to fix
                  lib/gitlab/sanitizers/svg/whitelist.rb on lines 40..40
                  lib/gitlab/sanitizers/svg/whitelist.rb on lines 72..72

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

                  Refactorings

                  Further Reading

                  Similar code found in 2 other locations

                  # Generated from:
                  # SVG element list: https://www.w3.org/TR/SVG/eltindex.html
                  # SVG Attribute list: https://www.w3.org/TR/SVG/attindex.html
                  module Gitlab
                    module Sanitizers
                  Found in Gitlab::Sanitizers::SVG::Whitelist and 2 other locations - About 1 day to fix
                  lib/gitlab/sanitizers/svg/whitelist.rb on lines 40..40
                  lib/gitlab/sanitizers/svg/whitelist.rb on lines 78..78

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

                  Refactorings

                  Further Reading

                  Similar code found in 2 other locations

                  # Generated from:
                  # SVG element list: https://www.w3.org/TR/SVG/eltindex.html
                  # SVG Attribute list: https://www.w3.org/TR/SVG/attindex.html
                  module Gitlab
                    module Sanitizers
                  Found in Gitlab::Sanitizers::SVG::Whitelist and 2 other locations - About 1 day to fix
                  lib/gitlab/sanitizers/svg/whitelist.rb on lines 72..72
                  lib/gitlab/sanitizers/svg/whitelist.rb on lines 78..78

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

                  Refactorings

                  Further Reading

                  Very high overall complexity: 262

                  class GitPushService < BaseService
                    attr_accessor :push_data, :push_commits
                    include Gitlab::CurrentSettings
                    include Gitlab::Access
                  
                  
                  Found in GitPushService - About 1 day to fix

                  When classes take on too many responsibilities, they grow. A large number of instance variables or methods can make a class hard to understand. Large classes tend to have lower cohesion and higher churn.

                  Often large classes have methods that do not operate on all of the class state. Identifying the groups of data that are used together can point to seams to split out additional collaborator classes or value objects.

                  Another trick is to look for repeated prefixes or suffixes in method and variable names, or repeated parameter names, and use them to guide extractions.

                  Refactorings

                  Further Reading

                  Very complex method in #dump

                      def dump
                        prepare
                  
                        Project.find_each(batch_size: 1000) do |project|
                          progress.print " * #{project.full_path} ... "
                  Found in Backup::Repository - About 1 day to fix

                  Long or complex methods can make code harder to understand. In most circumstances, methods are best as a small chunk of code (the "how") with a clear, understandable name (the "what"). Long methods can also lead to duplication, as it's harder to reuse logic that is tightly coupled to surrounding code.

                  Refactorings

                  Read More

                  Complex class definition

                  module API
                    module V3
                      class Templates < Grape::API
                        GLOBAL_TEMPLATE_TYPES = {
                          gitignores: {
                  Found in API::V3::Templates - About 1 day to fix

                    Complex class definition

                    module HasStatus
                      extend ActiveSupport::Concern
                    
                      DEFAULT_STATUS = 'created'.freeze
                      BLOCKED_STATUS = 'manual'.freeze
                    Found in HasStatus - About 1 day to fix

                      Very high overall complexity: 260

                      module Gitlab
                        module FogbugzImport
                          class Importer
                            attr_reader :project, :repo
                      
                      
                      Found in Gitlab::FogbugzImport::Importer - About 1 day to fix

                      When classes take on too many responsibilities, they grow. A large number of instance variables or methods can make a class hard to understand. Large classes tend to have lower cohesion and higher churn.

                      Often large classes have methods that do not operate on all of the class state. Identifying the groups of data that are used together can point to seams to split out additional collaborator classes or value objects.

                      Another trick is to look for repeated prefixes or suffixes in method and variable names, or repeated parameter names, and use them to guide extractions.

                      Refactorings

                      Further Reading

                      Complex class definition

                      module API
                        class JobArtifacts < Grape::API
                          before { authenticate_non_get! }
                      
                          params do
                      Found in API::JobArtifacts - About 1 day to fix

                        Very high overall complexity: 257

                        # OAuth extension for User model
                        #
                        # * Find GitLab user based on omniauth uid and provider
                        # * Create new user from omniauth data
                        #
                        Found in Gitlab::OAuth::User - About 1 day to fix

                        When classes take on too many responsibilities, they grow. A large number of instance variables or methods can make a class hard to understand. Large classes tend to have lower cohesion and higher churn.

                        Often large classes have methods that do not operate on all of the class state. Identifying the groups of data that are used together can point to seams to split out additional collaborator classes or value objects.

                        Another trick is to look for repeated prefixes or suffixes in method and variable names, or repeated parameter names, and use them to guide extractions.

                        Refactorings

                        Further Reading

                        Similar code found in 5 other locations

                        # Generated from:
                        # SVG element list: https://www.w3.org/TR/SVG/eltindex.html
                        # SVG Attribute list: https://www.w3.org/TR/SVG/attindex.html
                        module Gitlab
                          module Sanitizers
                        Found in Gitlab::Sanitizers::SVG::Whitelist and 5 other locations - About 1 day to fix
                        lib/gitlab/sanitizers/svg/whitelist.rb on lines 8..8
                        lib/gitlab/sanitizers/svg/whitelist.rb on lines 45..45
                        lib/gitlab/sanitizers/svg/whitelist.rb on lines 65..65
                        lib/gitlab/sanitizers/svg/whitelist.rb on lines 73..73
                        lib/gitlab/sanitizers/svg/whitelist.rb on lines 96..96

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

                        Refactorings

                        Further Reading

                        Similar code found in 5 other locations

                        # Generated from:
                        # SVG element list: https://www.w3.org/TR/SVG/eltindex.html
                        # SVG Attribute list: https://www.w3.org/TR/SVG/attindex.html
                        module Gitlab
                          module Sanitizers
                        Found in Gitlab::Sanitizers::SVG::Whitelist and 5 other locations - About 1 day to fix
                        lib/gitlab/sanitizers/svg/whitelist.rb on lines 8..8
                        lib/gitlab/sanitizers/svg/whitelist.rb on lines 38..38
                        lib/gitlab/sanitizers/svg/whitelist.rb on lines 45..45
                        lib/gitlab/sanitizers/svg/whitelist.rb on lines 73..73
                        lib/gitlab/sanitizers/svg/whitelist.rb on lines 96..96

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

                        Refactorings

                        Further Reading

                        Similar code found in 5 other locations

                        # Generated from:
                        # SVG element list: https://www.w3.org/TR/SVG/eltindex.html
                        # SVG Attribute list: https://www.w3.org/TR/SVG/attindex.html
                        module Gitlab
                          module Sanitizers
                        Found in Gitlab::Sanitizers::SVG::Whitelist and 5 other locations - About 1 day to fix
                        lib/gitlab/sanitizers/svg/whitelist.rb on lines 38..38
                        lib/gitlab/sanitizers/svg/whitelist.rb on lines 45..45
                        lib/gitlab/sanitizers/svg/whitelist.rb on lines 65..65
                        lib/gitlab/sanitizers/svg/whitelist.rb on lines 73..73
                        lib/gitlab/sanitizers/svg/whitelist.rb on lines 96..96

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

                        Refactorings

                        Further Reading

                        Similar code found in 5 other locations

                        # Generated from:
                        # SVG element list: https://www.w3.org/TR/SVG/eltindex.html
                        # SVG Attribute list: https://www.w3.org/TR/SVG/attindex.html
                        module Gitlab
                          module Sanitizers
                        Found in Gitlab::Sanitizers::SVG::Whitelist and 5 other locations - About 1 day to fix
                        lib/gitlab/sanitizers/svg/whitelist.rb on lines 8..8
                        lib/gitlab/sanitizers/svg/whitelist.rb on lines 38..38
                        lib/gitlab/sanitizers/svg/whitelist.rb on lines 65..65
                        lib/gitlab/sanitizers/svg/whitelist.rb on lines 73..73
                        lib/gitlab/sanitizers/svg/whitelist.rb on lines 96..96

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

                        Refactorings

                        Further Reading

                        Similar code found in 5 other locations

                        # Generated from:
                        # SVG element list: https://www.w3.org/TR/SVG/eltindex.html
                        # SVG Attribute list: https://www.w3.org/TR/SVG/attindex.html
                        module Gitlab
                          module Sanitizers
                        Found in Gitlab::Sanitizers::SVG::Whitelist and 5 other locations - About 1 day to fix
                        lib/gitlab/sanitizers/svg/whitelist.rb on lines 8..8
                        lib/gitlab/sanitizers/svg/whitelist.rb on lines 38..38
                        lib/gitlab/sanitizers/svg/whitelist.rb on lines 45..45
                        lib/gitlab/sanitizers/svg/whitelist.rb on lines 65..65
                        lib/gitlab/sanitizers/svg/whitelist.rb on lines 73..73

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

                        Refactorings

                        Further Reading

                        Similar code found in 5 other locations

                        # Generated from:
                        # SVG element list: https://www.w3.org/TR/SVG/eltindex.html
                        # SVG Attribute list: https://www.w3.org/TR/SVG/attindex.html
                        module Gitlab
                          module Sanitizers
                        Found in Gitlab::Sanitizers::SVG::Whitelist and 5 other locations - About 1 day to fix
                        lib/gitlab/sanitizers/svg/whitelist.rb on lines 8..8
                        lib/gitlab/sanitizers/svg/whitelist.rb on lines 38..38
                        lib/gitlab/sanitizers/svg/whitelist.rb on lines 45..45
                        lib/gitlab/sanitizers/svg/whitelist.rb on lines 65..65
                        lib/gitlab/sanitizers/svg/whitelist.rb on lines 96..96

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

                        Refactorings

                        Further Reading

                        Identical code found in 3 other locations

                        module API
                          class Issues < Grape::API
                            include PaginationParams
                        
                            before { authenticate! }
                        Found in API::Issues and 3 other locations - About 1 day to fix
                        lib/api/issues.rb on lines 90..94
                        lib/api/v3/issues.rb on lines 57..61
                        lib/api/v3/issues.rb on lines 76..80

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

                        Refactorings

                        Further Reading

                        Identical code found in 3 other locations

                        module API
                          class Issues < Grape::API
                            include PaginationParams
                        
                            before { authenticate! }
                        Found in API::Issues and 3 other locations - About 1 day to fix
                        lib/api/issues.rb on lines 119..123
                        lib/api/v3/issues.rb on lines 57..61
                        lib/api/v3/issues.rb on lines 76..80

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

                        Refactorings

                        Further Reading

                        Identical code found in 3 other locations

                        module API
                          module TimeTrackingEndpoints
                            extend ActiveSupport::Concern
                        
                            included do
                        Found in API::TimeTrackingEndpoints and 3 other locations - About 1 day to fix
                        lib/api/time_tracking_endpoints.rb on lines 56..59
                        lib/api/v3/time_tracking_endpoints.rb on lines 57..60
                        lib/api/v3/time_tracking_endpoints.rb on lines 80..83

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

                        Refactorings

                        Further Reading

                        Identical code found in 3 other locations

                        module API
                          module TimeTrackingEndpoints
                            extend ActiveSupport::Concern
                        
                            included do
                        Found in API::TimeTrackingEndpoints and 3 other locations - About 1 day to fix
                        lib/api/time_tracking_endpoints.rb on lines 79..82
                        lib/api/v3/time_tracking_endpoints.rb on lines 57..60
                        lib/api/v3/time_tracking_endpoints.rb on lines 80..83

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

                        Refactorings

                        Further Reading