Showing 98 of 172 total issues
Function list_repos
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def list_repos(owner=None, **kwargs):
"""List repositories in a namespace."""
client = get_repos_api()
api_kwargs = {}
- 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 distros
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def distros(ctx, opts, package_format):
"""List available distributions."""
# Use stderr for messages if the output is something else (e.g. # JSON)
use_stderr = opts.output != "pretty"
- 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_requests_session
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_requests_session(
Function validate_api_headers
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def validate_api_headers(param, value):
"""Validate that API headers is a CSV of k=v pairs."""
# pylint: disable=unused-argument
if not value:
return None
- 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 upload_files_and_create_package
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def upload_files_and_create_package(
Function move
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def move(
Function validate_slashes
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def validate_slashes(
param, value, minimum=2, maximum=None, form=None, allow_blank=False
):
"""Ensure that parameter has slashes and minimum parts."""
try:
- 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 wait_for_package_sync
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def wait_for_package_sync(
Function copy
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def copy(
Function request
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def request(
Function upload_files_and_create_package
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def upload_files_and_create_package(
ctx,
opts,
package_type,
owner_repo,
- 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 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 get
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def get(ctx, opts, owner_repo, page, page_size):
"""
List repositories for a namespace (owner).
OWNER/REPO: Specify the OWNER namespace (i.e user or org) to list the
- 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_tags
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _print_tags(opts, all_tags, all_immutable_tags):
"""Print the tags for a package."""
all_combined_tags = {"tags": all_tags, "tags_immutable": all_immutable_tags}
if utils.maybe_print_as_json(opts, all_combined_tags):
- 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 resync
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def resync(
Function create_package
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_package(ctx, opts, owner, repo, package_type, skip_errors, **kwargs):
Function multi_part_upload_file
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def multi_part_upload_file(
Function validate_create_package
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def validate_create_package(
Function upload_file
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def upload_file(ctx, opts, owner, repo, filepath, skip_errors, md5_checksum):