hackedteam/rcs-db

View on GitHub
lib/rcs-db/license.rb

Summary

Maintainability
F
6 days
Test Coverage

File license.rb has 428 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require_relative 'dongle.rb'
require_relative 'shard.rb'

# from RCS::Common
require 'rcs-common/trace'
Severity: Minor
Found in lib/rcs-db/license.rb - About 6 hrs to fix

    Method load_license has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
    Open

      def load_license(periodic = false)
    
        # load the license file
        lic_file = File.join $execution_directory, RCS::DB::Config::CONF_DIR, LICENSE_FILE
    
    
    Severity: Minor
    Found in lib/rcs-db/license.rb - About 4 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

    Method periodic_check has 86 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def periodic_check
        begin
    
          # periodically check for license file
          load_license(true)
    Severity: Major
    Found in lib/rcs-db/license.rb - About 3 hrs to fix

      Method periodic_check has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
      Open

        def periodic_check
          begin
      
            # periodically check for license file
            load_license(true)
      Severity: Minor
      Found in lib/rcs-db/license.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

      Method burn_one_license has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

        def burn_one_license(type, platform)
      
          # check if the platform can be used
          unless @limits[:agents][platform][0]
            trace :warn, "You don't have a license for #{platform.to_s}. Queuing agent..."
      Severity: Minor
      Found in lib/rcs-db/license.rb - About 2 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

      Method check has 50 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def check(field)
          # these check are performed just before the creation of an object.
          # thus the comparison is strictly < and not <=
          case (field)
            when :users
      Severity: Minor
      Found in lib/rcs-db/license.rb - About 2 hrs to fix

        Method load_license has 50 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def load_license(periodic = false)
        
            # load the license file
            lic_file = File.join $execution_directory, RCS::DB::Config::CONF_DIR, LICENSE_FILE
        
        
        Severity: Minor
        Found in lib/rcs-db/license.rb - About 2 hrs to fix

          Method new_license has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

            def new_license(file)
              file = "#{ENV['CWD']}/#{file}" if !File.exist?(file) and ENV['CWD']
              raise "file not found" unless File.exist?(file)
          
              trace :info, "Loading new license file #{file}"
          Severity: Minor
          Found in lib/rcs-db/license.rb - About 1 hr 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

          Method burn_one_license has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def burn_one_license(type, platform)
          
              # check if the platform can be used
              unless @limits[:agents][platform][0]
                trace :warn, "You don't have a license for #{platform.to_s}. Queuing agent..."
          Severity: Minor
          Found in lib/rcs-db/license.rb - About 1 hr to fix

            Method add_limits has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def add_limits(limit)
            
                @limits[:magic] = limit[:check]
            
                @limits[:type] = limit[:type]
            Severity: Minor
            Found in lib/rcs-db/license.rb - About 1 hr to fix

              Method check has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                def check(field)
                  # these check are performed just before the creation of an object.
                  # thus the comparison is strictly < and not <=
                  case (field)
                    when :users
              Severity: Minor
              Found in lib/rcs-db/license.rb - About 1 hr 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

              Method initialize has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def initialize
                  # default values.
                  # you have at least:
                  #   - one user to login to the system
                  #   - one collector to receive data
              Severity: Minor
              Found in lib/rcs-db/license.rb - About 1 hr to fix

                Method run has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                  def run(options)
                
                    # save the new file if requested
                    new_license(options[:new_license]) if options[:new_license]
                
                
                Severity: Minor
                Found in lib/rcs-db/license.rb - About 45 mins 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

                Avoid too many return statements within this method.
                Open

                        return false
                Severity: Major
                Found in lib/rcs-db/license.rb - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                          return @limits[:modify]
                  Severity: Major
                  Found in lib/rcs-db/license.rb - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                            return true
                    Severity: Major
                    Found in lib/rcs-db/license.rb - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                          return false
                      Severity: Major
                      Found in lib/rcs-db/license.rb - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                return @limits[:rmi]
                        Severity: Major
                        Found in lib/rcs-db/license.rb - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                  return @limits[:deletion]
                          Severity: Major
                          Found in lib/rcs-db/license.rb - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                  return false
                            Severity: Major
                            Found in lib/rcs-db/license.rb - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                      return @limits[:archive]
                              Severity: Major
                              Found in lib/rcs-db/license.rb - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                        return @limits[:alerting]
                                Severity: Major
                                Found in lib/rcs-db/license.rb - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                          return @limits[:correlation]
                                  Severity: Major
                                  Found in lib/rcs-db/license.rb - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                            return @limits[:ocr]
                                    Severity: Major
                                    Found in lib/rcs-db/license.rb - About 30 mins to fix

                                      Avoid too many return statements within this method.
                                      Open

                                              return @limits[:exploits]
                                      Severity: Major
                                      Found in lib/rcs-db/license.rb - About 30 mins to fix

                                        Avoid too many return statements within this method.
                                        Open

                                                return @limits[:scout]
                                        Severity: Major
                                        Found in lib/rcs-db/license.rb - About 30 mins to fix

                                          Avoid too many return statements within this method.
                                          Open

                                                  return @limits[:translation]
                                          Severity: Major
                                          Found in lib/rcs-db/license.rb - About 30 mins to fix

                                            Avoid too many return statements within this method.
                                            Open

                                                    return @limits[:intelligence]
                                            Severity: Major
                                            Found in lib/rcs-db/license.rb - About 30 mins to fix

                                              Avoid too many return statements within this method.
                                              Open

                                                      return true
                                              Severity: Major
                                              Found in lib/rcs-db/license.rb - About 30 mins to fix

                                                Avoid too many return statements within this method.
                                                Open

                                                        return Time.now.getutc <= @limits[:maintenance]
                                                Severity: Major
                                                Found in lib/rcs-db/license.rb - About 30 mins to fix

                                                  Avoid too many return statements within this method.
                                                  Open

                                                          return @limits[:connectors]
                                                  Severity: Major
                                                  Found in lib/rcs-db/license.rb - About 30 mins to fix

                                                    Avoid too many return statements within this method.
                                                    Open

                                                        return false
                                                    Severity: Major
                                                    Found in lib/rcs-db/license.rb - About 30 mins to fix

                                                      Avoid too many return statements within this method.
                                                      Open

                                                                return true
                                                      Severity: Major
                                                      Found in lib/rcs-db/license.rb - About 30 mins to fix

                                                        Method add_limits has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                        Open

                                                          def add_limits(limit)
                                                        
                                                            @limits[:magic] = limit[:check]
                                                        
                                                            @limits[:type] = limit[:type]
                                                        Severity: Minor
                                                        Found in lib/rcs-db/license.rb - About 25 mins 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

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

                                                          def crypt_check(hash)
                                                            # check the date digest (hidden expiration)
                                                            return false if hash[:digest_seed] and Time.now.to_i > hash[:digest_seed].unpack('I').first
                                                        
                                                            # first check on signature
                                                        Severity: Major
                                                        Found in lib/rcs-db/license.rb and 1 other location - About 2 hrs to fix
                                                        lib/rcs-license-check.rb on lines 173..187

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

                                                        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

                                                              if ::Collector.remote.count > @limits[:collectors][:anonymizers]
                                                                trace :fatal, "LICENCE EXCEEDED: Number of anonymizers is greater than license file. Fixing..."
                                                                # fix by deleting the collector
                                                                offending = ::Collector.remote.order_by([[:updated_at, :desc]]).first
                                                                trace :warn, "Deleting anonymizer '#{offending[:name]}' #{offending[:address]}"
                                                        Severity: Major
                                                        Found in lib/rcs-db/license.rb and 1 other location - About 2 hrs to fix
                                                        lib/rcs-db/license.rb on lines 422..438

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

                                                        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

                                                              if ::Collector.local.count > @limits[:collectors][:collectors]
                                                                trace :fatal, "LICENCE EXCEEDED: Number of collector is greater than license file. Fixing..."
                                                                # fix by deleting the collector
                                                                offending = ::Collector.local.order_by([[:updated_at, :desc]]).first
                                                                trace :warn, "Deleting collector '#{offending[:name]}' #{offending[:address]}"
                                                        Severity: Major
                                                        Found in lib/rcs-db/license.rb and 1 other location - About 2 hrs to fix
                                                        lib/rcs-db/license.rb on lines 440..456

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

                                                        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

                                                              if ::Item.agents.where(type: 'mobile', status: 'open', demo: false, deleted: false).count > @limits[:agents][:mobile]
                                                                trace :fatal, "LICENCE EXCEEDED: Number of agents(mobile) is greater than license file. Fixing..."
                                                                # fix by queuing the last updated agent
                                                                offending = ::Item.where(_kind: 'agent', type: 'mobile', status: 'open', demo: false).order_by([[:updated_at, :desc]]).first
                                                                offending[:status] = 'queued'
                                                        Severity: Major
                                                        Found in lib/rcs-db/license.rb and 1 other location - About 1 hr to fix
                                                        lib/rcs-db/license.rb on lines 467..473

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

                                                        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

                                                              if ::Item.agents.where(type: 'desktop', status: 'open', demo: false, deleted: false).count > @limits[:agents][:desktop]
                                                                trace :fatal, "LICENCE EXCEEDED: Number of agents(desktop) is greater than license file. Fixing..."
                                                                # fix by queuing the last updated agent
                                                                offending = ::Item.where(_kind: 'agent', type: 'desktop', status: 'open', demo: false).order_by([[:updated_at, :desc]]).first
                                                                offending[:status] = 'queued'
                                                        Severity: Major
                                                        Found in lib/rcs-db/license.rb and 1 other location - About 1 hr to fix
                                                        lib/rcs-db/license.rb on lines 476..482

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

                                                        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

                                                                       :agents => {:total => 0,
                                                                                      :desktop => 0,
                                                                                      :mobile => 0,
                                                                                      :windows => [false, false],
                                                                                      :osx => [false, false],
                                                        Severity: Minor
                                                        Found in lib/rcs-db/license.rb and 1 other location - About 50 mins to fix
                                                        scripts/rcs-db-license-gen.rb on lines 29..40

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

                                                        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

                                                              if type == :desktop and desktop < @limits[:agents][:desktop]
                                                                trace :info, "Using a reusable license: #{type.to_s} #{platform.to_s}"
                                                                return true
                                                              end
                                                        Severity: Minor
                                                        Found in lib/rcs-db/license.rb and 1 other location - About 15 mins to fix
                                                        lib/rcs-db/license.rb on lines 279..282

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

                                                        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

                                                              if type == :mobile and mobile < @limits[:agents][:mobile]
                                                                trace :info, "Using a reusable license: #{type.to_s} #{platform.to_s}"
                                                                return true
                                                              end
                                                        Severity: Minor
                                                        Found in lib/rcs-db/license.rb and 1 other location - About 15 mins to fix
                                                        lib/rcs-db/license.rb on lines 275..278

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

                                                        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

                                                        There are no issues that match your filters.

                                                        Category
                                                        Status