alexandrebarachant/pyRiemann

View on GitHub

Showing 137 of 184 total issues

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

def nanmean_riemann(X=None, tol=10e-9, maxiter=100, init=None,
Severity: Minor
Found in pyriemann/utils/mean.py - About 45 mins to fix

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

    def ajd_pham(X, *, init=None, eps=1e-6, n_iter_max=20, sample_weight=None):
    Severity: Minor
    Found in pyriemann/utils/ajd.py - About 45 mins to fix

      Function _update_doc has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def _update_doc(self, olddoc):
              newdoc = ".. warning:: DEPRECATED"
              if self.extra:
                  newdoc = "%s: %s" % (newdoc, self.extra)
              if olddoc:
      Severity: Minor
      Found in pyriemann/utils/docs.py - About 45 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 fit has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def fit(self, X, y):
              """Fit.
      
              Estimate the prototyped responses for each class.
      
      
      Severity: Minor
      Found in pyriemann/estimation.py - About 45 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 plot_classifiers has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      def plot_classifiers(metric):
          figure = plt.figure(figsize=(12, 10))
          figure.suptitle(f"Compare classifiers with metric='{metric}'", fontsize=16)
          i = 1
      
      
      Severity: Minor
      Found in examples/simulated/plot_classifier_comparison.py - About 45 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 mean_logdet has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def mean_logdet(X=None, tol=10e-5, maxiter=50, init=None, sample_weight=None,
      Severity: Minor
      Found in pyriemann/utils/mean.py - About 45 mins to fix

        Function plot_cospectra has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        def plot_cospectra(X, freqs, *, ylabels=None, title="Cospectra"):
            """Plot cospectral matrices.
        
            Parameters
            ----------
        Severity: Minor
        Found in pyriemann/utils/viz.py - About 45 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 __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def __init__(self,
        Severity: Minor
        Found in pyriemann/stats.py - About 45 mins to fix

          Function online_detect has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          def online_detect(t):
              global time, sig, covs_visu
          
              # Online artifact detection
              rp_label = rpotato.predict(covs[np.newaxis, t])[0]
          Severity: Minor
          Found in examples/artifacts/plot_detect_riemannian_potato_EEG.py - About 45 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 median_euclid has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def median_euclid(X, *, tol=10e-6, maxiter=50, init=None, weights=None):
          Severity: Minor
          Found in pyriemann/utils/median.py - About 45 mins to fix

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

            def _sample_parameter_r(n_samples, n_dim, sigma,
            Severity: Minor
            Found in pyriemann/datasets/sampling.py - About 45 mins to fix

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

              def cross_spectrum(X, window=128, overlap=0.75, fmin=None, fmax=None, fs=None):
              Severity: Minor
              Found in pyriemann/utils/covariance.py - About 45 mins to fix

                Function uwedge has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                def uwedge(X, *, init=None, eps=1e-7, n_iter_max=100):
                    """Approximate joint diagonalization based on UWEDGE.
                
                    This is an implementation of the AJD algorithm [1]_ [2]_: uniformly
                    weighted exhaustive diagonalization using Gauss iterations (U-WEDGE).
                Severity: Minor
                Found in pyriemann/utils/ajd.py - About 45 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 barycenter_weights has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def barycenter_weights(X, Y, indices, metric="riemann", kernel=None, reg=1e-3):
                Severity: Minor
                Found in pyriemann/embedding.py - About 45 mins to fix

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

                      def __init__(self, window=128, overlap=0.75, fmin=None, fmax=None,
                  Severity: Minor
                  Found in pyriemann/estimation.py - About 45 mins to fix

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

                        def __init__(self, power_list=[-1, 0, 1], method_label="sum_means",
                    Severity: Minor
                    Found in pyriemann/classification.py - About 35 mins to fix

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

                      def filter_bandpass(signal, low_freq, high_freq, channels=None, method="iir"):
                      Severity: Minor
                      Found in examples/artifacts/plot_detect_riemannian_potato_field_EEG.py - About 35 mins to fix

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

                        def _grad(Q, X, Y, weights, metric='euclid'):
                        Severity: Minor
                        Found in pyriemann/transfer/_rotate.py - About 35 mins to fix

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

                              def __init__(self, window=128, overlap=0.75, fmin=None, fmax=None,
                          Severity: Minor
                          Found in pyriemann/estimation.py - About 35 mins to fix

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

                            def bandpass_filter(raw, l_freq, h_freq, method="iir", verbose=False):
                            Severity: Minor
                            Found in examples/SSVEP/helpers/ssvep_helpers.py - About 35 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language