Showing 96 of 249 total issues
Function fit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def fit(self, X, y=None, noise_std=0.1):
"""Fit detector. y is ignored in unsupervised methods.
Parameters
----------
X : numpy array of shape (n_samples, n_features)
- 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_consistent_shape
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def check_consistent_shape(X_train, y_train, X_test, y_test, y_train_pred,
Avoid deeply nested control flow statements. Open
with torch.no_grad():
fake_data = names['sub_generator' + str(i)](
names['noise' + str(i)])
fake_outputs = self.discriminator(fake_data)
generator_loss = criterion(fake_outputs,
Function fit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def fit(self, X, y=None):
"""Fit detector. y is ignored in unsupervised methods.
Parameters
----------
- 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 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, in_channels, out_channels,
Function decision_function
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def decision_function(self, X):
"""Predict raw anomaly score of X using the fitted detector.
The anomaly score of an input sample is computed based on different
detector algorithms. For consistency, outliers are assigned with
- 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 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, latent_dim_G, n_features, G_layers, dropout_rate,
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function _calculate_outlier_scores
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _calculate_outlier_scores(X, bin_edges, hist, n_bins, alpha,
Function explain_outlier
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def explain_outlier(self, ind, columns=None, cutoffs=None,
Function fit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def fit(self, X, y=None):
"""Fit detector. y is ignored in unsupervised methods.
Parameters
----------
- 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 fit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def fit(self, X, y=None):
"""Fit detector. y is ignored in unsupervised methods.
Parameters
----------
- 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 vae_loss
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def vae_loss(x, x_recon, z_mu, z_logvar, beta=1.0, capacity=0.0):
Function _calculate_outlier_scores_auto
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _calculate_outlier_scores_auto(X, bin_edges, hist, alpha,
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self,
Function process_sub
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def process_sub(subspace, gm, median, scaler1, scaler2):
Function train_and_test
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def train_and_test(model, train_loader, test_loader, epochs, device):
Function rod_3D
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def rod_3D(x, gm=None, median=None, scaler1=None, scaler2=None):
Function get_in_out_channels
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_in_out_channels(i, num_layers, n_features, n_hidden, n_output,
Function input_batch_generation_sup_sparse
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def input_batch_generation_sup_sparse(x_train, outlier_indices, inlier_indices,