hackedteam/test-av

View on GitHub

Showing 1,005 of 1,471 total issues

Avoid too many return statements within this function.
Open

                return False
Severity: Major
Found in analyzer/windows/lib/api/process.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return HTTPResponse(body, header=header, status=206)
    Severity: Major
    Found in lib/bottle.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

          return HTTPResponse(body, header=header)
      Severity: Major
      Found in lib/bottle.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return "doc"
        Severity: Major
        Found in analyzer/windows/lib/core/packages.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                          return None
          Severity: Major
          Found in lib/cuckoo/core/processor.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return ExportDirData(
            Severity: Major
            Found in lib/pefile/pefile.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return table
              Severity: Major
              Found in lib/pefile/pefile.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                        return []
                Severity: Major
                Found in lib/pefile/pefile.py - About 30 mins to fix

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

                      def run(self):
                          """Run Yara processing.
                          @return: hash with matches.
                          """
                          self.key = "yara"
                  Severity: Minor
                  Found in modules/processing/yarasignatures.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 stop has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def stop(self):
                          """Stop sniffing.
                          @return: operation status.
                          """
                          if self.proc and not self.proc.poll():
                  Severity: Minor
                  Found in lib/cuckoo/core/sniffer.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 run has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def run(self):
                          """Run all processing modules and all signatures.
                          @return: processing results.
                          """
                          results = {}
                  Severity: Minor
                  Found in lib/cuckoo/core/processor.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 start has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def start(self, path):
                          p = Process()
                  
                          if "arguments" in self.options:
                              p.execute(path=path, args=self.options["arguments"], suspended=True)
                  Severity: Minor
                  Found in analyzer/windows/packages/exe.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, source=None, name=None, lookup=[], encoding='utf8', **settings):
                          """ Create a new template.
                          If the source parameter (str or buffer) is missing, the name argument
                          is used to guess a template filename. Subclasses can assume that
                          self.source and/or self.filename are set. Both are strings.
                  Severity: Minor
                  Found in lib/bottle.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 release has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def release(self, label=None):
                          """Release a machine.
                          @param label: machine name.
                          """
                          if label:
                  Severity: Minor
                  Found in lib/cuckoo/common/abstracts.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 doReboot has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def doReboot(self, vmx):
                          if vmx == "all":
                              vms = self.conf.getMachines()
                              sys.stdout.write("[*] Disabling network on guests.\n")
                              for vm in vms:
                  Severity: Minor
                  Found in utils/manager/av_updates.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 grant_debug_privilege has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def grant_debug_privilege(pid=0):
                      """Grant debug privileges.
                      @param pid: PID.
                      @return: operation status.
                      """
                  Severity: Minor
                  Found in analyzer/windows/lib/core/privileges.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 doReboot has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def doReboot(self, vmx):
                          if vmx == "all":
                              vms = self.conf.getMachines()
                              sys.stdout.write("[*] Disabling network on guests.\n")
                              for vm in vms:
                  Severity: Minor
                  Found in utils/manager/win_updates.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 start has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def start(self, vm_path, username="", password="", shot_path=""):
                          # creating a file .pid
                          self.lock_file = '/tmp/lock.pid'
                          if not os.path.exists(self.lock_file):
                              lock = open(self.lock_file, 'w')
                  Severity: Minor
                  Found in analyzer/windows/lib/api/screenshot.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 _handle has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def _handle(self, environ):
                          try:
                              environ['bottle.app'] = self
                              request.bind(environ)
                              response.bind()
                  Severity: Minor
                  Found in lib/bottle.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 get_type has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def get_type(self):
                          """Get MIME file type.
                          @return: file type.
                          """
                          try:
                  Severity: Minor
                  Found in lib/cuckoo/common/utils.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