Showing 43 of 45 total issues
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function get_tensors
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_tensors(
Avoid deeply nested control flow statements. Open
for batch_idx, (data, target) in enumerate(val_dl):
# data, target = map(torch.Tensor, (data, target))
# data, target = data.double(), target.double()
data = data.to(device).float()
target = target.to(device).float()
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Avoid deeply nested control flow statements. Open
for batch_idx, (data, target) in enumerate(val_dl):
data = data.to(device).float()
target = target.to(device).float()
out = net(data)
loss = criterion(out, target)
Function eval_net
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def eval_net(
Function save_generation
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def save_generation(
Function split_dataset
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def split_dataset(
Function gen_supervised_sequence
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def gen_supervised_sequence(
Function progbar
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def progbar(curr, total, full_progbar, net_size, max_ep, lr):
Function prepare_dataset
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def prepare_dataset(
Function split_dataset
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def split_dataset(
Function create_population
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def create_population(
self,
gene_pool: dict,
pop_size: int
) -> List[dict]:
- 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 series_to_supervised
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def series_to_supervised(data, n_in=1, n_out=1, dropnan=True):
n_vars = 1 if type(data) is list else data.shape[1]
df = pd.DataFrame(data)
cols, names = list(), list()
# input seq. (t-n, ..., t-1)
- 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_many_to_one
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_many_to_one(
self,
lag: int=6
) -> (pd.DataFrame, pd.DataFrame):
"""
- 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 gen_hparam_set
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def gen_hparam_set(
src_dict: Dict[str, Union[List[object], object]]
) -> List[Dict[str, object]]:
"""
Generate a collection of hyperparameters for hyparam searching.
- 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 uni_visualize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def uni_visualize(
actual_val: np.ndarray,
pred_val: np.ndarray,
break_point: int,
dir: 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 __init__
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __init__(
self,
file_dir: Union[str, None] = None,
verbose: bool = False
) -> 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 evaluate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def evaluate(
self,
verbose: bool = False
) -> 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 save_generation
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def save_generation(
population: List[dict],
scores: list,
generation: int,
file_dir: str,
- 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"