Showing 491 of 903 total issues
Function "decode_swap_8" has 8 parameters, which is greater than the 7 authorized. Open
def decode_swap_8(inp, out, idx, native_dtype, rr, origin, shape, ds_shape):
- Read upRead up
- Exclude checks
A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.
Noncompliant Code Example
With a maximum number of 4 parameters:
def do_something(param1, param2, param3, param4, param5): ...
Compliant Solution
def do_something(param1, param2, param3, param4): ...
Method "__init__" has 15 parameters, which is greater than the 7 authorized. Open
def __init__(self, tileshape=None, num_partitions=None, data=None, sig_dims=None,
check_cast=True, tiledelay=None, datashape=None, base_shape=None,
force_need_decode=False, io_backend=None,
nav_shape=None, sig_shape=None, sync_offset=0, array_backends=None):
- Read upRead up
- Exclude checks
A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.
Noncompliant Code Example
With a maximum number of 4 parameters:
def do_something(param1, param2, param3, param4, param5): ...
Compliant Solution
def do_something(param1, param2, param3, param4): ...
Method "fastmatch" has 8 parameters, which is greater than the 7 authorized. Open
def fastmatch(self, centers, zero, a, b, refineds=None, peak_values=None, peak_elevations=None):
- Read upRead up
- Exclude checks
A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.
Noncompliant Code Example
With a maximum number of 4 parameters:
def do_something(param1, param2, param3, param4, param5): ...
Compliant Solution
def do_something(param1, param2, param3, param4): ...
Function "run" has 11 parameters, which is greater than the 7 authorized. Open
host, port, browser, local_directory, numeric_level,
token, preload, strict_port, executor_spec, open_ds,
snooze_timeout: Optional[float] = None,
- Read upRead up
- Exclude checks
A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.
Noncompliant Code Example
With a maximum number of 4 parameters:
def do_something(param1, param2, param3, param4, param5): ...
Compliant Solution
def do_something(param1, param2, param3, param4): ...
Refactor this function to reduce its Cognitive Complexity from 29 to the 15 allowed. Open
def _read_metadata(cls, path, use_ds=None):
- Read upRead up
- Exclude checks
Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.
See
Method "__init__" has 8 parameters, which is greater than the 7 authorized. Open
def __init__(self, path, tileshape=None, endianess='<', nav_shape=None,
sig_shape=None, sync_offset=0, io_backend=None):
- Read upRead up
- Exclude checks
A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.
Noncompliant Code Example
With a maximum number of 4 parameters:
def do_something(param1, param2, param3, param4, param5): ...
Compliant Solution
def do_something(param1, param2, param3, param4): ...
Function "merge_ndarray" has 8 parameters, which is greater than the 7 authorized. Open
def merge_ndarray(dest_n, dest_sum, dest_varsum, src_n, src_sum, src_varsum, src_mean, forbuf):
- Read upRead up
- Exclude checks
A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.
Noncompliant Code Example
With a maximum number of 4 parameters:
def do_something(param1, param2, param3, param4, param5): ...
Compliant Solution
def do_something(param1, param2, param3, param4): ...
Function "merge_single" has 8 parameters, which is greater than the 7 authorized. Open
def merge_single(n, n_0, sum_0, varsum_0, n_1, sum_1, varsum_1, mean_1):
- Read upRead up
- Exclude checks
A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.
Noncompliant Code Example
With a maximum number of 4 parameters:
def do_something(param1, param2, param3, param4, param5): ...
Compliant Solution
def do_something(param1, param2, param3, param4): ...
Method "__init__" has 10 parameters, which is greater than the 7 authorized. Open
def __init__(self, mask_factories, use_torch=True, use_sparse=None, mask_count=None,
mask_dtype=None, preferred_dtype=None, backends=None, shifts=None, **kwargs):
- Read upRead up
- Exclude checks
A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.
Noncompliant Code Example
With a maximum number of 4 parameters:
def do_something(param1, param2, param3, param4, param5): ...
Compliant Solution
def do_something(param1, param2, param3, param4): ...
Refactor this function to reduce its Cognitive Complexity from 18 to the 15 allowed. Open
def process_tile(tile, n_0, sum_inout, varsum_inout):
- Read upRead up
- Exclude checks
Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.
See
Function "run_analysis_crystall" has 8 parameters, which is greater than the 7 authorized. Open
def run_analysis_crystall(ctx, dataset, rad_in, rad_out, real_center=None, real_rad=None, roi=None,
progress=False):
- Read upRead up
- Exclude checks
A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.
Noncompliant Code Example
With a maximum number of 4 parameters:
def do_something(param1, param2, param3, param4, param5): ...
Compliant Solution
def do_something(param1, param2, param3, param4): ...