hackedteam/test-av2

View on GitHub

Showing 203 of 446 total issues

Avoid too many return statements within this function.
Open

    return False, "Error Occurred: Timeout while starting VM"
Severity: Major
Found in AVCommon/commands/server/START_VM.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                return dispatch_kind(vm_name, kind, args, result_id, tries)
    Severity: Major
    Found in AVMaster/Old/oldMaster.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return "%s, ERROR: not updated. Reason: %s" % (vm_name, e)
      Severity: Major
      Found in AVMaster/master.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

            return True
        Severity: Major
        Found in scripts/mobile/hardware/monkeymain.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              return True
          Severity: Major
          Found in scripts/mobile/hardware/test_skype.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return
            Severity: Major
            Found in scripts/mobile/hardware/test_skype.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                          return
              Severity: Major
              Found in AVAgent/build.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return self.check_upgraded(instance_id, level, fast)
                Severity: Major
                Found in AVAgent/build.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                                  return
                  Severity: Major
                  Found in AVAgent/build.py - About 30 mins to fix

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

                    def execute(vm, protocol, args):
                        logging.debug("    CS Execute: args %s" % args)
                    
                        assert protocol
                        assert protocol.procedure
                    Severity: Minor
                    Found in AVCommon/commands/meta/ENABLE.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 execute_scout has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def execute_scout(self):
                            """ build and execute the  """
                            factory_id, ident, exe = self.execute_pull()
                    
                            self._execute_build(exe)
                    Severity: Minor
                    Found in scripts/dvd_offline/build.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 main has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def main():
                        print "let's build ya"
                    
                        p = {
                            "desktop": ["windows", "linux", "osx"],
                    Severity: Minor
                    Found in scripts/build_srv/build-srv.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 refresh_snapshot has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def refresh_snapshot(self, delete=True):
                            untouchables = ["ready", "activated", "_datarecovery_"]
                            date = datetime.now().strftime('%Y%m%d-%H%M')
                            self.create_snapshot(date)
                            if delete is True:
                    Severity: Minor
                    Found in AVMaster/lib/core/VMachine.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 wait_for_startup has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def wait_for_startup(vm, message=None, max_minute=8):
                        #r = Redis()
                        r = StrictRedis(socket_timeout=max_minute * 60)
                    
                        p = r.pubsub()
                    Severity: Minor
                    Found in AVMaster/master.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 longPress has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def longPress(self, name):
                            # WORKAROUND:
                            # Using 'input keyevent --longpress POWER' does not work correctly in
                            # KitKat (API 19), it sends a short instead of a long press.
                            # This uses the events instead, but it may vary from device to device.
                    Severity: Minor
                    Found in scripts/mobile/hardware/adbclient.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 execute has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def execute(vm, protocol, inst_args):
                        from AVMaster import vm_manager
                    
                        """ client side, returns (bool,*) """
                        logging.debug("    INSTALL_AGENT" )
                    Severity: Minor
                    Found in AVCommon/commands/server/INSTALL_AGENT.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 copy_to_guest has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def copy_to_guest(vm, test_dir, filestocopy):
                        #lib_dir = "%s\\lib" % test_dir
                        #assets_dir = "%s\\assets" % test_dir
                        vmavtest = "../AVAgent"
                    
                    
                    Severity: Minor
                    Found in AVMaster/master.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 _build_agent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def _build_agent(self, factory, melt = None, demo = False, tries = 0):
                            with connection() as c:
                                params = {}
                                params['blackberry'] = {'platform': 'blackberry',
                                    'binary': {'demo': demo},
                    Severity: Minor
                    Found in scripts/dvd_offline/build.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 search_plan has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def search_plan(proj_id, plan_id=-1, plan_name=""):
                        for p in get_plans(proj_id):
                            if p["is_completed"]:
                                continue
                            if p["id"] == plan_id or p["name"] == plan_name:
                    Severity: Minor
                    Found in AVMaster/testrail_api.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 copy_to_guest has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def copy_to_guest(vm, test_dir, filestocopy):
                        #lib_dir = "%s\\lib" % test_dir
                        #assets_dir = "%s\\assets" % test_dir
                        vmavtest = "../AVAgent"
                    
                    
                    Severity: Minor
                    Found in AVMaster/Old/oldMaster.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