Showing 95 of 134 total issues
Function to_flat_dict
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def to_flat_dict(
data: Any,
prefix: str | None = None,
separator: str = ".",
to_str: type[object] | tuple[type[object], ...] | None = 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 find_module_state_dict
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def find_module_state_dict(state_dict: dict | list | tuple, module_keys: set) -> dict:
r"""Tries to find automatically the part of the state dict related to
a module.
The user should specify the set of module's keys:
- 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_module_output_size
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def get_module_output_size(module: nn.Module) -> int:
r"""Gets the output size of a module.
This function works only for the module with a single output size.
- 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_module_input_size
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def get_module_input_size(module: nn.Module) -> int:
r"""Gets the input size of a module.
This function works only for the module with a single input size.
- 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 scheduled_profiler_with_tensorboard_trace
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def scheduled_profiler_with_tensorboard_trace(
Function find_tar_files
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def find_tar_files(path: Path, recursive: bool = True) -> tuple[Path, ...]:
r"""Finds the path of all the tar files in a given path.
This function does not check if a path is a symbolic link so be
careful if you are using a path with symbolic links.
- 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 _save
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _save(self, engine: BaseEngine) -> None:
r"""Saves the engine state dict in a PyTorch file.
Args:
----
- 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 __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function is_loss_decreasing
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def is_loss_decreasing(
Function is_loss_decreasing_with_adam
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def is_loss_decreasing_with_adam(
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function trunc_normal
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def trunc_normal(
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function is_loss_decreasing_with_sgd
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def is_loss_decreasing_with_sgd(
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function asinh_barron_robust_loss
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def asinh_barron_robust_loss(
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(