GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Chess   A
last analyzed

Complexity

Total Complexity 10

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Test Coverage

Coverage 50%

Importance

Changes 6
Bugs 0 Features 1
Metric Value
c 6
b 0
f 1
dl 0
loc 36
rs 10
ccs 12
cts 24
cp 0.5
wmc 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A __init__() 0 2 1
A generate_fen() 0 2 1
A move() 0 4 1
A export() 0 2 1
A _convert_location_to_board_indices() 0 10 3
A board() 0 3 1
A destinations() 0 2 1
A _get_board() 0 2 1
1 1
from .board import ChessBoard
0 ignored issues
show
Coding Style introduced by
This module should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
2
3
class Chess:
0 ignored issues
show
Coding Style introduced by
This class should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
4 1
5
    def __init__(self, existing_board=None):
6 1
        self._board = ChessBoard(existing_board)
7 1
8
    @property
9 1
    def board(self):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
10
        return self._get_board()
11 1
12
    def _get_board(self):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
13 1
        return self._board.board
14 1
15
    def generate_fen(self):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
16 1
        return self._board.generate_fen()
17
18
    def export(self):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
19 1
        return self._board.export()
20
21
    def move(self, start_location, end_location):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
22 1
        start = self._convert_location_to_board_indices(start_location)
23
        end = self._convert_location_to_board_indices(end_location)
24
        return self._board.move(start, end)
25
26
    def destinations(self, start_location):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
27 1
        return self._board.end_locations_for_piece_at_location(start_location)
28
29
    @staticmethod
30 1
    def _convert_location_to_board_indices(location):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
31
        if isinstance(location, str):
32
            assert len(location) == 2
33
            alphabet = "abcdefghijklmnopqrstuvwxyz"
34
            col = alphabet.index(location[0].lower())
35
            row = int(location[1]) - 1
36
            key = (row, col)
37
            return key
38
        return location
39