wafo-project/pywafo

View on GitHub
src/wafo/demos.py

Summary

Maintainability
F
3 days
Test Coverage

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

        M[i][j] = M[i + p][j]
Severity: Major
Found in src/wafo/demos.py and 1 other location - About 2 hrs to fix
src/wafo/demos.py on lines 40..40

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 35.

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

                M[i][j] = M[i + p][j]
Severity: Major
Found in src/wafo/demos.py and 1 other location - About 2 hrs to fix
src/wafo/demos.py on lines 46..46

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 35.

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 1.0 / ((y - 0.3) ** 2 + 0.01) + 1.0 / ((y - 0.9) ** 2 + 0.04) + \
Severity: Major
Found in src/wafo/demos.py and 1 other location - About 1 hr to fix
src/wafo/demos.py on lines 140..140

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

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

        M[i + p][j] = temp
Severity: Major
Found in src/wafo/demos.py and 1 other location - About 1 hr to fix
src/wafo/demos.py on lines 41..41

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

                M[i + p][j] = temp
Severity: Major
Found in src/wafo/demos.py and 1 other location - About 1 hr to fix
src/wafo/demos.py on lines 47..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 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

    if y is None:
        y = np.linspace(-3, 3, n)
Severity: Major
Found in src/wafo/demos.py and 1 other location - About 1 hr to fix
src/wafo/demos.py on lines 109..110

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

    if x is None:
        x = np.linspace(-3, 3, n)
Severity: Major
Found in src/wafo/demos.py and 1 other location - About 1 hr to fix
src/wafo/demos.py on lines 111..112

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

         10 * (x1 / 5 - x1 ** 3 - y1 ** 5) * exp(-x1 ** 2 - y1 ** 2) -
Severity: Major
Found in src/wafo/demos.py and 1 other location - About 1 hr to fix
src/wafo/padua.py on lines 258..258

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 15 locations. Consider refactoring.
Open

if __name__ == '__main__':
    from wafo.testing import test_docstrings
    test_docstrings(__file__)
Severity: Major
Found in src/wafo/demos.py and 14 other locations - About 1 hr to fix
src/wafo/bitwise.py on lines 85..87
src/wafo/containers.py on lines 639..641
src/wafo/dctpack.py on lines 435..437
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

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

        temp = M[i][j]
Severity: Major
Found in src/wafo/demos.py and 1 other location - About 1 hr to fix
src/wafo/demos.py on lines 39..39

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

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

                temp = M[i][j]
Severity: Major
Found in src/wafo/demos.py and 1 other location - About 1 hr to fix
src/wafo/demos.py on lines 45..45

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 3 locations. Consider refactoring.
Open

        k = (n - 2) // 4
Severity: Major
Found in src/wafo/demos.py and 2 other locations - About 1 hr to fix
src/wafo/interpolate.py on lines 95..95
src/wafo/misc.py on lines 2276..2276

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

    if (n < 3):
        raise ValueError('n must be greater than 2.')
Severity: Major
Found in src/wafo/demos.py and 1 other location - About 1 hr to fix
src/wafo/markov.py on lines 56..57

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 31 locations. Consider refactoring.
Open

    J, I = np.meshgrid(ix, ix)
Severity: Major
Found in src/wafo/demos.py and 30 other locations - About 55 mins to fix
src/wafo/containers.py on lines 203..203
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 31 locations. Consider refactoring.
Open

    J, I = np.meshgrid(ix, ix)
Severity: Major
Found in src/wafo/demos.py and 30 other locations - About 55 mins to fix
src/wafo/containers.py on lines 203..203
src/wafo/demos.py on lines 13..13
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 4 locations. Consider refactoring.
Open

    elif np.mod(n, 4) == 0:
Severity: Major
Found in src/wafo/demos.py and 3 other locations - About 50 mins to fix
src/wafo/demos.py on lines 89..89
src/wafo/misc.py on lines 2272..2272
src/wafo/padua.py on lines 293..293

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 4 locations. Consider refactoring.
Open

    if np.mod(n, 2) == 1:
Severity: Major
Found in src/wafo/demos.py and 3 other locations - About 50 mins to fix
src/wafo/demos.py on lines 91..91
src/wafo/misc.py on lines 2272..2272
src/wafo/padua.py on lines 293..293

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 11 locations. Consider refactoring.
Open

    [x1, y1] = meshgrid(x, y)
Severity: Major
Found in src/wafo/demos.py and 10 other locations - About 45 mins to fix
src/wafo/gaussian.py on lines 344..344
src/wafo/gaussian.py on lines 393..393
src/wafo/misc.py on lines 2672..2672
src/wafo/misc.py on lines 2723..2723
src/wafo/spectrum/core.py on lines 4112..4112
src/wafo/spectrum/models.py on lines 319..319
src/wafo/spectrum/models.py on lines 2078..2078
src/wafo/stats/_continuous_distns.py on lines 8525..8525
src/wafo/tests/test_misc.py on lines 429..429
src/wafo/tests/test_misc.py on lines 441..441

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 5 locations. Consider refactoring.
Open

         1. / 3 * exp(-(x1 + 1) ** 2 - y1 ** 2))
Severity: Major
Found in src/wafo/demos.py and 4 other locations - About 45 mins to fix
src/wafo/demos.py on lines 116..116
src/wafo/kdetools/kernels.py on lines 454..454
src/wafo/stats/_continuous_distns.py on lines 6431..6431
src/wafo/transform/models.py on lines 199..199

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 5 locations. Consider refactoring.
Open

    z = (3 * (1 - x1) ** 2 * exp(-(x1 ** 2) - (y1 + 1) ** 2) -
Severity: Major
Found in src/wafo/demos.py and 4 other locations - About 45 mins to fix
src/wafo/demos.py on lines 118..118
src/wafo/kdetools/kernels.py on lines 454..454
src/wafo/stats/_continuous_distns.py on lines 6431..6431
src/wafo/transform/models.py on lines 199..199

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 16 locations. Consider refactoring.
Open

    if x is None:
        y = np.linspace(0, 1)
Severity: Major
Found in src/wafo/demos.py and 15 other locations - About 40 mins to fix
src/wafo/doc/tutorial_scripts/rainflow_example.py on lines 141..141
src/wafo/interpolate.py on lines 1330..1330
src/wafo/kdetools/demo.py on lines 151..151
src/wafo/spectrum/models.py on lines 2063..2063
src/wafo/spectrum/models.py on lines 2069..2069
src/wafo/spectrum/models.py on lines 2097..2097
src/wafo/spectrum/models.py on lines 2098..2098
src/wafo/spectrum/models.py on lines 2106..2106
src/wafo/spectrum/models.py on lines 2110..2110
src/wafo/spectrum/tests/test_models.py on lines 26..26
src/wafo/spectrum/tests/test_specdata1d.py on lines 58..58
src/wafo/stats/_continuous_distns.py on lines 8534..8534
src/wafo/transform/models.py on lines 575..575
src/wafo/transform/tests/test_trdata.py on lines 11..11
src/wafo/wavemodels.py on lines 18..18

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

There are no issues that match your filters.

Category
Status