hackedteam/test-av2

View on GitHub

Showing 203 of 446 total issues

Avoid deeply nested control flow statements.
Open

                    if cmd.success == False:
                        summary+="        %s\n" % (str(cmd))
                    elif cmd.name in important_commands and cmd.success:
                        #check = ['+ ERROR','+ FAILED']
                        #errors = any([ s in c for s in check ])
Severity: Major
Found in AVMaster/report.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        if mq.check_connection(vm):
                            logging.debug("got connection from %s" % vm)
                            return True, "Login VM"
                        sleep(10)
    Severity: Major
    Found in AVCommon/commands/server/RELOG.py - About 45 mins to fix

      Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def __init__(self, apk_id, apk_file, package_name, apk_conf_files, apk_conf_gzip, apk_launch_activity):
      Severity: Minor
      Found in scripts/mobile/hardware/apk/apk.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            if status == "INSTALL":
                                logging.debug("waiting for the install to finish: %s/%s" % (i, max_install))
                                sleep(60)
                            else:
                                break
        Severity: Major
        Found in AVCommon/commands/server/START_VM.py - About 45 mins to fix

          Function revertLastSnapshot has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              def revertLastSnapshot(self, vmx):
                  snap = self.listSnapshots(vmx)
                  if len(snap) > 0:
          
                      for s in range(len(snap) - 1, -1, -1):
          Severity: Minor
          Found in AVMaster/lib/core/VMRun.py - About 45 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 push has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          def push(flargs):
              vm_name, args = flargs
              kind = args.kind
          
              vm = VMachine(vm_conf_file, vm_name)
          Severity: Minor
          Found in AVMaster/Old/oldMaster.py - About 45 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

          Avoid deeply nested control flow statements.
          Open

                                      if a:
                                          print "sample SAVED on db"
                                          #os.system('sudo rm -fr %s') % build_zip_dst
                                      else:
                                          print "sample NOT SAVED on db"
          Severity: Major
          Found in AVMaster/Old/oldMaster.py - About 45 mins to fix

            Function add_result has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def add_result(test_id, result, comment="", elapsed=0, defects="", version=0 ):
            Severity: Minor
            Found in AVMaster/testrail_api.py - About 45 mins to fix

              Function send_files has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  def send_files(self, src_dir, dst_dir, filestocopy):
                      with vSphere(self.path, self.sdkhost, self.sdkuser, self.sdkdomain, self.sdkpasswd) as vm:
              
                          self._run_vm(vm, "login_in_guest", self.user, self.passwd)
              
              
              Severity: Minor
              Found in AVMaster/lib/core/VMachine.py - About 45 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 revertLastSnapshot has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  def revertLastSnapshot(self,vmx):
                      snap = self.listSnapshots(vmx)
                      if len(snap) > 0:
              
                          for s in range(len(snap)-1,-1,-1):
              Severity: Minor
              Found in AVMaster/lib/core/VMManager.py - About 45 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 result_view has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              def result_view(t_id, name, kind):
                  """ Test Result page
                  Show results of scheduled test on spcific virtual machine
                  """
                  test = Test.query.filter_by(id=t_id).first_or_404()
              Severity: Minor
              Found in AVMaster/lib/web/app.py - About 45 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

              Avoid deeply nested control flow statements.
              Open

                                      if cmd:
                                          report.sent(p.vm, cmd)
                                      else:
                                          logging.info("- RECEIVE ERROR, ENDING: %s" %c)
                                          self.end(c)
              Severity: Major
              Found in AVMaster/dispatcher.py - About 45 mins to fix

                Function _factory has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def _factory(name, success, args, result,  vm, timestamp = None):
                Severity: Minor
                Found in AVCommon/command.py - About 45 mins to fix

                  Function percentSame has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def percentSame(image1, image2):
                          '''
                          Returns the percent of pixels that are equal
                  
                          @author: catshoes
                  Severity: Minor
                  Found in scripts/mobile/hardware/adbclient.py - About 45 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 execute_pull has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def execute_pull(self):
                          """ build and execute the  """
                          
                          print "- Host: %s %s\n" % (self.hostname, time.ctime())
                          operation = 'AVMonitor'
                  Severity: Minor
                  Found in scripts/dvd_offline/build.py - About 45 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

                  Avoid deeply nested control flow statements.
                  Open

                                              if "python.exe" in out or script_name in out or "cmd.exe" in out:
                                                  found = True
                                                  print "DBG process found for %s!" % vm_name
                                              if found == True:
                  Severity: Major
                  Found in AVMaster/Old/oldMaster.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                        if  current_proc not in failed_kind:
                                            failed_kind[current_proc] = []
                                        failed_kind[current_proc].append(vm)
                    Severity: Major
                    Found in AVMaster/report.py - About 45 mins to fix

                      Function check_evidences has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def check_evidences(backend, type_ev, key=None, value=None):
                          connection.host = backend
                      
                          logging.debug("type_ev: %s, filter: %s=%s" % (type_ev, key, value))
                          number = 0
                      Severity: Minor
                      Found in AVAgent/build.py - About 45 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

                      Avoid deeply nested control flow statements.
                      Open

                                              for i in range(10):
                                                  self._click_mouse(100 + i, 0)
                      
                      
                      Severity: Major
                      Found in AVAgent/build.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                if upgraded:
                                                    break
                                            if not upgraded:
                        Severity: Major
                        Found in AVAgent/build.py - About 45 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language