sebastianbeyer/concavehull

View on GitHub

Showing 12 of 26 total issues

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

def concaveHull(dataset, k):
    assert k >= 3, 'k has to be greater or equal to 3.'
    points = dataset
    # todo: remove duplicate points from dataset
    # todo: check if dataset consists of only 3 or less points
Severity: Minor
Found in ConcaveHull.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 tcase has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

def tcase(name):
    if name == 'F1':
        return (0,0), (7,7), (3,4), (4,5), False
    elif name == 'F2':
        return (-4,4), (-2,1), (-2,3), (0,0), False
Severity: Minor
Found in lineintersect.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

Avoid too many return statements within this function.
Open

        return (0,0), (3,3), (0,0), (3,3), True
Severity: Major
Found in lineintersect.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return (5,5), (0,0), (1,1), (8,2), True
    Severity: Major
    Found in lineintersect.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return (-1,-1), (2,2), (3,3), (5,5), False
      Severity: Major
      Found in lineintersect.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return (0,-2), (0,2), (-2,0), (2,0), True
        Severity: Major
        Found in lineintersect.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return (-1,0), (0,0), (-1,-1), (-1,1), True
          Severity: Major
          Found in lineintersect.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return (0,2), (2,2), (2,0), (2,4), True
            Severity: Major
            Found in lineintersect.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return (0,0), (5,5), (1,1), (3,3), True
              Severity: Major
              Found in lineintersect.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return (0,0), (1,1), (2,0), (0.5,2), False
                Severity: Major
                Found in lineintersect.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return (1,1), (4,1), (2,2), (3,2), False
                  Severity: Major
                  Found in lineintersect.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return (0,5), (6,0), (2,1), (2,2), False
                    Severity: Major
                    Found in lineintersect.py - About 30 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language