neurodata/mgcpy

View on GitHub

Showing 65 of 97 total issues

File indep_sim.py has 943 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import numpy as np


class _CheckInputs:
    """ Check if additional arguments are correct """
Severity: Major
Found in hyppo/sims/indep_sim.py - About 2 days to fix

    Function _2samp_rotate has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

    def _2samp_rotate(sim, x, y, p, degree=90, pow_type="samp"):
        angle = np.radians(degree)
        data = np.hstack([x, y])
        same_shape = [
            "joint_normal",
    Severity: Minor
    Found in hyppo/sims/ksample_sim.py - About 3 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

    File power_2samp.py has 285 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import numpy as np
    from math import ceil
    
    from scipy._lib._util import check_random_state, MapWrapper
    
    
    Severity: Minor
    Found in benchmarks/power_2samp.py - About 2 hrs to fix

      File ksample_sim.py has 254 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import numpy as np
      
      from .indep_sim import (
          linear,
          spiral,
      Severity: Minor
      Found in hyppo/sims/ksample_sim.py - About 2 hrs to fix

        Function power_2samp_sample has 12 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def power_2samp_sample(
        Severity: Major
        Found in benchmarks/power_2samp.py - About 1 hr to fix

          Function power_2samp_angle has 12 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def power_2samp_angle(
          Severity: Major
          Found in benchmarks/power_2samp.py - About 1 hr to fix

            Function power_2samp_dimension has 12 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def power_2samp_dimension(
            Severity: Major
            Found in benchmarks/power_2samp.py - About 1 hr to fix

              Function power has 12 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def power(
              Severity: Major
              Found in benchmarks/power_2samp.py - About 1 hr to fix

                Function _perm_test has 11 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def _perm_test(
                Severity: Major
                Found in benchmarks/power_2samp.py - About 1 hr to fix

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

                  def _linkcode_resolve(domain, info, package, url_fmt, revision):
                      """Determine a link to online source for a class/method/function
                      This is called by sphinx.ext.linkcode
                      An example with a long-untouched module that everyone has
                      >>> _linkcode_resolve('py', {'module': 'tty',
                  Severity: Minor
                  Found in docs/sphinxext/github_link.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 __init__ has 9 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def __init__(self, test, ksim, sim, n, p, noise, rngs, angle, trans):
                  Severity: Major
                  Found in benchmarks/power_2samp.py - About 1 hr to fix

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

                    def power_sample(
                    Severity: Major
                    Found in docs/tutorials/independence/power.py - About 1 hr to fix

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

                      def power_dim(
                      Severity: Major
                      Found in benchmarks/power.py - About 1 hr to fix

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

                        def power_3samp_epsweight(
                        Severity: Major
                        Found in benchmarks/power_3samp.py - About 1 hr to fix

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

                          def power(
                          Severity: Major
                          Found in benchmarks/power.py - About 1 hr to fix

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

                            def power(
                            Severity: Major
                            Found in docs/tutorials/independence/power.py - About 1 hr to fix

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

                              def power_dim(
                              Severity: Major
                              Found in docs/tutorials/independence/power.py - About 1 hr to fix

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

                                def power_sample(
                                Severity: Major
                                Found in benchmarks/power.py - About 1 hr to fix

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

                                  def _pearson_stat(distx, disty):  # pragma: no cover
                                      """Calculate the Pearson chi square stats"""
                                  
                                      n = distx.shape[0]
                                      S = np.zeros((n, n))
                                  Severity: Minor
                                  Found in hyppo/independence/hhg.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 _perm_test has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                  def _perm_test(
                                  Severity: Major
                                  Found in benchmarks/power.py - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language