hackedteam/test-av2

View on GitHub

Showing 203 of 446 total issues

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

def main():
    global logdir, status, test_id

    # PARSING

Severity: Minor
Found in AVMaster/Old/oldMaster.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

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

def main():
    global logdir, status, test_id

    # PARSING

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

Function execute_scout has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    def execute_scout(self):
        """ build and execute the  """
        factory_id, ident, exe = self.execute_pull()

        new_exe = "build\\scout.exe"
Severity: Minor
Found in AVAgent/build.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

File ez_setup.py has 312 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!python
"""Bootstrap setuptools installation

If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
Severity: Minor
Found in assets/ez_setup.py - About 3 hrs to fix

    AgentBuild has 27 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class AgentBuild:
        def __init__(self, backend, frontend=None, platform='windows', kind='silent',
                     ftype='desktop', blacklist=[], soldierlist=[], param=None,
                     puppet="puppet", asset_dir="AVAgent/assets", factory=None):
            self.kind = kind
    Severity: Minor
    Found in AVAgent/build.py - About 3 hrs to fix

      Function normalize has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
      Open

      def normalize(data):
          """ a command cane be unserialized in many ways:
          - command instance
          - dict: { command: payload }
          - tuple/array: (cmd, success, payload) or (cmd, payload)
      Severity: Minor
      Found in AVCommon/command.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

      Function get_status has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
      Open

      def get_status(vm):
          from AVMaster import vm_manager
          # [19/12/13 11:09:23] Seppia: pid=1432, owner=WIN7-NOAV\avtest, cmd=vmtoolsd.exe
          # pid=1776, owner=NT AUTHORITY\SYSTEM, cmd=vmtoolsd.exe
          # pid=712, owner=NT AUTHORITY\SYSTEM, cmd=TrustedInstaller.exe
      Severity: Minor
      Found in AVCommon/commands/server/START_VM.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

      Function read has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
      Open

          def read(self, blocking=False, timeout=0):
              """ reads a message from the underlining channel. This method can be blocking or it could timeout in a while
              """
              ret = None
              time_start = time.time()
      Severity: Minor
      Found in AVCommon/channel.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

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

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

        VMRun has 26 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class VMRun:
            def __init__(self, config_file):
                self.config = ConfigParser()
                self.config.read(config_file)
        
        
        Severity: Minor
        Found in AVMaster/lib/core/VMRun.py - About 3 hrs to fix

          Function _build_mail_body has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

              def _build_mail_body(self, url_dir):
          
                  hresults = []
                  hcolumns = ['name']
          
          
          Severity: Minor
          Found in AVMaster/lib/core/report.py - About 2 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_elite_fast has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

              def execute_elite_fast(self, instance_id = None, fast = True):
          
                  if not instance_id:
                      with connection() as c:
                          instance_id, target_id = get_instance(c)
          Severity: Minor
          Found in AVAgent/build.py - About 2 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 build.py has 285 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import os
          import re
          import time
          import socket
          import urllib2
          Severity: Minor
          Found in scripts/dvd_offline/build.py - About 2 hrs to fix

            VMRun has 25 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class VMRun:
                def __init__(self, config_file):
                    self.config = ConfigParser()
                    self.config.read(config_file)
            
            
            Severity: Minor
            Found in AVMaster/lib/core/VMManager.py - About 2 hrs to fix

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

              def execute(vm, protocol, args):
                  """ server side """
                  from AVMaster import vm_manager
              
                  logging.debug("    CS PUSH: %s" % str(args))
              Severity: Minor
              Found in AVCommon/commands/server/PUSH.py - About 2 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 test_device has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
              Open

              def test_device(device_id, dev, results):
              
                  # uninstall device
                  adb.uninstall(service, dev)
              
              
              Severity: Minor
              Found in scripts/mobile/hardware/main.py - About 2 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-core.rb has 263 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              require 'net/http'
              require 'json'
              require 'open-uri'
              require 'pp'
              require 'cgi'
              Severity: Minor
              Found in AVAgent/old/tmp/rcs-core.rb - About 2 hrs to fix

                Function execute has a Cognitive Complexity of 17 (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/RELOG.py - About 2 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 parse_results has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                Open

                def parse_results(filename):
                
                    success = []
                    errors  = []
                    failed  = []
                Severity: Minor
                Found in snippet/report_html.py - About 2 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 adb.py has 256 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                #!/usr/bin/python
                
                import sys
                import subprocess
                import json
                Severity: Minor
                Found in scripts/mobile/hardware/adb.py - About 2 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language