Showing 98 of 172 total issues
File entitlements.py
has 670 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""CLI/Commands - Entitlements."""
import functools
from operator import itemgetter
File push.py
has 457 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""CLI/Commands - Push packages."""
import math
import os
import time
from datetime import datetime
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 create_push_handlers
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
def create_push_handlers():
"""Create a handler for upload per package format."""
# pylint: disable=fixme
# HACK: hacky territory - Dynamically generate a handler for each of the
# package formats, until we have slightly more clever 'guess type'
- 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
Options
has 39 functions (exceeds 20 allowed). Consider refactoring. Open
class Options:
"""Options object that holds config for the application."""
def __init__(self, *args, **kwargs):
"""Initialise a new Options object."""
Function handle_api_exceptions
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
def handle_api_exceptions(
ctx, opts, context_msg=None, nl=False, exit_on_error=True, reraise_on_error=False
):
"""Context manager that handles API exceptions."""
# flake8: ignore=C901
- 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 initialise_api
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def initialise_api(
debug=False,
host=None,
key=None,
proxy=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
File upstream.py
has 347 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""CLI/Commands - create, retrieve, update or delete repository upstreams."""
import json
import click
File config.py
has 339 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""CLI - Configuration."""
import os
import re
import threading
Function wait_for_package_sync
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def wait_for_package_sync(
ctx, opts, owner, repo, slug, wait_interval, skip_errors, attempts=3
):
"""Wait for a package to synchronise (or fail)."""
# pylint: disable=too-many-locals
- 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
File tags.py
has 283 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""CLI/Commands - List objects."""
from operator import itemgetter
import click
Function create_requests_session
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def create_requests_session(
retries=None,
backoff_factor=None,
status_forcelist=None,
pools_size=4,
- 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 _load_values_into_opts
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def _load_values_into_opts(opts, values):
for k, v in values.items():
if v is None:
continue
if isinstance(v, str):
- 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
File decorators.py
has 272 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""CLI - Decorators."""
import functools
import click
Function get_details
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def get_details(exc):
"""Get the details from the exception."""
detail = None
fields = collections.OrderedDict()
- 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_config_files
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def create_config_files(ctx, opts, api_key):
"""Create default config files."""
# pylint: disable=unused-argument
config_reader = opts.get_config_reader()
creds_reader = opts.get_creds_reader()
- 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
File license.py
has 253 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""CLI/Commands - create, retrieve, update or delete license policies."""
import json
import click
Function request
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def request(
self,
method,
url,
query_params=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 initialise_api
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialise_api(
Function maybe_print_as_json
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def maybe_print_as_json(opts, data, page_info=None):
"""Maybe print data as JSON."""
if opts.output not in ("json", "pretty_json"):
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"