rapid7/metasploit-framework

View on GitHub

Showing 7,361 of 22,177 total issues

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

  def initialize
    super(
      'Name'           => 'VMWare Power On Virtual Machine',
      'Description'    => %Q{
        This module will log into the Web API of VMWare and try to power on
Severity: Major
Found in modules/auxiliary/admin/vmware/poweron_vm.rb and 2 other locations - About 50 mins to fix
modules/auxiliary/admin/vmware/poweroff_vm.rb on lines 11..28
modules/auxiliary/admin/vmware/terminate_esx_sessions.rb on lines 11..28

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

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 check
    begin
      res = send_request_cgi({
        'uri'     => "/hedwig.cgi",
        'method'  => 'GET'
Severity: Major
Found in modules/exploits/linux/http/dlink_hedwig_cgi_bof.rb and 2 other locations - About 50 mins to fix
modules/exploits/linux/http/airties_login_cgi_bof.rb on lines 57..72
modules/exploits/linux/http/dlink_authentication_cgi_bof.rb on lines 57..72

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

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 generate_uri(opts={})
    ds = opts[:datastore] || datastore
    uri_req_len = ds['StagerURILength'].to_i

    # Choose a random URI length between 30 and 255 bytes
Severity: Major
Found in lib/msf/core/payload/windows/x64/reverse_http_x64.rb and 2 other locations - About 50 mins to fix
lib/msf/core/payload/java/reverse_http.rb on lines 41..54
lib/msf/core/payload/windows/reverse_http.rb on lines 105..118

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 42.

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 check
    begin
      res = send_request_cgi({
        'uri'     => '/cgi-bin/login',
        'method'  => 'GET'
Severity: Major
Found in modules/exploits/linux/http/airties_login_cgi_bof.rb and 2 other locations - About 50 mins to fix
modules/exploits/linux/http/dlink_authentication_cgi_bof.rb on lines 57..72
modules/exploits/linux/http/dlink_hedwig_cgi_bof.rb on lines 56..71

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

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

    dll.add_function('DrawIconEx', 'BOOL',[
      ["DWORD","hdc","in"],
      ["DWORD","xLeft","in"],
      ["DWORD","yTop","in"],
      ["DWORD","hIcon","in"],
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 483..493
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 495..505
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1163..1173
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1310..1320
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1364..1374
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1376..1386
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 2023..2033
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 2035..2045
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_netapi32.rb on lines 127..137
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_netapi32.rb on lines 159..169
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 1702..1712
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 1714..1724
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 247..257
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 347..357
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 382..392

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

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

    dll.add_function('RegCreateKeyExW', 'DWORD',[
      ["DWORD","hKey","in"],
      ["PWCHAR","lpSubKey","in"],
      ["DWORD","Reserved","inout"],
      ["PWCHAR","lpClass","in"],
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 483..493
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1163..1173
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1310..1320
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1364..1374
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1376..1386
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 2023..2033
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 2035..2045
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_netapi32.rb on lines 127..137
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_netapi32.rb on lines 159..169
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 756..766
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 1702..1712
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 1714..1724
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 247..257
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 347..357
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 382..392

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

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

    dll.add_function('AddAuditAccessObjectAce', 'BOOL',[
      ["PBLOB","pAcl","inout"],
      ["DWORD","dwAceRevision","in"],
      ["DWORD","AceFlags","in"],
      ["DWORD","AccessMask","in"],
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 483..493
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 495..505
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1310..1320
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1364..1374
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1376..1386
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 2023..2033
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 2035..2045
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_netapi32.rb on lines 127..137
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_netapi32.rb on lines 159..169
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 756..766
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 1702..1712
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 1714..1724
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 247..257
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 347..357
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 382..392

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

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

    dll.add_function('NetServerEnum', 'DWORD',[
      ["PWCHAR","servername","in"],
      ["DWORD","level","in"],
      ["PLPVOID","bufptr","out"],
      ["DWORD","prefmaxlen","in"],
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 483..493
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 495..505
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1163..1173
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1310..1320
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1364..1374
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1376..1386
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 2023..2033
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 2035..2045
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_netapi32.rb on lines 159..169
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 756..766
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 1702..1712
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 1714..1724
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 247..257
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 347..357
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 382..392

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

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

    dll.add_function('WSARecvFrom', 'DWORD',[
      ["DWORD","s","in"],
      ["PBLOB","lpBuffers","inout"],
      ["DWORD","dwBufferCount","in"],
      ["PDWORD","lpNumberOfBytesRecvd","inout"],
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 483..493
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 495..505
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1163..1173
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1310..1320
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1364..1374
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1376..1386
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 2023..2033
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 2035..2045
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_netapi32.rb on lines 127..137
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_netapi32.rb on lines 159..169
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 756..766
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 1702..1712
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 1714..1724
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 247..257
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 382..392

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

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

    dll.add_function('ReportEventA', 'BOOL',[
      ["DWORD","hEventLog","in"],
      ["WORD","wType","in"],
      ["WORD","wCategory","in"],
      ["DWORD","dwEventID","in"],
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 483..493
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 495..505
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1163..1173
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1310..1320
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1364..1374
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1376..1386
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 2035..2045
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_netapi32.rb on lines 127..137
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_netapi32.rb on lines 159..169
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 756..766
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 1702..1712
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 1714..1724
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 247..257
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 347..357
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 382..392

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

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

    dll.add_function('NetSessionEnum', 'DWORD',[
        ['PWCHAR','servername','in'],
        ['PWCHAR','UncClientName','in'],
        ['PWCHAR','username','in'],
        ['DWORD','level','in'],
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 483..493
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 495..505
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1163..1173
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1310..1320
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1364..1374
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1376..1386
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 2023..2033
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 2035..2045
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_netapi32.rb on lines 127..137
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 756..766
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 1702..1712
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 1714..1724
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 247..257
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 347..357
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 382..392

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

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

    dll.add_function('WSAIoctl', 'DWORD',[
      ["DWORD","s","in"],
      ["DWORD","dwIoControlCode","in"],
      ["PBLOB","lpvInBuffer","in"],
      ["DWORD","cbInBuffer","in"],
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 483..493
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 495..505
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1163..1173
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1310..1320
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1364..1374
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1376..1386
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 2023..2033
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 2035..2045
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_netapi32.rb on lines 127..137
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_netapi32.rb on lines 159..169
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 756..766
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 1702..1712
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 1714..1724
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 347..357
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 382..392

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

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

    dll.add_function('GrayStringA', 'BOOL',[
      ["DWORD","hDC","in"],
      ["DWORD","hBrush","in"],
      ["PBLOB","lpOutputFunc","in"],
      ["DWORD","lpData","in"],
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 483..493
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 495..505
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1163..1173
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1310..1320
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1364..1374
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1376..1386
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 2023..2033
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 2035..2045
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_netapi32.rb on lines 127..137
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_netapi32.rb on lines 159..169
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 756..766
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 1714..1724
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 247..257
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 347..357
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 382..392

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

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

    dll.add_function('CreateRestrictedToken', 'BOOL',[
      ["DWORD","ExistingTokenHandle","in"],
      ["DWORD","Flags","in"],
      ["DWORD","DisableSidCount","in"],
      ["PBLOB","SidsToDisable","in"],
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 483..493
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 495..505
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1163..1173
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1310..1320
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1364..1374
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 2023..2033
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 2035..2045
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_netapi32.rb on lines 127..137
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_netapi32.rb on lines 159..169
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 756..766
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 1702..1712
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 1714..1724
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 247..257
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 347..357
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 382..392

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

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

    dll.add_function('ReportEventW', 'BOOL',[
      ["DWORD","hEventLog","in"],
      ["WORD","wType","in"],
      ["WORD","wCategory","in"],
      ["DWORD","dwEventID","in"],
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 483..493
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 495..505
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1163..1173
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1310..1320
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1364..1374
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1376..1386
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 2023..2033
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_netapi32.rb on lines 127..137
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_netapi32.rb on lines 159..169
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 756..766
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 1702..1712
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 1714..1724
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 247..257
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 347..357
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 382..392

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

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

    dll.add_function('WSASendTo', 'DWORD',[
      ["DWORD","s","in"],
      ["PBLOB","lpBuffers","in"],
      ["DWORD","dwBufferCount","in"],
      ["PDWORD","lpNumberOfBytesSent","inout"],
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 483..493
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 495..505
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1163..1173
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1310..1320
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1364..1374
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1376..1386
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 2023..2033
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 2035..2045
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_netapi32.rb on lines 127..137
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_netapi32.rb on lines 159..169
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 756..766
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 1702..1712
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 1714..1724
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 247..257
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 347..357

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

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

    dll.add_function('GrayStringW', 'BOOL',[
      ["DWORD","hDC","in"],
      ["DWORD","hBrush","in"],
      ["PBLOB","lpOutputFunc","in"],
      ["DWORD","lpData","in"],
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 483..493
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 495..505
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1163..1173
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1310..1320
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1364..1374
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1376..1386
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 2023..2033
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 2035..2045
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_netapi32.rb on lines 127..137
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_netapi32.rb on lines 159..169
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 756..766
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 1702..1712
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 247..257
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 347..357
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 382..392

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

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

    dll.add_function('CreatePrivateObjectSecurityWithMultipleInheritance', 'BOOL',[
      ["PBLOB","ParentDescriptor","in"],
      ["PBLOB","CreatorDescriptor","in"],
      ["PBLOB","NewDescriptor","out"],
      ["PBLOB","ObjectTypes","in"],
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 483..493
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 495..505
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1163..1173
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1364..1374
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1376..1386
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 2023..2033
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 2035..2045
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_netapi32.rb on lines 127..137
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_netapi32.rb on lines 159..169
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 756..766
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 1702..1712
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 1714..1724
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 247..257
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 347..357
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 382..392

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

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

    dll.add_function('CreateProcessWithTokenW', 'BOOL',[
      ["DWORD","hToken","in"],
      ["DWORD","dwLogonFlags","in"],
      ["PWCHAR","lpApplicationName","in"],
      ["PWCHAR","lpCommandLine","inout"],
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 483..493
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 495..505
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1163..1173
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1310..1320
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1376..1386
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 2023..2033
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 2035..2045
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_netapi32.rb on lines 127..137
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_netapi32.rb on lines 159..169
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 756..766
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 1702..1712
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 1714..1724
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 247..257
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 347..357
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 382..392

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

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

    dll.add_function('RegCreateKeyExA', 'DWORD',[
      ["DWORD","hKey","in"],
      ["PCHAR","lpSubKey","in"],
      ["DWORD","Reserved","inout"],
      ["PCHAR","lpClass","in"],
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 495..505
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1163..1173
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1310..1320
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1364..1374
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 1376..1386
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 2023..2033
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb on lines 2035..2045
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_netapi32.rb on lines 127..137
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_netapi32.rb on lines 159..169
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 756..766
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 1702..1712
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_user32.rb on lines 1714..1724
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 247..257
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 347..357
lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ws2_32.rb on lines 382..392

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

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