hackedteam/test-av2

View on GitHub

Showing 203 of 446 total issues

Method REST_task has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

def REST_task(http, cookie, type, filename, params={})
Severity: Minor
Found in AVAgent/old/tmp/rest_test.rb - About 35 mins to fix

    Function sync_and_check_evidences has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    def sync_and_check_evidences(operation, target_name, results):
            # sync e verifica
    
        with build.connection() as c:
    
    
    Severity: Minor
    Found in scripts/mobile/hardware/testmain.py - About 35 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 dispatch has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    def dispatch(flargs):
        try:
            vm_name, args = flargs
            kind = args.kind
            results = []
    Severity: Minor
    Found in AVMaster/Old/oldMaster.py - About 35 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 kill_proc_by_regex has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    def kill_proc_by_regex(procs, reagent):
    
        exenames = [ "%s.exe" % n for n in build.names]
    
        for caption, pid in [ (e['Caption'],int(e['ProcessId'])) for e in procs]:
    Severity: Minor
    Found in AVCommon/commands/client/UNINSTALL.py - About 35 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_popen has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def _run_popen(self, pargs, timeout=40):
            p = subprocess.Popen(pargs, stdout=subprocess.PIPE)
    
            executed = False
            tick = 0
    Severity: Minor
    Found in AVMaster/lib/core/VMManager.py - About 35 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_cmd has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def _run_cmd(self, vmx, cmd, args=[], vmx_creds=[], popen=False, bg=False, timeout=40):
            pargs = [self.path,
                     "-T", "vc",
                     "-h", self.host,
                     "-u", "%s\\%s" % (self.domain, self.user), "-p", self.passwd, cmd, vmx.path]
    Severity: Minor
    Found in AVMaster/lib/core/VMRun.py - About 35 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 _prepare_report has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def _prepare_report(self):
            r = ""
            for l in self.results:
                if l is list:
                    for el in l:
    Severity: Minor
    Found in AVMaster/lib/core/report.py - About 35 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 __setTransport has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def __setTransport(self):
            if DEBUG:
                print >> sys.stderr, "__setTransport()"
            if not self.serialno:
                raise ValueError("serialno not set, empty or None")
    Severity: Minor
    Found in scripts/mobile/hardware/adbclient.py - About 35 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 use_setuptools has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    def use_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL,
                       to_dir=os.curdir, download_delay=15):
        # making sure we use the absolute path
        to_dir = os.path.abspath(to_dir)
        was_imported = 'pkg_resources' in sys.modules or \
    Severity: Minor
    Found in assets/ez_setup.py - About 35 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_agent has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def start_agent(self, mq=None, procedure=None, force=False):
    
            if not force and check_running(self.vm):
                logging.fatal("already running")
                exit = True
    Severity: Minor
    Found in AVAgent/av_agent.py - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
    Open

    def execute(vm, args):
        if platform.release() == "XP":
            start_dir = '%s\\Start Menu\\Programs\\Startup' % os.environ['userprofile']
        else:
            start_dir = "%s\\Microsoft\\Windows\\Start Menu\\Programs\\Startup" % os.environ['appdata']
    Severity: Minor
    Found in AVCommon/commands/client/LIST_DIR.py - About 35 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 client has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    def client():
        r = Redis()
        p = r.pubsub()
        p.subscribe(channel)
        exit = False
    Severity: Minor
    Found in snippet/listener.py - About 35 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_web_expl has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def execute_web_expl(self, websrv):
            """ WEBZ: we need to download some files only """
    
            def check_file(filename):
                try:
    Severity: Minor
    Found in AVAgent/build.py - About 35 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 has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    def build(args, report):
        global results, report_send
        results = []
    
        report_send = report
    Severity: Minor
    Found in AVAgent/build.py - About 35 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 too many return statements within this function.
    Open

            return "skype call not supported by OS"
    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 "NO-VM-TOOLS"
      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 "%s, ERROR: not updated. Reason: %s" % (vm_name, e)
        Severity: Major
        Found in AVMaster/Old/oldMaster.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              return True
          Severity: Major
          Found in scripts/mobile/hardware/main.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 scripts/mobile/hardware/test_skype.py - About 30 mins to fix
                Severity
                Category
                Status
                Source
                Language