rapid7/metasploit-framework

View on GitHub

Showing 7,361 of 22,177 total issues

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

    ::ApplicationRecord.connection_pool.with_connection {
      # If we have the ID, there is no point in creating a complex query.
      if opts[:id] && !opts[:id].to_s.empty?
        return Array.wrap(Mdm::Session.find(opts[:id]))
      end
Severity: Major
Found in lib/msf/core/db_manager/session.rb and 1 other location - About 1 hr to fix
lib/msf/core/db_manager/vuln.rb on lines 248..264

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

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 exploit
    print_status("Executing #{target.name} for #{datastore['PAYLOAD']}")

    print_status("Authenticate with \"#{datastore['USERNAME']}/#{datastore['PASSWORD']}\"")
    gogs_login
Severity: Major
Found in modules/exploits/multi/http/gogs_git_hooks_rce.rb and 1 other location - About 1 hr to fix
modules/exploits/multi/http/gitea_git_hooks_rce.rb on lines 154..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 71.

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 check
    begin
      res = send_request_cgi(
        'uri'       => '/cgi-bin/index.cgi',
        'method'    => 'GET'
Severity: Major
Found in modules/exploits/linux/http/ipfire_bashbug_exec.rb and 1 other location - About 1 hr to fix
modules/exploits/linux/http/ipfire_proxy_exec.rb on lines 61..77

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

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 check
    begin
      res = send_request_cgi(
        'uri'       => '/cgi-bin/pakfire.cgi',
        'method'    => 'GET'
Severity: Major
Found in modules/exploits/linux/http/ipfire_proxy_exec.rb and 1 other location - About 1 hr to fix
modules/exploits/linux/http/ipfire_bashbug_exec.rb on lines 72..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 71.

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

    ::ApplicationRecord.connection_pool.with_connection {
      # If we have the ID, there is no point in creating a complex query.
      if opts[:id] && !opts[:id].to_s.empty?
        return Array.wrap(Mdm::Vuln.find(opts[:id]))
      end
Severity: Major
Found in lib/msf/core/db_manager/vuln.rb and 1 other location - About 1 hr to fix
lib/msf/core/db_manager/session.rb on lines 10..26

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

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 exploit
    print_status("Executing #{target.name} for #{datastore['PAYLOAD']}")

    print_status("Authenticate with \"#{datastore['USERNAME']}/#{datastore['PASSWORD']}\"")
    gitea_login
Severity: Major
Found in modules/exploits/multi/http/gitea_git_hooks_rce.rb and 1 other location - About 1 hr to fix
modules/exploits/multi/http/gogs_git_hooks_rce.rb on lines 140..157

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

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 handle_nessus_v2 has 14 arguments (exceeds 4 allowed). Consider refactoring.
Open

  def handle_nessus_v2(wspace,hobj,port,proto,name,nasl,nasl_name,severity,description,cve,bid,xref,msf,task=nil)
Severity: Major
Found in lib/msf/core/db_manager/import/nessus/xml/v2.rb - About 1 hr to fix

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

    def locate(src_file, dir='./src/'):
        for root, dirs, files in os.walk(dir):
            for name in files:
                if src_file == name:
                    return root
    Severity: Major
    Found in external/source/shellcode/windows/x64/build.py and 1 other location - About 1 hr to fix
    external/source/shellcode/windows/x86/build.py on lines 28..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 47.

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

            if self._noOutput is False:
                command += ' 1> ' + '\\\\127.0.0.1\\%s' % self._share + self._output  + ' 2>&1'
    Severity: Major
    Found in modules/auxiliary/scanner/smb/impacket/dcomexec.py and 2 other locations - About 1 hr to fix
    modules/auxiliary/scanner/smb/impacket/dcomexec.py on lines 208..209
    modules/auxiliary/scanner/smb/impacket/wmiexec.py on lines 132..133

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

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

            if self._noOutput is False:
                command += ' 1> ' + '\\\\127.0.0.1\\%s' % self._share + self._output  + ' 2>&1'
    Severity: Major
    Found in modules/auxiliary/scanner/smb/impacket/wmiexec.py and 2 other locations - About 1 hr to fix
    modules/auxiliary/scanner/smb/impacket/dcomexec.py on lines 208..209
    modules/auxiliary/scanner/smb/impacket/dcomexec.py on lines 258..259

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

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

            if self._noOutput is False:
                command += ' 1> ' + '\\\\127.0.0.1\\%s' % self._share + self._output + ' 2>&1'
    Severity: Major
    Found in modules/auxiliary/scanner/smb/impacket/dcomexec.py and 2 other locations - About 1 hr to fix
    modules/auxiliary/scanner/smb/impacket/dcomexec.py on lines 258..259
    modules/auxiliary/scanner/smb/impacket/wmiexec.py on lines 132..133

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

    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 locate(src_file, dir='./src/'):
        for root, dirs, files in os.walk(dir):
            for name in files:
                if src_file == name:
                    return root
    Severity: Major
    Found in external/source/shellcode/windows/x86/build.py and 1 other location - About 1 hr to fix
    external/source/shellcode/windows/x64/build.py on lines 30..35

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

    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 vulns.'
          key :tags, [ 'vuln' ]
    
          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_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 services.'
          key :tags, [ 'service' ]
    
          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/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 notes.'
          key :tags, [ 'note' ]
    
          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/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 :get do
          key :description, 'Return notes that are stored in the database.'
          key :tags, [ 'note' ]
    
          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 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 :get do
          key :description, 'Return sessions that are stored in the database.'
          key :tags, [ 'session' ]
    
          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/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 services that are stored in the database.'
          key :tags, [ 'service' ]
    
          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 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 payloads that are stored in the database.'
          key :tags, [ 'payload' ]
    
          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 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 hosts.'
          key :tags, [ 'host' ]
    
          parameter :delete_opts
    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
    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

    Severity
    Category
    Status
    Source
    Language