rapid7/metasploit-framework

View on GitHub

Showing 7,361 of 22,177 total issues

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

    operation :get do
      key :description, 'Return loot entries that are stored in the database.'
      key :tags, [ 'loot' ]

      parameter :workspace
lib/msf/core/web_services/documentation/api/v1/host_api_doc.rb on lines 194..223
lib/msf/core/web_services/documentation/api/v1/loot_api_doc.rb on lines 127..156
lib/msf/core/web_services/documentation/api/v1/note_api_doc.rb on lines 34..63
lib/msf/core/web_services/documentation/api/v1/note_api_doc.rb on lines 112..141
lib/msf/core/web_services/documentation/api/v1/payload_api_doc.rb on lines 45..74
lib/msf/core/web_services/documentation/api/v1/payload_api_doc.rb on lines 128..157
lib/msf/core/web_services/documentation/api/v1/service_api_doc.rb on lines 35..64
lib/msf/core/web_services/documentation/api/v1/service_api_doc.rb on lines 114..143
lib/msf/core/web_services/documentation/api/v1/session_api_doc.rb on lines 26..55
lib/msf/core/web_services/documentation/api/v1/vuln_api_doc.rb on lines 55..84
lib/msf/core/web_services/documentation/api/v1/vuln_api_doc.rb on lines 139..168
lib/msf/core/web_services/documentation/api/v1/vuln_attempt_api_doc.rb on lines 35..64
lib/msf/core/web_services/documentation/api/v1/workspace_api_doc.rb on lines 101..130

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

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

    operation :delete do
      key :description, 'Delete the specified payloads.'
      key :tags, [ 'payload' ]

      parameter :delete_opts
lib/msf/core/web_services/documentation/api/v1/host_api_doc.rb on lines 194..223
lib/msf/core/web_services/documentation/api/v1/loot_api_doc.rb on lines 46..75
lib/msf/core/web_services/documentation/api/v1/loot_api_doc.rb on lines 127..156
lib/msf/core/web_services/documentation/api/v1/note_api_doc.rb on lines 34..63
lib/msf/core/web_services/documentation/api/v1/note_api_doc.rb on lines 112..141
lib/msf/core/web_services/documentation/api/v1/payload_api_doc.rb on lines 45..74
lib/msf/core/web_services/documentation/api/v1/service_api_doc.rb on lines 35..64
lib/msf/core/web_services/documentation/api/v1/service_api_doc.rb on lines 114..143
lib/msf/core/web_services/documentation/api/v1/session_api_doc.rb on lines 26..55
lib/msf/core/web_services/documentation/api/v1/vuln_api_doc.rb on lines 55..84
lib/msf/core/web_services/documentation/api/v1/vuln_api_doc.rb on lines 139..168
lib/msf/core/web_services/documentation/api/v1/vuln_attempt_api_doc.rb on lines 35..64
lib/msf/core/web_services/documentation/api/v1/workspace_api_doc.rb on lines 101..130

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

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

    operation :get do
      key :description, 'Return vuln attempts that are stored in the database.'
      key :tags, [ 'vuln_attempt' ]

      parameter :workspace
lib/msf/core/web_services/documentation/api/v1/host_api_doc.rb on lines 194..223
lib/msf/core/web_services/documentation/api/v1/loot_api_doc.rb on lines 46..75
lib/msf/core/web_services/documentation/api/v1/loot_api_doc.rb on lines 127..156
lib/msf/core/web_services/documentation/api/v1/note_api_doc.rb on lines 34..63
lib/msf/core/web_services/documentation/api/v1/note_api_doc.rb on lines 112..141
lib/msf/core/web_services/documentation/api/v1/payload_api_doc.rb on lines 45..74
lib/msf/core/web_services/documentation/api/v1/payload_api_doc.rb on lines 128..157
lib/msf/core/web_services/documentation/api/v1/service_api_doc.rb on lines 35..64
lib/msf/core/web_services/documentation/api/v1/service_api_doc.rb on lines 114..143
lib/msf/core/web_services/documentation/api/v1/session_api_doc.rb on lines 26..55
lib/msf/core/web_services/documentation/api/v1/vuln_api_doc.rb on lines 55..84
lib/msf/core/web_services/documentation/api/v1/vuln_api_doc.rb on lines 139..168
lib/msf/core/web_services/documentation/api/v1/workspace_api_doc.rb on lines 101..130

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

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

    operation :get do
      key :description, 'Return vulns that are stored in the database.'
      key :tags, [ 'vuln' ]

      parameter :workspace
lib/msf/core/web_services/documentation/api/v1/host_api_doc.rb on lines 194..223
lib/msf/core/web_services/documentation/api/v1/loot_api_doc.rb on lines 46..75
lib/msf/core/web_services/documentation/api/v1/loot_api_doc.rb on lines 127..156
lib/msf/core/web_services/documentation/api/v1/note_api_doc.rb on lines 34..63
lib/msf/core/web_services/documentation/api/v1/note_api_doc.rb on lines 112..141
lib/msf/core/web_services/documentation/api/v1/payload_api_doc.rb on lines 45..74
lib/msf/core/web_services/documentation/api/v1/payload_api_doc.rb on lines 128..157
lib/msf/core/web_services/documentation/api/v1/service_api_doc.rb on lines 35..64
lib/msf/core/web_services/documentation/api/v1/service_api_doc.rb on lines 114..143
lib/msf/core/web_services/documentation/api/v1/session_api_doc.rb on lines 26..55
lib/msf/core/web_services/documentation/api/v1/vuln_api_doc.rb on lines 139..168
lib/msf/core/web_services/documentation/api/v1/vuln_attempt_api_doc.rb on lines 35..64
lib/msf/core/web_services/documentation/api/v1/workspace_api_doc.rb on lines 101..130

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

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

    operation :delete do
      key :description, 'Delete the specified loot.'
      key :tags, [ 'loot' ]

      parameter :delete_opts
lib/msf/core/web_services/documentation/api/v1/host_api_doc.rb on lines 194..223
lib/msf/core/web_services/documentation/api/v1/loot_api_doc.rb on lines 46..75
lib/msf/core/web_services/documentation/api/v1/note_api_doc.rb on lines 34..63
lib/msf/core/web_services/documentation/api/v1/note_api_doc.rb on lines 112..141
lib/msf/core/web_services/documentation/api/v1/payload_api_doc.rb on lines 45..74
lib/msf/core/web_services/documentation/api/v1/payload_api_doc.rb on lines 128..157
lib/msf/core/web_services/documentation/api/v1/service_api_doc.rb on lines 35..64
lib/msf/core/web_services/documentation/api/v1/service_api_doc.rb on lines 114..143
lib/msf/core/web_services/documentation/api/v1/session_api_doc.rb on lines 26..55
lib/msf/core/web_services/documentation/api/v1/vuln_api_doc.rb on lines 55..84
lib/msf/core/web_services/documentation/api/v1/vuln_api_doc.rb on lines 139..168
lib/msf/core/web_services/documentation/api/v1/vuln_attempt_api_doc.rb on lines 35..64
lib/msf/core/web_services/documentation/api/v1/workspace_api_doc.rb on lines 101..130

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

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

    operation :delete do
      key :description, 'Delete the specified workspaces.'
      key :tags, [ 'workspace' ]

      parameter :delete_opts
lib/msf/core/web_services/documentation/api/v1/host_api_doc.rb on lines 194..223
lib/msf/core/web_services/documentation/api/v1/loot_api_doc.rb on lines 46..75
lib/msf/core/web_services/documentation/api/v1/loot_api_doc.rb on lines 127..156
lib/msf/core/web_services/documentation/api/v1/note_api_doc.rb on lines 34..63
lib/msf/core/web_services/documentation/api/v1/note_api_doc.rb on lines 112..141
lib/msf/core/web_services/documentation/api/v1/payload_api_doc.rb on lines 45..74
lib/msf/core/web_services/documentation/api/v1/payload_api_doc.rb on lines 128..157
lib/msf/core/web_services/documentation/api/v1/service_api_doc.rb on lines 35..64
lib/msf/core/web_services/documentation/api/v1/service_api_doc.rb on lines 114..143
lib/msf/core/web_services/documentation/api/v1/session_api_doc.rb on lines 26..55
lib/msf/core/web_services/documentation/api/v1/vuln_api_doc.rb on lines 55..84
lib/msf/core/web_services/documentation/api/v1/vuln_api_doc.rb on lines 139..168
lib/msf/core/web_services/documentation/api/v1/vuln_attempt_api_doc.rb on lines 35..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 70.

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 on_new_session(session)
    if session.type == "meterpreter"
      session.core.use("stdapi") unless session.ext.aliases.include?("stdapi")

      @dropped_files.each do |file|
Severity: Major
Found in modules/exploits/windows/browser/honeywell_tema_exec.rb and 3 other locations - About 1 hr to fix
modules/exploits/windows/browser/honeywell_hscremotedeploy_exec.rb on lines 75..90
modules/exploits/windows/browser/notes_handler_cmdinject.rb on lines 78..96
modules/exploits/windows/browser/oracle_webcenter_checkoutandopen.rb on lines 73..88

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

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 exploit
    # These CheckCodes are allowed to pass automatically
    checkcodes = [
      CheckCode::Appears,
      CheckCode::Vulnerable
Severity: Major
Found in modules/exploits/linux/http/webmin_backdoor.rb and 1 other location - About 1 hr to fix
modules/exploits/multi/http/nostromo_code_exec.rb on lines 96..124

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

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 on_new_session(session)
    if session.type == "meterpreter"
      session.core.use("stdapi") unless session.ext.aliases.include?("stdapi")

      @dropped_files.delete_if do |file|
modules/exploits/windows/browser/honeywell_hscremotedeploy_exec.rb on lines 75..90
modules/exploits/windows/browser/honeywell_tema_exec.rb on lines 82..100
modules/exploits/windows/browser/oracle_webcenter_checkoutandopen.rb on lines 73..88

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

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 on_new_session(session)
    if session.type == "meterpreter"
      session.core.use("stdapi") unless session.ext.aliases.include?("stdapi")

      @dropped_files.delete_if do |file|
modules/exploits/windows/browser/honeywell_tema_exec.rb on lines 82..100
modules/exploits/windows/browser/notes_handler_cmdinject.rb on lines 78..96
modules/exploits/windows/browser/oracle_webcenter_checkoutandopen.rb on lines 73..88

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

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 exploit
    # These CheckCodes are allowed to pass automatically
    checkcodes = [
      CheckCode::Appears,
      CheckCode::Vulnerable
Severity: Major
Found in modules/exploits/multi/http/nostromo_code_exec.rb and 1 other location - About 1 hr to fix
modules/exploits/linux/http/webmin_backdoor.rb on lines 143..171

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

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 on_new_session(session)
    if session.type == "meterpreter"
      session.core.use("stdapi") unless session.ext.aliases.include?("stdapi")

      @dropped_files.delete_if do |file|
modules/exploits/windows/browser/honeywell_hscremotedeploy_exec.rb on lines 75..90
modules/exploits/windows/browser/honeywell_tema_exec.rb on lines 82..100
modules/exploits/windows/browser/notes_handler_cmdinject.rb on lines 78..96

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

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

  def parse_tspkg(output)
    results = {}
    lines = output.lines

    while lines.length > 0 do
Severity: Major
Found in lib/rex/post/meterpreter/extensions/kiwi/kiwi.rb and 2 other locations - About 1 hr to fix
lib/rex/post/meterpreter/extensions/kiwi/kiwi.rb on lines 244..272
lib/rex/post/meterpreter/extensions/kiwi/kiwi.rb on lines 306..334

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

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

  def parse_kerberos(output)
    results = {}
    lines = output.lines

    while lines.length > 0 do
Severity: Major
Found in lib/rex/post/meterpreter/extensions/kiwi/kiwi.rb and 2 other locations - About 1 hr to fix
lib/rex/post/meterpreter/extensions/kiwi/kiwi.rb on lines 244..272
lib/rex/post/meterpreter/extensions/kiwi/kiwi.rb on lines 275..303

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

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

  def parse_wdigest(output)
    results = {}
    lines = output.lines

    while lines.length > 0 do
Severity: Major
Found in lib/rex/post/meterpreter/extensions/kiwi/kiwi.rb and 2 other locations - About 1 hr to fix
lib/rex/post/meterpreter/extensions/kiwi/kiwi.rb on lines 275..303
lib/rex/post/meterpreter/extensions/kiwi/kiwi.rb on lines 306..334

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

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 ::File.exist? loot_info[:orig_path]
      loot_dir = ::File.join(basedir,"loot")
      loot_file = ::File.split(loot_info[:orig_path]).last
      if ::File.exist? loot_dir
        unless (::File.directory?(loot_dir) && ::File.writable?(loot_dir))
Severity: Major
Found in lib/msf/core/db_manager/import/metasploit_framework/zip.rb and 1 other location - About 1 hr to fix
lib/msf/core/db_manager/import/metasploit_framework/zip.rb on lines 132..150

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

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 stop_dbconnectionpool(token, db_con_pool)
    vprint_status("Attempting to stop DB Connection Pool: #{db_con_pool}")
    body = {
      'disconnectedNodeAcknowledged' => false,
      'state' => 'DISABLED',
Severity: Major
Found in lib/msf/core/exploit/remote/http/nifi/dbconnectionpool.rb and 1 other location - About 1 hr to fix
lib/msf/core/exploit/remote/http/nifi/dbconnectionpool.rb on lines 84..109

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

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 asm_block_recv(opts={})
    reliable     = opts[:reliable]
    asm = %Q^
      recv:
        ; Receive the size of the incoming second stage...
Severity: Major
Found in lib/msf/core/payload/windows/reverse_tcp.rb and 1 other location - About 1 hr to fix
lib/msf/core/payload/windows/x64/reverse_tcp_x64.rb on lines 192..290

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

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 start_dbconnectionpool(token, db_con_pool)
    vprint_status("Attempting to start DB Connection Pool: #{db_con_pool}")
    body = {
      'disconnectedNodeAcknowledged' => false,
      'state' => 'ENABLED',
Severity: Major
Found in lib/msf/core/exploit/remote/http/nifi/dbconnectionpool.rb and 1 other location - About 1 hr to fix
lib/msf/core/exploit/remote/http/nifi/dbconnectionpool.rb on lines 13..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 70.

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 asm_block_recv(opts={})

    reliable     = opts[:reliable]

    asm = %Q^
Severity: Major
Found in lib/msf/core/payload/windows/x64/reverse_tcp_x64.rb and 1 other location - About 1 hr to fix
lib/msf/core/payload/windows/reverse_tcp.rb on lines 225..313

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

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