Showing 98 of 172 total issues
Function update
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def update(ctx, opts, owner_repo_identifier, show_tokens, name, token):
Function resync_package
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def resync_package(ctx, opts, owner, repo, slug, skip_errors):
Function rate_limit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def rate_limit(client, headers):
"""Pause the process based on suggested rate interval."""
if not client or not headers:
return False
- 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 _print_metrics_table
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _print_metrics_table(opts, data):
"""Print metrics as a table."""
category_keys = {"Bandwidth": "bandwidth", "Downloads": "downloads"}
metrics_keys = {
- 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 handle_api_exceptions
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def handle_api_exceptions(
Function validate_slashes
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def validate_slashes(
Function make_table
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def make_table(headers=None, rows=None):
"""Make a table from headers and rows."""
if callable(headers):
headers = headers()
if callable(rows):
- 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 _print_metrics_table
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _print_metrics_table(opts, data):
"""Print metrics as a table."""
category_keys = {"Bandwidth": "bandwidth", "Downloads": "downloads"}
metrics_keys = {
- 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 create
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def create(ctx, opts, owner_repo, show_tokens, name, token):
Function get_package_formats
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_package_formats():
"""Get the list of available package formats and parameters."""
# pylint: disable=fixme
# HACK: This obviously isn't great, and it is subject to change as
- 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 packages
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def packages(ctx, opts, owner_repo, page, page_size, query):
Function validate_upload_file
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def validate_upload_file(ctx, opts, owner, repo, filepath, skip_errors):
Function usage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def usage(ctx, opts, owner_repo, tokens, start, finish):
Function print_upstreams
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def print_upstreams(upstreams, upstream_fmt):
"""Print upstreams as a table or output in another format."""
def build_row(u):
row = [
- 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 usage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def usage(ctx, opts, owner_repo, packages, start, finish):
Function sync
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def sync(ctx, opts, owner_repo, show_tokens, source, yes):
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_entitlement
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_entitlement(owner, repo, identifier, name, token, show_tokens):
Function replace_tags
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def replace_tags(ctx, opts, owner_repo_package, tags, immutable):