rapid7/metasploit-framework

View on GitHub

Showing 22,177 of 22,177 total issues

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

    register_options(
      [
        Opt::RPORT(11006), # 11002,11004,11006,etc
        OptBool.new('SSL', [true, 'Negotiate SSL/TLS', true]),
        OptRaw.new('SSLVersion', [true, 'Default Version for WASND ', 'SSLv3']),
modules/auxiliary/admin/http/manageengine_pmp_privesc.rb on lines 41..48
modules/auxiliary/gather/mcafee_epo_xxe.rb on lines 46..53
modules/exploits/linux/http/f5_icall_cmd.rb on lines 52..59
modules/exploits/linux/http/f5_icontrol_exec.rb on lines 39..46
modules/exploits/linux/http/lifesize_uvc_ping_rce.rb on lines 47..54
modules/exploits/multi/http/cisco_dcnm_upload_2019.rb on lines 63..70

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

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

      register_options(
        [
          Opt::RPORT(443),
          OptBool.new('SSL', [true, 'Use SSL', true]),
          OptString.new('TARGETURI', [true, 'The URI of the vulnerable instance', '/']),
Severity: Major
Found in modules/exploits/linux/http/lifesize_uvc_ping_rce.rb and 6 other locations - About 30 mins to fix
modules/auxiliary/admin/http/manageengine_pmp_privesc.rb on lines 41..48
modules/auxiliary/gather/mcafee_epo_xxe.rb on lines 46..53
modules/exploits/linux/http/f5_icall_cmd.rb on lines 52..59
modules/exploits/linux/http/f5_icontrol_exec.rb on lines 39..46
modules/exploits/multi/http/cisco_dcnm_upload_2019.rb on lines 63..70
modules/exploits/windows/ibm/ibm_was_dmgr_java_deserialization_rce.rb on lines 51..58

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

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

      register_options(
        [
          Opt::RPORT(443),
          OptBool.new('SSL', [true, 'Use SSL', true]),
          OptString.new('TARGETURI', [true, 'The base path to the iControl installation', '/']),
Severity: Major
Found in modules/exploits/linux/http/f5_icontrol_exec.rb and 6 other locations - About 30 mins to fix
modules/auxiliary/admin/http/manageengine_pmp_privesc.rb on lines 41..48
modules/auxiliary/gather/mcafee_epo_xxe.rb on lines 46..53
modules/exploits/linux/http/f5_icall_cmd.rb on lines 52..59
modules/exploits/linux/http/lifesize_uvc_ping_rce.rb on lines 47..54
modules/exploits/multi/http/cisco_dcnm_upload_2019.rb on lines 63..70
modules/exploits/windows/ibm/ibm_was_dmgr_java_deserialization_rce.rb on lines 51..58

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

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

  def initialize(info = {})
    super(
      update_info(
        info,
        'Name'        => 'Amazon Web Services IAM credential enumeration',
Severity: Major
Found in modules/auxiliary/cloud/aws/enum_iam.rb and 4 other locations - About 30 mins to fix
modules/auxiliary/scanner/http/file_same_name_dir.rb on lines 14..32
modules/auxiliary/scanner/http/mod_negotiation_scanner.rb on lines 10..24
modules/auxiliary/scanner/http/prev_dir_same_name_file.rb on lines 14..29
modules/auxiliary/scanner/http/sentry_cdu_enum.rb on lines 14..33

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

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

  def initialize(info = {})
    super(update_info(info,
      'Name'           => 'Apache HTTPD mod_negotiation Scanner',
      'Description'    => %q{
          This module scans the webserver of the given host(s) for the existence of mod_negotiate.
Severity: Major
Found in modules/auxiliary/scanner/http/mod_negotiation_scanner.rb and 4 other locations - About 30 mins to fix
modules/auxiliary/cloud/aws/enum_iam.rb on lines 9..28
modules/auxiliary/scanner/http/file_same_name_dir.rb on lines 14..32
modules/auxiliary/scanner/http/prev_dir_same_name_file.rb on lines 14..29
modules/auxiliary/scanner/http/sentry_cdu_enum.rb on lines 14..33

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

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

    when 'DIR-845L'
      @d_link['arch'] = 'mipsle'
      return Rex::Version.new(@d_link['firmware']) <= Rex::Version.new('1.02') && (@d_link['hardware'][0] == 'A' || @d_link['hardware'] == 'N/A')
    when 'DIR-850L'
Severity: Major
Found in modules/exploits/linux/upnp/dlink_upnp_msearch_exec.rb and 4 other locations - About 30 mins to fix
modules/exploits/linux/upnp/dlink_upnp_msearch_exec.rb on lines 269..272
modules/exploits/linux/upnp/dlink_upnp_msearch_exec.rb on lines 275..278
modules/exploits/linux/upnp/dlink_upnp_msearch_exec.rb on lines 278..281
modules/exploits/linux/upnp/dlink_upnp_msearch_exec.rb on lines 297..300

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

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

  def initialize(info = {})
    super(update_info(info,
      'Name'           => 'HTTP File Same Name Directory Scanner',
      'Description'    => %q{
        This module identifies the existence of files
Severity: Major
Found in modules/auxiliary/scanner/http/file_same_name_dir.rb and 4 other locations - About 30 mins to fix
modules/auxiliary/cloud/aws/enum_iam.rb on lines 9..28
modules/auxiliary/scanner/http/mod_negotiation_scanner.rb on lines 10..24
modules/auxiliary/scanner/http/prev_dir_same_name_file.rb on lines 14..29
modules/auxiliary/scanner/http/sentry_cdu_enum.rb on lines 14..33

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

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

  def initialize(info={})
    super(update_info(info,
      'Name'           => 'Sentry Switched CDU Bruteforce Login Utility',
      'Description'    => %{
        This module scans for ServerTech's Sentry Switched CDU (Cabinet Power
Severity: Major
Found in modules/auxiliary/scanner/http/sentry_cdu_enum.rb and 4 other locations - About 30 mins to fix
modules/auxiliary/cloud/aws/enum_iam.rb on lines 9..28
modules/auxiliary/scanner/http/file_same_name_dir.rb on lines 14..32
modules/auxiliary/scanner/http/mod_negotiation_scanner.rb on lines 10..24
modules/auxiliary/scanner/http/prev_dir_same_name_file.rb on lines 14..29

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

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

    when 'DIR-850L'
      @d_link['arch'] = 'mipsbe'
      return Rex::Version.new(@d_link['firmware']) <= Rex::Version.new('1.12') && (@d_link['hardware'][0] == 'A' || @d_link['hardware'] == 'N/A')
    when 'DIR-859'
Severity: Major
Found in modules/exploits/linux/upnp/dlink_upnp_msearch_exec.rb and 4 other locations - About 30 mins to fix
modules/exploits/linux/upnp/dlink_upnp_msearch_exec.rb on lines 269..272
modules/exploits/linux/upnp/dlink_upnp_msearch_exec.rb on lines 275..278
modules/exploits/linux/upnp/dlink_upnp_msearch_exec.rb on lines 278..281
modules/exploits/linux/upnp/dlink_upnp_msearch_exec.rb on lines 294..297

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

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

    when 'DIR-816L'
      @d_link['arch'] = 'mipsbe'
      return Rex::Version.new(@d_link['firmware']) <= Rex::Version.new('2.06') && (@d_link['hardware'][0] == 'B' || @d_link['hardware'] == 'N/A')
    when 'DIR-817LW'
Severity: Major
Found in modules/exploits/linux/upnp/dlink_upnp_msearch_exec.rb and 4 other locations - About 30 mins to fix
modules/exploits/linux/upnp/dlink_upnp_msearch_exec.rb on lines 269..272
modules/exploits/linux/upnp/dlink_upnp_msearch_exec.rb on lines 278..281
modules/exploits/linux/upnp/dlink_upnp_msearch_exec.rb on lines 294..297
modules/exploits/linux/upnp/dlink_upnp_msearch_exec.rb on lines 297..300

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

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

    when 'DIR-817LW'
      @d_link['arch'] = 'mipsbe'
      return Rex::Version.new(@d_link['firmware']) <= Rex::Version.new('1.04') && (@d_link['hardware'][0] == 'A' || @d_link['hardware'] == 'N/A')
    when 'DIR-818LW', 'DIR-818L'
Severity: Major
Found in modules/exploits/linux/upnp/dlink_upnp_msearch_exec.rb and 4 other locations - About 30 mins to fix
modules/exploits/linux/upnp/dlink_upnp_msearch_exec.rb on lines 269..272
modules/exploits/linux/upnp/dlink_upnp_msearch_exec.rb on lines 275..278
modules/exploits/linux/upnp/dlink_upnp_msearch_exec.rb on lines 294..297
modules/exploits/linux/upnp/dlink_upnp_msearch_exec.rb on lines 297..300

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

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

      if [ Rex::Arch::ARCH_X86, Rex::Arch::ARCH_X64 ].include? payload.arch.first
        command = cmd_psh_payload(payload.encoded, payload.arch.first, { remove_comspec: true })
      elsif payload.arch.first == Rex::Arch::ARCH_CMD
        command = payload.encoded
      end
Severity: Minor
Found in lib/msf/core/exploit/java_deserialization.rb and 1 other location - About 30 mins to fix
lib/msf/core/exploit/ruby_deserialization.rb on lines 34..38

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

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

    if @state[:ref_cb] && @state[:ref_cb].kind_of?(Array)
      @state[:ref_cb].each do |cb|
        references.append({ :source => "CB", :value => cb.dup}) if !cb.empty?
      end
      @state[:ref_cb].clear
Severity: Major
Found in lib/rex/parser/openvas_document.rb and 3 other locations - About 30 mins to fix
lib/rex/parser/openvas_document.rb on lines 187..192
lib/rex/parser/openvas_document.rb on lines 193..198
lib/rex/parser/openvas_document.rb on lines 205..210

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

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

    begin
      res = send_request_cgi({
        'uri'     => datastore['URI'],
        'method'  => 'GET'
        }, 25)
Severity: Minor
Found in modules/auxiliary/scanner/nessus/nessus_xmlrpc_ping.rb and 1 other location - About 30 mins to fix
modules/auxiliary/scanner/nexpose/nexpose_api_login.rb on lines 33..42

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

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

      while (r = udp_sock.recvfrom(65535, del) and r[1])
        parse_reply(r)

        # Prevent an indefinite loop if the targets keep replying
        cnt += 1
Severity: Minor
Found in modules/auxiliary/scanner/vxworks/wdbrpc_bootline.rb and 1 other location - About 30 mins to fix
modules/auxiliary/scanner/vxworks/wdbrpc_version.rb on lines 73..84

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

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

    when 'DIR-645'
      @d_link['arch'] = 'mipsle'
      return Rex::Version.new(@d_link['firmware']) <= Rex::Version.new('1.05') && (@d_link['hardware'][0] == 'A' || @d_link['hardware'] == 'N/A')
    when 'DIR-815'
Severity: Major
Found in modules/exploits/linux/upnp/dlink_upnp_msearch_exec.rb and 4 other locations - About 30 mins to fix
modules/exploits/linux/upnp/dlink_upnp_msearch_exec.rb on lines 275..278
modules/exploits/linux/upnp/dlink_upnp_msearch_exec.rb on lines 278..281
modules/exploits/linux/upnp/dlink_upnp_msearch_exec.rb on lines 294..297
modules/exploits/linux/upnp/dlink_upnp_msearch_exec.rb on lines 297..300

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

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

      parameter do
        key :name, :order
        key :in, :query
        key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::ORDER_DESC
        key :type, :string
lib/msf/core/web_services/documentation/api/v1/event_api_doc.rb on lines 57..64

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

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

  def initialize(info = {})
    super(update_info(info,
      'Name'           => 'HTTP Previous Directory File Scanner',
      'Description'    => %q{
        This module identifies files in the first parent directory with same name as
Severity: Major
Found in modules/auxiliary/scanner/http/prev_dir_same_name_file.rb and 4 other locations - About 30 mins to fix
modules/auxiliary/cloud/aws/enum_iam.rb on lines 9..28
modules/auxiliary/scanner/http/file_same_name_dir.rb on lines 14..32
modules/auxiliary/scanner/http/mod_negotiation_scanner.rb on lines 10..24
modules/auxiliary/scanner/http/sentry_cdu_enum.rb on lines 14..33

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

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

      def question=(object)
        case object
        when Array
          if object.all? {|x| x.kind_of? Net::DNS::Question}
            @question = object
Severity: Major
Found in lib/net/dns/packet.rb and 3 other locations - About 30 mins to fix
lib/net/dns/packet.rb on lines 336..347
lib/net/dns/packet.rb on lines 355..366
lib/net/dns/packet.rb on lines 374..385

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

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

    if @state[:ref_cve] && @state[:ref_cve].kind_of?(Array)
      @state[:ref_cve].each do |cve|
        references.append({ :source => "CVE", :value => cve.dup}) if !cve.empty?
      end
      @state[:ref_cve].clear
Severity: Major
Found in lib/rex/parser/openvas_document.rb and 3 other locations - About 30 mins to fix
lib/rex/parser/openvas_document.rb on lines 193..198
lib/rex/parser/openvas_document.rb on lines 199..204
lib/rex/parser/openvas_document.rb on lines 205..210

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

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