Showing 1,005 of 1,471 total issues
Avoid deeply nested control flow statements. Open
Open
if resource_id.name is not None:
dump.add_line('Name: [%s]' % resource_id.name, 6)
else:
dump.add_line('Id: [0x%X]' % resource_id.struct.Id, 6)
Avoid deeply nested control flow statements. Open
Open
if stringtable_offset >= stringfileinfo_struct.Length:
break
# Parse a VarFileInfo entry
#
Avoid deeply nested control flow statements. Open
Open
if not var_struct:
break
Avoid deeply nested control flow statements. Open
Open
for st_entry in entry.StringTable:
[dump.add_line(' '+line) for line in st_entry.dump()]
dump.add_line(' LangID: '+st_entry.LangID)
dump.add_newline()
for str_entry in st_entry.entries.items():
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, id=None, schema_version=None, Analyses=None, Behaviors=None, Actions=None, Pools=None):
Avoid deeply nested control flow statements. Open
Open
if not stringtable_struct:
break
Avoid deeply nested control flow statements. Open
Open
while varword_offset < orig_varword_offset + var_struct.ValueLength:
word1 = self.get_word_from_data(
raw_data[varword_offset:varword_offset+2], 0)
word2 = self.get_word_from_data(
raw_data[varword_offset+2:varword_offset+4], 0)
Avoid deeply nested control flow statements. Open
Open
for st_entry in entry.StringTable:
for key, entry in st_entry.entries.items():
offsets = st_entry.entries_offsets[key]
lengths = st_entry.entries_lengths[key]
Avoid deeply nested control flow statements. Open
Open
if var_offset <= var_offset+var_struct.Length:
break
# Increment and align the offset
Avoid deeply nested control flow statements. Open
Open
if hasattr(resource_id, 'directory'):
if hasattr(resource_id.directory, 'strings') and resource_id.directory.strings:
for res_string in resource_id.directory.strings.values():
resources_strings.append( res_string )
Avoid deeply nested control flow statements. Open
Open
for var_entry in entry.Var:
if hasattr(var_entry, 'entry'):
[dump.add_line(' '+line) for line in var_entry.dump()]
dump.add_line(
' ' +
Avoid deeply nested control flow statements. Open
Open
if hasattr(resource_id, 'directory'):
resource_strings = dict()
for resource_lang in resource_id.directory.entries:
Function new
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def new(host=None, port=10000, ident=None, secret=None, reconnect=True, sleepwait=20):
Avoid deeply nested control flow statements. Open
Open
if hasattr(resource_id, 'directory'):
dump.add_lines(resource_id.directory.struct.dump(), 8)
for resource_lang in resource_id.directory.entries:
if hasattr(resource_lang, 'data'):
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, type_=None, id=None, classificationName=None, companyName=None, category=None, classificationDetails=None):
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, Start_Address=None, Source_Address=None, Destination_Address=None, Page_Base_Address=None, Target_PID=None, Requested_Address=None):
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, Existing_File_Name=None, Destination_File_Name=None, Access_Mode=None, Flags=None, Open_Mode=None, File_Attributes=None):
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, Process_Base_Address=None, Thread_ID=None, Start_Address=None, Creation_Flags=None, User_Name=None, Target_PID=None):
Function exportLiteralChildren
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def exportLiteralChildren(self, outfile, level, name_):
if self.company is not None:
showIndent(outfile, level)
outfile.write('company=%s,\n' % quote_python(self.company).encode(ExternalEncoding))
if self.author is not 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 buildChildren
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'company':
company_ = child_.text
company_ = self.gds_validate_string(company_, node, 'company')
self.company = company_
- 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"