wafo-project/pywafo

View on GitHub
src/wafo/kdetools/tests/test_kernels.py

Summary

Maintainability
F
5 days
Test Coverage

Remove this commented out code.
Open

            # truth[name] = kernel.norm_factor(d=1, n=20)

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"

Remove this commented out code.
Open

            # truth[name] = kernel.stats()

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"

Remove this commented out code.
Open

            # truth[name] = kernel.effective_support()

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"

Remove this commented out code.
Open

    # import sys;sys.argv = ['', 'Test.testName']

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

        for name in self.names:
            kernel = wkk.Kernel(name)
            assert_allclose(kernel.stats(), truth[name])
Severity: Major
Found in src/wafo/kdetools/tests/test_kernels.py and 1 other location - About 2 hrs to fix
src/wafo/kdetools/tests/test_kernels.py on lines 60..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 37.

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

        for name in self.names:
            kernel = wkk.Kernel(name)
            assert_allclose(kernel.effective_support(), truth[name])
Severity: Major
Found in src/wafo/kdetools/tests/test_kernels.py and 1 other location - About 2 hrs to fix
src/wafo/kdetools/tests/test_kernels.py on lines 34..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 37.

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

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

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

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

Refactorings

Further Reading

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

    def test_hns(self):
        hs = self.gauss.hns(self.data)
        assert_allclose(hs, [0.18154437, 0.36207987, 0.37396219])
Severity: Major
Found in src/wafo/kdetools/tests/test_kernels.py and 6 other locations - About 2 hrs to fix
src/wafo/kdetools/tests/test_kernels.py on lines 92..94
src/wafo/kdetools/tests/test_kernels.py on lines 123..126
src/wafo/kdetools/tests/test_kernels.py on lines 128..130
src/wafo/kdetools/tests/test_kernels.py on lines 132..135
src/wafo/kdetools/tests/test_kernels.py on lines 137..139
src/wafo/kdetools/tests/test_kernels.py on lines 141..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 33.

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

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

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

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

Refactorings

Further Reading

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

    def test_hstt(self):
        hs = self.gauss.hstt(self.data)
        assert_allclose(hs, [0.18099075, 0.50409881, 0.11018912])
Severity: Major
Found in src/wafo/kdetools/tests/test_kernels.py and 6 other locations - About 2 hrs to fix
src/wafo/kdetools/tests/test_kernels.py on lines 88..90
src/wafo/kdetools/tests/test_kernels.py on lines 92..94
src/wafo/kdetools/tests/test_kernels.py on lines 123..126
src/wafo/kdetools/tests/test_kernels.py on lines 132..135
src/wafo/kdetools/tests/test_kernels.py on lines 137..139
src/wafo/kdetools/tests/test_kernels.py on lines 141..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 33.

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

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

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

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

Refactorings

Further Reading

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

    def test_hscv(self):
        hs = self.gauss.hscv(self.data)
        assert_allclose(hs, [0.1656318800590673, 0.3273938258112911,
                             0.31072126996412214])
Severity: Major
Found in src/wafo/kdetools/tests/test_kernels.py and 6 other locations - About 2 hrs to fix
src/wafo/kdetools/tests/test_kernels.py on lines 88..90
src/wafo/kdetools/tests/test_kernels.py on lines 92..94
src/wafo/kdetools/tests/test_kernels.py on lines 128..130
src/wafo/kdetools/tests/test_kernels.py on lines 132..135
src/wafo/kdetools/tests/test_kernels.py on lines 137..139
src/wafo/kdetools/tests/test_kernels.py on lines 141..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 33.

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

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

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

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

Refactorings

Further Reading

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

    def test_hste(self):
        hs = self.gauss.hste(self.data)
        assert_allclose(hs, [0.17035204677390572, 0.29851960273788863,
                             0.186685349741972])
Severity: Major
Found in src/wafo/kdetools/tests/test_kernels.py and 6 other locations - About 2 hrs to fix
src/wafo/kdetools/tests/test_kernels.py on lines 88..90
src/wafo/kdetools/tests/test_kernels.py on lines 92..94
src/wafo/kdetools/tests/test_kernels.py on lines 123..126
src/wafo/kdetools/tests/test_kernels.py on lines 128..130
src/wafo/kdetools/tests/test_kernels.py on lines 137..139
src/wafo/kdetools/tests/test_kernels.py on lines 141..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 33.

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

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

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

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

Refactorings

Further Reading

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

    def test_hos(self):
        hs = self.gauss.hos(self.data)
        assert_allclose(hs, [0.195209, 0.3893332, 0.40210988])
Severity: Major
Found in src/wafo/kdetools/tests/test_kernels.py and 6 other locations - About 2 hrs to fix
src/wafo/kdetools/tests/test_kernels.py on lines 88..90
src/wafo/kdetools/tests/test_kernels.py on lines 123..126
src/wafo/kdetools/tests/test_kernels.py on lines 128..130
src/wafo/kdetools/tests/test_kernels.py on lines 132..135
src/wafo/kdetools/tests/test_kernels.py on lines 137..139
src/wafo/kdetools/tests/test_kernels.py on lines 141..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 33.

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

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

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

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

Refactorings

Further Reading

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

    def test_hisj(self):
        hs = self.gauss.hisj(self.data)
        assert_allclose(hs, [0.29542502, 0.74277133, 0.51899114])
Severity: Major
Found in src/wafo/kdetools/tests/test_kernels.py and 6 other locations - About 2 hrs to fix
src/wafo/kdetools/tests/test_kernels.py on lines 88..90
src/wafo/kdetools/tests/test_kernels.py on lines 92..94
src/wafo/kdetools/tests/test_kernels.py on lines 123..126
src/wafo/kdetools/tests/test_kernels.py on lines 128..130
src/wafo/kdetools/tests/test_kernels.py on lines 132..135
src/wafo/kdetools/tests/test_kernels.py on lines 137..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 33.

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

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

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

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

Refactorings

Further Reading

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

    def test_hldpi(self):
        hs = self.gauss.hldpi(self.data)
        assert_allclose(hs, [0.1732289, 0.33159097, 0.3107633])
Severity: Major
Found in src/wafo/kdetools/tests/test_kernels.py and 6 other locations - About 2 hrs to fix
src/wafo/kdetools/tests/test_kernels.py on lines 88..90
src/wafo/kdetools/tests/test_kernels.py on lines 92..94
src/wafo/kdetools/tests/test_kernels.py on lines 123..126
src/wafo/kdetools/tests/test_kernels.py on lines 128..130
src/wafo/kdetools/tests/test_kernels.py on lines 132..135
src/wafo/kdetools/tests/test_kernels.py on lines 141..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 33.

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

        hs = wkk.Kernel('triwe').hmns(self.data[:2])
Severity: Major
Found in src/wafo/kdetools/tests/test_kernels.py and 1 other location - About 1 hr to fix
src/wafo/kdetools/tests/test_kernels.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 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

        hs = wkk.Kernel('biwe').hmns(self.data[:2])
Severity: Major
Found in src/wafo/kdetools/tests/test_kernels.py and 1 other location - About 1 hr to fix
src/wafo/kdetools/tests/test_kernels.py on lines 113..113

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

        truth = {
            'biweight': 1.0666666666666667, 'logistic': 1.0,
            'p1biweight': 1.0666666666666667, 'triangular': 1.0,
            'gaussian': 2.5066282746310002, 'epanechnikov': 1.3333333333333333,
            'triweight': 0.91428571428571426, 'laplace': 2,
Severity: Major
Found in src/wafo/kdetools/tests/test_kernels.py and 1 other location - About 1 hr to fix
src/wafo/containers.py on lines 515..519

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

        self.assertRaises(NotImplementedError,
                          wkk.Kernel('triangular').hmns, self.data)
Severity: Major
Found in src/wafo/kdetools/tests/test_kernels.py and 2 other locations - About 1 hr to fix
src/wafo/kdetools/tests/test_kernels.py on lines 116..117
src/wafo/kdetools/tests/test_kernels.py on lines 118..119

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

        self.assertRaises(NotImplementedError,
                          wkk.Kernel('biwe').hmns, self.data)
Severity: Major
Found in src/wafo/kdetools/tests/test_kernels.py and 2 other locations - About 1 hr to fix
src/wafo/kdetools/tests/test_kernels.py on lines 118..119
src/wafo/kdetools/tests/test_kernels.py on lines 120..121

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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 3 locations. Consider refactoring.
Open

        self.assertRaises(NotImplementedError,
                          wkk.Kernel('triwe').hmns, self.data)
Severity: Major
Found in src/wafo/kdetools/tests/test_kernels.py and 2 other locations - About 1 hr to fix
src/wafo/kdetools/tests/test_kernels.py on lines 116..117
src/wafo/kdetools/tests/test_kernels.py on lines 120..121

Duplicated Code

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

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

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

Tuning

This issue has a mass of 21.

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

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

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

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

Refactorings

Further Reading

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

        assert_allclose(hs, [[0.975375, -0.080535],
                             [-0.080535, 1.17577]], rtol=1e-5)
Severity: Major
Found in src/wafo/kdetools/tests/test_kernels.py and 1 other location - About 1 hr to fix
src/wafo/kdetools/tests/test_kernels.py on lines 111..112

Duplicated Code

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

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

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

Tuning

This issue has a mass of 21.

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

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

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

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

Refactorings

Further Reading

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

        assert_allclose(hs, [[0.868428, -0.071705],
                             [-0.071705, 1.04685]], rtol=1e-5)
Severity: Major
Found in src/wafo/kdetools/tests/test_kernels.py and 1 other location - About 1 hr to fix
src/wafo/kdetools/tests/test_kernels.py on lines 114..115

Duplicated Code

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

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

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

Tuning

This issue has a mass of 21.

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

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

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

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

Refactorings

Further Reading

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

        hs = self.gauss.hmns(self.data[0])
Severity: Major
Found in src/wafo/kdetools/tests/test_kernels.py and 1 other location - About 1 hr to fix
src/wafo/spectrum/models.py on lines 1799..1799

Duplicated Code

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

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

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

Tuning

This issue has a mass of 21.

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

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

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

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

Refactorings

Further Reading

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

        assert_allclose(hs,
                        [[8.363847e-01, -6.915749e-02, 8.202747e-04],
                         [-6.915749e-02, 1.006357e+00, 6.138052e-02],
                         [8.202747e-04, 6.138052e-02, 1.041954e+00]],
Severity: Major
Found in src/wafo/kdetools/tests/test_kernels.py and 1 other location - About 1 hr to fix
src/wafo/kdetools/tests/test_kernels.py on lines 98..100

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

        assert_allclose(hs, [[3.25196193e-01, -2.68892467e-02, 3.18932448e-04],
                             [-2.68892467e-02, 3.91283306e-01, 2.38654678e-02],
                             [3.18932448e-04, 2.38654678e-02, 4.05123874e-01]])
Severity: Major
Found in src/wafo/kdetools/tests/test_kernels.py and 1 other location - About 1 hr to fix
src/wafo/kdetools/tests/test_kernels.py on lines 105..108

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/kdetools/tests/test_kernels.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/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_objects.py on lines 187..189
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 6 locations. Consider refactoring.
Open

            m0 = kernel.norm_factor(d=1, n=1)
Severity: Major
Found in src/wafo/kdetools/tests/test_kernels.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/spectrum/core.py on lines 4400..4400
src/wafo/spectrum/tests/test_specdata1d.py on lines 183..183

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

        self.gauss = wkk.Kernel('gaussian')
Severity: Major
Found in src/wafo/kdetools/tests/test_kernels.py and 4 other locations - About 45 mins to fix
src/wafo/objects.py on lines 100..100
src/wafo/objects.py on lines 101..101
src/wafo/transform/core.py on lines 186..186
src/wafo/transform/core.py on lines 187..187

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

            xmin, xmax = kernel.effective_support()
Severity: Major
Found in src/wafo/kdetools/tests/test_kernels.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/objects.py on lines 779..779
src/wafo/spectrum/tests/test_specdata1d.py on lines 104..104
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 2 locations. Consider refactoring.
Open

            pdf = kernel(x) / m0
Severity: Minor
Found in src/wafo/kdetools/tests/test_kernels.py and 1 other location - About 35 mins to fix
src/wafo/stats/_continuous_distns.py on lines 7298..7298

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

There are no issues that match your filters.

Category
Status