hackedteam/test-av2

View on GitHub

Showing 446 of 446 total issues

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

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

def grab_loop(vm):
    global go_on, found
    iter=0;
    logging.debug("grab loop")
    if not os.path.exists("crop"):
Severity: Minor
Found in AVCommon/commands/client/CROP.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

Method login has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def login(host, port, user, pass)
    @host = host || '127.0.0.1'
    @port = port || 443
    @http = Net::HTTP.new(@host, @port)
    @http.use_ssl = true
Severity: Minor
Found in AVAgent/old/tmp/rcs-core.rb - 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 server has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def server():
    r = Redis("10.0.20.1")
    p = r.pubsub()
    p.subscribe(channel)
    for cmd in ["START","PUSH","SILENT","END"]:
Severity: Minor
Found in snippet/listener.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