hackedteam/test-av2

View on GitHub
AVMaster/testrail_api.py

Summary

Maintainability
B
4 hrs
Test Coverage

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 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 add_result has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def add_result(test_id, result, comment="", elapsed=0, defects="", version=0 ):
    Severity: Minor
    Found in AVMaster/testrail_api.py - About 45 mins to fix

      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

      There are no issues that match your filters.

      Category
      Status