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, type='cos-2s', theta0=0,  # @ReservedAssignment
Severity: Major
Found in src/wafo/spectrum/models.py - About 1 hr to fix

    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 __call__ has 11 arguments (exceeds 7 allowed). Consider refactoring.
      Open

          def __call__(self, fun, a, b, releps=1e-3, abseps=1e-3, alpha=0, beta=0,
      Severity: Major
      Found in src/wafo/integrate.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 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 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 _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 __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 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, 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

                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 __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 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

                      Avoid deeply nested control flow statements.
                      Open

                                              if (Nx == 1):  # % THEN
                                                  #  Joint density of (TMd,TMm),(Tdm,TMm) given
                                                  #  the max and the min.
                                                  #  Note that 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 (row) * nh + col < nfigspertile:
                                                if idx < nfigs:
                                                    figlft = int(
                                                        screenpos[0] + (col + 1) * hspc + col * figwid)
                                                    fighnd = wnds[idx]
                        Severity: Major
                        Found in src/wafo/fig.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

                            Avoid deeply nested control flow statements.
                            Open

                                                    for i in range(1, Nx1):
                                                        J = IJ + Nx1
                                                        pdf[1:Nx1, i, 0] += fxind[IJ:J].T * dt  # *CC
                                                        err[1:Nx1, i, 0] += err0[IJ:J].T * dt2
                                                        terr[1:Nx1, 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 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

                                Avoid deeply nested control flow statements.
                                Open

                                                    if nA == 1:
                                                        fx = NN / (1 - AA) * e
                                                    else:
                                                        # TODO CHECK this
                                                        fx = NN * np.linalg.solve((I - AA), e)[0]  # (I-AA)\e
                                Severity: Major
                                Found in src/wafo/markov.py - About 45 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language