Showing 398 of 455 total issues
Function __init__
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(
self,
n_features,
n_layers,
d_model,
Function forward
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def forward(self, x):
x = x.unsqueeze(-2)
for i in range(self.num_stage):
B, M, D, N = x.shape
- 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 future_multi_mixing
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def future_multi_mixing(self, B, enc_out_list, x_list):
dec_out_list = []
if self.channel_independence == 1:
x_list = x_list[0]
for i, enc_out in zip(range(len(x_list)), enc_out_list):
- 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_prior
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _init_prior(self, device="cpu"):
# Compute kernel matrices for each latent dimension
kernel_matrices = []
for i in range(self.kernel_scales):
if self.kernel == "rbf":
- 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_dict_into_h5
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def save_dict_into_h5(
data_dict: dict,
saving_path: str,
file_name: Optional[str] = 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 run
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def run(self):
"""Execute the given command."""
# run checks first
self.checkup()
- 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 _check_array_input
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _check_array_input(
X: Union[np.ndarray, torch.Tensor],
X_ori: Optional[Union[np.ndarray, torch.Tensor]] = None,
X_pred: Optional[Union[np.ndarray, torch.Tensor]] = None,
y: Optional[Union[np.ndarray, torch.Tensor]] = 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 turn_data_into_specified_dtype
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def turn_data_into_specified_dtype(
data: Union[np.ndarray, torch.Tensor, list],
dtype: str = "tensor",
) -> Union[np.ndarray, torch.Tensor]:
"""Turn the given data into the specified data 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"
Further reading
Function _BTTF
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def _BTTF(
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function sample_factor_x
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def sample_factor_x(tau_sparse_tensor, tau_ind, time_lags, U, V, X, A, Lambda_x):
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function get_conv1d
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_conv1d(in_channels, out_channels, kernel_size, stride, padding, dilation, groups, bias):
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function conv_bn
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def conv_bn(
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(