rs2wapy/adapters/adapters.py
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
Open
assert isinstance(self._model, models.Ban)
- Exclude checks
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
Open
assert isinstance(self._model, models.Player)
- Exclude checks
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
Open
assert isinstance(self._model, models.Squad)
- Exclude checks
Possible hardcoded password: '' Open
Open
token = ""
# TODO: Move to parsing.py.
- Exclude checks
File adapters.py
has 1011 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
from __future__ import annotations
import base64
import datetime
import functools
Function _perform
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _perform(self, url: str, curl_obj: pycurl.Curl = None,
Function ban_player
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def ban_player(self, player: Union[models.Player, PlayerWrapper],
Function retry
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def retry(on_exc: Union[Type[Exception], Tuple[Exception, ...]],
Function retry
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def retry(on_exc: Union[Type[Exception], Tuple[Exception, ...]],
tries: int = 10, delay: int = 3, backoff: int = 2,
cap: int = 30):
"""Retry calling the decorated function
using an exponential back-off with back-off cap.
- Read upRead up
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"