nil0x42/phpsploit

View on GitHub

Showing 269 of 269 total issues

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.
 
 
Severity: Minor
Found in src/core/session/__init__.py - About 2 hrs to fix

    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>]
    Severity: Minor
    Found in src/ui/interface.py - About 2 hrs to fix

    Cyclomatic complexity is too high in method _build_env. (10)
    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.
    """
    Severity: Minor
    Found in src/core/tunnel/connector.py by radon

    Cyclomatic complexity is too high in method do_session. (10)
    Open

    @staticmethod
    def do_session(argv):
    """phpsploit session handler
     
    SYNOPSIS:
    Severity: Minor
    Found in src/ui/interface.py by radon

    Cyclomatic complexity is too high in method fill. (10)
    Open

    def fill(self):
    """Add user configuration dir's default content."""
     
    # create default $USERDIR/config if it doesn't exist
    config = utils.path.truepath(self.path, "config")
    Severity: Minor
    Found in src/core/config.py by radon

    Cyclomatic complexity is too high in method _write_line. (10)
    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
    Severity: Minor
    Found in src/ui/output/wrapper.py by radon

    Cyclomatic complexity is too high in method __init__. (10)
    Open

    def __init__(self, value, validator=None):
    if not hasattr(self, "desc"):
    raise NotImplementedError("`desc` (description) attribute"
    "is not defined")
    if validator is None:
    Severity: Minor
    Found in src/linebuf.py by radon

    Cyclomatic complexity is too high in class Plugin. (10)
    Open

    class Plugin:
    """Phpsploit plugin class
     
    This object instanciates a new plugin object.
     
     
    Severity: Minor
    Found in src/core/plugins/Plugin.py by radon

    Cyclomatic complexity is too high in method complete_help. (10)
    Open

    def complete_help(self, text, line, *_):
    """Use settings as `set` completers (case insensitive)"""
    argv = line.split()
    if argv[:2] == ["help", "set"]:
    if (len(argv) == 2 and line[-1] == " ") \
    Severity: Minor
    Found in src/ui/interface.py by radon

    Cyclomatic complexity is too high in method update. (10)
    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
    Severity: Minor
    Found in src/core/session/__init__.py by radon

    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)
    Severity: Minor
    Found in src/core/config.py - About 2 hrs to fix

    Request has 22 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Request:
    """Phpsploit HTTP Request Handler
    """
    # the list of available methods
    methods = ['GET', 'POST']
    Severity: Minor
    Found in src/core/tunnel/handler.py - About 2 hrs to fix

      Cyclomatic complexity is too high in method write. (9)
      Open

      def write(self, data, bin_mode=False):
      """Write `data` to the file path.
       
      If bin_mode is True or data is a bytes() object,
      data is rawly written to the file in binary mode.
      Severity: Minor
      Found in src/datatypes/Path.py by radon

      Cyclomatic complexity is too high in method __init__. (9)
      Open

      def __init__(self, path):
      if path.endswith(os.sep) or path.endswith("/"):
      path = path[:-1]
      self.path = path
      self.name = os.path.basename(path)
      Severity: Minor
      Found in src/core/plugins/Plugin.py by radon

      Cyclomatic complexity is too high in method build_forwarder. (9)
      Open

      def build_forwarder(self, method, decoder):
      """build the effective payload forwarder, which is in fact
      a header using the PASSKEY setting as name.
      The payload forwarder is called by the remote backdoor, and then
      formats the final payload if necessary before executing it.
      Severity: Minor
      Found in src/core/tunnel/handler.py by radon

      Cyclomatic complexity is too high in method __new__. (9)
      Open

      def __new__(cls, name):
      # a boring Mas OS/X case ..
      blacklist = ['macosx']
       
      lst = [x for x in webbrowser._browsers.keys() if x not in blacklist]
      Severity: Minor
      Found in src/datatypes/WebBrowser.py by radon

      Cyclomatic complexity is too high in method do_corectl. (9)
      Open

      def do_corectl(self, argv):
      """Advanced core debugging utils
       
      SYNOPSIS:
      corectl <TOOL>
      Severity: Minor
      Found in src/ui/interface.py by radon

      Cyclomatic complexity is too high in method do_alias. (9)
      Open

      def do_alias(self, argv):
      """Define command aliases
       
      SYNOPSIS:
      alias [<NAME> ["<VALUE>"|None]]
      Severity: Minor
      Found in src/ui/interface.py by radon

      Cyclomatic complexity is too high in method send_single_request. (9)
      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.
       
       
      Severity: Minor
      Found in src/core/tunnel/handler.py by radon

      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)
       
       
      Severity: Minor
      Found in src/core/session/settings/__init__.py - About 2 hrs to fix
      Severity
      Category
      Status
      Source
      Language