Function _member_group_memberships
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def _member_group_memberships(
member: Member, condition: Callable[[Membership], bool]
) -> dict[str, dict[str, Any]]:
"""Determine the group membership of a user based on a condition.
- 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 execute_data_minimisation
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def execute_data_minimisation(dry_run=False, members=None) -> list[Member]:
"""Clean the profiles of members/users of whom the last membership ended at least 31 days ago.
:param dry_run: does not really remove data if True
:param members: queryset of members to process, optional
- 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 member_achievements
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def member_achievements(member) -> list:
"""Derive a list of achievements of a member.
Committee and board memberships + mentorships
"""
- 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"