Function download
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def download(
url: str,
path: str,
verify_ssl: bool = True,
timeout: float = 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 __getattr__
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def __getattr__(self, name):
method = requests.__dict__.get(name.lower())
if not method:
return method
- 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 download
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def download(
Function download_github_artifact
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def download_github_artifact(url: str, target_file: str, timeout: int = None):
"""Download file from main URL or fallback URL (to avoid firewall errors if github.com is blocked).
Optionally allows to define a timeout in seconds."""
def do_download(
- 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 parse_request_data
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def parse_request_data(method: str, path: str, data=None, headers=None) -> Dict:
"""Extract request data either from query string as well as request body (e.g., for POST)."""
result = {}
headers = headers or {}
content_type = headers.get("Content-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"