File entitlements.py
has 670 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""CLI/Commands - Entitlements."""
import functools
from operator import itemgetter
Function print_entitlements_with_restrictions
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
def print_entitlements_with_restrictions(
opts, data, page_info=None, show_list_info=True
):
# pylint: disable=too-many-locals
"""Print entitlements (with restrictions) as a table or output in another format."""
- 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 restrict
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def restrict(
Function restrict
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def restrict(
ctx,
opts,
owner_repo_identifier,
refresh_token,
- 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 list_entitlements
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def list_entitlements(ctx, opts, owner_repo, page, page_size, show_tokens):
Function create
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def create(ctx, opts, owner_repo, show_tokens, name, token):
Function print_entitlements
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def print_entitlements(opts, data, page_info=None, show_list_info=True):
"""Print entitlements as a table or output in another format."""
if utils.maybe_print_as_json(opts, data, page_info):
return
- 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 update
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def update(ctx, opts, owner_repo_identifier, show_tokens, name, token):
Function sync
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def sync(ctx, opts, owner_repo, show_tokens, source, yes):
Function refresh
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def refresh(ctx, opts, owner_repo_identifier, show_tokens, yes):