wafo-project/pywafo

View on GitHub

Showing 153 of 6,500 total issues

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

    def __init__(self, f, g, dg=None, a=-1, b=1, basis=chebyshev_basis, s=15,
Severity: Major
Found in src/wafo/integrate_oscillating.py - About 1 hr to fix

    Function to_mm_pdf has 11 arguments (exceeds 7 allowed). Consider refactoring.
    Open

        def to_mm_pdf(self, paramt=None, paramu=None, utc=None, nit=2, EPS=5e-5,
    Severity: Major
    Found in src/wafo/spectrum/core.py - About 1 hr to fix

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

          def __init__(self, type='cos-2s', theta0=0,  # @ReservedAssignment
      Severity: Major
      Found in src/wafo/spectrum/models.py - About 1 hr to fix

        Consider simplifying this complex logical expression.
        Open

                        if (((z0 == +1) and cmp1(yi, fmi))
                                or ((z0 == -1) and cmp2(yi, fpi))):
                            z1 = -1
                        elif (((z0 == +1) and cmp2(fmi, yi)) or
                                ((z0 == -1) and cmp1(fpi, yi))):
        Severity: Major
        Found in src/wafo/_misc_numba.py - About 1 hr to fix

          Function _findrfc5_astm has a Cognitive Complexity of 19 (exceeds 15 allowed). Consider refactoring.
          Open

          def _findrfc5_astm(array_ext, array_t, a, t, array_out):
              """
              Rain flow with time analysis
          
              returns
          Severity: Minor
          Found in src/wafo/_misc_numba.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 _findrfc3_astm has a Cognitive Complexity of 19 (exceeds 15 allowed). Consider refactoring.
          Open

          def _findrfc3_astm(array_ext, a, array_out):
              """
              Rain flow without time analysis
          
              Return [ampl ampl_mean nr_of_cycle]
          Severity: Minor
          Found in src/wafo/_misc_numba.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 prbnorm2d has a Cognitive Complexity of 19 (exceeds 15 allowed). Consider refactoring.
          Open

          def prbnorm2d(a, b, r):
              """
              Returns Bivariate Normal probability
          
              Parameters
          Severity: Minor
          Found in src/wafo/gaussian.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 sim has a Cognitive Complexity of 19 (exceeds 15 allowed). Consider refactoring.
          Open

              def sim(self, ns=None, cases=1, dt=None, iseed=None, method='random',
                      derivative=False):
                  ''' Simulates a Gaussian process and its derivative from spectrum
          
                  Parameters
          Severity: Minor
          Found in src/wafo/spectrum/core.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 disufq has 10 arguments (exceeds 7 allowed). Consider refactoring.
          Open

          def disufq(rA, iA, w, kw, h, g, nmin, nmax, m, n):
          Severity: Major
          Found in src/wafo/_misc_numba.py - About 50 mins to fix

            Function dispersion_idx has 10 arguments (exceeds 7 allowed). Consider refactoring.
            Open

            def dispersion_idx(
            Severity: Major
            Found in src/wafo/stats/core.py - About 50 mins to fix

              Function sim_nl has 10 arguments (exceeds 7 allowed). Consider refactoring.
              Open

                  def sim_nl(self, ns=None, cases=1, dt=None, iseed=None, method='random',
              Severity: Major
              Found in src/wafo/spectrum/core.py - About 50 mins to fix

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

                    def __init__(self, f, g, dg=None, a=-1, b=1, basis=chebyshev_basis, s=8,
                Severity: Major
                Found in src/wafo/integrate_oscillating.py - About 50 mins to fix

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

                      def __init__(self, f, g, dg=None, a=-1, b=1, basis=chebyshev_basis, s=1,
                  Severity: Major
                  Found in src/wafo/integrate_oscillating.py - About 50 mins to fix

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

                        def __init__(self, data, y, p=0, hs=None, kernel=None, alpha=0.0,
                    Severity: Major
                    Found in src/wafo/kdetools/kdetools.py - About 50 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              for i in range(1, Nx1):
                                                  J = IJ + i
                                                  pdf[:i, i, 0] += fxind[IJ:J].T * dt  # *CC
                                                  err[:i, i, 0] += err0[IJ + 1:J].T * dt2
                                                  terr[:i, i, 0] += terr0[IJ:J].T * dt
                      Severity: Major
                      Found in src/wafo/spectrum/core.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                if def_nr in [3, 4]:
                                                    if (Nx == 1):
                                                        # Joint density (TMd,TMm) given the Max and min
                                                        # Note the density is not scaled to unity
                                                        pdf[0, ts, tn] = fxind[0]  # *CC
                        Severity: Major
                        Found in src/wafo/spectrum/core.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                              if norm != 0:
                                                  PmM[j, :] = PmM[j, :] / norm
                                                  e[j] = e[j] / norm
                                              # end
                                          # end
                          Severity: Major
                          Found in src/wafo/markov.py - About 45 mins to fix

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

                                def __init__(self, pos=(0, 0, 0), sensortype='n', h=inf, g=9.81, rho=1028,
                            Severity: Major
                            Found in src/wafo/wave_theory/core.py - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                      for i in range(1, Nx1):
                                                          J = IJ + Nx1
                                                          pdf[1:Nx1, i, Ntd] += fxind[IJ:J].T  # %*CC
                                                          err[1:Nx1, i, Ntd] += err0[IJ:J].T
                                                          terr[1:Nx1, i, Ntd] += terr0[IJ:J].T
                              Severity: Major
                              Found in src/wafo/spectrum/core.py - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                    if normA[j] != 0:
                                                        AA[j, :] = AA[j, :] / normA[j]
                                                        e[j] = e[j] / normA[j]
                                                    # end if
                                                # end for
                                Severity: Major
                                Found in src/wafo/markov.py - About 45 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language