Showing 79 of 269 total issues
File interface.py
has 883 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""PhpSploit shell interface
Handles general behavior of Phpsploit interactive command-line interface.
"""
# pylint: disable=too-many-lines
File handler.py
has 637 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Phpsploit HTTP request handler"""
__all__ = ["Request", "new_request", "get_raw_requests"]
import sys
import re
Function __call__
has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring. Open
def __call__(self, question=None):
# use custom question, or fallback to the default one.
if question is not None:
question = str(question)
- 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_help
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
def do_help(self, argv):
"""Show commands help
SYNOPSIS:
help
- 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 build_multipart_request
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
def build_multipart_request(self, method, php_payload):
"""build a multipart request for `php_payload` with HTTP `method`
For infos about return format, read build_request() docstring.
"""
- 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 _obj_value
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def _obj_value(self, raw=None, fatal_errors=True):
"""Restore Session() from its 'built-in types only' representation.
Used to get back Session() from data returned by _raw_value() method
>>> from core import session
- 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 Build
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def Build(self, php_payload):
"""Main request Builder:
if takes the basic php payload as argument,
and returns the apropriate request object.
- 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
Shell
has 33 functions (exceeds 20 allowed). Consider refactoring. Open
class Shell(shnake.Shell):
"""PhpSploit shell interface"""
prompt = colorize('%Lined', 'phpsploit', '%Reset', ' > ')
Function Send
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def Send(self, request):
"""Main request Sender:
if takes the concerned request object as argument
and returns the unparsed and decapsulated phpsploit response
- 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 _build_env
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def _build_env(self, raw_vars):
"""collect the server related vars, usefull for further
plugins usage and framework management.
written at self.CNF['SRV'] on the interface's core.
"""
- 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 22 (exceeds 5 allowed). Consider refactoring. Open
def run(self, argv):
"""run current plugin
"""
self.argv = argv
from api import server
- 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_exit
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def do_exit(self, argv):
"""Quit current shell interface
SYNOPSIS:
exit [--force]
- 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
File linebuf.py
has 278 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Provide advanced line-buffers for phpsploit session settings"""
import os
import hashlib
import random
File __init__.py
has 275 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""PhpSploit Session Manager
When imorted for the first time, the "session" package initializes it
self as a PhpSploit blank session, with its default values.
Function do_session
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def do_session(argv):
"""phpsploit session handler
SYNOPSIS:
session [load|diff] [<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 __init__
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self):
"""Get phpsploit configuration directory,
by checking, in this order of preference:
- $PHPSPLOIT_CONFIG_DIR/ (only if env var exists)
- $XDG_CONFIG_HOME/phpsploit/ (only if env var exists)
- 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
Request
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class Request:
"""Phpsploit HTTP Request Handler
"""
# the list of available methods
methods = ['GET', 'POST']
Function __setitem__
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def __setitem__(self, name, value):
# if the set value is a *LineBuffer instance, just do it!
if isinstance(value, linebuf.AbstractLineBuffer):
return super().__setitem__(name, 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 _load_plugins
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def _load_plugins(self, categories):
"""Fill current plugins instance with currently available plugins.
All plugins are added to self items, with a key equal to the
plugin name. Each plugin value is a Plugin() instance.
- 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 diff
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def diff(self, file=None, display_diff=False):
"""This function returns True is the given `file` is
a phpsploit session which differs from current session.
Otherwise, False 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"