File deck.py
has 461 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import logging
import os
- Create a ticketCreate a ticket
Deck
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
class Deck:
"""
Deck you will be using. Make sure to create the instance somewhere reachable :)
:param cards: | Use this parameter if you don't plan to register your cards another way
- Create a ticketCreate a ticket
Function draw_specific
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def draw_specific(self, specific_card: CardType) -> CardType:
"""
Draw a specific card from the deck
.. note::
- Read upRead up
- Create a ticketCreate a ticket
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 _card_compare
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _card_compare(card: CardType, second_card: CardType) -> bool:
"""
Function for comparing two cards. First it checks their `__eq__`,
if that returns False, it checks `__dict__` and name of the Class
that spawned them .
- Read upRead up
- Create a ticketCreate a ticket
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 discard
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def discard(self, card: CardType) -> None:
"""
Puts a card into the discard pile
:param card: Card to be discarded
- Read upRead up
- Create a ticketCreate a ticket
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"