Showing 58 of 165 total issues
Function vol_regdump
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def vol_regdump(_project):
global result
print_header("Executing vol_regdump command")
- 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 vol_netscan
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def vol_netscan(_project):
global result
print_header("Gathering network information")
###Testing area
- 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 generator
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def generator(self, data):
for result in data:
try:
yield (0, ['{0}'.format(result.get('timestamp') if result.get('timestamp') else result.get('key').LastWriteTime),
'{0}'.format(result.get('value') if not result.get('timestamp_type') else result.get('timestamp_type')),
- 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 execute_volatility_plugin
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def execute_volatility_plugin(plugin_type, plugin_name,
- Create a ticketCreate a ticket
Function memoize
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def memoize(func):
if os.path.exists(CACHE_FILE) and args.cache:
debug("Using local cache ..")
with open(CACHE_FILE) as f:
cache = pickle.load(f)
- 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 vol_getosversion
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def vol_getosversion(_project):
global result
print_header("Attempting to gather OS version info")
- 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 clean_db
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def clean_db(self):
'''
Deletes the DB, cache and all files from dump dir
'''
- 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 enrich_pslist
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def enrich_pslist(_project, plist):
rdbl = dbops.DBOps(_project.db_name)
query = "select FileName,CompanyName,OriginalFileName," \
"FileDescription,FileSize,LegalCopyright,FileDescription,md5," \
- 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
Avoid deeply nested control flow statements. Open
if idx == (len(sections)-1):
running = False
thiselem = elem
nextelem = last_element+(len(cmd_out)-1)
else:
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
for acctype in types:
if account_type == int(acctype):
results['users'][username]['Account Type'] = types[acctype]
results['users'][username]['RID'] = str(int(x.name().strip("0000"), 16)) #Since im converting hex to int, you need to tell python it's in base 16
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if content != None:
outfd.write("".join(["{0:#010x} {1:<48} {2}\n".format(vad.Start + o, h, ''.join(c))
for o, h, c in utils.Hexdump(content)]))
else:
outfd.write("\tNo Hexdump: Memory Unreadable at {0:#010x}\n".format(vad.Start))
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if int(suspicious_process['risk_index']) >= 2:
list_of_suspicious_processes.append(suspicious_process.copy())
else:
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if eth.eth_type == 0x0800: # IPv4:
eth_payload = obj.Object('_IPv4', vm=session_space,
offset = eth.v() + 0x0E)
end = 14 + eth_payload.length
if self._config.SLACK:
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if n not in jdata_keys:
jdata_keys.append(n)
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
for dst in dsts:
dsts_file.write(dst + '\n')
outfd.write('Written {:,} destination IPs to \'{}\'.\n'.format(
- Create a ticketCreate a ticket
Function calculate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def calculate(self):
if self._config.PID:
filter_pid = self._config.PID
# This is so that when -p option is given it can still enumerate all processes to determine parent
self._config.PID = 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
Avoid deeply nested control flow statements. Open
if process_list['mz']:
choice = "bad"
grisk_dict = {'pid': process_list['pid'], 'risk': 1}
result['risk_index'].append(grisk_dict.copy())
- 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'] += "\n"
newOffset += 28
- Create a ticketCreate a ticket
Function update_parent_proc_info
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def update_parent_proc_info(self, proc_peb_info):
"""Builds a dictionary containing parent process information for all the processes"""
self.parent_proc_info = {}
for pid in proc_peb_info:
self.parent_proc_info[pid] = []
- 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 update_parent_proc_info
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def update_parent_proc_info(self, proc_peb_info):
"""Builds a dictionary containing parent process information for all the processes"""
self.parent_proc_info = {}
for pid in proc_peb_info:
self.parent_proc_info[pid] = []
- 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"