wafo-project/pywafo

View on GitHub
src/wafo/spectrum/tests/test_specdata1d.py

Summary

Maintainability
F
4 days
Test Coverage

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

            assert(np.abs(m - trueval) < 2 * sa)

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

            assert(tv == v)

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

        assert((np.abs(vals - true_vals) < 1e-6).all())

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

            assert(np.abs(m - trueval) < sa)

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

        assert(me == 0.0)

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

        assert(sum(t1 > t0) <= 5)

Remove this commented out code.
Open

        # ns =100; dt = .2

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"

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

        assert((np.abs(vals - true_vals) < 1e-6).all())
Severity: Major
Found in src/wafo/spectrum/tests/test_specdata1d.py and 3 other locations - About 1 hr to fix
src/wafo/transform/tests/test_models.py on lines 16..16
src/wafo/transform/tests/test_models.py on lines 42..42
src/wafo/transform/tests/test_trdata.py on lines 27..27

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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):
        S = self.S
        assert_array_almost_equal(S.sampling_period(), 1.0471975511965976)
Severity: Major
Found in src/wafo/spectrum/tests/test_specdata1d.py and 2 other locations - About 1 hr to fix
src/wafo/spectrum/tests/test_specdata1d.py on lines 125..127
src/wafo/tests/test_objects.py on lines 21..23

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_nyquist_freq(self):
        S = self.S
        assert_array_almost_equal(S.nyquist_freq(), 3.0)
Severity: Major
Found in src/wafo/spectrum/tests/test_specdata1d.py and 2 other locations - About 1 hr to fix
src/wafo/spectrum/tests/test_specdata1d.py on lines 129..131
src/wafo/tests/test_objects.py on lines 21..23

Duplicated Code

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

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

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

Tuning

This issue has a mass of 25.

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

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

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

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

Refactorings

Further Reading

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

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

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

        acfmat = self.S.tocov_matrix(nr=3, nt=256, dt=0.1)
Severity: Major
Found in src/wafo/spectrum/tests/test_specdata1d.py and 1 other location - About 1 hr to fix
src/wafo/kdetools/demo.py on lines 33..33

Duplicated Code

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

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

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

Tuning

This issue has a mass of 21.

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

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

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

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

Refactorings

Further Reading

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

if __name__ == '__main__':
    import nose
    nose.run()
Severity: Major
Found in src/wafo/spectrum/tests/test_specdata1d.py and 4 other locations - About 1 hr to fix
src/wafo/data/info.py on lines 481..483
src/wafo/transform/tests/test_models.py on lines 44..46
src/wafo/transform/tests/test_trdata.py on lines 32..34
src/wafo/wave_theory/tests/test_dispersion_relation.py on lines 56..58

Duplicated Code

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

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

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

Tuning

This issue has a mass of 20.

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

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

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

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

Refactorings

Further Reading

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

        funs = [np.mean, np.std, st.skew, st.kurtosis]
Severity: Major
Found in src/wafo/spectrum/tests/test_specdata1d.py and 2 other locations - About 1 hr to fix
src/wafo/spectrum/tests/test_specdata1d.py on lines 79..79
src/wafo/stats/estimation.py on lines 1444..1445

Duplicated Code

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

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

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

Tuning

This issue has a mass of 18.

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

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

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

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

Refactorings

Further Reading

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

        funs = [np.mean, np.std, st.skew, st.kurtosis]
Severity: Major
Found in src/wafo/spectrum/tests/test_specdata1d.py and 2 other locations - About 1 hr to fix
src/wafo/spectrum/tests/test_specdata1d.py on lines 60..60
src/wafo/stats/estimation.py on lines 1444..1445

Duplicated Code

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

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

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

Tuning

This issue has a mass of 18.

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

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

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

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

Refactorings

Further Reading

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

        me, va, sk, ku = S.stats_nl(moments='mvsk')
Severity: Major
Found in src/wafo/spectrum/tests/test_specdata1d.py and 1 other location - About 1 hr to fix
src/wafo/spectrum/tests/test_specdata1d.py on lines 101..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 18.

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

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

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

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

Refactorings

Further Reading

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

        me, _va, sk, ku = S.stats_nl(moments='mvsk')
Severity: Major
Found in src/wafo/spectrum/tests/test_specdata1d.py and 1 other location - About 1 hr to fix
src/wafo/spectrum/tests/test_specdata1d.py on lines 89..89

Duplicated Code

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

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

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

Tuning

This issue has a mass of 18.

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

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

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

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

Refactorings

Further Reading

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

        ch, R, txt = S.characteristic(['Hm0', 'Tm02'])
Severity: Major
Found in src/wafo/spectrum/tests/test_specdata1d.py and 1 other location - About 1 hr to fix
src/wafo/doc/tutorial_scripts/chapter3.py on lines 153..153

Duplicated Code

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

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

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

Tuning

This issue has a mass of 18.

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

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

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

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

Refactorings

Further Reading

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

        truth = [0.0, 0.014068786046738972, 0.027384724577108947, 0.039538002584522454,
                 0.050183061144017056, 0.05948762020247726, 0.0669017098497974,
                 0.07251637759775977, 0.07729759248201125, 0.08151306823047058]
Severity: Major
Found in src/wafo/spectrum/tests/test_specdata1d.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 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
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.00028327, 0.00027281, 0.00042283, 0.00058736, 0.00083936,
                 0.00160774, 0.00186591, 0.00196073, 0.00213102]
Severity: Major
Found in src/wafo/spectrum/tests/test_specdata1d.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/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
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 6 locations. Consider refactoring.
Open

        Sj = sm.Jonswap(Hm0=3, Tp=7)
Severity: Major
Found in src/wafo/spectrum/tests/test_specdata1d.py and 5 other locations - About 1 hr to fix
src/wafo/doc/tutorial_scripts/chapter1.py on lines 23..23
src/wafo/doc/tutorial_scripts/chapter1.py on lines 31..31
src/wafo/doc/tutorial_scripts/chapter2.py on lines 320..320
src/wafo/kdetools/tests/test_kernels.py on lines 73..73
src/wafo/spectrum/core.py on lines 4400..4400

Duplicated Code

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

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

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

Tuning

This issue has a mass of 16.

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

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

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

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

Refactorings

Further Reading

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

            res = fun(x2.data, axis=0)
Severity: Minor
Found in src/wafo/spectrum/tests/test_specdata1d.py and 1 other location - About 55 mins to fix
src/wafo/kdetools/kdetools.py on lines 98..98

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

        new_vals, _txt = Sn.moment(2)
Severity: Major
Found in src/wafo/spectrum/tests/test_specdata1d.py and 2 other locations - About 50 mins to fix
src/wafo/spectrum/tests/test_specdata1d.py on lines 135..135
src/wafo/spectrum/tests/test_specdata1d.py on lines 139..139

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

        mom, txt = S.moment(2)
Severity: Major
Found in src/wafo/spectrum/tests/test_specdata1d.py and 2 other locations - About 50 mins to fix
src/wafo/spectrum/tests/test_specdata1d.py on lines 139..139
src/wafo/spectrum/tests/test_specdata1d.py on lines 147..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 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 3 locations. Consider refactoring.
Open

        vals, _txt = S.moment(2)
Severity: Major
Found in src/wafo/spectrum/tests/test_specdata1d.py and 2 other locations - About 50 mins to fix
src/wafo/spectrum/tests/test_specdata1d.py on lines 135..135
src/wafo/spectrum/tests/test_specdata1d.py on lines 147..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 14.

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

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

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

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

Refactorings

Further Reading

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

        assert_array_almost_equal(new_vals, np.ones(2))
Severity: Minor
Found in src/wafo/spectrum/tests/test_specdata1d.py and 1 other location - About 50 mins to fix
src/wafo/tests/test_integrate.py on lines 16..16

Duplicated Code

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

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

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

Tuning

This issue has a mass of 14.

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

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

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

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

Refactorings

Further Reading

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

        S = SpecData1D(Sj(w), w)  # Make spectrum object from numerical values
Severity: Minor
Found in src/wafo/spectrum/tests/test_specdata1d.py and 1 other location - About 50 mins to fix
src/wafo/spectrum/models.py on lines 1852..1852

Duplicated Code

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

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

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

Tuning

This issue has a mass of 14.

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

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

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

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

Refactorings

Further Reading

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

        vals = acfmat[:2, :]
Severity: Minor
Found in src/wafo/spectrum/tests/test_specdata1d.py and 1 other location - About 50 mins to fix
src/wafo/objects.py on lines 244..244

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

        w = np.linspace(0, 4, 256)
Severity: Major
Found in src/wafo/spectrum/tests/test_specdata1d.py and 36 other locations - About 45 mins to fix
src/wafo/doc/tutorial_scripts/chapter3.py on lines 37..37
src/wafo/doc/tutorial_scripts/chapter5.py on lines 97..97
src/wafo/doc/tutorial_scripts/chapter5.py on lines 184..184
src/wafo/interpolate.py on lines 1149..1149
src/wafo/interpolate.py on lines 1150..1150
src/wafo/interpolate.py on lines 1151..1151
src/wafo/interpolate.py on lines 1155..1155
src/wafo/interpolate.py on lines 1156..1156
src/wafo/interpolate.py on lines 1157..1157
src/wafo/interpolate.py on lines 1304..1304
src/wafo/kdetools/demo.py on lines 31..31
src/wafo/kdetools/demo.py on lines 68..68
src/wafo/kdetools/kernels.py on lines 923..923
src/wafo/objects.py on lines 415..415
src/wafo/sg_filter/demos.py on lines 20..20
src/wafo/sg_filter/demos.py on lines 381..381
src/wafo/sg_filter/demos.py on lines 417..417
src/wafo/sg_filter/tests/test_sg_filter.py on lines 37..37
src/wafo/spectrum/core.py on lines 4401..4401
src/wafo/spectrum/models.py on lines 2087..2087
src/wafo/spectrum/models.py on lines 2092..2092
src/wafo/spectrum/models.py on lines 2140..2140
src/wafo/spectrum/models.py on lines 2150..2150
src/wafo/stats/core.py on lines 1427..1427
src/wafo/stats/core.py on lines 1446..1446
src/wafo/tests/test_gaussian.py on lines 153..153
src/wafo/tests/test_misc.py on lines 112..112
src/wafo/tests/test_misc.py on lines 389..389
src/wafo/tests/test_misc.py on lines 452..452
src/wafo/tests/test_misc.py on lines 510..510
src/wafo/tests/test_misc.py on lines 520..520
src/wafo/tests/test_misc.py on lines 530..530
src/wafo/tests/test_misc.py on lines 535..535
src/wafo/tests/test_misc.py on lines 545..545
src/wafo/tests/test_misc.py on lines 555..555
src/wafo/tests/test_misc.py on lines 568..568

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

        self.S = self.Sj.tospecdata()
Severity: Major
Found in src/wafo/spectrum/tests/test_specdata1d.py and 4 other locations - About 45 mins to fix
src/wafo/sg_filter/_core.py on lines 287..287
src/wafo/spectrum/models.py on lines 161..161
src/wafo/spectrum/tests/test_specdata1d.py on lines 113..113
src/wafo/stats/estimation.py on lines 1125..1126

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

        self.S = self.Sj.tospecdata()
Severity: Major
Found in src/wafo/spectrum/tests/test_specdata1d.py and 4 other locations - About 45 mins to fix
src/wafo/sg_filter/_core.py on lines 287..287
src/wafo/spectrum/models.py on lines 161..161
src/wafo/spectrum/tests/test_specdata1d.py on lines 19..19
src/wafo/stats/estimation.py on lines 1125..1126

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

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

        truth1 = [0, np.sqrt(S.moment(1)[0]), 0., 0.]
Severity: Minor
Found in src/wafo/spectrum/tests/test_specdata1d.py and 1 other location - About 45 mins to fix
src/wafo/spectrum/tests/test_specdata1d.py on lines 73..73

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

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

        truth1 = [0, np.sqrt(S.moment(1)[0][0])] + S.stats_nl(moments='sk')
Severity: Minor
Found in src/wafo/spectrum/tests/test_specdata1d.py and 1 other location - About 45 mins to fix
src/wafo/spectrum/tests/test_specdata1d.py on lines 59..59

Duplicated Code

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

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

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

Tuning

This issue has a mass of 13.

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

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

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

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

Refactorings

Further Reading

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

        vals = acf.data[:5]
Severity: Minor
Found in src/wafo/spectrum/tests/test_specdata1d.py and 1 other location - About 45 mins to fix
src/wafo/objects.py on lines 290..290

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

        x2 = S.sim(20000, 20)
Severity: Major
Found in src/wafo/spectrum/tests/test_specdata1d.py and 15 other locations - About 40 mins to fix
src/wafo/demos.py on lines 135..136
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/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

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

        vals, txt = S.moment()
Severity: Major
Found in src/wafo/spectrum/tests/test_specdata1d.py and 8 other locations - About 40 mins to fix
src/wafo/doc/tutorial_scripts/rainflow_example.py on lines 103..103
src/wafo/doc/tutorial_scripts/rainflow_example.py on lines 106..106
src/wafo/doc/tutorial_scripts/rainflow_example.py on lines 109..109
src/wafo/integrate.py on lines 1201..1201
src/wafo/kdetools/tests/test_kernels.py on lines 71..71
src/wafo/objects.py on lines 779..779
src/wafo/spectrum/tests/test_specdata1d.py on lines 104..104
src/wafo/stats/estimation.py on lines 1547..1547

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

        g0, _gemp = ys.trdata()
Severity: Major
Found in src/wafo/spectrum/tests/test_specdata1d.py and 8 other locations - About 40 mins to fix
src/wafo/doc/tutorial_scripts/rainflow_example.py on lines 103..103
src/wafo/doc/tutorial_scripts/rainflow_example.py on lines 106..106
src/wafo/doc/tutorial_scripts/rainflow_example.py on lines 109..109
src/wafo/integrate.py on lines 1201..1201
src/wafo/kdetools/tests/test_kernels.py on lines 71..71
src/wafo/objects.py on lines 779..779
src/wafo/spectrum/tests/test_specdata1d.py on lines 117..117
src/wafo/stats/estimation.py on lines 1547..1547

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

        assert_array_almost_equal(mom,
                                  [1.5614600345079888, 0.95567089481941048])
Severity: Major
Found in src/wafo/spectrum/tests/test_specdata1d.py and 8 other locations - About 35 mins to fix
src/wafo/spectrum/tests/test_specdata1d.py on lines 173..174
src/wafo/tests/test_misc.py on lines 472..472
src/wafo/tests/test_misc.py on lines 476..476
src/wafo/tests/test_misc.py on lines 480..480
src/wafo/tests/test_misc.py on lines 484..484
src/wafo/tests/test_misc.py on lines 487..487
src/wafo/tests/test_misc.py on lines 492..492
src/wafo/tests/test_misc.py on lines 496..496

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

        assert_array_almost_equal(ch,
                                  [4.99833578,  8.03139757])
Severity: Major
Found in src/wafo/spectrum/tests/test_specdata1d.py and 8 other locations - About 35 mins to fix
src/wafo/spectrum/tests/test_specdata1d.py on lines 136..137
src/wafo/tests/test_misc.py on lines 472..472
src/wafo/tests/test_misc.py on lines 476..476
src/wafo/tests/test_misc.py on lines 480..480
src/wafo/tests/test_misc.py on lines 484..484
src/wafo/tests/test_misc.py on lines 487..487
src/wafo/tests/test_misc.py on lines 492..492
src/wafo/tests/test_misc.py on lines 496..496

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

        assert_array_equal(txt, ['m0', 'm0tt'])
Severity: Minor
Found in src/wafo/spectrum/tests/test_specdata1d.py and 1 other location - About 35 mins to fix
src/wafo/spectrum/tests/test_specdata1d.py on lines 177..177

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

        assert(sum(t1 > t0) <= 5)
Severity: Minor
Found in src/wafo/spectrum/tests/test_specdata1d.py and 2 other locations - About 35 mins to fix
src/wafo/doc/tutorial_scripts/chapter2.py on lines 185..185
src/wafo/stats/core.py on lines 589..589

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

        assert_array_equal(txt, ['Hm0', 'Tm02'])
Severity: Minor
Found in src/wafo/spectrum/tests/test_specdata1d.py and 1 other location - About 35 mins to fix
src/wafo/spectrum/tests/test_specdata1d.py on lines 138..138

Duplicated Code

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

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

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

Tuning

This issue has a mass of 11.

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

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

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

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

Refactorings

Further Reading

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

        true_vals = [0.73062845,  0.34476034,  0.68277527,  2.90817052]
Severity: Major
Found in src/wafo/spectrum/tests/test_specdata1d.py and 5 other locations - About 30 mins to fix
src/wafo/integrate.py on lines 481..481
src/wafo/spectrum/tests/test_models.py on lines 18..18
src/wafo/tests/test_padua.py on lines 66..66
src/wafo/tests/test_padua.py on lines 75..75
src/wafo/tests/test_padua.py on lines 86..86

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