wafo-project/pywafo

View on GitHub
src/wafo/containers.py

Summary

Maintainability
F
1 wk
Test Coverage

Cyclomatic complexity is too high in function plot2d. (8)
Open

def plot2d(axis, wdata, plotflag, *args, **kwds):
    f = wdata
    if isinstance(wdata.args, (list, tuple)):
        args1 = tuple((wdata.args)) + (wdata.data,) + args
    else:
Severity: Minor
Found in src/wafo/containers.py by radon

Cyclomatic Complexity

Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

Construct Effect on CC Reasoning
if +1 An if statement is a single decision.
elif +1 The elif statement adds another decision.
else +0 The else statement does not cause a new decision. The decision is at the if.
for +1 There is a decision at the start of the loop.
while +1 There is a decision at the while statement.
except +1 Each except branch adds a new conditional path of execution.
finally +0 The finally block is unconditionally executed.
with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
assert +1 The assert statement internally roughly equals a conditional statement.
Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

Source: http://radon.readthedocs.org/en/latest/intro.html

Cyclomatic complexity is too high in function plot1d. (8)
Open

def plot1d(axis, args, data, dataCI, plotflag, *varargin, **kwds):
    h = []
    plottype = np.mod(plotflag, 10)
    if plottype == 0:  # No plotting
        return h
Severity: Minor
Found in src/wafo/containers.py by radon

Cyclomatic Complexity

Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

Construct Effect on CC Reasoning
if +1 An if statement is a single decision.
elif +1 The elif statement adds another decision.
else +0 The else statement does not cause a new decision. The decision is at the if.
for +1 There is a decision at the start of the loop.
while +1 There is a decision at the while statement.
except +1 Each except branch adds a new conditional path of execution.
finally +0 The finally block is unconditionally executed.
with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
assert +1 The assert statement internally roughly equals a conditional statement.
Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

Source: http://radon.readthedocs.org/en/latest/intro.html

Cyclomatic complexity is too high in function set_axis. (6)
Open

def set_axis(axis, f_max, trans_flag, log_scale):
    if log_scale or (trans_flag == 5 and not log_scale):
        ax = list(axis.axis())
        if trans_flag == 8 and not log_scale:
            ax[3] = 11 * np.log10(f_max)
Severity: Minor
Found in src/wafo/containers.py by radon

Cyclomatic Complexity

Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

Construct Effect on CC Reasoning
if +1 An if statement is a single decision.
elif +1 The elif statement adds another decision.
else +0 The else statement does not cause a new decision. The decision is at the if.
for +1 There is a decision at the start of the loop.
while +1 There is a decision at the while statement.
except +1 Each except branch adds a new conditional path of execution.
finally +0 The finally block is unconditionally executed.
with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
assert +1 The assert statement internally roughly equals a conditional statement.
Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

Source: http://radon.readthedocs.org/en/latest/intro.html

Function plot2d has a Cognitive Complexity of 18 (exceeds 15 allowed). Consider refactoring.
Open

def plot2d(axis, wdata, plotflag, *args, **kwds):
    f = wdata
    if isinstance(wdata.args, (list, tuple)):
        args1 = tuple((wdata.args)) + (wdata.data,) + args
    else:
Severity: Minor
Found in src/wafo/containers.py - About 45 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

Refactor this function to reduce its Cognitive Complexity from 18 to the 15 allowed.
Open

def plot2d(axis, wdata, plotflag, *args, **kwds):
Severity: Critical
Found in src/wafo/containers.py by sonar-python

Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

See

Merge this if statement with the enclosing one.
Open

            if title0.lower().strip() != txt.lower().strip():
Severity: Major
Found in src/wafo/containers.py by sonar-python

Merging collapsible if statements increases the code's readability.

Noncompliant Code Example

if condition1:
    if condition2:
        # ...

Compliant Solution

if condition1 and condition2:
    # ...

TODO found
Open

    # TODO: mesh, surf waterfall plots are missing
Severity: Minor
Found in src/wafo/containers.py by fixme

Identical blocks of code found in 2 locations. Consider refactoring.
Open

    def copy(self):
        newcopy = empty_copy(self)
        newcopy.__dict__.update(self.__dict__)
        return newcopy
Severity: Major
Found in src/wafo/containers.py and 1 other location - About 2 hrs to fix
src/wafo/containers.py on lines 289..292

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 31.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

    def copy(self):
        newcopy = empty_copy(self)
        newcopy.__dict__.update(self.__dict__)
        return newcopy
Severity: Major
Found in src/wafo/containers.py and 1 other location - About 2 hrs to fix
src/wafo/containers.py on lines 89..92

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 31.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        logYscaleId = (np.mod(scaleId // 10, 10) > 0) * 2
Severity: Major
Found in src/wafo/containers.py and 1 other location - About 2 hrs to fix
src/wafo/containers.py on lines 491..491

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 30.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        logZscaleId = (np.mod(scaleId // 100, 10) > 0) * 4
Severity: Major
Found in src/wafo/containers.py and 1 other location - About 2 hrs to fix
src/wafo/containers.py on lines 490..490

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 30.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    def __init__(self, title='', xlab='', ylab='', zlab='', **kwds):
        self.title = title
        self.xlab = xlab
        self.ylab = ylab
        self.zlab = zlab
Severity: Major
Found in src/wafo/containers.py and 1 other location - About 2 hrs to fix
src/wafo/sg_filter/_core.py on lines 1116..1120

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 29.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    return {'': 0, 'None': 0, 'f': 0, '1-f': 1,
            'cumtrapz(f)': 2, '1-cumtrapz(f)': 3,
            'log(f)': 4, 'log(1-f)': 5,
            'log(cumtrapz(f))': 6, 'log(1-cumtrapz(f))': 7,
            '10log10(f)': 8}[transform_id] * 10
Severity: Major
Found in src/wafo/containers.py and 1 other location - About 1 hr to fix
src/wafo/kdetools/tests/test_kernels.py on lines 41..47

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 25.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        ix = np.flatnonzero((a < x) & (x < b))
Severity: Major
Found in src/wafo/containers.py and 1 other location - About 1 hr to fix
src/wafo/stats/core.py on lines 334..334

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 25.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            ax[2] = ax[3] * 1e-4
Severity: Major
Found in src/wafo/containers.py and 1 other location - About 1 hr to fix
src/wafo/covariance/core.py on lines 602..602

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 23.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            ax[2] = ax[3] - 40
Severity: Major
Found in src/wafo/containers.py and 1 other location - About 1 hr to fix
src/wafo/spectrum/tests/test_specdata1d.py on lines 74..74

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 23.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

        if isinstance(self.args, (list, tuple)):  # Multidimensional data
            raise NotImplementedError('integration for ndim>1 not implemented')
Severity: Major
Found in src/wafo/containers.py and 1 other location - About 1 hr to fix
src/wafo/containers.py on lines 199..200

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 21.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

        if isinstance(self.args, (list, tuple)):  # Multidimensional data
            raise NotImplementedError('integration for ndim>1 not implemented')
Severity: Major
Found in src/wafo/containers.py and 1 other location - About 1 hr to fix
src/wafo/containers.py on lines 160..161

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 21.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        if b is None:
            b = x[-1]
Severity: Major
Found in src/wafo/containers.py and 1 other location - About 1 hr to fix
src/wafo/containers.py on lines 167..168

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 21.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        if a is None:
            a = x[0]
Severity: Major
Found in src/wafo/containers.py and 1 other location - About 1 hr to fix
src/wafo/containers.py on lines 169..170

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 21.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 15 locations. Consider refactoring.
Open

if __name__ == '__main__':
    from wafo.testing import test_docstrings
    test_docstrings(__file__)
Severity: Major
Found in src/wafo/containers.py and 14 other locations - About 1 hr to fix
src/wafo/bitwise.py on lines 85..87
src/wafo/dctpack.py on lines 435..437
src/wafo/demos.py on lines 144..146
src/wafo/gaussian.py on lines 1033..1035
src/wafo/integrate.py on lines 1470..1472
src/wafo/kdetools/demo.py on lines 328..330
src/wafo/kdetools/gridding.py on lines 362..364
src/wafo/markov.py on lines 1439..1441
src/wafo/misc.py on lines 2928..2930
src/wafo/padua.py on lines 529..531
src/wafo/sg_filter/_core.py on lines 1221..1223
src/wafo/sg_filter/demos.py on lines 473..475
src/wafo/transform/core.py on lines 214..216
src/wafo/wave_theory/dispersion_relation.py on lines 206..208

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 20.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 16 locations. Consider refactoring.
Open

        if axis is None:
            axis = plt.gca()
Severity: Major
Found in src/wafo/containers.py and 15 other locations - About 1 hr to fix
src/wafo/containers.py on lines 230..231
src/wafo/containers.py on lines 312..313
src/wafo/graphutil.py on lines 37..38
src/wafo/graphutil.py on lines 39..40
src/wafo/graphutil.py on lines 119..120
src/wafo/graphutil.py on lines 121..122
src/wafo/graphutil.py on lines 210..211
src/wafo/misc.py on lines 1569..1570
src/wafo/stats/estimation.py on lines 544..545
src/wafo/stats/estimation.py on lines 1449..1450
src/wafo/stats/estimation.py on lines 1467..1468
src/wafo/stats/estimation.py on lines 1493..1494
src/wafo/stats/estimation.py on lines 1545..1546
src/wafo/stats/estimation.py on lines 1569..1570
src/wafo/stats/estimation.py on lines 1592..1593

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 19.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 16 locations. Consider refactoring.
Open

        if axis is None:
            axis = plt.gca()
Severity: Major
Found in src/wafo/containers.py and 15 other locations - About 1 hr to fix
src/wafo/containers.py on lines 312..313
src/wafo/containers.py on lines 351..352
src/wafo/graphutil.py on lines 37..38
src/wafo/graphutil.py on lines 39..40
src/wafo/graphutil.py on lines 119..120
src/wafo/graphutil.py on lines 121..122
src/wafo/graphutil.py on lines 210..211
src/wafo/misc.py on lines 1569..1570
src/wafo/stats/estimation.py on lines 544..545
src/wafo/stats/estimation.py on lines 1449..1450
src/wafo/stats/estimation.py on lines 1467..1468
src/wafo/stats/estimation.py on lines 1493..1494
src/wafo/stats/estimation.py on lines 1545..1546
src/wafo/stats/estimation.py on lines 1569..1570
src/wafo/stats/estimation.py on lines 1592..1593

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 19.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 16 locations. Consider refactoring.
Open

        if axis is None:
            axis = plt.gca()
Severity: Major
Found in src/wafo/containers.py and 15 other locations - About 1 hr to fix
src/wafo/containers.py on lines 230..231
src/wafo/containers.py on lines 351..352
src/wafo/graphutil.py on lines 37..38
src/wafo/graphutil.py on lines 39..40
src/wafo/graphutil.py on lines 119..120
src/wafo/graphutil.py on lines 121..122
src/wafo/graphutil.py on lines 210..211
src/wafo/misc.py on lines 1569..1570
src/wafo/stats/estimation.py on lines 544..545
src/wafo/stats/estimation.py on lines 1449..1450
src/wafo/stats/estimation.py on lines 1467..1468
src/wafo/stats/estimation.py on lines 1493..1494
src/wafo/stats/estimation.py on lines 1545..1546
src/wafo/stats/estimation.py on lines 1569..1570
src/wafo/stats/estimation.py on lines 1592..1593

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 19.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

        try:
            return self._labelfig(axis)
        except Exception as err:
            warnings.warn(str(err))
Severity: Major
Found in src/wafo/containers.py and 2 other locations - About 1 hr to fix
src/wafo/stats/estimation.py on lines 396..400
src/wafo/stats/estimation.py on lines 927..934

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 19.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

            if tmp1 is not None:
                tmp.append(tmp1)
Severity: Major
Found in src/wafo/containers.py and 2 other locations - About 1 hr to fix
src/wafo/spectrum/core.py on lines 2609..2610
src/wafo/spectrum/core.py on lines 2859..2860

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 19.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

    transform_id = np.mod(plotflag // 10, 10)
Severity: Major
Found in src/wafo/containers.py and 2 other locations - About 1 hr to fix
src/wafo/containers.py on lines 402..402
src/wafo/containers.py on lines 506..506

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 18.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

    trans_flag = np.mod(plotflag // 10, 10)
Severity: Major
Found in src/wafo/containers.py and 2 other locations - About 1 hr to fix
src/wafo/containers.py on lines 506..506
src/wafo/containers.py on lines 523..523

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 18.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

    transform_id = np.mod(plotflag // 10, 10)
Severity: Major
Found in src/wafo/containers.py and 2 other locations - About 1 hr to fix
src/wafo/containers.py on lines 402..402
src/wafo/containers.py on lines 523..523

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 18.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        scaleId = logYscaleId + logXscaleId + logZscaleId
Severity: Major
Found in src/wafo/containers.py and 1 other location - About 1 hr to fix
src/wafo/stats/_continuous_distns.py on lines 3934..3934

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 17.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        h1 = plot1d(axis, x, data, dataCI, plotflag, *args, **kwds)
Severity: Major
Found in src/wafo/containers.py and 1 other location - About 1 hr to fix
src/wafo/integrate_oscillating.py on lines 527..527

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 17.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

                 lambda f, x: np.log1p(-cumtrapz(f, x)),
Severity: Major
Found in src/wafo/containers.py and 3 other locations - About 1 hr to fix
src/wafo/stats/_continuous_distns.py on lines 2097..2097
src/wafo/stats/_continuous_distns.py on lines 2103..2103
src/wafo/stats/_continuous_distns.py on lines 2106..2106

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 16.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        if trans_flag == 8 and not log_scale:
Severity: Major
Found in src/wafo/containers.py and 1 other location - About 1 hr to fix
src/wafo/containers.py on lines 382..382

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 16.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            return np.hstack((res, np.ravel(res_ci)))
Severity: Major
Found in src/wafo/containers.py and 1 other location - About 1 hr to fix
src/wafo/fig.py on lines 159..159

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 16.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    if log_scale or (trans_flag == 5 and not log_scale):
Severity: Major
Found in src/wafo/containers.py and 1 other location - About 1 hr to fix
src/wafo/containers.py on lines 384..384

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 16.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                                dataCI[:, 1] - data],
Severity: Major
Found in src/wafo/containers.py and 1 other location - About 1 hr to fix
src/wafo/containers.py on lines 420..420

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 16.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                          yerr=[dataCI[:, 0] - data,
Severity: Major
Found in src/wafo/containers.py and 1 other location - About 1 hr to fix
src/wafo/containers.py on lines 421..421

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 16.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 31 locations. Consider refactoring.
Open

        fi, xi = self._get_fi_xi(a, b)
Severity: Major
Found in src/wafo/containers.py and 30 other locations - About 55 mins to fix
src/wafo/demos.py on lines 13..13
src/wafo/demos.py on lines 23..23
src/wafo/graphutil.py on lines 214..215
src/wafo/integrate.py on lines 83..83
src/wafo/interpolate.py on lines 1161..1161
src/wafo/kdetools/gridding.py on lines 339..339
src/wafo/kdetools/kernels.py on lines 116..116
src/wafo/markov.py on lines 489..493
src/wafo/misc.py on lines 494..494
src/wafo/misc.py on lines 1334..1334
src/wafo/misc.py on lines 2429..2429
src/wafo/padua.py on lines 326..326
src/wafo/padua.py on lines 475..475
src/wafo/padua.py on lines 513..513
src/wafo/sg_filter/demos.py on lines 418..418
src/wafo/spectrum/models.py on lines 2099..2099
src/wafo/spectrum/models.py on lines 2108..2108
src/wafo/stats/_continuous_distns.py on lines 3779..3779
src/wafo/stats/core.py on lines 495..495
src/wafo/stats/core.py on lines 534..534
src/wafo/stats/core.py on lines 937..937
src/wafo/stats/estimation.py on lines 474..474
src/wafo/stats/estimation.py on lines 482..482
src/wafo/tests/test_gaussian.py on lines 47..47
src/wafo/tests/test_gaussian.py on lines 154..154
src/wafo/tests/test_misc.py on lines 546..546
src/wafo/tests/test_misc.py on lines 556..556
src/wafo/tests/test_misc.py on lines 569..569
src/wafo/transform/models.py on lines 231..231
src/wafo/transform/models.py on lines 240..240

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 15.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

            if ndim < 2:
                msg = '''
                Unable to determine plotter-type, because len(self.args)<2.
                If the data is 1D, then self.args should be a vector!
                If the data is 2D, then length(self.args) should be 2.
Severity: Major
Found in src/wafo/containers.py and 4 other locations - About 55 mins to fix
src/wafo/containers.py on lines 144..151
src/wafo/spectrum/models.py on lines 563..568
src/wafo/spectrum/models.py on lines 917..920
src/wafo/spectrum/models.py on lines 922..925

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 15.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

            if ndim < 2:
                msg = '''
                Unable to determine plotter-type, because len(self.args)<2.
                If the data is 1D, then self.args should be a vector!
                If the data is 2D, then length(self.args) should be 2.
Severity: Major
Found in src/wafo/containers.py and 4 other locations - About 55 mins to fix
src/wafo/containers.py on lines 251..258
src/wafo/spectrum/models.py on lines 563..568
src/wafo/spectrum/models.py on lines 917..920
src/wafo/spectrum/models.py on lines 922..925

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 15.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

        child_kwds = dict(self.plot_kwds_children).copy()
Severity: Major
Found in src/wafo/containers.py and 2 other locations - About 55 mins to fix
src/wafo/containers.py on lines 238..238
src/wafo/covariance/core.py on lines 482..482

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 15.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

        main_kwds = dict(self.plot_kwds).copy()
Severity: Major
Found in src/wafo/containers.py and 2 other locations - About 55 mins to fix
src/wafo/containers.py on lines 216..216
src/wafo/covariance/core.py on lines 482..482

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 15.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    x = np.linspace(0, np.pi, 9)
Severity: Minor
Found in src/wafo/containers.py and 1 other location - About 55 mins to fix
src/wafo/tests/test_containers.py on lines 15..15

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 15.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        if plotmethod is None:
            plotmethod = 'contour'
Severity: Minor
Found in src/wafo/containers.py and 1 other location - About 55 mins to fix
src/wafo/containers.py on lines 342..343

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 15.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        if plotmethod is None:
            plotmethod = 'plot'
Severity: Minor
Found in src/wafo/containers.py and 1 other location - About 55 mins to fix
src/wafo/containers.py on lines 551..552

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 15.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

    scales = ['linear', 'xlog', 'ylog', 'xylog', 'zlog', 'xzlog',
              'yzlog', 'xyzlog']
Severity: Major
Found in src/wafo/containers.py and 4 other locations - About 50 mins to fix
src/wafo/covariance/core.py on lines 128..128
src/wafo/dctpack.py on lines 7..7
src/wafo/doc/tutorial_scripts/rainflow_example.py on lines 7..7
src/wafo/stats/tests/test_fit.py on lines 19..27

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 14.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        self.plot_args = kwds.pop('plot_args', [])
Severity: Minor
Found in src/wafo/containers.py and 1 other location - About 50 mins to fix
src/wafo/containers.py on lines 80..80

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 14.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        self.plot_args_children = kwds.pop('plot_args_children', [])
Severity: Minor
Found in src/wafo/containers.py and 1 other location - About 50 mins to fix
src/wafo/containers.py on lines 82..82

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 14.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        self.plot_kwds = kwds.pop('plot_kwds', {})
Severity: Minor
Found in src/wafo/containers.py and 1 other location - About 50 mins to fix
src/wafo/containers.py on lines 81..81

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 14.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        self.plot_kwds_children = kwds.pop('plot_kwds_children', {})
Severity: Minor
Found in src/wafo/containers.py and 1 other location - About 50 mins to fix
src/wafo/containers.py on lines 83..83

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 14.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 36 locations. Consider refactoring.
Open

                txt = self._add_title_if_fun_is_set_title(txt, title0, fun)
Severity: Major
Found in src/wafo/containers.py and 35 other locations - About 45 mins to fix
src/wafo/containers.py on lines 235..236
src/wafo/integrate.py on lines 1014..1014
src/wafo/integrate.py on lines 1412..1412
src/wafo/integrate_oscillating.py on lines 442..442
src/wafo/integrate_oscillating.py on lines 492..492
src/wafo/interpolate.py on lines 574..574
src/wafo/interpolate.py on lines 577..577
src/wafo/kdetools/kdetools.py on lines 712..712
src/wafo/kdetools/kernels.py on lines 820..820
src/wafo/kdetools/kernels.py on lines 912..912
src/wafo/kdetools/kernels.py on lines 1018..1018
src/wafo/kdetools/kernels.py on lines 1139..1139
src/wafo/kdetools/kernels.py on lines 1247..1247
src/wafo/misc.py on lines 248..248
src/wafo/misc.py on lines 1339..1339
src/wafo/misc.py on lines 1393..1393
src/wafo/misc.py on lines 2248..2248
src/wafo/misc.py on lines 2260..2260
src/wafo/misc.py on lines 2262..2262
src/wafo/misc.py on lines 2273..2273
src/wafo/misc.py on lines 2292..2292
src/wafo/misc.py on lines 2461..2461
src/wafo/objects.py on lines 446..446
src/wafo/objects.py on lines 978..978
src/wafo/sg_filter/_core.py on lines 429..429
src/wafo/sg_filter/_core.py on lines 1167..1167
src/wafo/sg_filter/_core.py on lines 1168..1168
src/wafo/sg_filter/_core.py on lines 1169..1169
src/wafo/sg_filter/demos.py on lines 424..424
src/wafo/sg_filter/demos.py on lines 426..426
src/wafo/sg_filter/demos.py on lines 428..428
src/wafo/spectrum/models.py on lines 1582..1582
src/wafo/stats/_continuous_distns.py on lines 3870..3870
src/wafo/stats/estimation.py on lines 534..537
src/wafo/transform/models.py on lines 72..72

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 13.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 23 locations. Consider refactoring.
Open

        h2 = wdata.labels.labelfig(axis)
Severity: Major
Found in src/wafo/containers.py and 22 other locations - About 45 mins to fix
src/wafo/covariance/core.py on lines 704..704
src/wafo/covariance/estimation.py on lines 129..130
src/wafo/doc/tutorial_scripts/chapter5.py on lines 36..36
src/wafo/doc/tutorial_scripts/chapter5.py on lines 46..46
src/wafo/doc/tutorial_scripts/chapter5.py on lines 88..88
src/wafo/doc/tutorial_scripts/chapter5.py on lines 243..243
src/wafo/interpolate.py on lines 1297..1297
src/wafo/interpolate.py on lines 1311..1311
src/wafo/kdetools/kdetools.py on lines 451..451
src/wafo/kdetools/kdetools.py on lines 493..493
src/wafo/kdetools/kdetools.py on lines 722..722
src/wafo/kdetools/kernels.py on lines 641..641
src/wafo/kdetools/kernels.py on lines 801..801
src/wafo/kdetools/kernels.py on lines 802..802
src/wafo/kdetools/kernels.py on lines 886..886
src/wafo/kdetools/kernels.py on lines 1001..1001
src/wafo/kdetools/kernels.py on lines 1002..1002
src/wafo/kdetools/kernels.py on lines 1105..1105
src/wafo/kdetools/kernels.py on lines 1106..1106
src/wafo/kdetools/kernels.py on lines 1232..1232
src/wafo/kdetools/kernels.py on lines 1233..1233
src/wafo/markov.py on lines 803..803

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 13.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 36 locations. Consider refactoring.
Open

        if not plotflag and self.children is not None:
            tmp = self._plot_children(axis, plotflag, kwds)
Severity: Major
Found in src/wafo/containers.py and 35 other locations - About 45 mins to fix
src/wafo/containers.py on lines 307..307
src/wafo/integrate.py on lines 1014..1014
src/wafo/integrate.py on lines 1412..1412
src/wafo/integrate_oscillating.py on lines 442..442
src/wafo/integrate_oscillating.py on lines 492..492
src/wafo/interpolate.py on lines 574..574
src/wafo/interpolate.py on lines 577..577
src/wafo/kdetools/kdetools.py on lines 712..712
src/wafo/kdetools/kernels.py on lines 820..820
src/wafo/kdetools/kernels.py on lines 912..912
src/wafo/kdetools/kernels.py on lines 1018..1018
src/wafo/kdetools/kernels.py on lines 1139..1139
src/wafo/kdetools/kernels.py on lines 1247..1247
src/wafo/misc.py on lines 248..248
src/wafo/misc.py on lines 1339..1339
src/wafo/misc.py on lines 1393..1393
src/wafo/misc.py on lines 2248..2248
src/wafo/misc.py on lines 2260..2260
src/wafo/misc.py on lines 2262..2262
src/wafo/misc.py on lines 2273..2273
src/wafo/misc.py on lines 2292..2292
src/wafo/misc.py on lines 2461..2461
src/wafo/objects.py on lines 446..446
src/wafo/objects.py on lines 978..978
src/wafo/sg_filter/_core.py on lines 429..429
src/wafo/sg_filter/_core.py on lines 1167..1167
src/wafo/sg_filter/_core.py on lines 1168..1168
src/wafo/sg_filter/_core.py on lines 1169..1169
src/wafo/sg_filter/demos.py on lines 424..424
src/wafo/sg_filter/demos.py on lines 426..426
src/wafo/sg_filter/demos.py on lines 428..428
src/wafo/spectrum/models.py on lines 1582..1582
src/wafo/stats/_continuous_distns.py on lines 3870..3870
src/wafo/stats/estimation.py on lines 534..537
src/wafo/transform/models.py on lines 72..72

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 13.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 17 locations. Consider refactoring.
Open

            _unused_axcl = cltext(clvals, percent=isPL)
Severity: Major
Found in src/wafo/containers.py and 16 other locations - About 45 mins to fix
src/wafo/covariance/core.py on lines 632..632
src/wafo/integrate.py on lines 1197..1197
src/wafo/integrate.py on lines 1198..1198
src/wafo/integrate.py on lines 1199..1199
src/wafo/integrate.py on lines 1402..1402
src/wafo/objects.py on lines 1655..1655
src/wafo/sg_filter/demos.py on lines 37..37
src/wafo/sg_filter/demos.py on lines 400..400
src/wafo/spectrum/core.py on lines 1428..1428
src/wafo/spectrum/core.py on lines 1429..1429
src/wafo/stats/core.py on lines 621..621
src/wafo/stats/core.py on lines 624..624
src/wafo/stats/estimation.py on lines 573..573
src/wafo/stats/estimation.py on lines 578..578
src/wafo/stats/estimation.py on lines 1399..1399
src/wafo/transform/estimation.py on lines 444..444

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 13.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 7 locations. Consider refactoring.
Open

        ax = list(axis.axis())
Severity: Major
Found in src/wafo/containers.py and 6 other locations - About 45 mins to fix
src/wafo/integrate.py on lines 1309..1309
src/wafo/spectrum/models.py on lines 1817..1817
src/wafo/spectrum/models.py on lines 1853..1853
src/wafo/spectrum/models.py on lines 1871..1871
src/wafo/stats/estimation.py on lines 1552..1552
src/wafo/transform/estimation.py on lines 324..324

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 13.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

            tmp1 = child.plot(*child_args, **child_kwds)
Severity: Major
Found in src/wafo/containers.py and 2 other locations - About 45 mins to fix
src/wafo/stats/_continuous_distns.py on lines 7247..7247
src/wafo/stats/tests/test_fit.py on lines 96..96

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 13.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        default_plotflag = self.plot_kwds.get('plotflag')
Severity: Minor
Found in src/wafo/containers.py and 1 other location - About 45 mins to fix
src/wafo/covariance/estimation.py on lines 121..121

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 13.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                args1 = tuple((wdata.args)) + vals + args
Severity: Minor
Found in src/wafo/containers.py and 1 other location - About 45 mins to fix
src/wafo/stats/estimation.py on lines 1117..1117

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 13.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    if plottype == 0:  # No plotting
        return h
Severity: Minor
Found in src/wafo/containers.py and 1 other location - About 45 mins to fix
src/wafo/sg_filter/_core.py on lines 157..158

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 13.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 22 locations. Consider refactoring.
Open

        return_ci = kwds.pop('return_ci', False)
Severity: Major
Found in src/wafo/containers.py and 21 other locations - About 40 mins to fix
src/wafo/containers.py on lines 229..229
src/wafo/containers.py on lines 233..233
src/wafo/containers.py on lines 350..350
src/wafo/containers.py on lines 353..353
src/wafo/fig.py on lines 663..663
src/wafo/fig.py on lines 766..766
src/wafo/fig.py on lines 861..861
src/wafo/graphutil.py on lines 209..209
src/wafo/objects.py on lines 2563..2563
src/wafo/stats/_continuous_distns.py on lines 345..345
src/wafo/stats/_continuous_distns.py on lines 346..346
src/wafo/stats/_continuous_distns.py on lines 646..646
src/wafo/stats/_continuous_distns.py on lines 647..647
src/wafo/stats/_continuous_distns.py on lines 1550..1550
src/wafo/stats/_continuous_distns.py on lines 1551..1551
src/wafo/stats/_continuous_distns.py on lines 2933..2933
src/wafo/stats/_continuous_distns.py on lines 2943..2943
src/wafo/stats/_continuous_distns.py on lines 5077..5077
src/wafo/stats/_continuous_distns.py on lines 5084..5084
src/wafo/stats/_continuous_distns.py on lines 7704..7704
src/wafo/stats/_continuous_distns.py on lines 7705..7705

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 12.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 22 locations. Consider refactoring.
Open

        axis = kwds.pop('axis', None)
Severity: Major
Found in src/wafo/containers.py and 21 other locations - About 40 mins to fix
src/wafo/containers.py on lines 202..202
src/wafo/containers.py on lines 233..233
src/wafo/containers.py on lines 350..350
src/wafo/containers.py on lines 353..353
src/wafo/fig.py on lines 663..663
src/wafo/fig.py on lines 766..766
src/wafo/fig.py on lines 861..861
src/wafo/graphutil.py on lines 209..209
src/wafo/objects.py on lines 2563..2563
src/wafo/stats/_continuous_distns.py on lines 345..345
src/wafo/stats/_continuous_distns.py on lines 346..346
src/wafo/stats/_continuous_distns.py on lines 646..646
src/wafo/stats/_continuous_distns.py on lines 647..647
src/wafo/stats/_continuous_distns.py on lines 1550..1550
src/wafo/stats/_continuous_distns.py on lines 1551..1551
src/wafo/stats/_continuous_distns.py on lines 2933..2933
src/wafo/stats/_continuous_distns.py on lines 2943..2943
src/wafo/stats/_continuous_distns.py on lines 5077..5077
src/wafo/stats/_continuous_distns.py on lines 5084..5084
src/wafo/stats/_continuous_distns.py on lines 7704..7704
src/wafo/stats/_continuous_distns.py on lines 7705..7705

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 12.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 22 locations. Consider refactoring.
Open

        axis = kwds.pop('axis', None)
Severity: Major
Found in src/wafo/containers.py and 21 other locations - About 40 mins to fix
src/wafo/containers.py on lines 202..202
src/wafo/containers.py on lines 229..229
src/wafo/containers.py on lines 233..233
src/wafo/containers.py on lines 353..353
src/wafo/fig.py on lines 663..663
src/wafo/fig.py on lines 766..766
src/wafo/fig.py on lines 861..861
src/wafo/graphutil.py on lines 209..209
src/wafo/objects.py on lines 2563..2563
src/wafo/stats/_continuous_distns.py on lines 345..345
src/wafo/stats/_continuous_distns.py on lines 346..346
src/wafo/stats/_continuous_distns.py on lines 646..646
src/wafo/stats/_continuous_distns.py on lines 647..647
src/wafo/stats/_continuous_distns.py on lines 1550..1550
src/wafo/stats/_continuous_distns.py on lines 1551..1551
src/wafo/stats/_continuous_distns.py on lines 2933..2933
src/wafo/stats/_continuous_distns.py on lines 2943..2943
src/wafo/stats/_continuous_distns.py on lines 5077..5077
src/wafo/stats/_continuous_distns.py on lines 5084..5084
src/wafo/stats/_continuous_distns.py on lines 7704..7704
src/wafo/stats/_continuous_distns.py on lines 7705..7705

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 12.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 22 locations. Consider refactoring.
Open

        plotflag = kwds.pop('plotflag', False)
Severity: Major
Found in src/wafo/containers.py and 21 other locations - About 40 mins to fix
src/wafo/containers.py on lines 202..202
src/wafo/containers.py on lines 229..229
src/wafo/containers.py on lines 233..233
src/wafo/containers.py on lines 350..350
src/wafo/fig.py on lines 663..663
src/wafo/fig.py on lines 766..766
src/wafo/fig.py on lines 861..861
src/wafo/graphutil.py on lines 209..209
src/wafo/objects.py on lines 2563..2563
src/wafo/stats/_continuous_distns.py on lines 345..345
src/wafo/stats/_continuous_distns.py on lines 346..346
src/wafo/stats/_continuous_distns.py on lines 646..646
src/wafo/stats/_continuous_distns.py on lines 647..647
src/wafo/stats/_continuous_distns.py on lines 1550..1550
src/wafo/stats/_continuous_distns.py on lines 1551..1551
src/wafo/stats/_continuous_distns.py on lines 2933..2933
src/wafo/stats/_continuous_distns.py on lines 2943..2943
src/wafo/stats/_continuous_distns.py on lines 5077..5077
src/wafo/stats/_continuous_distns.py on lines 5084..5084
src/wafo/stats/_continuous_distns.py on lines 7704..7704
src/wafo/stats/_continuous_distns.py on lines 7705..7705

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 12.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 22 locations. Consider refactoring.
Open

        plotflag = kwds.get('plotflag', default_plotflag)
Severity: Major
Found in src/wafo/containers.py and 21 other locations - About 40 mins to fix
src/wafo/containers.py on lines 202..202
src/wafo/containers.py on lines 229..229
src/wafo/containers.py on lines 350..350
src/wafo/containers.py on lines 353..353
src/wafo/fig.py on lines 663..663
src/wafo/fig.py on lines 766..766
src/wafo/fig.py on lines 861..861
src/wafo/graphutil.py on lines 209..209
src/wafo/objects.py on lines 2563..2563
src/wafo/stats/_continuous_distns.py on lines 345..345
src/wafo/stats/_continuous_distns.py on lines 346..346
src/wafo/stats/_continuous_distns.py on lines 646..646
src/wafo/stats/_continuous_distns.py on lines 647..647
src/wafo/stats/_continuous_distns.py on lines 1550..1550
src/wafo/stats/_continuous_distns.py on lines 1551..1551
src/wafo/stats/_continuous_distns.py on lines 2933..2933
src/wafo/stats/_continuous_distns.py on lines 2943..2943
src/wafo/stats/_continuous_distns.py on lines 5077..5077
src/wafo/stats/_continuous_distns.py on lines 5084..5084
src/wafo/stats/_continuous_distns.py on lines 7704..7704
src/wafo/stats/_continuous_distns.py on lines 7705..7705

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 12.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

                 lambda f, x: np.log(cumtrapz(f, x)),
Severity: Major
Found in src/wafo/containers.py and 2 other locations - About 40 mins to fix
src/wafo/misc.py on lines 2613..2613
src/wafo/tests/test_integrate_oscillating.py on lines 319..319

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 12.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                 lambda f, x: 1 - cumtrapz(f, x),
Severity: Minor
Found in src/wafo/containers.py and 1 other location - About 40 mins to fix
src/wafo/stats/core.py on lines 1144..1144

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 12.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        method = kwds.pop('method', 'trapz')
Severity: Minor
Found in src/wafo/containers.py and 1 other location - About 40 mins to fix
src/wafo/kdetools/kdetools.py on lines 218..218

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 12.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        h = axis.plot(args, data, *varargin, **kwds)
Severity: Minor
Found in src/wafo/containers.py and 1 other location - About 40 mins to fix
src/wafo/kdetools/kdetools.py on lines 457..457

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 12.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        res = fun(fi, xi, **kwds)
Severity: Minor
Found in src/wafo/containers.py and 1 other location - About 40 mins to fix
src/wafo/kdetools/kdetools.py on lines 194..194

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 12.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            plotfun = getattr(axis, self.plotmethod)
Severity: Minor
Found in src/wafo/containers.py and 1 other location - About 40 mins to fix
src/wafo/objects.py on lines 1508..1508

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 12.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        super(Plotter_2d, self).__init__(plotmethod)
Severity: Minor
Found in src/wafo/containers.py and 1 other location - About 40 mins to fix
src/wafo/spectrum/models.py on lines 811..811

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 12.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 33 locations. Consider refactoring.
Open

        options = dict(method='linear')
Severity: Major
Found in src/wafo/containers.py and 32 other locations - About 35 mins to fix
src/wafo/kdetools/tests/test_kdetools.py on lines 189..189
src/wafo/kdetools/tests/test_kdetools.py on lines 208..208
src/wafo/objects.py on lines 1113..1113
src/wafo/spectrum/tests/test_models.py on lines 76..76
src/wafo/stats/_continuous_distns.py on lines 386..386
src/wafo/stats/_continuous_distns.py on lines 1198..1198
src/wafo/stats/_continuous_distns.py on lines 1423..1423
src/wafo/stats/_continuous_distns.py on lines 1483..1483
src/wafo/stats/_continuous_distns.py on lines 1666..1666
src/wafo/stats/_continuous_distns.py on lines 2492..2492
src/wafo/stats/_continuous_distns.py on lines 2818..2818
src/wafo/stats/_continuous_distns.py on lines 3282..3282
src/wafo/stats/_continuous_distns.py on lines 3341..3341
src/wafo/stats/_continuous_distns.py on lines 3528..3528
src/wafo/stats/_continuous_distns.py on lines 4069..4069
src/wafo/stats/_continuous_distns.py on lines 4219..4219
src/wafo/stats/_continuous_distns.py on lines 4262..4262
src/wafo/stats/_continuous_distns.py on lines 4839..4839
src/wafo/stats/_continuous_distns.py on lines 4893..4893
src/wafo/stats/_continuous_distns.py on lines 4943..4943
src/wafo/stats/_continuous_distns.py on lines 5574..5574
src/wafo/stats/_continuous_distns.py on lines 5719..5719
src/wafo/stats/_continuous_distns.py on lines 6006..6006
src/wafo/stats/_continuous_distns.py on lines 6116..6116
src/wafo/stats/_continuous_distns.py on lines 6386..6386
src/wafo/stats/_continuous_distns.py on lines 6521..6521
src/wafo/stats/_continuous_distns.py on lines 6801..6801
src/wafo/stats/_continuous_distns.py on lines 6802..6802
src/wafo/stats/_continuous_distns.py on lines 7046..7046
src/wafo/stats/_continuous_distns.py on lines 7585..7585
src/wafo/stats/_continuous_distns.py on lines 7828..7828
src/wafo/stats/_continuous_distns.py on lines 8002..8002

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 11.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

        if plotflag in [1, 8, 9]:
Severity: Major
Found in src/wafo/containers.py and 7 other locations - About 35 mins to fix
src/wafo/gaussian.py on lines 268..268
src/wafo/gaussian.py on lines 272..272
src/wafo/gaussian.py on lines 274..274
src/wafo/gaussian.py on lines 277..277
src/wafo/integrate.py on lines 971..971
src/wafo/spectrum/core.py on lines 2084..2084
src/wafo/stats/estimation.py on lines 182..182

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 11.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

        self.labels = AxisLabels(**kwds)
Severity: Major
Found in src/wafo/containers.py and 5 other locations - About 35 mins to fix
src/wafo/containers.py on lines 259..260
src/wafo/containers.py on lines 249..265
src/wafo/kdetools/kdetools.py on lines 82..85
src/wafo/stats/core.py on lines 1067..1067
src/wafo/win32_utils.py on lines 80..80

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 11.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

        h = pltfun(*args1, **kwds)
Severity: Major
Found in src/wafo/containers.py and 5 other locations - About 35 mins to fix
src/wafo/containers.py on lines 366..366
src/wafo/containers.py on lines 596..599
src/wafo/integrate.py on lines 1034..1034
src/wafo/kdetools/kdetools.py on lines 219..219
src/wafo/tests/test_misc.py on lines 315..315

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 11.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

        if isinstance(self.args, (list, tuple)):  # Multidimensional data
            ndim = len(self.args)
            if ndim < 2:
                msg = '''
                Unable to determine plotter-type, because len(self.args)<2.
Severity: Major
Found in src/wafo/containers.py and 5 other locations - About 35 mins to fix
src/wafo/containers.py on lines 85..85
src/wafo/containers.py on lines 259..260
src/wafo/kdetools/kdetools.py on lines 82..85
src/wafo/stats/core.py on lines 1067..1067
src/wafo/win32_utils.py on lines 80..80

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 11.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

            elif ndim == 2:
                self.plotter = Plotter_2d(plotmethod)
Severity: Major
Found in src/wafo/containers.py and 5 other locations - About 35 mins to fix
src/wafo/containers.py on lines 85..85
src/wafo/containers.py on lines 249..265
src/wafo/kdetools/kdetools.py on lines 82..85
src/wafo/stats/core.py on lines 1067..1067
src/wafo/win32_utils.py on lines 80..80

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 11.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

            h1 = plotfun(*args1, **kwds)
Severity: Major
Found in src/wafo/containers.py and 5 other locations - About 35 mins to fix
src/wafo/containers.py on lines 596..599
src/wafo/containers.py on lines 615..615
src/wafo/integrate.py on lines 1034..1034
src/wafo/kdetools/kdetools.py on lines 219..219
src/wafo/tests/test_misc.py on lines 315..315

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 11.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

        child_kwds['axis'] = axis
Severity: Major
Found in src/wafo/containers.py and 3 other locations - About 35 mins to fix
src/wafo/containers.py on lines 240..240
src/wafo/dctpack.py on lines 419..419
src/wafo/spectrum/core.py on lines 1991..1991

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 11.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

        main_kwds['axis'] = axis
Severity: Major
Found in src/wafo/containers.py and 3 other locations - About 35 mins to fix
src/wafo/containers.py on lines 218..218
src/wafo/dctpack.py on lines 419..419
src/wafo/spectrum/core.py on lines 1991..1991

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 11.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    di = PlotData(d.eval_points(xi, method='cubic'), xi)
Severity: Minor
Found in src/wafo/containers.py and 1 other location - About 35 mins to fix
src/wafo/kdetools/gridding.py on lines 185..185

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 11.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        return PlotData(cdf, np.copy(self.args), xlab='x', ylab='F(x)')
Severity: Minor
Found in src/wafo/containers.py and 1 other location - About 35 mins to fix
src/wafo/tests/test_integrate.py on lines 111..111

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 11.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 10 locations. Consider refactoring.
Open

        if plotflag in (1, 6):
Severity: Major
Found in src/wafo/containers.py and 9 other locations - About 30 mins to fix
src/wafo/integrate.py on lines 967..967
src/wafo/integrate.py on lines 993..993
src/wafo/markov.py on lines 157..157
src/wafo/markov.py on lines 861..861
src/wafo/misc.py on lines 567..567
src/wafo/spectrum/core.py on lines 1765..1765
src/wafo/spectrum/core.py on lines 1999..1999
src/wafo/spectrum/core.py on lines 2150..2150
src/wafo/tests/test_misc.py on lines 168..168

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 10.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

    set_axis(axis, f_max, trans_flag, log_scale)
Severity: Minor
Found in src/wafo/containers.py and 2 other locations - About 30 mins to fix
src/wafo/integrate.py on lines 1430..1430
src/wafo/spectrum/tests/test_models.py on lines 10..11

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 10.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

There are no issues that match your filters.

Category
Status