Showing 14 of 14 total issues
File requests.py
has 494 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
# Copyright 2021-2023 Cardiff University
# Distributed under the terms of the BSD-3-Clause license
"""Python Requests interface with IGWN authentication.
Function _prepare_auth
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
def _prepare_auth(
url=None,
auth=None,
cert=None,
token=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 scitokens.py
has 304 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
# Copyright 2021 Cardiff University
# Distributed under the terms of the BSD-3-Clause license
"""Utility functions for discovering valid scitokens
Function is_valid_token
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def is_valid_token(
token,
audience,
scope,
issuer=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 request
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def request(
Function find_token
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def find_token(
audience,
scope,
issuer=None,
timeleft=600,
- 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 _prepare_auth
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def _prepare_auth(
Function __init__
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function _find_tokens
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _find_tokens(**deserialize_kwargs):
"""Yield all tokens that we can find
This function will `yield` exceptions that are raised when
attempting to parse a token that was actually found, so that
- 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 linkcode_resolve
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def linkcode_resolve(domain, info):
"""Determine the URL corresponding to Python object
This code is stolen with thanks from the scipy team.
"""
- 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 find_token
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def find_token(
Function find_credentials
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def find_credentials(timeleft=600):
"""Locate X509 certificate and (optionally) private key files.
This function checks the following paths in order:
- 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 is_valid_token
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def is_valid_token(
Function request
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def request(method, url, *args, session=None, **kwargs):