hackedteam/test-av2

View on GitHub

Showing 203 of 446 total issues

File rest_test.rb has 926 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'net/http'
require 'json'
require 'benchmark'
require 'open-uri'
require 'pp'
Severity: Major
Found in AVAgent/old/tmp/rest_test.rb - About 2 days to fix

    File build.py has 876 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import os
    import shutil
    from time import sleep
    import time
    import socket
    Severity: Major
    Found in AVAgent/build.py - About 2 days to fix

      Function dispatch_kind has a Cognitive Complexity of 83 (exceeds 5 allowed). Consider refactoring.
      Open

      def dispatch_kind(vm_name, kind, args, r_id=None, tries=0):
          #   PREPARE FILES
      
          global status, test_id
      
      
      Severity: Minor
      Found in AVMaster/Old/oldMaster.py - About 1 day 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

      File master.py has 629 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import argparse
      import os
      import time
      import random
      import os.path
      Severity: Major
      Found in AVMaster/master.py - About 1 day to fix

        File oldMaster.py has 604 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import argparse
        import os
        import time
        import random
        import os.path
        Severity: Major
        Found in AVMaster/Old/oldMaster.py - About 1 day to fix

          Function main has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
          Open

          def main(argv):
              devices = adb.get_attached_devices()
          
              print """
              !!! Test AntiVirus !!!
          Severity: Minor
          Found in scripts/mobile/hardware/testtools.py - About 1 day 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 dispatch has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
          Open

              def dispatch(self, procedure, pool=0 ):
                  global received
                  exit = False
          
                  command.context = {}
          Severity: Minor
          Found in AVMaster/dispatcher.py - About 7 hrs 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 summary has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
          Open

          def summary():
              report = Report()
              report.vm = {}
          
              hostname = helper.get_hostname()
          Severity: Minor
          Found in AVMaster/report.py - About 7 hrs 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

          File adbclient.py has 450 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          '''
          Copyright (C) 2012-2013  Diego Torres Milano
          Created on Dec 1, 2012
          
          Licensed under the Apache License, Version 2.0 (the "License");
          Severity: Minor
          Found in scripts/mobile/hardware/adbclient.py - About 6 hrs to fix

            Function check has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
            Open

                def check():
                    ret = True
                    called = set()
                    system = []
                    try:
            Severity: Minor
            Found in AVCommon/procedure.py - About 6 hrs 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 check_upgraded has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
            Open

                def check_upgraded(self, instance_id, level, fast = True):
                    logging.debug("check_upgraded")
            
                    if fast:
                        logging.debug("- Upgrade, Wait for 5 minutes: %s" % time.ctime())
            Severity: Minor
            Found in AVAgent/build.py - About 5 hrs 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 has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
            Open

            def execute(vm, protocol, args):
                """ server side """
                from AVMaster import vm_manager
            
                #logging.debug("    CS Execute")
            Severity: Minor
            Found in AVCommon/commands/server/START_VM.py - About 5 hrs 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

            File rcs_client.py has 377 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import urllib2
            from urllib2 import HTTPError
            import cookielib
            import json
            import traceback
            Severity: Minor
            Found in AVAgent/rcs_client.py - About 5 hrs to fix

              Rcs_client has 38 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class Rcs_client:
                  myid = "0"
              
                  def __init__(self, host, user="avtest", passwd="avtest"):
                      self.host = host
              Severity: Minor
              Found in AVAgent/rcs_client.py - About 5 hrs to fix

                AdbClient has 35 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class AdbClient:
                
                    def __init__(self, serialno=None, hostname=HOSTNAME, port=PORT, settransport=True, reconnect=True):
                        self.serialno = serialno
                        self.hostname = hostname
                Severity: Minor
                Found in scripts/mobile/hardware/adbclient.py - About 4 hrs to fix

                  Function check_static has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def check_static(files, report = None):
                  
                      global report_send
                      if report:
                          report_send = report
                  Severity: Minor
                  Found in AVAgent/build.py - About 4 hrs 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 dispatch_status has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def dispatch_status(vm, kind, server, test_id, r_id, res, status, message):
                  #    print "DBG dispatch status %d (start)" % status
                      test_dir = "C:\\Users\\avtest\\Desktop\\AVTEST"
                      global log
                  
                  
                  Severity: Minor
                  Found in AVMaster/master.py - About 4 hrs 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

                  File rcs_client.py has 325 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import urllib2
                  from urllib2 import HTTPError
                  import cookielib
                  import json
                  import pprint
                  Severity: Minor
                  Found in scripts/dvd_offline/rcs_client.py - About 3 hrs to fix

                    Function dispatch_kind has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def dispatch_kind(vm_name, kind, args, r_id=None, res=None, tries=0, status=0):
                        #global status, test_id
                        global test_id #, res
                        if res is None or status == 0:
                            res = "%s, %s, ERROR GENERAL" % (vm_name, kind)
                    Severity: Minor
                    Found in AVMaster/master.py - About 3 hrs 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

                    VMachine has 30 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class VMachine:
                        def __init__(self, name):
                            self.name = name
                            self.config = None
                    
                    
                    Severity: Minor
                    Found in AVMaster/lib/core/VMachine.py - About 3 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language