hackedteam/test-av2

View on GitHub

Showing 203 of 446 total issues

Function add_plan_result has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

def add_plan_result(proj_id, plan_id, config, run_name, test_case, result, elapsed = 0, comment="avg"):
    logging.debug("adding plan result: %s, %s, %s, %s, %s" % (config, run_name, test_case, result, comment))
    statuses = get_statuses()

    results = dict([ (s['name'],s['id']) for s in statuses])
Severity: Minor
Found in AVMaster/testrail_api.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 shell has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    def shell(self, cmd=None):
        if DEBUG:
            print >> sys.stderr, "shell(cmd=%s)" % cmd
        if cmd:
            self.__send('shell:%s' % cmd, checkok=True, reconnect=False)
Severity: Minor
Found in scripts/mobile/hardware/adbclient.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 build_mail_body has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

def build_mail_body(results):

    for av in results:
        name = av[0].split(",")[0]
        k = len(av)
Severity: Minor
Found in snippet/results.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 has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

def execute(vm, protocol, args):
    """ server side """
    #logging.debug("    CS Execute")
    assert vm, "null self.vm"
    assert isinstance(args, bool), "INTERNET argument must be boolean"
Severity: Minor
Found in AVCommon/commands/server/INTERNET.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 dump has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

def dump():
    report = Report()

    #f=open("%s/report.%s.%s.yaml" % (logger.logdir, report.timestamp, report.name), "w+")
    #f.write(yaml.dump(report, default_flow_style=False, indent=4))
Severity: Minor
Found in AVMaster/report.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 has a Cognitive Complexity of 14 (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/PULL.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 14 (exceeds 5 allowed). Consider refactoring.
Open

def test_device(device, results):

    print results

    build.connection.host = "rcs-castore"
Severity: Minor
Found in scripts/mobile/hardware/test_skype.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_up_and_down has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

def test_up_and_down():
#    vmm = VMManager("../AVMaster/conf/vms.cfg")
    vmm = VMManager()
    logging.info( "TEST VMManager")
    #vms=["zenovm", "noav"]
Severity: Minor
Found in tests_integration/test_vm_manager.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 has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

def execute(vm, args):
    from PIL import ImageGrab
    global im1, thread, go_on, found

    if not os.path.exists(config.basedir_crop):
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 convert_processes has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

def convert_processes(procs):
    processes = []
    if not procs:
        return None

Severity: Minor
Found in AVCommon/helper.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 main has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def main():
    global logdir, status, test_id

    # PARSING

Severity: Minor
Found in AVMaster/Old/oldMaster.py - About 1 hr to fix

    Function main has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def main():
        global logdir, status, test_id
    
        # PARSING
    
    
    Severity: Minor
    Found in AVMaster/master.py - About 1 hr to fix

      Function takeSnapshot has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          def takeSnapshot(self, reconnect=False):
              '''
              Takes a snapshot of the device and return it as a PIL Image.
              '''
      
      
      Severity: Minor
      Found in scripts/mobile/hardware/adbclient.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 _extractall has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

      def _extractall(self, path=".", members=None):
          """Extract all members from the archive to the current working
             directory and set owner, modification time and permissions on
             directories afterwards. `path' specifies a different directory
             to extract to. `members' is optional and must be a subset of the
      Severity: Minor
      Found in assets/ez_setup.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 _build_agent has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          def _build_agent(self, factory, melt=None, kind="silent",tries=0):
      
              with connection() as c:
      
                  try:
      Severity: Minor
      Found in AVAgent/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

      Method run has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

        def self.run(options)
      
          begin
            c = CoreDeveloper.new
            c.name = options[:name]
      Severity: Minor
      Found in AVAgent/old/tmp/rcs-core.rb - 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 has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def execute(vm, args):
          """ client side, returns (bool,*) """
          logging.debug("    BUILD %s" % args)
          assert vm, "null vm"
          assert command.context, "Null context"
      Severity: Minor
      Found in AVCommon/commands/client/BUILD.py - About 1 hr to fix

        Function test_connection has 36 lines of code (exceeds 25 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

          Function report_view has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

          def report_view(t_id):
              """ Report page
              Show report page
              """
              test = Test.query.filter_by(id=t_id).first_or_404()
          Severity: Minor
          Found in AVMaster/lib/web/app.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 refreshSnapshot has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

              def refreshSnapshot(self, vmx, delete=True):
                  untouchables = [ "_datarecovery_"] #"ready", "activated",
          
                  if config.verbose:
                      logging.debug("[%s] Refreshing snapshot.\n" % vmx)
          Severity: Minor
          Found in AVMaster/lib/core/VMRun.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

          Severity
          Category
          Status
          Source
          Language