neuropsychology/NeuroKit.py

View on GitHub

Showing 90 of 176 total issues

Function bio_EventRelated has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

def bio_EventRelated(epoch, event_length, window_post_ecg=0, window_post_rsp=4, window_post_eda=4, ecg_features=["Heart_Rate", "Cardiac_Phase", "RR_Interval", "RSA", "HRV"]):
Severity: Minor
Found in neurokit/bio/bio_meta.py - About 45 mins to fix

    Function create_epochs has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def create_epochs(data, events_onsets, sampling_rate=1000, duration=1, onset=0, index=None):
    Severity: Minor
    Found in neurokit/signal/epochs.py - About 45 mins to fix

      Function emg_find_activation has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def emg_find_activation(envelope, sampling_rate=1000, threshold=0, n_above=0.25, n_below=1):
      Severity: Minor
      Found in neurokit/bio/bio_emg.py - About 35 mins to fix

        Function eeg_microstates_features has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def eeg_microstates_features(results, method, ecg=True, nonlinearity=True, verbose=True):
        Severity: Minor
        Found in examples/UnderDev/eeg/eeg_microstates.py - About 35 mins to fix

          Function eeg_gfp has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def eeg_gfp(raws, gflp_method="GFPL1", scale=True, normalize=True, smoothing=None):
          Severity: Minor
          Found in examples/UnderDev/eeg/eeg_microstates.py - About 35 mins to fix

            Function eeg_select_electrodes has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def eeg_select_electrodes(eeg, include="all", exclude=None, hemisphere="both", central=True):
            Severity: Minor
            Found in neurokit/eeg/eeg_data.py - About 35 mins to fix

              Function segmenter_pekkanen has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def segmenter_pekkanen(ecg, sampling_rate, window_size=5.0, lfreq=5.0, hfreq=15.0):
              Severity: Minor
              Found in neurokit/bio/bio_ecg_preprocessing.py - About 35 mins to fix

                Function complexity_entropy_multiscale has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                def complexity_entropy_multiscale(signal, max_scale_factor=20, m=2, r="default"):
                    """
                    Computes the Multiscale Entropy. Uses sample entropy with 'chebychev' distance.
                
                    Parameters
                Severity: Minor
                Found in neurokit/signal/complexity.py - About 35 mins to fix

                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 localize_events has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                def localize_events(events_channel, treshold="auto", cut="higher", time_index=None):
                    """
                    Find the onsets of all events based on a continuous signal.
                
                    Parameters
                Severity: Minor
                Found in neurokit/signal/events.py - About 35 mins to fix

                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 a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                def eeg_to_df(eeg, index=None, include="all", exclude=None, hemisphere="both", central=True):
                    """
                    Convert mne Raw or Epochs object to dataframe or dict of dataframes.
                
                    DOCS INCOMPLETE :(
                Severity: Minor
                Found in neurokit/eeg/eeg_data.py - About 25 mins to fix

                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

                Severity
                Category
                Status
                Source
                Language