wafo-project/pywafo

View on GitHub

Showing 153 of 6,500 total issues

Function test_func has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def test_func():
    from scipy import interpolate
    import matplotlib.pyplot as plt
    import matplotlib
    matplotlib.interactive(False)
Severity: Minor
Found in src/wafo/interpolate.py - About 1 hr to fix

    Function _deep_water_disufq has 12 arguments (exceeds 7 allowed). Consider refactoring.
    Open

    def _deep_water_disufq(rvec, ivec, rA, iA, w, kw, h, g, nmin, nmax, m, n):
    Severity: Major
    Found in src/wafo/_misc_numba.py - About 1 hr to fix

      Function _finite_water_disufq has 12 arguments (exceeds 7 allowed). Consider refactoring.
      Open

      def _finite_water_disufq(rvec, ivec, rA, iA, w, kw, h, g, nmin, nmax, m, n):
      Severity: Major
      Found in src/wafo/_misc_numba.py - About 1 hr to fix

        Function tocovdata has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def tocovdata(self, timeseries):
                """
                Return auto covariance function from data.
        
                Return
        Severity: Minor
        Found in src/wafo/covariance/estimation.py - About 1 hr to fix

          Function sim has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def sim(self, ns=None, cases=1, dt=None, iseed=None, derivative=False):
                  '''
                  Simulates a Gaussian process and its derivative from ACF
          
                  Parameters
          Severity: Minor
          Found in src/wafo/covariance/core.py - About 1 hr to fix

            Function _init_spec has a Cognitive Complexity of 20 (exceeds 15 allowed). Consider refactoring.
            Open

                def _init_spec(self):
                    """ Initialize swell and wind part of Torsethaugen spectrum
                    """
                    monitor = 0
                    Hm0 = self.Hm0
            Severity: Minor
            Found in src/wafo/spectrum/models.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 setlabels has a Cognitive Complexity of 20 (exceeds 15 allowed). Consider refactoring.
            Open

                def setlabels(self):
                    ''' Set automatic title, x-,y- and z- labels on SPECDATA object
            
                        based on type, angletype, freqtype
                    '''
            Severity: Minor
            Found in src/wafo/spectrum/core.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 sim has a Cognitive Complexity of 20 (exceeds 15 allowed). Consider refactoring.
            Open

                def sim(self, ns=None, cases=1, dt=None, iseed=None, derivative=False):
                    '''
                    Simulates a Gaussian process and its derivative from ACF
            
                    Parameters
            Severity: Minor
            Found in src/wafo/covariance/core.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 findpeaks has a Cognitive Complexity of 20 (exceeds 15 allowed). Consider refactoring.
            Open

            def findpeaks(data, n=2, min_h=None, min_p=0.0):
                '''
                Find peaks of vector or matrix possibly rainflow filtered
            
                Parameters
            Severity: Minor
            Found in src/wafo/misc.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 setlabels has a Cognitive Complexity of 20 (exceeds 15 allowed). Consider refactoring.
            Open

                def setlabels(self):
                    ''' Set automatic title, x-,y- and z- labels on SPECDATA object
            
                        based on type, angletype, freqtype
                    '''
            Severity: Minor
            Found in src/wafo/spectrum/core.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 padefitlsq has a Cognitive Complexity of 20 (exceeds 15 allowed). Consider refactoring.
            Open

            def padefitlsq(fun, m, k, a=-1, b=1, trace=False, x=None, end_points=True):
                """
                Rational polynomial fitting. A minimax solution by least squares.
            
                Parameters
            Severity: Minor
            Found in src/wafo/polynomial.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 dispersion_idx has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            def dispersion_idx(
                data, t=None, u=None, umin=None, umax=None, nu=None, nmin=10, tb=1,
                    alpha=0.05, plotflag=False):
                """Return Dispersion Index vs threshold
            
            
            Severity: Minor
            Found in src/wafo/stats/core.py - About 1 hr to fix

              Function _covinput_mmt_pdf has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def _covinput_mmt_pdf(BIG, R, tn, ts, tnold=-1):
                      """
                      COVINPUT Sets up the covariance matrix
              
                       CALL BIG = covinput(BIG, R0,R1,R2,R3,R4,tn,ts)
              Severity: Minor
              Found in src/wafo/spectrum/core.py - About 1 hr to fix

                Function example_dct2 has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                def example_dct2(debug=True):
                    """
                    Examples
                    --------
                    >>> import numpy as np
                Severity: Minor
                Found in src/wafo/dctpack.py - About 1 hr to fix

                  Function _fitstart has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def _fitstart(self, data):
                          # We follow McCullock 1986 method - Simple Consistent Estimators
                          # of Stable Distribution Parameters
                  
                          # Table III and IV
                  Severity: Minor
                  Found in src/wafo/stats/_continuous_distns.py - About 1 hr to fix

                    Function main has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    def main():
                        import matplotlib
                        matplotlib.interactive(True)
                        from wafo.spectrum import models as sm
                    
                    
                    Severity: Minor
                    Found in src/wafo/spectrum/core.py - About 1 hr to fix

                      Function to_mm_pdf has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          def to_mm_pdf(self, paramt=None, paramu=None, utc=None, nit=2, EPS=5e-5,
                                        EPSS=1e-6, C=4.5, EPS0=1e-5, IAC=1, ISQ=0, verbose=False):
                              '''
                              nit    = order of numerical integration: 0,1,2,3,4,5.
                              paramu = parameter vector defining discretization of min/max values.
                      Severity: Minor
                      Found in src/wafo/spectrum/core.py - About 1 hr to fix

                        Function demo_monoticity has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        def demo_monoticity():
                            # Step function test...
                            import matplotlib.pyplot as plt
                            plt.figure(2)
                            plt.title("pchip() step function test")
                        Severity: Minor
                        Found in src/wafo/interpolate.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

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

                                def __init__(self, Hm0=7.0, Tp=11.0, gamma=None, sigmaA=0.07, sigmaB=0.09,
                            Severity: Major
                            Found in src/wafo/spectrum/models.py - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language