Function __str__
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
def __str__(self):
if type(self.y_flip) == tuple and type(self.weights) != tuple:
return "%s_%s_css%i_rs%i_nd%i_ln%i_%i_d%i_%i" % (
"gr" if self.incremental is False else "inc",
"n" if self.recurring is False else "r",
- 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 _make_classification
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
def _make_classification(self):
np.random.seed(self.random_state)
# Using concept with weights from the rows of a diagonal matrix
self.concepts = np.array(
[
- 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
File StreamGenerator.py
has 389 lines of code (exceeds 250 allowed). Consider refactoring. Open
import numpy as np
from scipy.stats import logistic
from sklearn.datasets import make_classification
import csv
Consider simplifying this complex logical expression. Open
if type(self.y_flip) == tuple and type(self.weights) != tuple:
return "%s_%s_css%i_rs%i_nd%i_ln%i_%i_d%i_%i" % (
"gr" if self.incremental is False else "inc",
"n" if self.recurring is False else "r",
999
Function __init__
has 16 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function _sigmoid
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _sigmoid(self, sigmoid_spacing, n_drifts):
period = (
int((self.n_samples) / (n_drifts)) if n_drifts > 0 else int(self.n_samples)
)
css = sigmoid_spacing if sigmoid_spacing is not None else 9999
- 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
return "%s_%s_css%i_rs%i_nd%i_ln%i_dd%s_%i" % (
Avoid too many return
statements within this function. Open
return "%s_%s_css%i_rs%i_nd%i_ln%i_%i_dd%s_%i" % (