hackedteam/rcs-collector

View on GitHub

Showing 209 of 209 total issues

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

    if steps.include? :purge and DB.instance.purge? session[:bid]
      available += [PROTO_PURGE].pack('I')
      trace :info, "[#{peer}][#{session[:cookie]}] Available: Purge"
    end
Severity: Major
Found in lib/rcs-collector/sync_commands.rb and 6 other locations - About 25 mins to fix
lib/rcs-collector/sync_commands.rb on lines 91..94
lib/rcs-collector/sync_commands.rb on lines 99..102
lib/rcs-collector/sync_commands.rb on lines 103..106
lib/rcs-collector/sync_commands.rb on lines 107..110
lib/rcs-collector/sync_commands.rb on lines 111..114
lib/rcs-collector/sync_commands.rb on lines 115..118

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

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

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

  def self.get
    # don't perform resolution if not wanted
    return '' unless Config.instance.global['RESOLVE_IP']

    address = ''
Severity: Minor
Found in lib/rcs-collector/my_ip.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

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

  def self.stop
    return unless @server_handle

    trace(:info, "Stopping http server...")
    EM.stop_server(@server_handle) if @server_handle
Severity: Minor
Found in lib/rcs-collector/events.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

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

    if steps.include? :filesystem and DB.instance.new_filesystems? session[:bid]
      available += [PROTO_FILESYSTEM].pack('I')
      trace :info, "[#{peer}][#{session[:cookie]}] Available: New filesystems"
    end
Severity: Major
Found in lib/rcs-collector/sync_commands.rb and 6 other locations - About 25 mins to fix
lib/rcs-collector/sync_commands.rb on lines 91..94
lib/rcs-collector/sync_commands.rb on lines 95..98
lib/rcs-collector/sync_commands.rb on lines 99..102
lib/rcs-collector/sync_commands.rb on lines 103..106
lib/rcs-collector/sync_commands.rb on lines 107..110
lib/rcs-collector/sync_commands.rb on lines 111..114

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

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

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

  def command_conf(peer, session, message)
    trace :info, "[#{peer}][#{session[:cookie]}] Configuration request"

    # if the command contains a message
    # it is a response to inform us of the stressfulness of the operation
Severity: Minor
Found in lib/rcs-collector/sync_commands.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

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

    if steps.include? :download and DB.instance.new_downloads? session[:bid]
      available += [PROTO_DOWNLOAD].pack('I')
      trace :info, "[#{peer}][#{session[:cookie]}] Available: New downloads"
    end
Severity: Major
Found in lib/rcs-collector/sync_commands.rb and 6 other locations - About 25 mins to fix
lib/rcs-collector/sync_commands.rb on lines 91..94
lib/rcs-collector/sync_commands.rb on lines 95..98
lib/rcs-collector/sync_commands.rb on lines 99..102
lib/rcs-collector/sync_commands.rb on lines 103..106
lib/rcs-collector/sync_commands.rb on lines 107..110
lib/rcs-collector/sync_commands.rb on lines 115..118

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

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

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

      def process_http_request

        operation = proc do
          begin
            # perform the protocol (all the interesting stuff happens here)
Severity: Minor
Found in lib/rcs-controller/network_controller.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

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

  def store_evidence_chunk(session, id, base, chunk, size, content)
    Dir::mkdir(REPO_CHUNK_DIR) if not File.directory?(REPO_CHUNK_DIR)
    path =  REPO_CHUNK_DIR + '/' + session[:ident] + '_' + session[:instance]

    header_len = 12
Severity: Minor
Found in lib/rcs-collector/evidence_manager.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

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

    if steps.include? :config and DB.instance.new_conf? session[:bid]
      available += [PROTO_CONF].pack('I')
      trace :info, "[#{peer}][#{session[:cookie]}] Available: New config"
    end
Severity: Major
Found in lib/rcs-collector/sync_commands.rb and 6 other locations - About 25 mins to fix
lib/rcs-collector/sync_commands.rb on lines 95..98
lib/rcs-collector/sync_commands.rb on lines 99..102
lib/rcs-collector/sync_commands.rb on lines 103..106
lib/rcs-collector/sync_commands.rb on lines 107..110
lib/rcs-collector/sync_commands.rb on lines 111..114
lib/rcs-collector/sync_commands.rb on lines 115..118

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

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 7 locations. Consider refactoring.
Open

    if steps.include? :exec and DB.instance.new_exec? session[:bid]
      available += [PROTO_EXEC].pack('I')
      trace :info, "[#{peer}][#{session[:cookie]}] Available: New commands exec"
    end
Severity: Major
Found in lib/rcs-collector/sync_commands.rb and 6 other locations - About 25 mins to fix
lib/rcs-collector/sync_commands.rb on lines 91..94
lib/rcs-collector/sync_commands.rb on lines 95..98
lib/rcs-collector/sync_commands.rb on lines 99..102
lib/rcs-collector/sync_commands.rb on lines 103..106
lib/rcs-collector/sync_commands.rb on lines 111..114
lib/rcs-collector/sync_commands.rb on lines 115..118

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

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

  def get_injectors
    begin
      ret = rest_call('GET', "/injector")
      return JSON.parse(ret.body)
    rescue Exception => e
Severity: Minor
Found in lib/rcs-collector/db_rest.rb and 1 other location - About 25 mins to fix
lib/rcs-collector/db_rest.rb on lines 593..600

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

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

  def get_collectors
    begin
      ret = rest_call('GET', "/collector")
      return JSON.parse(ret.body)
    rescue Exception => e
Severity: Minor
Found in lib/rcs-collector/db_rest.rb and 1 other location - About 25 mins to fix
lib/rcs-collector/db_rest.rb on lines 534..541

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

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

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

  def create_repository(session)
    # ensure the repository directory is present
    Dir::mkdir(REPO_DIR) if not File.directory?(REPO_DIR)

    trace :info, "Creating repository for [#{session[:ident]}_#{session[:instance]}]"
Severity: Minor
Found in lib/rcs-collector/evidence_manager.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

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

  def self.new_conf(bid)
    return nil unless File.exist?(CACHE_FILE)

    begin
      db = SQLite.open CACHE_FILE
Severity: Minor
Found in lib/rcs-collector/db_cache.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

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

      def perform
        # if the database connection has gone
        # try to re-login to the database again
        unless DB.instance.connected?
          trace :debug, "heartbeat: try to reconnect to rcs-db"
Severity: Minor
Found in lib/rcs-carrier/heartbeat.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

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

  def agent_status(build_id, instance_id, platform, demo, level)
    begin
      request = {:ident => build_id, :instance => instance_id, :platform => platform, :demo => demo, :level => level}
      ret = rest_call('GET', '/agent/status/?' + CGI.encode_query(request))

Severity: Minor
Found in lib/rcs-collector/db_rest.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

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

    if steps.include? :upload and DB.instance.new_uploads? session[:bid]
      available += [PROTO_UPLOAD].pack('I')
      trace :info, "[#{peer}][#{session[:cookie]}] Available: New uploads"
    end
Severity: Major
Found in lib/rcs-collector/sync_commands.rb and 6 other locations - About 25 mins to fix
lib/rcs-collector/sync_commands.rb on lines 91..94
lib/rcs-collector/sync_commands.rb on lines 95..98
lib/rcs-collector/sync_commands.rb on lines 103..106
lib/rcs-collector/sync_commands.rb on lines 107..110
lib/rcs-collector/sync_commands.rb on lines 111..114
lib/rcs-collector/sync_commands.rb on lines 115..118

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

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 7 locations. Consider refactoring.
Open

    if steps.include? :upgrade and DB.instance.new_upgrade? session[:bid]
      available += [PROTO_UPGRADE].pack('I')
      trace :info, "[#{peer}][#{session[:cookie]}] Available: New upgrade"
    end
Severity: Major
Found in lib/rcs-collector/sync_commands.rb and 6 other locations - About 25 mins to fix
lib/rcs-collector/sync_commands.rb on lines 91..94
lib/rcs-collector/sync_commands.rb on lines 95..98
lib/rcs-collector/sync_commands.rb on lines 99..102
lib/rcs-collector/sync_commands.rb on lines 107..110
lib/rcs-collector/sync_commands.rb on lines 111..114
lib/rcs-collector/sync_commands.rb on lines 115..118

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

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

  def run(options)

    # reset upon request
    purge if options[:purge]

Severity: Minor
Found in lib/rcs-carrier/statistics.rb and 1 other location - About 25 mins to fix
lib/rcs-collector/statistics.rb on lines 134..154

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

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

  def collector_set_version(id, version)
    begin
      rest_call('POST', "/collector/version/#{id}", {:version => version}.to_json)
    rescue Exception => e
      trace :error, "Error calling collector_set_version: #{e.class} #{e.message}"
Severity: Minor
Found in lib/rcs-collector/db_rest.rb and 1 other location - About 25 mins to fix
lib/rcs-collector/db_rest.rb on lines 544..550

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

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