Showing 13 of 13 total issues
Function send_notification_async
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def send_notification_async(self, token_hex: str, notification: Payload, topic: Optional[str] = None,
priority: NotificationPriority = NotificationPriority.Immediate,
expiration: Optional[int] = None, collapse_id: Optional[str] = None,
push_type: Optional[NotificationType] = None) -> int:
json_str = json.dumps(notification.dict(), cls=self.__json_encoder, ensure_ascii=False, separators=(',', ':'))
- 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"
Further reading
Function __init__
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function dict
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def dict(self) -> Dict[str, Any]:
result = {} # type: Dict[str, Any]
if self.title:
result['title'] = self.title
- 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"
Further reading
Function dict
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def dict(self) -> Dict[str, Any]:
result = {
'aps': {}
} # type: Dict[str, Any]
- 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"
Further reading
Function __init__
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self,
Function __init__
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function send_notification_batch
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def send_notification_batch(self, notifications: Iterable[Notification], topic: Optional[str] = None,
priority: NotificationPriority = NotificationPriority.Immediate,
expiration: Optional[int] = None, collapse_id: Optional[str] = None,
push_type: Optional[NotificationType] = None) -> Dict[str, Union[str, Tuple[str, str]]]:
"""
- 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"
Further reading
Function send_notification_async
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def send_notification_async(self, token_hex: str, notification: Payload, topic: Optional[str] = None,
Function send_notification_batch
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def send_notification_batch(self, notifications: Iterable[Notification], topic: Optional[str] = None,
Function send_notification
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def send_notification(self, token_hex: str, notification: Payload, topic: Optional[str] = None,
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, auth_key_path: str, auth_key_id: str, team_id: str,
Function create_connection
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_connection(self, server: str, port: int, proto: Optional[str], proxy_host: Optional[str] = None,
Function _init_connection
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _init_connection(self, use_sandbox: bool, use_alternative_port: bool, proto: Optional[str],