File gsuite.py
has 388 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""GSuite syncing helpers defined by the mailinglists package."""
import logging
from random import random
from time import sleep
- Create a ticketCreate a ticket
Function sync_mailing_lists
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def sync_mailing_lists(self, lists: list[GroupData] | None = None):
"""Sync mailing lists with GSuite. Lists are only deleted if all lists are synced and thus no lists are passed to this function.
:param lists: optional parameter to determine which lists to sync
"""
- 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 _update_group_members
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _update_group_members(self, group):
"""Update the group members of the specified group based on the existing members.
:param group: group data
"""
- 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__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
- Create a ticketCreate a ticket
Function create_group
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def create_group(self, group):
"""Create a new group based on the provided data.
:param group: GroupData to create a group for
"""
- 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"