Showing 79 of 269 total issues
Function do_set
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def do_set(argv):
"""view and edit configuration settings
SYNOPSIS:
set [<VAR> [+] ["<VALUE>"]]
- 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 open
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def open(self, php_payload):
"""open a request to the server with the given php payload
It respectively calls the Build(), Send() and Read() methods.
if one of these methods returns a string, it will be considered as
an error, so execution will stop, and self.error will be filled.
- 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 _load_php_libs
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def _load_php_libs(self, code):
"""Replace `!import(<FOO>)` special syntax with real
local library files.
"""
result = ''
- 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 _raw_value
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def _raw_value(self, sess=None):
"""Get a 'built-in types only' representation of `sess`
Session() object.
This @staticmethod is guaranted to return only python built-in
- 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 complete_session
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def complete_session(text, line, *_):
"""autocompletion for `session` command"""
argv = line.split()
if (len(argv) == 2 and line[-1] != " ") or len(argv) == 1:
keys = ['save', 'diff', 'upgrade']
- 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 send_single_request
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def send_single_request(self, request):
"""send a single request object element (a request object's single
tuple, in the form mentionned in the build_request() docstring.
A response dict() will be returned, with 'error' and 'data' keys.
- 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 Read
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def Read(self, response):
"""Main request Reader
if takes the http response data as argument
and writes the __RESULT__'s php data into the self.response string,
- 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 __new__
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def __new__(cls, *args, mode='', filename='file.txt'):
"""Create a new path object.
The file/dir path is determined by joining `args` as a single
absolute 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 isolate_readline_context
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def isolate_readline_context(function):
"""A decorator for separating readline context.
This decorator isolates readline context of target
function or method.
- 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 do_corectl
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def do_corectl(self, argv):
"""Advanced core debugging utils
SYNOPSIS:
corectl <TOOL>
- 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 isolate_io_context
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def isolate_io_context(function):
"""A decorator for separating I/O context.
This decorator isolates I/O context of target
function or method.
- 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 update
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def update(self, obj=None, update_history=False):
"""Update current session with `obj`.
The given argument can be a dictionnary instance, in which case
it must be a valid session object to merge in.
If `obj` is a string, it is then considered as a file path, and
- 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 open
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def open(self):
"""open a new remote connection to TARGET"""
if self.active:
raise ValueError("cannot open() an active tunnel")
socket = connector.Request()
- 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 _phpserialize_recursive_dict2list
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _phpserialize_recursive_dict2list(python_var):
"""Get real python list() objetcs from php objects.
* As php makes no difference between lists and
dictionnaries, we should call this function which
recursively converts all dict() generated object that
- 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 do_alias
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def do_alias(self, argv):
"""Define command aliases
SYNOPSIS:
alias [<NAME> ["<VALUE>"|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 __init__
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(self):
# customizable variables
self.target_obj = session.Conf.TARGET(call=False)
self.hostname = self.target_obj.host
self.port = self.target_obj.port
Function __call__
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def __call__(self, file=None, fatal_errors=True):
"""Load and return the session object stored in `file`.
if `file` is None, current session (self) is returned.
"""
- 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 _write_line
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _write_line(self, line):
"""Process individual line morphing, and write it"""
# Process per platform newline transformation
if line.endswith('\r\n'):
line = line[:-2] + os.linesep
- 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, value, validator=None):
if not hasattr(self, "desc"):
raise NotImplementedError("`desc` (description) attribute"
"is not defined")
if validator is 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 colorize
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def colorize(*args):
"""Takes single or multiple strings as argument, and colorize them.
Syntax:
* Ansi color/style can be defined by providing a CamelCase
- 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"