neuropsychology/NeuroKit.py

View on GitHub

Showing 90 of 176 total issues

Function eeg_complexity has 23 arguments (exceeds 4 allowed). Consider refactoring.
Open

def eeg_complexity(eeg, sampling_rate, times=None, index=None, include="all", exclude=None, hemisphere="both", central=True, verbose=True, shannon=True, sampen=True, multiscale=True, spectral=True, svd=True, correlation=True, higushi=True, petrosian=True, fisher=True, hurst=True, dfa=True, lyap_r=False, lyap_e=False, names="Complexity"):
Severity: Major
Found in neurokit/eeg/eeg_complexity.py - About 2 hrs to fix

    Function eeg_microstates_clustering has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

    def eeg_microstates_clustering(data, n_microstates=4, clustering_method="kmeans", n_jobs=1, n_init=25, occurence_rejection_treshold=0.05, max_refitting=5, verbose=True):
        """
        Fit the clustering algorithm.
        """
        # Create training set
    Severity: Minor
    Found in examples/UnderDev/eeg/eeg_microstates.py - About 2 hrs 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_microstates has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

    def eeg_microstates(gfp, n_microstates=4, clustering_method="kmeans", n_jobs=1, n_init=25, occurence_rejection_treshold=0.05, max_refitting=5, clustering_metrics=True, good_fit_treshold=0, feature_reduction_method="PCA", n_features=32, nonlinearity=True, verbose=True):
        """
        Run the full microstates analysis.
    
        Parameters
    Severity: Minor
    Found in examples/UnderDev/eeg/eeg_microstates.py - About 2 hrs 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 rsp_find_cycles has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

    def rsp_find_cycles(signal):
        """
        Find Respiratory cycles onsets, durations and phases.
    
        Parameters
    Severity: Minor
    Found in neurokit/bio/bio_rsp.py - About 2 hrs 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 find_events has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

    def find_events(events_channel, treshold="auto", cut="higher", time_index=None, number="all", after=0, before=None, min_duration=1):
        """
        Find and select events based on a continuous signal.
    
        Parameters
    Severity: Minor
    Found in neurokit/signal/events.py - About 2 hrs 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 complexity has 20 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def complexity(signal, sampling_rate=1000, shannon=True, sampen=True, multiscale=True, spectral=True, svd=True, correlation=True, higushi=True, petrosian=True, fisher=True, hurst=True, dfa=True, lyap_r=False, lyap_e=False, emb_dim=2, tolerance="default", k_max=8, bands=None, tau=1):
    Severity: Major
    Found in neurokit/signal/complexity.py - About 2 hrs to fix

      Function eeg_microstates_plot has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

      def eeg_microstates_plot(method, path="", extension=".png", show_sensors_position=False, show_sensors_name=False, plot=True, save=True, dpi=150, contours=0, colorbar=False, separate=False):
          """
          Plot the microstates.
          """
          # Generate and store figures
      Severity: Minor
      Found in examples/UnderDev/eeg/eeg_microstates.py - About 2 hrs 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 eda_EventRelated has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

      def eda_EventRelated(epoch, event_length, window_post=4):
          """
          Extract event-related EDA and Skin Conductance Response (SCR).
      
          Parameters
      Severity: Minor
      Found in neurokit/bio/bio_eda.py - About 2 hrs 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_microstates_features has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

      def eeg_microstates_features(results, method, ecg=True, nonlinearity=True, verbose=True):
          """
          Compute statistics and features for/of the microstates.
          """
      
      
      Severity: Minor
      Found in examples/UnderDev/eeg/eeg_microstates.py - About 2 hrs 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 emg_process has a Cognitive Complexity of 16 (exceeds 5 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):
          """
          Automated processing of EMG signal.
      
          Parameters
      Severity: Minor
      Found in neurokit/bio/bio_emg.py - About 2 hrs 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 plot_eeg_erp has 16 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def plot_eeg_erp(all_epochs, conditions=None, times=None, include="all", exclude=None, hemisphere="both", central=True, name=None, colors=None, gfp=False, ci=0.95, ci_alpha=0.333, invert_y=False, linewidth=1, linestyle="-", filter_hfreq=None):
      Severity: Major
      Found in neurokit/eeg/eeg_erp.py - About 2 hrs to fix

        Function eeg_power_per_epoch has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        def eeg_power_per_epoch(epochs, include="all", exclude=None, hemisphere="both", include_central=True, frequency_bands="all", time_start=0, time_end="max", fill_bads="NA", print_progression=True):
            """
            """
        
        
        
        Severity: Minor
        Found in examples/UnderDev/eeg/eeg_time_frequency.py - About 1 hr 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_gfp has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        def eeg_gfp(raws, gflp_method="GFPL1", scale=True, normalize=True, smoothing=None):
            """
            Run the GFP analysis.
            """
        
        
        Severity: Minor
        Found in examples/UnderDev/eeg/eeg_microstates.py - About 1 hr 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_gfp_peaks has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        def eeg_gfp_peaks(data, gflp_method='GFPL1', smoothing=False, smoothing_window=100, peak_method="wavelet", normalize=False):
            """
            The Global Field Power (GFP) is a scalar measure of the strength of the scalp potential field and is calculated as the standard deviation of all electrodes at a given time point (Lehmann and Skrandies, 1980; Michel et al., 1993; Murray et al., 2008; Brunet et al., 2011). Between two GFP troughs, the strength of the potential field varies but the topography remains generally stable. The local maxima of the GFP are thus the best representative of a given microstate in terms of signal-to-noise ratio (Pascual-Marqui et al., 1995), corresponding to moments of high global neuronal synchronization (Skrandies, 2007).
        
            Parameters
        Severity: Minor
        Found in examples/UnderDev/eeg/eeg_microstates.py - About 1 hr 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 ecg_rsa has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        def ecg_rsa(rpeaks, rsp, sampling_rate=1000):
            """
            Returns Respiratory Sinus Arrhythmia (RSA) features. Only the Peak-to-trough (P2T) algorithm is currently implemented (see details).
        
            Parameters
        Severity: Minor
        Found in neurokit/bio/bio_ecg.py - About 1 hr 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 cvxEDA has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        def cvxEDA(eda, sampling_rate=1000, tau0=2., tau1=0.7, delta_knot=10., alpha=8e-4, gamma=1e-2, solver=None, verbose=False, options={'reltol':1e-9}):
            """
            A convex optimization approach to electrodermal activity processing (CVXEDA).
        
            This function implements the cvxEDA algorithm described in "cvxEDA: a
        Severity: Minor
        Found in neurokit/bio/bio_eda.py - About 1 hr to fix

          Function eeg_microstates has 13 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def eeg_microstates(gfp, n_microstates=4, clustering_method="kmeans", n_jobs=1, n_init=25, occurence_rejection_treshold=0.05, max_refitting=5, clustering_metrics=True, good_fit_treshold=0, feature_reduction_method="PCA", n_features=32, nonlinearity=True, verbose=True):
          Severity: Major
          Found in examples/UnderDev/eeg/eeg_microstates.py - About 1 hr to fix

            Function ecg_hrv_assessment has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

            def ecg_hrv_assessment(hrv, age=None, sex=None, position=None):
                """
                Correct HRV features based on normative data from Voss et al. (2015).
            
                Parameters
            Severity: Minor
            Found in neurokit/bio/bio_ecg.py - About 1 hr 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 eda_scr has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

            def eda_scr(signal, sampling_rate=1000, treshold=0.1, method="fast"):
                """
                Skin-Conductance Responses extraction algorithm.
            
                Parameters
            Severity: Minor
            Found in neurokit/bio/bio_eda.py - About 1 hr 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 binarize_signal has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

            def binarize_signal(signal, treshold="auto", cut="higher"):
                """
                Binarize a channel based on a continuous channel.
            
                Parameters
            Severity: Minor
            Found in neurokit/signal/events.py - About 1 hr 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