Function search_status
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def search_status(d: dict) -> List[Dict[str, bool]]:
"""Get the status of a specific subscription.
Args:
d: dictionary of subscription object
- 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 _is_active
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _is_active(self) -> None:
"""Check if the key has an associated active subscription and change the state button accordingly."""
# As there is not any key that identify the nicfi contract,
# let's find though all the subscriptions a representative name
wildcards = ["Level_0", "Level_1", "Level2"]
- 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 init_session
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def init_session(self, credentials: Union[str, List[str]], write_secrets: bool = False) -> None:
"""Initialize planet client with api key or credentials. It will handle errors.
Args:
credentials: planet API key, username and password pair or a secrets planet.json file.
- 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"