Showing 42 of 44 total issues
File config.py
has 687 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python3
# thamos
# Copyright(C) 2018 - 2021 Fridolin Pokorny
#
# This program is free software: you can redistribute it and / or modify
- Create a ticketCreate a ticket
Function discover_cudnn_version
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def discover_cudnn_version() -> Optional[str]:
"""Discover CuDNN version and return None if not found."""
result = run_command("nvcc --version", raise_on_error=False)
if result.return_code != 0:
- Read upRead up
- Create a ticketCreate a ticket
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 advise
has 27 arguments (exceeds 4 allowed). Consider refactoring. Open
def advise(
- Create a ticketCreate a ticket
Function advise_here
has 23 arguments (exceeds 4 allowed). Consider refactoring. Open
def advise_here(
- Create a ticketCreate a ticket
Function advise_using_config
has 22 arguments (exceeds 4 allowed). Consider refactoring. Open
def advise_using_config(
- Create a ticketCreate a ticket
Function _print_report
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def _print_report(
report: list,
*,
json_output: bool = False,
title: Optional[str] = None,
- Read upRead up
- Create a ticketCreate a ticket
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_runtime_environment
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def get_runtime_environment(self, name: Optional[str] = None) -> Dict[str, Any]:
"""Get runtime environment, retrieve the first runtime environment (the default one) if no name is provided."""
content = self.content
if "runtime_environments" not in content:
raise NoRuntimeEnvironmentError(
- Read upRead up
- Create a ticketCreate a ticket
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 discover.py
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python3
# thamos
# Copyright(C) 2018 - 2021 Fridolin Pokorny
#
# This program is free software: you can redistribute it and / or modify
- Create a ticketCreate a ticket
Function _compute_metrics_scorecards
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def _compute_metrics_scorecards(report) -> Optional[OrderedDict]:
"""Aggregate OSSF Scorecards information from report and compute metrics."""
nb_dependencies = 0
scorecards_metrics = {}
- Read upRead up
- Create a ticketCreate a ticket
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 discover_cpu
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Confirmed
def discover_cpu() -> Dict[str, Union[str, int, None]]:
"""Discover CPU model, model name and family."""
result = {
"cpu_family": None,
"cpu_model": None,
- Read upRead up
- Create a ticketCreate a ticket
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 advise
has 16 arguments (exceeds 4 allowed). Consider refactoring. Open
def advise(
- Create a ticketCreate a ticket
Function build_analysis
has 16 arguments (exceeds 4 allowed). Consider refactoring. Open
def build_analysis(
- Create a ticketCreate a ticket
Function provenance_check
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
def provenance_check(
- Create a ticketCreate a ticket
Function image_analysis
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def image_analysis(
- Create a ticketCreate a ticket
Function list_thoth_container_images
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def list_thoth_container_images(
- Create a ticketCreate a ticket
Function images
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def images(
- Create a ticketCreate a ticket
Function provenance_check_here
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def provenance_check_here(
- Create a ticketCreate a ticket
Function run
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def run(
command: typing.List[str],
runtime_environment: Optional[str] = None,
no_pedantic: bool = False,
) -> None: # noqa: D412
- Read upRead up
- Create a ticketCreate a ticket
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_default_config
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_default_config(
self, template: Optional[str] = None, nowrite: bool = False
) -> Optional[dict]:
"""Place default configuration into the current directory."""
if not os.path.isdir(".git"):
- Create a ticketCreate a ticket
Function _parse_labels
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _parse_labels(label: Optional[str]) -> Optional[Dict[str, str]]:
"""Parse labels from their string representation."""
if not label:
return None
- Read upRead up
- Create a ticketCreate a ticket
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"