Showing 95 of 134 total issues
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(
Function create_linspace_scale
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def create_linspace_scale(
Function is_loss_decreasing_with_sgd
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def is_loss_decreasing_with_sgd(
Function sync_reduce
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def sync_reduce(variable: Union[Tensor, int, float], op: str) -> Union[Tensor, int, float]:
r"""Synchronizes all the processes and then reduce the variable.
This function is a no-operation function if the distributed mode
is not activated. It returns the input. If the distributed mode
- 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 human_byte_size
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def human_byte_size(size: int, unit: str | None = None) -> str:
r"""Gets a human-readable representation of the byte size.
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
Avoid too many return
statements within this function. Open
Open
return get_module_input_size(module.self_attn)
Avoid too many return
statements within this function. Open
Open
return _get_sequential_output_size(module)
Avoid too many return
statements within this function. Open
Open
return get_module_output_size(module.self_attn)
Avoid too many return
statements within this function. Open
Open
return get_module_input_size(module[0])
Avoid too many return
statements within this function. Open
Open
return data.to(device)
Avoid too many return
statements within this function. Open
Open
return get_module_input_size(module.layers)
Avoid too many return
statements within this function. Open
Open
return module.embedding_dim
Avoid too many return
statements within this function. Open
Open
return module.embed_dim
Avoid too many return
statements within this function. Open
Open
return get_module_output_size(module[0])
Avoid too many return
statements within this function. Open
Open
return module.embed_dim
Avoid too many return
statements within this function. Open
Open
return get_module_output_size(module.layers)