wafo-project/pywafo

View on GitHub

Showing 153 of 6,500 total issues

File _continuous_distns.py has 5642 lines of code (exceeds 1000 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
#
# Author:  Travis Oliphant  2002-2011 with contributions from
#          SciPy Developers 2004-2011
#
Severity: Major
Found in src/wafo/stats/_continuous_distns.py - About 2 wks to fix

    File core.py has 2966 lines of code (exceeds 1000 allowed). Consider refactoring.
    Open

    import warnings
    import os
    import numpy as np
    from numpy import (pi, inf, zeros, ones, where, nonzero,
                       flatnonzero, ceil, sqrt, exp, log, arctan2,
    Severity: Major
    Found in src/wafo/spectrum/core.py - About 6 days to fix

      File misc.py has 2355 lines of code (exceeds 1000 allowed). Consider refactoring.
      Open

      '''
      Misc
      '''
      
      try:
      Severity: Major
      Found in src/wafo/misc.py - About 4 days to fix

        File polynomial.py has 1993 lines of code (exceeds 1000 allowed). Consider refactoring.
        Open

        """
            Extended functions to operate on polynomials
        """
        # ------------------------------------------------------------------------
        # Name:        polynomial
        Severity: Major
        Found in src/wafo/polynomial.py - About 3 days to fix

          Function _cov2mmtpdf has a Cognitive Complexity of 165 (exceeds 15 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 3 days 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 objects.py has 1859 lines of code (exceeds 1000 allowed). Consider refactoring.
          Open

          # Name:        module1
          # Purpose:
          #
          # Author:      pab
          #
          Severity: Major
          Found in src/wafo/objects.py - About 2 days to fix

            File models.py has 1719 lines of code (exceeds 1000 allowed). Consider refactoring.
            Open

            #!/usr/bin/env python
            """
            Models module
            -------------
            
            
            Severity: Major
            Found in src/wafo/spectrum/models.py - About 2 days to fix

              File estimation.py has 1342 lines of code (exceeds 1000 allowed). Consider refactoring.
              Open

              """
              Contains FitDistribution and Profile class, which are
              
              important classes for fitting to various Continous and Discrete Probability
              Distributions
              Severity: Major
              Found in src/wafo/stats/estimation.py - About 1 day to fix

                Function moment has a Cognitive Complexity of 67 (exceeds 15 allowed). Consider refactoring.
                Open

                    def moment(self, nr=2, vari='xt'):
                        '''
                        Calculates spectral moments from spectrum
                
                        Parameters
                Severity: Minor
                Found in src/wafo/spectrum/core.py - About 1 day 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 mctp2tc has a Cognitive Complexity of 57 (exceeds 15 allowed). Consider refactoring.
                Open

                def mctp2tc(f_Mm, utc, param, f_mM=None):
                    """
                    MCTP2TC  Calculates frequencies for the  upcrossing troughs and crests
                    using Markov chain of turning points.
                
                
                Severity: Minor
                Found in src/wafo/markov.py - About 7 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

                Function cdfnorm2d has a Cognitive Complexity of 55 (exceeds 15 allowed). Consider refactoring.
                Open

                def cdfnorm2d(b1, b2, r):
                    """
                    Returnc Bivariate Normal cumulative distribution function
                
                    Parameters
                Severity: Minor
                Found in src/wafo/gaussian.py - About 6 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 core.py has 1165 lines of code (exceeds 1000 allowed). Consider refactoring.
                Open

                import warnings
                from wafo.containers import PlotData
                from wafo.misc import findextrema
                from scipy import special
                import numpy as np
                Severity: Major
                Found in src/wafo/stats/core.py - About 5 hrs to fix

                  Function _make_findrfc has a Cognitive Complexity of 49 (exceeds 15 allowed). Consider refactoring.
                  Open

                  def _make_findrfc(cmp1, cmp2):
                  
                      @jit(int64(int64[:], float64[:], float64), nopython=True)
                      def local_findrfc(t, y, h):
                          """Returns indices, t, to RFC turningpoints of a vector y of turningpoints
                  Severity: Minor
                  Found in src/wafo/_misc_numba.py - About 5 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

                  Function to_mmt_pdf has a Cognitive Complexity of 46 (exceeds 15 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 5 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

                  Function _rvs_scalar has a Cognitive Complexity of 42 (exceeds 15 allowed). Consider refactoring.
                  Open

                      def _rvs_scalar(self, p, b, numsamples=None):
                          # following [2], the quasi-pdf is used instead of the pdf for the
                          # generation of rvs
                          invert_res = False
                          if not(numsamples):
                  Severity: Minor
                  Found in src/wafo/stats/_continuous_distns.py - About 4 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

                  Function _findrfc has a Cognitive Complexity of 41 (exceeds 15 allowed). Consider refactoring.
                  Open

                  def _findrfc(ind, y, h):
                      """Returns indices to RFC turningpoints of a vector y of turningpoints
                  
                      Notes
                      -----
                  Severity: Minor
                  Found in src/wafo/_misc_numba.py - About 4 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 integrate.py has 1092 lines of code (exceeds 1000 allowed). Consider refactoring.
                  Open

                  import warnings
                  import numpy as np
                  from numpy import pi, sqrt, ones, zeros
                  from scipy import integrate as intg
                  import scipy.special.orthogonal as ort
                  Severity: Major
                  Found in src/wafo/integrate.py - About 4 hrs to fix

                    FitDistribution has 33 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class FitDistribution(rv_frozen):
                        """
                        Return estimators to shape, location, and scale from data
                    
                        Starting points for the fit are given by input arguments.  For any
                    Severity: Minor
                    Found in src/wafo/stats/estimation.py - About 4 hrs to fix

                      SpecData1D has 32 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class SpecData1D(PlotData):
                      
                          """
                          Container class for 1D spectrum data objects in WAFO
                      
                      
                      Severity: Minor
                      Found in src/wafo/spectrum/core.py - About 4 hrs to fix

                        Function mctp2rfc has a Cognitive Complexity of 35 (exceeds 15 allowed). Consider refactoring.
                        Open

                        def mctp2rfc(fmM, fMm=None):
                            """
                            Return Rainflow matrix given a Markov chain of turning points
                        
                            computes f_rfc = f_mM + F_mct(f_mM).
                        Severity: Minor
                        Found in src/wafo/markov.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

                        Severity
                        Category
                        Status
                        Source
                        Language