wafo-project/pywafo

View on GitHub

Showing 153 of 6,500 total issues

Function _test_some_spectra has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def _test_some_spectra():
    S = Jonswap()

    w = np.linspace(0, 3.0)
    S(w) * phi1(w, 30.0)
Severity: Minor
Found in src/wafo/spectrum/models.py - About 1 hr to fix

    Function resample has a Cognitive Complexity of 24 (exceeds 15 allowed). Consider refactoring.
    Open

        def resample(self, dt=None, Nmin=0, Nmax=2 ** 13 + 1, method='stineman'):
            '''
            Interpolate and zero-padd spectrum to change Nyquist freq.
    
            Parameters
    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

    Consider simplifying this complex logical expression.
    Open

        if np.all(infin == 2):
            return (bvd(lower[0], lower[1], correl) -
                    bvd(upper[0], lower[1], correl) -
                    bvd(lower[0], upper[1], correl) +
                    bvd(upper[0], upper[1], correl))
    Severity: Critical
    Found in src/wafo/gaussian.py - About 1 hr to fix

      Function demo_tide_filter has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def demo_tide_filter():
          """
          Examples
          --------
          >>> demo_tide_filter()
      Severity: Minor
      Found in src/wafo/sg_filter/demos.py - About 1 hr to fix

        Function to_t_pdf has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def to_t_pdf(self, u=None, kind='Tc', paramt=None, **options):
                '''
                Density of crest/trough- period or length, version 2.
        
                Parameters
        Severity: Minor
        Found in src/wafo/spectrum/core.py - About 1 hr to fix

          Function __init__ has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def __init__(self, maxiter=500, accuracy=1e-6, alpha=0.05,
                           deletecolinear=True, verbose=False):
          
                  self.maxiter = maxiter
                  self.accuracy = accuracy
          Severity: Minor
          Found in src/wafo/stats/core.py - About 1 hr to fix

            Function to_mmt_pdf has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def to_mmt_pdf(self, paramt=None, paramu=None, utc=None, kind='mm',
                               verbose=False, **options):
                    ''' Returns joint density of Maximum, minimum and period.
            
                    Parameters
            Severity: Minor
            Found in src/wafo/spectrum/core.py - About 1 hr to fix

              Function sim has 38 lines of code (exceeds 25 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 1 hr to fix

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

                    def __init__(self, method='nonlinear', chkder=True, plotflag=False,
                Severity: Major
                Found in src/wafo/transform/estimation.py - About 1 hr to fix

                  Function plot_wave has a Cognitive Complexity of 22 (exceeds 15 allowed). Consider refactoring.
                  Open

                      def plot_wave(self, sym1='k.', ts=None, sym2='k+', nfig=None, nsub=None,
                                    sigma=None, vfact=3):
                          '''
                          Plots the surface elevation of timeseries.
                  
                  
                  Severity: Minor
                  Found in src/wafo/objects.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 main has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  def main():
                      exp = np.exp
                      [c1, c2] = padefitlsq(exp, 3, 3, 0, 2)
                  
                      x = np.linspace(0, 4)
                  Severity: Minor
                  Found in src/wafo/polynomial.py - About 1 hr to fix

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

                        def __init__(self, data, y, method='beta', a=0.05, b=0.05, p=0, hs_e=None,
                    Severity: Major
                    Found in src/wafo/kdetools/kdetools.py - About 1 hr to fix

                      Function _init_spec has 34 lines of code (exceeds 25 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

                        Function to_linspec has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            def to_linspec(self, ns=None, dt=None, cases=20, iseed=None,
                                           fn_limit=sqrt(2), gravity=9.81):
                                '''
                                Split the linear and non-linear component from the Spectrum
                                    according to 2nd order wave theory
                        Severity: Minor
                        Found in src/wafo/spectrum/core.py - About 1 hr to fix

                          Function __init__ has 13 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

                            Function tile has a Cognitive Complexity of 21 (exceeds 15 allowed). Consider refactoring.
                            Open

                            def tile(*figure_numbers, **kwds):
                                """Tile figure windows.
                            
                                Parameters
                                ----------
                            Severity: Minor
                            Found in src/wafo/fig.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 rotate has a Cognitive Complexity of 21 (exceeds 15 allowed). Consider refactoring.
                            Open

                                def rotate(self, phi=0, rotateGrid=False, method='linear'):
                                    '''
                                    Rotate spectrum clockwise around the origin.
                            
                                    Parameters
                            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 _cov2mmtpdf has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                def _cov2mmtpdf(self, R, dt, u, def_nr, Nstart, hg, options):
                                    '''
                                    COV2MMTPDF Joint density of Maximum, minimum and period.
                            
                                    CALL  [pdf, err, options] = cov2mmtpdf(R,dt,u,def,Nstart,hg,options)
                            Severity: Minor
                            Found in src/wafo/spectrum/core.py - About 1 hr to fix

                              Function demo_kalman_sine has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              def demo_kalman_sine():
                                  """Kalman Filter demonstration with sine signal.
                              
                                  Examples
                                  --------
                              Severity: Minor
                              Found in src/wafo/sg_filter/demos.py - About 1 hr to fix

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

                                    def prb_smoothed(self, prb_e, hs, alpha=0.05, color='r', label=''):
                                        """Return smoothed binomial probability.
                                
                                        Parameters
                                        ----------
                                Severity: Minor
                                Found in src/wafo/kdetools/kdetools.py - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language