LordDarkula/chess_py

View on GitHub

Showing 43 of 71 total issues

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

    def find_piece(self, piece):
        """
        Finds Location of the first piece that matches piece.
        If none is found, Exception is raised.

Severity: Minor
Found in chess_py/core/board.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 shift has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def shift(self, direction):
        """
        Shifts in direction provided by ``Direction`` enum.

        :type: direction: Direction
Severity: Minor
Found in chess_py/core/algebraic/location.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 loc_adjacent_to_opponent_king has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def loc_adjacent_to_opponent_king(self, location, position):
        """
        Finds if 2 kings are touching given the position of one of the kings.

        :type: location: Location
Severity: Minor
Found in chess_py/pieces/king.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