Showing 1,005 of 1,471 total issues
File behavior.py
has 278 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Copyright (C) 2010-2012 Cuckoo Sandbox Developers.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
import os
BaseResponse
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class BaseResponse(object):
""" Storage class for a response body as well as headers and cookies.
This class does support dict-like case-insensitive item-access to
headers, but is NOT a dict. Most notably, iterating over a response
Consider simplifying this complex logical expression. Open
if (
self.DateTime_Created is not None or
self.DateTime_Modified is not None or
self.Path is not None or
self.Hashes is not None or
File_System_Action_AttributesType
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class File_System_Action_AttributesType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, Existing_File_Name=None, Destination_File_Name=None, Access_Mode=None, Flags=None, Open_Mode=None, File_Attributes=None):
self.Existing_File_Name = Existing_File_Name
APICallType
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class APICallType(GeneratedsSuper):
"""APICall_ParameterType is intended provide a method for the
characterization of API calls, namely functions and their
parameters.The apifunction_name attribute contains the exact
name of the API function called. E.g. CreateFileW."""
Process_Action_AttributesType
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class Process_Action_AttributesType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, Process_Base_Address=None, Thread_ID=None, Start_Address=None, Creation_Flags=None, User_Name=None, Target_PID=None):
self.Process_Base_Address = Process_Base_Address
BundleType
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class BundleType(GeneratedsSuper):
"""BundleType is intended to serve as the high-level construct under
which all other MAEC elements reside. The required
schema_version attribute specifies the version of the MAEC
Schema that the document has been written in and that should be
ActionsType1
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class ActionsType1(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, Action_Collection=None, Action=None, Action_Reference=None):
if Action_Collection is None:
Memory_Action_AttributesType
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class Memory_Action_AttributesType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, Start_Address=None, Source_Address=None, Destination_Address=None, Page_Base_Address=None, Target_PID=None, Requested_Address=None):
self.Start_Address = Start_Address
Function acquire
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def acquire(self, machine_id=None, platform=None):
"""Acquire a machine to start analysis.
@param machine_id: machine ID.
@param platform: machine platform.
@return: machine 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 parse_data_directories
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def parse_data_directories(self, directories=None):
"""Parse and process the PE file's data directories.
If the optional argument 'directories' is given, only
the directories at the specified indices will be parsed.
- 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 _run
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def _run(self, message_callback, error_callback):
while not self.stopped:
while self.connected:
d = self.s.recv(BUFSIZ)
if not d:
- 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
Bottle
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class Bottle(object):
""" Each Bottle object represents a single, distinct web application and
consists of routes, callbacks, plugins, resources and configuration.
Instances are callable WSGI applications.
GeneratedsSuper
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class GeneratedsSuper(object):
def gds_format_string(self, input_data, input_name=''):
return input_data
def gds_validate_string(self, input_data, node, input_name=''):
return input_data
relationship
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class relationship(GeneratedsSuper):
"""Relationships are used to express relationships between objects, and
dates. Relationships have a type (an attribute with a defined
list of allowed relationships), source (a set of xpath
references to the parent end of the relationship), target (xpath
File analyzer.py
has 268 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Copyright (C) 2010-2012 Cuckoo Sandbox Developers.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
import os
Function dump
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def dump(self, indentation=0):
"""Returns a string representation of the structure."""
dump = []
- 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 19 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, object_name=None, permanent=None, type_=None, id=None, Object_Size=None, Classifications=None, Associated_Code=None, Related_Objects=None, File_System_Object_Attributes=None, GUI_Object_Attributes=None, IPC_Object_Attributes=None, Internet_Object_Attributes=None, Module_Object_Attributes=None, Registry_Object_Attributes=None, Process_Object_Attributes=None, Memory_Object_Attributes=None, Network_Object_Attributes=None, Daemon_Object_Attributes=None, Custom_Object_Attributes=None):
MultiDict
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class MultiDict(DictMixin):
""" This dict stores multiple values per key, but behaves exactly like a
normal dict in that it returns only the newest value for any given key.
There are special methods available to access the full list of values.
"""
Consider simplifying this complex logical expression. Open
if (
self.Hashes is not None or
self.Name is not None or
self.Physical_Address is not None or
self.Virtual_Address is not None or