Showing 58 of 165 total issues
Avoid deeply nested control flow statements. Open
if check in process:
###NOt all have peb information
if not str(process[check]).lower() == str(rule_list[key][check]).lower() and str(process[check]).lower() != "nopeb" :
print("Violation detected on: [%s] "
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
for flag in acb_flags: #Compare the two hex values and check if one is contained in the other, if so save it
if bool(flag & b[7]):
flags.append(acb_flags[flag])
f_values[b[6]].append(flags)
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if len(result['hollow']) != 0:
for hollow_process in result['hollow']:
if str(hollow_process['pid']) == str(process_list['pid']):
process_list['hollow'] = True
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
for flag in f_values[RID][3]:
results['users'][user]['Account Flags'] += (flag + " | ")
results['users'][user]['Failed Login Count'] = f_values[RID][4]
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if struct.unpack("<B", data[offset:offset+1])[0] == 0:
offset = offset+1
results['groups'][groupname]['Members'] += binary_to_sid(data[offset:offset+12])
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if int(suspicious_process['risk_index']) >= int(risk_level):
list_of_suspicious_processes.append(suspicious_process.copy())
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if eth_payload.is_tcp():
payload = obj.Object('_TCP', vm=session_space,
offset=eth_payload.payload_offset())
elif eth_payload.is_udp():
payload = obj.Object('_UDP', vm=session_space,
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if username != None:
results['groups'][groupname]['Members'] += " -> " + username + "</br>"
else:
results['groups'][groupname]['Members'] += "\t\n"
newOffset += 12
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if flag:
net_info.append((rs[0], rs[1]))
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if "country" in i:
countries.append(i['country'][0])
- Create a ticketCreate a ticket
Function update_value
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_value(self, table_name, column_name, value, key_name, key):
- Create a ticketCreate a ticket
Function vol_cmdscan
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def vol_cmdscan(_project):
global result
print_header("Running cmdscan command")
rdb = dbops.DBOps(_project.db_name)
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function valid_ip
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def valid_ip(input_string):
#Return if IP not local/Brodacast and if private or public
if not is_ipv4(input_string):
return False,False
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function prep_cmd
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def prep_cmd(self, **kwargs):
'''
Prepares for running the required command from module/cmds
Args:
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function calculate_shanon_string
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def calculate_shanon_string(input):
stList = list(input)
alphabet = list(Set(stList)) # list of symbols in the string
freqList = []
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function calculate_md5
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def calculate_md5():
print_header("Calculating MD5 of dumped files..")
rdb = dbops.DBOps("results.db")
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function detect_proc_hollow
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def detect_proc_hollow(self):
"""Detects hollowed processes and returns dictionary with pid as the key and type of process hollowing as value"""
proc_peb_info = self.get_proc_peb_info()
proc_vad_info = self.get_proc_vad_info()
hol_type = None
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function binary_shanon_entropy
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def binary_shanon_entropy(data, _debug=False):
entropy = 0
count = dict()
for c in data:
try:
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"