Showing 7,361 of 22,177 total issues
Method run
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
opt = {}
opt['PADDING'] = datastore['PADDING'] unless datastore['PADDING'].nil?
print_status('Gathering Data...')
vin = read_data_by_id(datastore['CANBUS'], datastore['SRCID'], datastore['DSTID'], [0xF1, 0x90], opt)
Method run
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
pw_tbl = Rex::Text::Table.new(
'Header' => 'MobaXterm Password',
'Columns' => [
'Protocol',
Method initialize
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(info = {})
super(
update_info(
info,
'Name' => 'SolarWinds Orion Secrets Dump',
Method run
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
credential_count = {}
qcred = datastore['CRED'] || nil
qpath = datastore['PATH'] || nil
Method execute_assembly
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def execute_assembly(exe_path, clr_version)
if datastore['TECHNIQUE'] == 'SPAWN_AND_INJECT'
self.hprocess = launch_process
self.terminate_process = datastore['KILL']
check_process_suitability(hprocess.pid)
Method transport_prepare_request
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def transport_prepare_request(method, opts={})
unless valid_transport?(opts[:transport]) && opts[:lport]
return nil
end
Method option_values_dispatch
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def option_values_dispatch(mod, o, str, words)
res = []
res << o.default.to_s if o.default
case o
when Msf::OptAddress
Method dump_jobs
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.dump_jobs(framework, verbose = false, indent = DefaultIndent, col = DefaultColumnWrap)
columns = [ 'Id', 'Name', "Payload", "Payload opts"]
if (verbose)
columns += [ "URIPATH", "Start Time", "Handler opts", "Persist" ]
Method start_handler
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def start_handler
# Our HTTP client and URL for talking to the hop
uri = URI(full_uri)
self.control = "#{uri.request_uri}control"
self.mclient = Rex::Proto::Http::Client.new(
Method connect_dialup
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def connect_dialup(global = true, opts={})
if (not @telephony_loaded)
print_status("The serialport module is not available: #{telephony_error}")
raise RuntimeError, "Telephony not available"
Method process_data
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def process_data(data)
@inbuffer += data if data
case @state
when :id_state
if line?
Method pdu_client_confirm_active
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def pdu_client_confirm_active
pdu =
"\xea\x03\x01\x00" + # shareId: 66538
"\xea\x03" + # originatorId
"\x06\x00" + # lengthSourceDescriptor: 6
Method asm_block_recv_rc4
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def asm_block_recv_rc4(opts={})
xorkey = Rex::Text.to_dword(opts[:xorkey]).chomp
asm = %Q^
recv:
; Receive the size of the incoming second stage...
Method asm_block_recv
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def asm_block_recv(opts={})
reliable = opts[:reliable]
asm = %Q^
recv:
; Receive the size of the incoming second stage...
Method get_version_info_impl
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_version_info_impl
if session.type == 'meterpreter'
result = session.railgun.ntdll.RtlGetVersion(input_os_version_info_ex)
os_version_info_ex = unpack_version_info(result['VersionInformation'])
major = os_version_info_ex[1]
Method mcp_parse
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def mcp_parse(stream)
# Reminder: this has to be an array, not a hash, because there are
# often duplicate entries (like multiple userdb_entry results when a
# query is performed).
result = []
Method parse
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse(pkt)
# We want to return immediatly if we do not have a packet which is handled by us
return unless pkt.is_tcp?
return if (pkt.tcp_sport != 110 and pkt.tcp_dport != 110)
s = find_session((pkt.tcp_sport == 110) ? get_session_src(pkt) : get_session_dst(pkt))
Similar blocks of code found in 2 locations. Consider refactoring. Open
this.assignXor = operation(function xor(a, b) {
for (var i = 0; i < 8; i++) {
bytes[i] = a.byteAt(i) ^ b.byteAt(i);
}
return this;
- Read upRead up
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 86.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
this.assignAnd = operation(function and(a, b) {
for (var i = 0; i < 8; i++) {
bytes[i] = a.byteAt(i) & b.byteAt(i);
}
return this;
- Read upRead up
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 86.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
def setup_handler
if !datastore['Proxies'].blank? && !datastore['ReverseAllowProxy']
raise RuntimeError, "TCP connect-back payloads cannot be used with Proxies. Use 'set ReverseAllowProxy true' to override this behaviour."
end
- Read upRead up
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 94.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76