wafo-project/pywafo

View on GitHub
src/wafo/tests/test_objects.py

Summary

Maintainability
F
5 days
Test Coverage

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Open

        assert 1.65 < g0.dist2gauss() < 2.05
Severity: Info
Found in src/wafo/tests/test_objects.py by bandit

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Open

        assert 1.2 < S.tr.dist2gauss() < 1.6
Severity: Info
Found in src/wafo/tests/test_objects.py by bandit

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Open

        assert 0.54 < g1.dist2gauss() < 0.95
Severity: Info
Found in src/wafo/tests/test_objects.py by bandit

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Open

        assert 1.5 < g2.dist2gauss() < 1.9
Severity: Info
Found in src/wafo/tests/test_objects.py by bandit

Remove this commented out code.
Open

    # import sys;sys.argv = ['', 'Test.testName']
Severity: Major
Found in src/wafo/tests/test_objects.py by sonar-python

Programmers should not comment out code as it bloats programs and reduces readability.

Unused code should be deleted and can be retrieved from source control history if required.

See

  • MISRA C:2004, 2.4 - Sections of code should not be "commented out".
  • MISRA C++:2008, 2-7-2 - Sections of code shall not be "commented out" using C-style comments.
  • MISRA C++:2008, 2-7-3 - Sections of code should not be "commented out" using C++ comments.
  • MISRA C:2012, Dir. 4.4 - Sections of code should not be "commented out"

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

    def setUp(self):
        x = wafo.data.sea()
        self.ts = wo.mat2timeseries(x)
Severity: Major
Found in src/wafo/tests/test_objects.py and 1 other location - About 2 hrs to fix
src/wafo/tests/test_objects.py on lines 114..116

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

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

    def setUp(self):
        x = wafo.data.sea()
        self.ts = wo.mat2timeseries(x)
Severity: Major
Found in src/wafo/tests/test_objects.py and 1 other location - About 2 hrs to fix
src/wafo/tests/test_objects.py on lines 17..19

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

        lc_exp = lc.extrapolate(-2 * s, 2 * s, dist='expon')
Severity: Major
Found in src/wafo/tests/test_objects.py and 2 other locations - About 2 hrs to fix
src/wafo/tests/test_objects.py on lines 161..161
src/wafo/tests/test_objects.py on lines 169..169

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

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

        lc_gpd = lc.extrapolate(-2 * s, 2 * s, dist='genpareto')
Severity: Major
Found in src/wafo/tests/test_objects.py and 2 other locations - About 2 hrs to fix
src/wafo/tests/test_objects.py on lines 161..161
src/wafo/tests/test_objects.py on lines 167..167

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

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

        lc_ray = lc.extrapolate(-2 * s, 2 * s, dist='rayleigh')
Severity: Major
Found in src/wafo/tests/test_objects.py and 2 other locations - About 2 hrs to fix
src/wafo/tests/test_objects.py on lines 167..167
src/wafo/tests/test_objects.py on lines 169..169

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

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

        assert_allclose(lc_ray.data[ix],
                        [1.79048319e-37, 9.61443295e-23, 2.05330344e-11, 1.74404876e-03,
                         5.89169345e+01, 5.24000000e+02, 6.72611616e+01, 4.46072713e-01,
                         2.23424122e-04, 8.45157346e-09])
Severity: Major
Found in src/wafo/tests/test_objects.py and 1 other location - About 1 hr to fix
src/wafo/tests/test_objects.py on lines 171..176

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

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

        assert_allclose(lc_exp.data[ix],
                        [6.51864195e-12, 1.13025876e-08,
                         1.95974080e-05, 3.39796881e-02,
                         5.89169345e+01, 5.24000000e+02,
                         6.43476951e+01, 1.13478843e+00,
Severity: Major
Found in src/wafo/tests/test_objects.py and 1 other location - About 1 hr to fix
src/wafo/tests/test_objects.py on lines 163..166

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

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

                    ([0., 1., 2., 3., 3., 4., 5., 6., 7., 9.],
                     [-1.7504945, -1.4404945, -1.4204945, -1.4004945,
                      -1.3704945, -1.3204945, -1.2704945, -1.2604945,
                      -1.2504945, -1.2004945]),
Severity: Major
Found in src/wafo/tests/test_objects.py and 3 other locations - About 1 hr to fix
src/wafo/tests/test_objects.py on lines 132..135
src/wafo/tests/test_objects.py on lines 140..143
src/wafo/tests/test_objects.py on lines 144..147

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

        true_lcs = (([0., 1., 2., 2., 3., 4., 5., 6., 7., 9.],
                     [-1.7504945, -1.4404945, -1.4204945, -1.4004945,
                      -1.3704945, -1.3204945, -1.2704945, -1.2604945,
                      -1.2504945, -1.2004945]),
Severity: Major
Found in src/wafo/tests/test_objects.py and 3 other locations - About 1 hr to fix
src/wafo/tests/test_objects.py on lines 136..139
src/wafo/tests/test_objects.py on lines 140..143
src/wafo/tests/test_objects.py on lines 144..147

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

                    ([1., 2., 3., 4., 4., 5., 6., 7., 9., 11.],
                     [-1.7504945, -1.4404945, -1.4204945, -1.4004945,
                      -1.3704945, -1.3204945, -1.2704945, -1.2604945,
                      -1.2504945, -1.2004945]),
Severity: Major
Found in src/wafo/tests/test_objects.py and 3 other locations - About 1 hr to fix
src/wafo/tests/test_objects.py on lines 132..135
src/wafo/tests/test_objects.py on lines 136..139
src/wafo/tests/test_objects.py on lines 144..147

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

                    ([1., 2., 3., 3., 4., 5., 6., 7., 9., 11.],
                     [-1.7504945, -1.4404945, -1.4204945, -1.4004945,
                      -1.3704945, -1.3204945, -1.2704945, -1.2604945,
                      -1.2504945, -1.2004945]))
Severity: Major
Found in src/wafo/tests/test_objects.py and 3 other locations - About 1 hr to fix
src/wafo/tests/test_objects.py on lines 132..135
src/wafo/tests/test_objects.py on lines 136..139
src/wafo/tests/test_objects.py on lines 140..143

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

    def test_sampling_period(self):
        ts = self.ts
        assert_allclose(ts.sampling_period(), 0.25)
Severity: Major
Found in src/wafo/tests/test_objects.py and 2 other locations - About 1 hr to fix
src/wafo/spectrum/tests/test_specdata1d.py on lines 125..127
src/wafo/spectrum/tests/test_specdata1d.py on lines 129..131

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

            T, _ix = ts.wave_periods(vh=0.0, pdef=pdef)
Severity: Major
Found in src/wafo/tests/test_objects.py and 3 other locations - About 1 hr to fix
src/wafo/doc/tutorial_scripts/chapter3.py on lines 146..146
src/wafo/spectrum/core.py on lines 1661..1661
src/wafo/spectrum/core.py on lines 3779..3779

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

if __name__ == "__main__":
    # import sys;sys.argv = ['', 'Test.testName']
    unittest.main()
Severity: Major
Found in src/wafo/tests/test_objects.py and 12 other locations - About 1 hr to fix
src/wafo/kdetools/tests/test_gridding.py on lines 114..116
src/wafo/kdetools/tests/test_kdetools.py on lines 413..415
src/wafo/kdetools/tests/test_kernels.py on lines 146..148
src/wafo/sg_filter/tests/test_sg_filter.py on lines 78..80
src/wafo/spectrum/tests/test_models.py on lines 131..132
src/wafo/tests/test_bitwise.py on lines 36..38
src/wafo/tests/test_containers.py on lines 56..58
src/wafo/tests/test_dct_pack.py on lines 65..67
src/wafo/tests/test_gaussian.py on lines 169..171
src/wafo/tests/test_integrate.py on lines 122..124
src/wafo/tests/test_integrate_oscillating.py on lines 391..393
src/wafo/tests/test_padua.py on lines 100..101

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

        tp_truth = [-1.2004945, 0.83950546, -0.09049454, -0.02049454, -0.09049454,
                    -0.04049454, -0.16049454, 0.25950546, -0.43049454, -0.08049454]
Severity: Major
Found in src/wafo/tests/test_objects.py and 7 other locations - About 1 hr to fix
src/wafo/gaussian.py on lines 776..780
src/wafo/gaussian.py on lines 781..785
src/wafo/spectrum/tests/test_specdata1d.py on lines 43..45
src/wafo/spectrum/tests/test_specdata1d.py on lines 49..50
src/wafo/tests/test_objects.py on lines 38..41
src/wafo/tests/test_objects.py on lines 128..129
src/wafo/tests/test_objects.py on lines 178..181

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

        mm_truth = [0.83950546, -0.02049454, -0.04049454, 0.25950546, -0.08049454,
                    -0.08049454, 0.34950546, 0.85950546, 0.0095054599, 0.31950546]
Severity: Major
Found in src/wafo/tests/test_objects.py and 7 other locations - About 1 hr to fix
src/wafo/gaussian.py on lines 776..780
src/wafo/gaussian.py on lines 781..785
src/wafo/spectrum/tests/test_specdata1d.py on lines 43..45
src/wafo/spectrum/tests/test_specdata1d.py on lines 49..50
src/wafo/tests/test_objects.py on lines 38..41
src/wafo/tests/test_objects.py on lines 121..122
src/wafo/tests/test_objects.py on lines 178..181

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

        rf_truth = [0.2236863694370409, 0.20838472806306807, 0.17110733468261707,
                    0.12237802905232559, 0.07024054173332359, 0.020648586944915163,
                    -0.022188309948145163, -0.05559930301041356, -0.07859846868575099,
                    -0.09166187410953541]
Severity: Major
Found in src/wafo/tests/test_objects.py and 7 other locations - About 1 hr to fix
src/wafo/gaussian.py on lines 776..780
src/wafo/gaussian.py on lines 781..785
src/wafo/spectrum/tests/test_specdata1d.py on lines 43..45
src/wafo/spectrum/tests/test_specdata1d.py on lines 49..50
src/wafo/tests/test_objects.py on lines 121..122
src/wafo/tests/test_objects.py on lines 128..129
src/wafo/tests/test_objects.py on lines 178..181

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

        truth = [0.0, 0.0, 0.0, 0.0,
                 58.91693446677314, 524.0,
                 68.04847695471916, 0.14101938976341344,
                 0.0, 0.0]
Severity: Major
Found in src/wafo/tests/test_objects.py and 7 other locations - About 1 hr to fix
src/wafo/gaussian.py on lines 776..780
src/wafo/gaussian.py on lines 781..785
src/wafo/spectrum/tests/test_specdata1d.py on lines 43..45
src/wafo/spectrum/tests/test_specdata1d.py on lines 49..50
src/wafo/tests/test_objects.py on lines 38..41
src/wafo/tests/test_objects.py on lines 121..122
src/wafo/tests/test_objects.py on lines 128..129

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

        assert_allclose(rf.data[:10], rf_truth)
Severity: Major
Found in src/wafo/tests/test_objects.py and 4 other locations - About 1 hr to fix
src/wafo/tests/test_objects.py on lines 123..123
src/wafo/tests/test_objects.py on lines 131..131
src/wafo/tests/test_objects.py on lines 151..151
src/wafo/tests/test_objects.py on lines 152..152

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

            assert_allclose(lc.args[:10], true_levels)
Severity: Major
Found in src/wafo/tests/test_objects.py and 4 other locations - About 1 hr to fix
src/wafo/tests/test_objects.py on lines 43..43
src/wafo/tests/test_objects.py on lines 123..123
src/wafo/tests/test_objects.py on lines 131..131
src/wafo/tests/test_objects.py on lines 151..151

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

        assert_allclose(mm.data[:10], mm_truth)
Severity: Major
Found in src/wafo/tests/test_objects.py and 4 other locations - About 1 hr to fix
src/wafo/tests/test_objects.py on lines 43..43
src/wafo/tests/test_objects.py on lines 123..123
src/wafo/tests/test_objects.py on lines 151..151
src/wafo/tests/test_objects.py on lines 152..152

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

            assert_allclose(lc.data[:10], true_count)
Severity: Major
Found in src/wafo/tests/test_objects.py and 4 other locations - About 1 hr to fix
src/wafo/tests/test_objects.py on lines 43..43
src/wafo/tests/test_objects.py on lines 123..123
src/wafo/tests/test_objects.py on lines 131..131
src/wafo/tests/test_objects.py on lines 152..152

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

        assert_allclose(tp.data[:10], tp_truth)
Severity: Major
Found in src/wafo/tests/test_objects.py and 4 other locations - About 1 hr to fix
src/wafo/tests/test_objects.py on lines 43..43
src/wafo/tests/test_objects.py on lines 131..131
src/wafo/tests/test_objects.py on lines 151..151
src/wafo/tests/test_objects.py on lines 152..152

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

        assert 1.65 < g0.dist2gauss() < 2.05
Severity: Major
Found in src/wafo/tests/test_objects.py and 2 other locations - About 55 mins to fix
src/wafo/tests/test_objects.py on lines 61..61
src/wafo/tests/test_objects.py on lines 62..62

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

        S = self.ts.tospecdata(L=150)
Severity: Major
Found in src/wafo/tests/test_objects.py and 2 other locations - About 55 mins to fix
src/wafo/kdetools/kdetools.py on lines 364..364
src/wafo/tests/test_objects.py on lines 36..36

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

        assert 0.54 < g1.dist2gauss() < 0.95
Severity: Major
Found in src/wafo/tests/test_objects.py and 2 other locations - About 55 mins to fix
src/wafo/tests/test_objects.py on lines 60..60
src/wafo/tests/test_objects.py on lines 62..62

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

        rf = self.ts.tocovdata(lag=150)
Severity: Major
Found in src/wafo/tests/test_objects.py and 2 other locations - About 55 mins to fix
src/wafo/kdetools/kdetools.py on lines 364..364
src/wafo/tests/test_objects.py on lines 26..26

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

        assert 1.5 < g2.dist2gauss() < 1.9
Severity: Major
Found in src/wafo/tests/test_objects.py and 2 other locations - About 55 mins to fix
src/wafo/tests/test_objects.py on lines 60..60
src/wafo/tests/test_objects.py on lines 61..61

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

            assert_allclose(T[:3], truth)
Severity: Major
Found in src/wafo/tests/test_objects.py and 3 other locations - About 50 mins to fix
src/wafo/tests/test_misc.py on lines 123..123
src/wafo/tests/test_misc.py on lines 124..124
src/wafo/tests/test_objects.py on lines 110..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 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

            assert_allclose(T[:3], truth)
Severity: Major
Found in src/wafo/tests/test_objects.py and 3 other locations - About 50 mins to fix
src/wafo/tests/test_misc.py on lines 123..123
src/wafo/tests/test_misc.py on lines 124..124
src/wafo/tests/test_objects.py on lines 97..97

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

        wdefs = ['mw', 'Mw', 'dw', 'uw', 'tw', 'cw', ]
Severity: Major
Found in src/wafo/tests/test_objects.py and 5 other locations - About 40 mins to fix
source/rind2007/build_all.py on lines 19..20
src/wafo/f2py_tools.py on lines 48..52
src/wafo/kdetools/demo.py on lines 17..17
src/wafo/stats/tests/test_fit.py on lines 30..36
setup.py on lines 171..176

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

        ix = slice(0, 1000, 100)
Severity: Minor
Found in src/wafo/tests/test_objects.py and 1 other location - About 35 mins to fix
src/wafo/interpolate.py on lines 1287..1287

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

            T, _ix = ts.wave_periods(vh=0.0, pdef=pdef, wdef=wdef)
Severity: Minor
Found in src/wafo/tests/test_objects.py and 1 other location - About 30 mins to fix
src/wafo/tests/test_integrate_oscillating.py on lines 381..381

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