Showing 90 of 176 total issues
Function plot_polarbar
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_polarbar(scores, labels=None, labels_size=15, colors="default", distribution_means=None, distribution_sds=None, treshold=1.28, fig_size=(15, 15)):
Function emg_process
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def emg_process(emg, sampling_rate=1000, emg_names=None, envelope_freqs=[10, 400], envelope_lfreq=4, activation_treshold="default", activation_n_above=0.25, activation_n_below=1):
Function find_closest_in_list
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def find_closest_in_list(number, array, direction="both", strictly=False):
"""
Find the closest number in the array from x.
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 ecg_wave_detector
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def ecg_wave_detector(ecg, rpeaks):
"""
Returns the localization of the P, Q, T waves. This function needs massive help!
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 eeg_to_all_evokeds
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def eeg_to_all_evokeds(all_epochs, conditions=None):
"""
Convert all_epochs to all_evokeds.
DOCS INCOMPLETE :(
- 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 ecg_preprocess
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def ecg_preprocess(ecg, sampling_rate=1000, filter_type="FIR", filter_band="bandpass", filter_frequency=[3, 45], filter_order=0.3, segmenter="hamilton"):
Function eeg_psd
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def eeg_psd(raw, sensors_include="all", sensors_exclude=None, fmin=0.016, fmax=60, method="multitaper", proj=False):
Function read_acqknowledge
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def read_acqknowledge(filename, path="", index="datetime", sampling_rate="max", resampling_method="pad", fill_interruptions=True, return_sampling_rate=True):
Function eda_process
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def eda_process(eda, sampling_rate=1000, alpha=8e-4, gamma=1e-2, filter_type = "butter", scr_method="makowski", scr_treshold=0.1):
Function eeg_gfp_peaks
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def eeg_gfp_peaks(data, gflp_method='GFPL1', smoothing=False, smoothing_window=100, peak_method="wavelet", normalize=False):
Avoid deeply nested control flow statements. Open
if key in complexity_features[epoch_index].keys():
complexity_features[epoch_index][key].append(feature)
else:
complexity_features[epoch_index][key] = [feature]
Function complexity_entropy_shannon
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def complexity_entropy_shannon(signal):
"""
Computes the shannon entropy. Copied from the `pyEntropy <https://github.com/nikdon/pyEntropy>`_ repo by tjugo.
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 eeg_to_df
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def eeg_to_df(eeg, index=None, include="all", exclude=None, hemisphere="both", central=True):
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, signal=[0, 100], treshold=0.50, burn=5, stop_n_inversions=False, prior_signal=[], prior_response=[]):
Avoid deeply nested control flow statements. Open
if isinstance(hrv[key], float): # Avoid storing series or dataframes
ECG_Response["ECG_HRV_" + key + "_Baseline"] = hrv[key]
# Compute differences between features and baseline
keys = [key for key in ECG_Response.keys() if '_Baseline' in key] # Find keys
Function ecg_process
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def ecg_process(ecg, rsp=None, sampling_rate=1000, filter_type="FIR", filter_band="bandpass", filter_frequency=[3, 45], segmenter="hamilton", quality_model="default", hrv_features=["time", "frequency"], age=None, sex=None, position=None):
"""
Automated processing of ECG and RSP signals.
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 eeg_add_channel
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def eeg_add_channel(raw, channel, sync_index_eeg=0, sync_index_channel=0, channel_type=None, channel_name=None):
Function ecg_signal_quality
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def ecg_signal_quality(cardiac_cycles, sampling_rate, rpeaks=None, quality_model="default"):
"""
Attempt to find the recording lead and the overall and individual quality of heartbeats signal. Although used as a routine, this feature is experimental.
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 save_nk_object
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def save_nk_object(obj, filename="file", path="", extension="nk", compress=False, compatibility=-1):
Function find_following_duplicates
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def find_following_duplicates(array):
"""
Find the duplicates that are following themselves.
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"