nil0x42/phpsploit

View on GitHub

Showing 79 of 269 total issues

Avoid too many return statements within this function.
Open

        return tunnel.open()  # it raises exception if fails
Severity: Major
Found in src/ui/interface.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                return False
    Severity: Major
    Found in src/ui/interface.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                      return False
      Severity: Major
      Found in src/ui/interface.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                    return True
        Severity: Major
        Found in src/ui/interface.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return response
          Severity: Major
          Found in src/core/tunnel/handler.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return False
            Severity: Major
            Found in src/ui/interface.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                              return self.interpret("alias %s" % argv[1])
              Severity: Major
              Found in src/ui/interface.py - About 30 mins to fix

                Function complete_alias has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def complete_alias(text, line, *_):
                        """autocompletion for `alias` command"""
                        argv = line.split()
                        if (len(argv) == 2 and line[-1] == " ") or len(argv) > 2:
                            return []
                Severity: Minor
                Found in src/ui/interface.py - About 25 mins to fix

                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 process_tags has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def process_tags(line):
                        """Process tagged line transformations, such as auto colorization
                        and pattern rules.
                
                        >>> process_tags("[*] FOO: «bar»\\n")
                Severity: Minor
                Found in src/ui/output/wrapper.py - About 25 mins to fix

                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 __str__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def __str__(self):
                        self_str = super().__str__()
                        if self == 1:
                            return "1 byte"
                
                
                Severity: Minor
                Found in src/datatypes/ByteSize.py - About 25 mins to fix

                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 phpcode has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def phpcode(self):
                        """Get minified php code from file.
                
                        Minification:
                        The method removes php tag markers ('<?', '?>'),
                Severity: Minor
                Found in src/datatypes/Path.py - About 25 mins to fix

                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 _list_path_dirs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _list_path_dirs(self, root_dir, _type="plugin"):
                        """Returns a list of tuples representing a plugin directory.
                
                        Each tuple is in the form: (basename, abspath)
                
                
                Severity: Minor
                Found in src/core/plugins/__init__.py - About 25 mins to fix

                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 Code has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                def Code(language):
                
                    class ColoredCode(str):
                        """Piece of source code. (extends str)
                        Takes a string representing a portion of source code.
                Severity: Minor
                Found in src/datatypes/Code.py - About 25 mins to fix

                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 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def __new__(cls, value=0):
                
                        # convert to an uppercase string, and format it.
                        value = str(value)
                        if len(value.splitlines()) != 1:
                Severity: Minor
                Found in src/datatypes/ByteSize.py - About 25 mins to fix

                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_env has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def complete_env(text, line, *_):
                        """Use env vars as `env` completers (case insensitive)"""
                        argv = line.split()
                        if (len(argv) == 2 and line[-1] == " ") or len(argv) > 2:
                            return []
                Severity: Minor
                Found in src/ui/interface.py - About 25 mins to fix

                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 _sanitize_path has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                def _sanitize_path(path):
                    """Remove unneeded path elements
                
                    >>> _sanitize_path('/foo/../bar/')
                    /bar/
                Severity: Minor
                Found in src/api/server/path.py - About 25 mins to fix

                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_set has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def complete_set(text, line, *_):
                        """Use settings as `set` completers (case insensitive)"""
                        argv = line.split()
                        if (len(argv) == 2 and line[-1] == " ") or len(argv) > 2:
                            return []
                Severity: Minor
                Found in src/ui/interface.py - About 25 mins to fix

                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 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def __init__(self, value=None, title=None):
                        if value is None:
                            value = {}
                        self.update(value)
                
                
                Severity: Minor
                Found in src/metadict.py - About 25 mins to fix

                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 __call__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def __call__(self, session_path):
                        """Get raw session object from `session_path`.
                        """
                        new_session = copy.deepcopy(self._template)
                        session_keys = new_session.keys()
                Severity: Minor
                Found in src/core/session/compat_session.py - About 25 mins to fix

                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

                Severity
                Category
                Status
                Source
                Language