Showing 1,005 of 1,471 total issues
Function exportLiteralChildren
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def exportLiteralChildren(self, outfile, level, name_):
if self.Image_Name is not None:
showIndent(outfile, level)
outfile.write('Image_Name=%s,\n' % quote_python(self.Image_Name).encode(ExternalEncoding))
if self.Start_Username 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 11 (exceeds 5 allowed). Consider refactoring. Open
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'Image_Name':
Image_Name_ = child_.text
Image_Name_ = self.gds_validate_string(Image_Name_, node, 'Image_Name')
self.Image_Name = Image_Name_
- 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 exportChildren
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def exportChildren(self, outfile, level, namespace_='maec:', name_='Optional_HeaderType', fromsubclass_=False):
if self.Hashes is not None:
self.Hashes.export(outfile, level, namespace_, name_='Hashes')
if self.Major_Linker_Version is not None:
self.Major_Linker_Version.export(outfile, level, namespace_, name_='Major_Linker_Version')
Function __init__
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(self, Hashes=None, Major_Linker_Version=None, Minor_Linker_Version=None, Size_Of_Code=None, Size_Of_Initialized_Data=None, Size_Of_Uninitialized_Data=None, Address_Of_Entry_Point=None, Base_Of_Code=None, Base_Of_Data=None, Image_Base=None, Section_Alignment=None, File_Alignment=None, Major_OS_Version=None, Minor_OS_Version=None, Major_Image_Version=None, Minor_Image_Version=None, Major_Subsystem_Version=None, Minor_Subsystem_Version=None, Reserved=None, Size_Of_Image=None, Size_Of_Headers=None, Checksum=None, Subsystem=None, DLL_Characteristics=None, Size_Of_Stack_Reserve=None, Size_Of_Stack_Commit=None, Size_Of_Heap_Reserve=None, Size_Of_Heap_Commit=None, Loader_Flags=None, Number_Of_Rva_And_Sizes=None, Data_Directory=None):
self.Hashes = Hashes
self.Major_Linker_Version = Major_Linker_Version
self.Minor_Linker_Version = Minor_Linker_Version
self.Size_Of_Code = Size_Of_Code
Function exportLiteralChildren
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def exportLiteralChildren(self, outfile, level, name_):
if self.Hashes is not None:
showIndent(outfile, level)
outfile.write('Hashes=model_.HashesType4(\n')
self.Hashes.exportLiteral(outfile, level, name_='Hashes')
Function exportLiteralChildren
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def exportLiteralChildren(self, outfile, level, name_):
showIndent(outfile, level)
outfile.write('Text_Title=[\n')
level += 1
for Text_Title_ in self.Text_Title:
Function exportLiteralChildren
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def exportLiteralChildren(self, outfile, level, name_):
showIndent(outfile, level)
outfile.write('Text_Title=[\n')
level += 1
for Text_Title_ in self.Text_Title:
Function store_and_submit_fileobj
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def store_and_submit_fileobj(fobj, filename, desc, package="",
Function store_and_submit_fileobj
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def store_and_submit_fileobj(fobj, filename, desc, package="",
Function __init__
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, id=None, name=None, Affinity_Type=None, Affinity_Degree=None, Description=None, Action_Sub_Collection=None, Action=None, Action_Reference=None, Effects=None):
Function __init__
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, id=None, md5=None, sha1=None, sha256=None, sha512=None, size=None, crc32=None, fileType=None, extraHash=None):
Function __init__
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, references=None, startDate=None, endDate=None, firstSeenDate=None, origin=None, commonality=None, volume=None, importance=None, location=None):
Function path_shift
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def path_shift(script_name, path_info, shift=1):
''' Shift path fragments from PATH_INFO to SCRIPT_NAME and vice versa.
:return: The modified paths.
:param script_name: The SCRIPT_NAME path.
- 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 __init__
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, cfg):
"""@param cfg: configuration file."""
config = ConfigParser.ConfigParser(allow_no_value=True)
config.read(cfg)
- 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 _get_imported_symbols
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _get_imported_symbols(self):
"""Gets imported symbols.
@return: imported symbols dict or None.
"""
if not self.pe:
- 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 parse_rule
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def parse_rule(self, rule):
''' Parses a rule into a (name, filter, conf) token stream. If mode is
None, name contains a static rule part. '''
offset, prefix = 0, ''
for match in self.rule_syntax.finditer(rule):
- 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 wsgi
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def wsgi(self, environ, start_response):
""" The bottle WSGI-interface. """
try:
out = self._cast(self._handle(environ))
# rfc2616 section 4.3
- 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 add_malware
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def add_malware(self, data, name, iszip=False):
"""Get analysis data.
@param data: analysis data.
@param name: file name.
@param iszip: is a zip file.
- 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 parse_range_header
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def parse_range_header(header, maxlen=0):
''' Yield (start, end) ranges parsed from a HTTP Range header. Skip
unsatisfiable ranges. The end index is non-inclusive.'''
if not header or header[:6] != 'bytes=': return
ranges = [r.split('-', 1) for r in header[6:].split(',') if '-' in r]
- 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 __init__
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, cfg=os.path.join(CUCKOO_ROOT, "conf", "cuckoo.conf")):
"""@param cfg: configuration file path."""
config = ConfigParser.ConfigParser()
config.read(cfg)
- 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"