wafo-project/pywafo

View on GitHub

Showing 153 of 6,500 total issues

Spreading has 29 functions (exceeds 20 allowed). Consider refactoring.
Open

class Spreading(object):
    """
    Directional spreading function.

    Parameters
Severity: Minor
Found in src/wafo/spectrum/models.py - About 3 hrs to fix

    Function mc2rfc has a Cognitive Complexity of 32 (exceeds 15 allowed). Consider refactoring.
    Open

    def mc2rfc(f_xy, paramv=None, paramu=None):
        """
        MC2RFC  Calculates a rainflow matrix given a Markov chain with kernel f_xy;
               f_rfc = f_xy + F_mc(f_xy).
    
    
    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

    Function poly2str has a Cognitive Complexity of 32 (exceeds 15 allowed). Consider refactoring.
    Open

    def poly2str(p, variable='x'):
        """
        Return polynomial as a string.
    
        Parameters
    Severity: Minor
    Found in src/wafo/polynomial.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

    Function fit has 71 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def fit(self, y, X=None, theta0=None, beta0=None):
            """
            Member variables
          .df           : degrees of freedom for error.
          .params       : estimated model parameters
    Severity: Major
    Found in src/wafo/stats/core.py - About 2 hrs to fix

      Kalman has 25 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Kalman(object):
      
          """
          Kalman filter object - updates a system state vector estimate based upon an
                    observation, using a discrete Kalman filter.
      Severity: Minor
      Found in src/wafo/sg_filter/_core.py - About 2 hrs to fix

        _CommonProfile has 25 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class _CommonProfile:
            def __init__(self, fit_dist, i=None, pmin=None, pmax=None, n=100, alpha=0.05, lmaxdiff=1e-5):
        
                self.fit_dist = fit_dist
                self.pmin = pmin
        Severity: Minor
        Found in src/wafo/stats/estimation.py - About 2 hrs to fix

          _KDE has 25 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class _KDE(object):
          
              def __init__(self, data, kernel=None, xmin=None, xmax=None):
                  self.dataset = data
                  self.xmin = xmin
          Severity: Minor
          Found in src/wafo/kdetools/kdetools.py - About 2 hrs to fix

            frechet_r_gen has 23 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class frechet_r_gen(weibull_min_gen):
                """A Frechet right (or Weibull minimum) continuous random variable.
            
                %(before_notes)s
            
            
            Severity: Minor
            Found in src/wafo/stats/_continuous_distns.py - About 2 hrs to fix

              frechet_l_gen has 23 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class frechet_l_gen(weibull_max_gen):
                  """A Frechet left (or Weibull maximum) continuous random variable.
              
                  %(before_notes)s
              
              
              Severity: Minor
              Found in src/wafo/stats/_continuous_distns.py - About 2 hrs to fix

                Function poly2hstr has a Cognitive Complexity of 28 (exceeds 15 allowed). Consider refactoring.
                Open

                def poly2hstr(p, variable='x'):
                    """
                    Return polynomial as a Horner represented string.
                
                    Parameters
                Severity: Minor
                Found in src/wafo/polynomial.py - About 2 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

                TransferFunction has 22 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class TransferFunction(object):
                
                    '''
                    Class for computing transfer functions based on linear wave theory
                        of the system with input surface elevation,
                Severity: Minor
                Found in src/wafo/wave_theory/core.py - About 2 hrs to fix

                  Function sim_nl has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def sim_nl(self, ns=None, cases=1, dt=None, iseed=None, method='random',
                                 fnlimit=1.4142, reltol=1e-3, g=9.81, verbose=False,
                                 output='timeseries'):
                          """
                          Simulates a Randomized 2nd order non-linear wave X(t)
                  Severity: Major
                  Found in src/wafo/spectrum/core.py - About 2 hrs to fix

                    Function test_exp_zdcos2t_dcos2t_exp_jw_cos_t_b_dcos2t has a Cognitive Complexity of 27 (exceeds 15 allowed). Consider refactoring.
                    Open

                        def test_exp_zdcos2t_dcos2t_exp_jw_cos_t_b_dcos2t(self):
                            x1 = 20
                            y1 = 50
                            z1 = 10
                            beta = np.abs(np.arctan(y1/x1))
                    Severity: Minor
                    Found in src/wafo/tests/test_integrate_oscillating.py - About 2 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 findoutliers has a Cognitive Complexity of 27 (exceeds 15 allowed). Consider refactoring.
                    Open

                    def findoutliers(x, zcrit=0.0, dcrit=None, ddcrit=None, verbose=False):
                        """
                        Return indices to spurious points of data
                    
                        Parameters
                    Severity: Minor
                    Found in src/wafo/misc.py - About 2 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 fit has a Cognitive Complexity of 27 (exceeds 15 allowed). Consider refactoring.
                    Open

                        def fit(self, y, X=None, theta0=None, beta0=None):
                            """
                            Member variables
                          .df           : degrees of freedom for error.
                          .params       : estimated model parameters
                    Severity: Minor
                    Found in src/wafo/stats/core.py - About 2 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

                    Cheb1d has 21 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class Cheb1d(object):
                        coeffs = None
                        order = None
                        a = None
                        b = None
                    Severity: Minor
                    Found in src/wafo/polynomial.py - About 2 hrs to fix

                      Function simcond has a Cognitive Complexity of 26 (exceeds 15 allowed). Consider refactoring.
                      Open

                          def simcond(self, xo, method='approx', i_unknown=None):
                              """
                              Simulate values conditionally on observed known values
                      
                              Parameters
                      Severity: Minor
                      Found in src/wafo/covariance/core.py - About 2 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 sim has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          def sim(self, ns, alpha):
                              """
                              Simulates process with given irregularity factor and crossing spectrum
                      
                              Parameters
                      Severity: Minor
                      Found in src/wafo/objects.py - About 1 hr to fix

                        Function test_rind has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        def test_rind():
                        
                            Et = 0.001946  # exact prob.
                            n = 5
                            Blo = -np.inf
                        Severity: Minor
                        Found in src/wafo/tests/test_gaussian.py - About 1 hr to fix

                          Function characteristic has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              def characteristic(self, fact='Hm0', T=1200, g=9.81):
                                  """
                                  Returns spectral characteristics and their covariance
                          
                                  Parameters
                          Severity: Minor
                          Found in src/wafo/spectrum/core.py - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language