hackedteam/test-av2

View on GitHub

Showing 203 of 446 total issues

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

def main():
    devices = adb.get_attached_devices()

    print """
    !!! Test AntiVirus !!!
Severity: Minor
Found in scripts/mobile/hardware/testmain.py - About 1 hr 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 test_connection has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def test_connection(self):
        logging.debug('test')
        host = "rcs-minotauro"
        user = "avmonitor"
        passwd = "avmonitorp123"
Severity: Minor
Found in tests_integration/test_rcs_client.py - About 1 hr 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_elite has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def execute_elite(self):
        """ build scout and upgrade it to elite """
        instance = self.execute_scout()

        if not instance:
Severity: Minor
Found in scripts/dvd_offline/build.py - About 1 hr 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 10 (exceeds 5 allowed). Consider refactoring.
Open

def dispatch(flargs):

    try:
        vm_name, args = flargs
        kind = args.kind
Severity: Minor
Found in AVMaster/master.py - About 1 hr 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 test_device has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def test_device(device, results):
    dev = device.serialno
    adb.uninstall(service, dev)

    if not adb.install(apk, dev):
Severity: Minor
Found in scripts/mobile/hardware/monkeymain.py - About 1 hr 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 test has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def test():
    import socket
    import time

    print 'test'
Severity: Minor
Found in scripts/dvd_offline/rcs_client.py - About 1 hr 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 on_answer has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def on_answer(vm, success, answer):
    from AVMaster import vm_manager

    #assert command.context, "Null context"

Severity: Minor
Found in AVCommon/commands/client/CROP.py - About 1 hr 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 delete_startup has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def delete_startup():
    logging.debug("deleting startup")
    for d in build.start_dirs:
        for b in build.names:
            filename = "%s/%s.exe" %(d,b)
Severity: Minor
Found in AVCommon/commands/client/UNINSTALL.py - About 1 hr 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 crop has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def crop(iter):
    from PIL import ImageGrab
    global im1

    logging.debug("crop: %s" % iter)
Severity: Minor
Found in AVCommon/commands/client/CROP.py - About 1 hr 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 test_av has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def test_av(dev, antivirus_apk_instance, results):
    print "##################################################"
    print "#### STAGE 1 : TESTING ANTIVIRUS %s ####" % antivirus_apk_instance.apk_file
    print "##################################################"

Severity: Minor
Found in scripts/mobile/hardware/testtools.py - About 1 hr to fix

    Function add_plan_result has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def add_plan_result(proj_id, plan_id, config, run_name, test_case, result, elapsed = 0, comment="avg"):
    Severity: Major
    Found in AVMaster/testrail_api.py - About 1 hr to fix

      Function dispatch_status has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def dispatch_status(vm, kind, server, test_id, r_id, res, status, message):
      Severity: Major
      Found in AVMaster/master.py - About 1 hr to fix

        Function kill_rcs has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

        def kill_rcs(vm):
        
            logging.debug("Killing rcs")
        
            cmd = 'WMIC PROCESS get Caption,Processid /format:value'
        Severity: Minor
        Found in AVCommon/commands/client/UNINSTALL.py - About 55 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 _create_new_factory has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def _create_new_factory(self, operation, target, factory, config):
                with connection() as c:
                    operation_id, group_id = c.operation(operation)
                    print "DBG type: ", self.ftype, " operation: " , operation, " target: ", target, " factory: ", factory
        
        
        Severity: Minor
        Found in scripts/dvd_offline/build.py - About 55 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 9 (exceeds 5 allowed). Consider refactoring.
        Open

        def execute(vm, protocol, args):
            from AVMaster import vm_manager
        
            """ server side """
            #logging.debug("    CS Execute")
        Severity: Minor
        Found in AVCommon/commands/server/WAIT_SHUTDOWN.py - About 55 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 update has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

        def update(flargs):
            vms = len(flargs[1].vms)
            try:
                vm_name = flargs[0]
                vm = VMachine(vm_conf_file, vm_name)
        Severity: Minor
        Found in AVMaster/master.py - About 55 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 9 (exceeds 5 allowed). Consider refactoring.
        Open

        def execute(vm, protocol, args):
            from AVMaster import vm_manager
        
            """ server side """
            clean = True # VM IS NOT INFECTED!! TEST CAN CONTINUE!!!
        Severity: Minor
        Found in AVCommon/commands/server/CHECK_INFECTION.py - About 55 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 __send has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def __send(self, msg, checkok=True, reconnect=False):
                if DEBUG:
                    print >> sys.stderr, "__send(%s, checkok=%s, reconnect=%s)" % (msg, checkok, reconnect)
                if not re.search('^host:', msg):
                    if not self.isTransportSet:
        Severity: Minor
        Found in scripts/mobile/hardware/adbclient.py - About 55 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 9 (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/STOP_VM.py - About 55 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 write has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def write(self, message):
                """ writes a message to the channel. The channel is created automatically """
                if config.verbose:
                    logging.debug("  CH write: channel: %s  message: %s" % (str(self.channel), str(message)))
        
        
        Severity: Minor
        Found in AVCommon/channel.py - About 55 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