Showing 1,005 of 1,471 total issues
Function store_file
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def store_file(self):
"""Store sample file.
@raise CuckooAnalysisError: if unable to store file."""
md5 = File(self.task.file_path).get_md5()
self.analysis.stored_file_path = os.path.join(CUCKOO_ROOT, "storage", "binaries", md5)
- 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 __set_format__
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def __set_format__(self, format):
offset = 0
for elm in format:
if ',' in elm:
- 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
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def add(self, txt, indent=0):
"""Adds some text, no newline will be appended.
The text can be indented with the optional argument 'indent'.
"""
- 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 quote_python
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def quote_python(inStr):
s1 = inStr
if s1.find("'") == -1:
if s1.find('\n') == -1:
return "'%s'" % s1
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'md5':
obj_ = xs_hexBinary.factory()
obj_.build(child_)
self.set_md5(obj_)
- 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 exportLiteralChildren
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def exportLiteralChildren(self, outfile, level, name_):
if self.Affinity_Type is not None:
showIndent(outfile, level)
outfile.write('Affinity_Type=%s,\n' % quote_python(self.Affinity_Type).encode(ExternalEncoding))
if self.Affinity_Degree is not None:
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, app, rule, method, callback, name=None,
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, id=None, name=None, Affinity_Type=None, Affinity_Degree=None, Description=None, Effect_Sub_Collection=None, Effect=None, Effect_Reference=None):
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, id=None, uriString=None, protocol=None, hostname=None, domain=None, port=None, path=None, ipProtocol=None):
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, Header_Hashes=None, Data_Hashes=None, Section_Name=None, Entropy=None, Virtual_Address=None, Virtual_Size=None, Flags=None, Relocations=None):
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, Internal_Name=None, Product_Name=None, Company_Name=None, Legal_Copyright=None, Product_Version_Text=None, File_Description=None, File_Version_Text=None, Original_File_Name=None):
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, Hashes=None, Machine=None, Number_Of_Sections=None, Time_Date_Stamp=None, Pointer_To_Symbol_Table=None, Number_Of_Symbols=None, Size_Of_Optional_Header=None, Characteristics=None):
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, Internal_Port=None, External_Port=None, Socket_Type=None, Socket_ID=None, Internal_IP_Address=None, External_IP_Address=None, IP_Protocol=None, Application_Layer_Protocol=None):
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, Internal_Port=None, External_Port=None, Internal_IP_Address=None, External_IP_Address=None, Host_Name=None, Data_Sent=None, Data_Received=None, Buffer_Length=None):
Consider simplifying this complex logical expression. Open
if (
self.Subject or
self.Description is not None or
self.Analysts is not None or
self.Source is not None or
Consider simplifying this complex logical expression. Open
if (
self.Description is not None or
self.Discovery_Method is not None or
self.Action_Initiator is not None or
self.Action_Implementation is not None or
Consider simplifying this complex logical expression. Open
if (
self.uriString is not None or
self.protocol is not None or
self.hostname is not None or
self.domain is not None or
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, file=None, uri=None, domain=None, registry=None, ip=None, asn=None, entity=None, classification=None):
Consider simplifying this complex logical expression. Open
if (
self.Purpose is not None or
self.Description is not None or
self.Discovery_Method is not None or
self.Actions is not None or
Consider simplifying this complex logical expression. Open
if (
self.Affinity_Type is not None or
self.Affinity_Degree is not None or
self.Description is not None or
self.Action_Sub_Collection or