Showing 1,005 of 1,471 total issues
Function get_options
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_options(self):
"""Get analysis options.
@return: options dict.
"""
options = {}
- Read upRead up
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 argument["name"] == "Registry":
registry = int(argument["value"], 16)
elif argument["name"] == "SubKey":
subkey = argument["value"]
elif argument["name"] == "Handle":
Function choose_package
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def choose_package(file_type):
"""Choose analysis package due to file type.
@param file_type: file type.
@return: package or None.
"""
- Read upRead up
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 __generate_signature
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __generate_signature(self, pe, offset, name, ep_only=False,
Function parse_resources_directory
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def parse_resources_directory(self, rva, size=0, base_rva = None, level = 0, dirs=None):
Avoid deeply nested control flow statements. Open
if res['hostname'] == req.get_hostname():
ip = res['ip']
# Check if obj exist
found = None
for obj in self.objects.get_ip():
Avoid deeply nested control flow statements. Open
if argument["name"] == "MutexName":
if argument["value"] not in mutexes:
mutexes.append(argument["value"])
Avoid deeply nested control flow statements. Open
for st_entry in entry.StringTable:
for str_entry in st_entry.entries.items():
entry = {}
entry["name"] = convert_to_printable(str_entry[0])
entry["value"] = convert_to_printable(str_entry[1])
Function run
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def run(self):
idx = 1
# creating a file .pid
#self.lock_file = '/tmp/lock.pid'
#self.lock_file = 'C:\\WINDOWS\Temp\\lock.pid'
- Read upRead up
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
for var_entry in entry.Var:
if hasattr(var_entry, "entry"):
entry = {}
entry["name"] = convert_to_printable(var_entry.entry.keys()[0])
entry["value"] = convert_to_printable(var_entry.entry.values()[0])
Function match_data
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def match_data(self, code_data, ep_only=True, section_start_only=False):
data = code_data
scan_addresses = [ 0 ]
- Read upRead up
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 hasattr(resource_id, "directory"):
for resource_lang in resource_id.directory.entries:
data = self.pe.get_data(resource_lang.data.struct.OffsetToData, resource_lang.data.struct.Size)
filetype = self._get_filetype(data)
language = pefile.LANG.get(resource_lang.data.lang, None)
Function doUpdate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def doUpdate(self, vmx):
if vmx == 'all':
#update all vms
vms = self.conf.getMachines()
- Read upRead up
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 self._check_dns(udp.data):
self._add_dns(udp.data)
Function complete
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def complete(self, task_id, success=True):
"""Mark a task as completed.
@param task_id: task id.
@param success: completed with status.
@return: operation status.
- Read upRead up
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 uninstall
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def uninstall(self, plugin):
''' Uninstall plugins. Pass an instance to remove a specific plugin, a type
object to remove all plugins that match that type, a string to remove
all plugins with a matching ``name`` attribute or ``True`` to remove all
plugins. Return the list of removed plugins. '''
- Read upRead up
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 argument["name"] == "FileName":
if argument["value"] not in files:
files.append(argument["value"])
Avoid deeply nested control flow statements. Open
while entry_offset < stringtable_offset + stringtable_struct.Length:
string_struct = self.__unpack_data__(
self.__String_format__, raw_data[entry_offset:],
file_offset = start_offset+entry_offset )
Avoid deeply nested control flow statements. Open
if new_stringtable_offset == stringtable_offset:
break
stringtable_offset = new_stringtable_offset
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, Text_Title=None, Text=None, Code_Example_Language=None, Code=None, Images=None, Block=None):