Showing 113 of 113 total issues
Function remove_prefix_suffix
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def remove_prefix_suffix(
x: str, prefix: Union[str, List[str]], suffix: Union[str, List[str]]
) -> str:
"""
Remove the prefix and suffix from a string,
- 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 deeply nested control flow statements. Open
Open
if case in file:
os.chdir(os.path.join(path_to_train, folder))
source = file
destination = os.path.join(path_to_test, folder)
shutil.move(source, destination)
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(
Function register
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def register(
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(
Function tile_slices
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def tile_slices(img_paths, save_path="", fname=None, slice_inds=None, col_titles=None):
Function build_dataset
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def build_dataset(
Function train_step
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def train_step(grid, weights, optimizer, mov, fix) -> object:
Function build_checkpoint_callback
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def build_checkpoint_callback(
Function gif_tile_slices
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def gif_tile_slices(img_paths, save_path=None, size=(2, 2), fname=None, interval=50):
Function build_output_block
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def build_output_block(
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(
Function build_output_block
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def build_output_block(
Function move_files_into_correct_path
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def move_files_into_correct_path(
Function gen_rand_ddf
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def gen_rand_ddf(
Function build_output_block
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def build_output_block(
Function build_config
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def build_config(
Function validate_images_and_labels
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def validate_images_and_labels(
Function deconv_output_padding
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def deconv_output_padding(
Function move_files_into_correct_path
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def move_files_into_correct_path(