alexandrebarachant/pyRiemann

View on GitHub

Showing 137 of 184 total issues

Function _rejection_sampling_2D has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

def _rejection_sampling_2D(n_samples, sigma, random_state=None,
                           return_acceptance_rate=False):
    """Rejection sampling algorithm for the 2D case.

    Implementation of a rejection sampling algorithm. The implementation
Severity: Minor
Found in pyriemann/datasets/sampling.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 _fit_single has 9 arguments (exceeds 4 allowed). Consider refactoring.
Open

def _fit_single(X, y=None, n_clusters=2, init="random", random_state=None,
Severity: Major
Found in pyriemann/clustering.py - About 1 hr to fix

    Function plot_potato_2D has 9 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def plot_potato_2D(ax, cax, X, Y, p_zscores, p_center, covs, p_colors, clabel):
    Severity: Major
    Found in examples/artifacts/plot_detect_riemannian_potato_EEG.py - About 1 hr to fix

      Function get_results has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      def get_results(X, y, all_ppl):
          results = []
          le = LabelEncoder()
          y_ = le.fit_transform(y)
          cv = StratifiedKFold(5, shuffle=True, random_state=42)
      Severity: Minor
      Found in examples/motor-imagery/helpers/coherence_helpers.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 make_classification_transfer has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def make_classification_transfer(n_matrices, class_sep=3.0, class_disp=1.0,
      Severity: Major
      Found in pyriemann/datasets/simulated.py - About 1 hr to fix

        Function _run_minimization has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def _run_minimization(Q_ini, M_source, M_target, weights=None, metric='euclid',
        Severity: Major
        Found in pyriemann/transfer/_rotate.py - About 1 hr to fix

          Function _get_filtered_cov has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def _get_filtered_cov(raw, picks, event_id, fmin, fmax, tmin, tmax, verbose):
          Severity: Major
          Found in examples/motor-imagery/helpers/frequencybandselection_helpers.py - About 1 hr to fix

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

                def __init__(self, n_clusters=2, max_iter=100, metric="riemann",
            Severity: Major
            Found in pyriemann/clustering.py - About 1 hr to fix

              Function make_matrices has 8 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def make_matrices(n_matrices, n_dim, kind, rs=None, return_params=False,
              Severity: Major
              Found in pyriemann/datasets/simulated.py - About 1 hr to fix

                Function mean_riemann has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                def mean_riemann(X=None, tol=10e-9, maxiter=50, init=None, sample_weight=None,
                                 covmats=None):
                    r"""Mean of SPD/HPD matrices according to the Riemannian metric.
                
                    The affine-invariant Riemannian mean minimizes the sum of squared
                Severity: Minor
                Found in pyriemann/utils/mean.py - About 55 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_alm has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                def mean_alm(X=None, tol=1e-14, maxiter=100, sample_weight=None, covmats=None):
                    r"""Ando-Li-Mathias (ALM) mean of SPD/HPD matrices.
                
                    Return the geometric mean recursively [1]_, generalizing from:
                
                
                Severity: Minor
                Found in pyriemann/utils/mean.py - About 55 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 _run_minimization has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                def _run_minimization(Q_ini, M_source, M_target, weights=None, metric='euclid',
                                      tol_step=1e-9, maxiter=10_000, maxiter_linesearch=32):
                
                    Q_1 = Q_ini
                
                
                Severity: Minor
                Found in pyriemann/transfer/_rotate.py - About 55 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 9 (exceeds 5 allowed). Consider refactoring.
                Open

                    def fit(self, X, y=None):
                        """Fit (estimates) the clusters.
                
                        Parameters
                        ----------
                Severity: Minor
                Found in pyriemann/clustering.py - About 55 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 make_node has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                    def make_node(self, name, issue_no, config, options=None):
                        name_map = {"pr": "pull", "issue": "issues", "commit": "commit"}
                        options = options or {}
                        repo_match = self.EXTERNAL_REPO_REGEX.match(issue_no)
                        if repo_match:  # External repo
                Severity: Minor
                Found in doc/sphinxext/sphinx_issues.py - About 55 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_riemann has 7 arguments (exceeds 4 allowed). Consider refactoring.
                Open

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

                  Function user_role has 7 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  def user_role(name, rawtext, text, lineno, inliner, options=None, content=None):
                  Severity: Major
                  Found in doc/sphinxext/sphinx_issues.py - About 50 mins to fix

                    Function __call__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def __call__(
                    Severity: Major
                    Found in doc/sphinxext/sphinx_issues.py - About 50 mins to fix

                      Function coherence has 7 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

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

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

                            def __init__(self, n_potatoes=1, p_threshold=0.01, z_threshold=3,
                        Severity: Major
                        Found in pyriemann/clustering.py - About 50 mins to fix

                          Function mean_power has 7 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          def mean_power(X=None, p=None, *, sample_weight=None, zeta=10e-10, maxiter=100,
                          Severity: Major
                          Found in pyriemann/utils/mean.py - About 50 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language