wafo-project/pywafo

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

Summary

Maintainability
F
5 days
Test Coverage

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

                        [[[8.74229894e-01, 1.27910940e+00, 1.42033973e-01],
                          [1.94778915e+00, 2.59536282e+00, 3.28213680e-01],
                          [1.08429416e-01, 1.69571495e-01, 7.48896775e-03]],
                         [[1.44969128e+00, 2.58396370e+00, 2.45459949e-01],
                          [2.28951650e+00, 4.49653348e+00, 2.73167915e-01],
Severity: Major
Found in src/wafo/kdetools/tests/test_gridding.py and 4 other locations - About 4 hrs to fix
src/wafo/kdetools/tests/test_gridding.py on lines 80..88
src/wafo/kdetools/tests/test_gridding.py on lines 89..97
src/wafo/kdetools/tests/test_gridding.py on lines 98..106
src/wafo/tests/test_dct_pack.py on lines 22..30

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

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

                 [[[3.41883175e-01, 5.97977973e-01, 0.0],
                   [5.72071865e-01, 8.58566538e-01, 0.0],
                     [3.46939323e-03, 4.04056116e-02, 0.0]],
                  [[3.58861043e-01, 6.28962785e-01, 0.0],
                     [8.80697705e-01, 1.47373158e+00, 0.0],
Severity: Major
Found in src/wafo/kdetools/tests/test_gridding.py and 4 other locations - About 4 hrs to fix
src/wafo/kdetools/tests/test_gridding.py on lines 58..66
src/wafo/kdetools/tests/test_gridding.py on lines 80..88
src/wafo/kdetools/tests/test_gridding.py on lines 98..106
src/wafo/tests/test_dct_pack.py on lines 22..30

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

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

                 [[[3.13810608e-03, 2.11731327e-02, 0.0],
                   [6.71606255e-03, 4.53139824e-02, 0.0],
                     [0.0, 0.0, 0.0]],
                  [[7.05946179e-03, 5.44614852e-02, 0.0],
                   [1.09099593e-01, 1.95935584e-01, 0.0],
Severity: Major
Found in src/wafo/kdetools/tests/test_gridding.py and 4 other locations - About 4 hrs to fix
src/wafo/kdetools/tests/test_gridding.py on lines 58..66
src/wafo/kdetools/tests/test_gridding.py on lines 80..88
src/wafo/kdetools/tests/test_gridding.py on lines 89..97
src/wafo/tests/test_dct_pack.py on lines 22..30

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

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

        truth = [[[[1.77163904e-01, 1.87720108e-01, 0.0],
                   [5.72573585e-01, 6.09557834e-01, 0.0],
                   [3.48549923e-03, 4.05931870e-02, 0.0]],
                  [[1.83770124e-01, 2.56357594e-01, 0.0],
                   [4.35845892e-01, 6.14958970e-01, 0.0],
Severity: Major
Found in src/wafo/kdetools/tests/test_gridding.py and 4 other locations - About 4 hrs to fix
src/wafo/kdetools/tests/test_gridding.py on lines 58..66
src/wafo/kdetools/tests/test_gridding.py on lines 89..97
src/wafo/kdetools/tests/test_gridding.py on lines 98..106
src/wafo/tests/test_dct_pack.py on lines 22..30

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

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

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

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

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

Refactorings

Further Reading

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

        t = np.trapz(np.trapz(np.trapz(c / dx**3 / N, x), x), x)
Severity: Major
Found in src/wafo/kdetools/tests/test_gridding.py and 1 other location - About 3 hrs to fix
src/wafo/kdetools/tests/test_gridding.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 40.

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

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

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

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

Refactorings

Further Reading

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

        t = np.trapz(np.trapz(np.trapz(np.trapz(c / dx**4 / N, x), x), x), x)
Severity: Major
Found in src/wafo/kdetools/tests/test_gridding.py and 1 other location - About 3 hrs to fix
src/wafo/kdetools/tests/test_gridding.py on lines 68..68

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

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

                        [[0.38922806, 0.8987982, 0.34676493, 0.21042807, 0.],
                         [1.15012203, 5.16513541, 3.19250588, 0.55420752, 0.],
                         [0.74293418, 3.42517219, 1.97923195, 0.76076621, 0.],
                         [0.02063536, 0.31054405, 0.71865964, 0.13486633, 0.],
                         [0., 0., 0., 0., 0.]], 1e-5)
Severity: Major
Found in src/wafo/kdetools/tests/test_gridding.py and 1 other location - About 2 hrs to fix
src/wafo/tests/test_misc.py on lines 548..552

Duplicated Code

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

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

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

Tuning

This issue has a mass of 36.

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

        x = np.linspace(0, max(np.ravel(data)) + 1, 3)
Severity: Major
Found in src/wafo/kdetools/tests/test_gridding.py and 5 other locations - About 2 hrs to fix
src/wafo/kdetools/tests/test_gridding.py on lines 33..33
src/wafo/kdetools/tests/test_gridding.py on lines 52..52
src/wafo/kdetools/tests/test_kdetools.py on lines 181..181
src/wafo/kdetools/tests/test_kdetools.py on lines 219..219
src/wafo/kdetools/tests/test_kdetools.py on lines 232..232

Duplicated Code

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

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

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

Tuning

This issue has a mass of 29.

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

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

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

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

Refactorings

Further Reading

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

        x = np.linspace(0, max(np.ravel(data)) + 1, 5)
Severity: Major
Found in src/wafo/kdetools/tests/test_gridding.py and 5 other locations - About 2 hrs to fix
src/wafo/kdetools/tests/test_gridding.py on lines 52..52
src/wafo/kdetools/tests/test_gridding.py on lines 76..76
src/wafo/kdetools/tests/test_kdetools.py on lines 181..181
src/wafo/kdetools/tests/test_kdetools.py on lines 219..219
src/wafo/kdetools/tests/test_kdetools.py on lines 232..232

Duplicated Code

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

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

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

Tuning

This issue has a mass of 29.

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

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

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

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

Refactorings

Further Reading

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

        x = np.linspace(0, max(np.ravel(data)) + 1, 3)
Severity: Major
Found in src/wafo/kdetools/tests/test_gridding.py and 5 other locations - About 2 hrs to fix
src/wafo/kdetools/tests/test_gridding.py on lines 33..33
src/wafo/kdetools/tests/test_gridding.py on lines 76..76
src/wafo/kdetools/tests/test_kdetools.py on lines 181..181
src/wafo/kdetools/tests/test_kdetools.py on lines 219..219
src/wafo/kdetools/tests/test_kdetools.py on lines 232..232

Duplicated Code

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

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

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

Tuning

This issue has a mass of 29.

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

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

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

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

Refactorings

Further Reading

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

        dx = x[1] - x[0]
Severity: Major
Found in src/wafo/kdetools/tests/test_gridding.py and 15 other locations - About 1 hr to fix
src/wafo/covariance/estimation.py on lines 28..28
src/wafo/covariance/estimation.py on lines 30..30
src/wafo/kdetools/kdetools.py on lines 1125..1125
src/wafo/kdetools/tests/test_gridding.py on lines 34..34
src/wafo/kdetools/tests/test_gridding.py on lines 53..53
src/wafo/kdetools/tests/test_gridding.py on lines 77..77
src/wafo/misc.py on lines 2465..2465
src/wafo/misc.py on lines 2541..2541
src/wafo/objects.py on lines 1348..1348
src/wafo/objects.py on lines 1350..1350
src/wafo/sg_filter/demos.py on lines 47..47
src/wafo/spectrum/core.py on lines 1274..1274
src/wafo/spectrum/core.py on lines 1289..1289
src/wafo/spectrum/core.py on lines 1406..1406
src/wafo/spectrum/core.py on lines 1712..1712

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

        dx = x[1] - x[0]
Severity: Major
Found in src/wafo/kdetools/tests/test_gridding.py and 15 other locations - About 1 hr to fix
src/wafo/covariance/estimation.py on lines 28..28
src/wafo/covariance/estimation.py on lines 30..30
src/wafo/kdetools/kdetools.py on lines 1125..1125
src/wafo/kdetools/tests/test_gridding.py on lines 19..19
src/wafo/kdetools/tests/test_gridding.py on lines 53..53
src/wafo/kdetools/tests/test_gridding.py on lines 77..77
src/wafo/misc.py on lines 2465..2465
src/wafo/misc.py on lines 2541..2541
src/wafo/objects.py on lines 1348..1348
src/wafo/objects.py on lines 1350..1350
src/wafo/sg_filter/demos.py on lines 47..47
src/wafo/spectrum/core.py on lines 1274..1274
src/wafo/spectrum/core.py on lines 1289..1289
src/wafo/spectrum/core.py on lines 1406..1406
src/wafo/spectrum/core.py on lines 1712..1712

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

        dx = x[1] - x[0]
Severity: Major
Found in src/wafo/kdetools/tests/test_gridding.py and 15 other locations - About 1 hr to fix
src/wafo/covariance/estimation.py on lines 28..28
src/wafo/covariance/estimation.py on lines 30..30
src/wafo/kdetools/kdetools.py on lines 1125..1125
src/wafo/kdetools/tests/test_gridding.py on lines 19..19
src/wafo/kdetools/tests/test_gridding.py on lines 34..34
src/wafo/kdetools/tests/test_gridding.py on lines 53..53
src/wafo/misc.py on lines 2465..2465
src/wafo/misc.py on lines 2541..2541
src/wafo/objects.py on lines 1348..1348
src/wafo/objects.py on lines 1350..1350
src/wafo/sg_filter/demos.py on lines 47..47
src/wafo/spectrum/core.py on lines 1274..1274
src/wafo/spectrum/core.py on lines 1289..1289
src/wafo/spectrum/core.py on lines 1406..1406
src/wafo/spectrum/core.py on lines 1712..1712

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

        dx = x[1] - x[0]
Severity: Major
Found in src/wafo/kdetools/tests/test_gridding.py and 15 other locations - About 1 hr to fix
src/wafo/covariance/estimation.py on lines 28..28
src/wafo/covariance/estimation.py on lines 30..30
src/wafo/kdetools/kdetools.py on lines 1125..1125
src/wafo/kdetools/tests/test_gridding.py on lines 19..19
src/wafo/kdetools/tests/test_gridding.py on lines 34..34
src/wafo/kdetools/tests/test_gridding.py on lines 77..77
src/wafo/misc.py on lines 2465..2465
src/wafo/misc.py on lines 2541..2541
src/wafo/objects.py on lines 1348..1348
src/wafo/objects.py on lines 1350..1350
src/wafo/sg_filter/demos.py on lines 47..47
src/wafo/spectrum/core.py on lines 1274..1274
src/wafo/spectrum/core.py on lines 1289..1289
src/wafo/spectrum/core.py on lines 1406..1406
src/wafo/spectrum/core.py on lines 1712..1712

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

        x = np.linspace(0, max(data) + 1, 10)
Severity: Major
Found in src/wafo/kdetools/tests/test_gridding.py and 1 other location - About 1 hr to fix
src/wafo/kdetools/tests/test_kdetools.py on lines 144..144

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

        assert_allclose(c,
                        [0.1430937435034, 5.864465648665, 9.418694957317207,
                         2.9154367000439, 0.6583089504704, 0.0,
                         0.12255097773682266, 0.8774490222631774, 0.0, 0.0])
Severity: Major
Found in src/wafo/kdetools/tests/test_gridding.py and 14 other locations - About 1 hr to fix
src/wafo/kdetools/tests/test_kdetools.py on lines 89..91
src/wafo/kdetools/tests/test_kdetools.py on lines 94..96
src/wafo/kdetools/tests/test_kdetools.py on lines 99..103
src/wafo/kdetools/tests/test_kdetools.py on lines 106..110
src/wafo/kdetools/tests/test_kdetools.py on lines 118..122
src/wafo/kdetools/tests/test_kdetools.py on lines 125..129
src/wafo/kdetools/tests/test_kdetools.py on lines 147..149
src/wafo/kdetools/tests/test_kdetools.py on lines 151..153
src/wafo/kdetools/tests/test_kdetools.py on lines 155..157
src/wafo/kdetools/tests/test_kdetools.py on lines 160..164
src/wafo/kdetools/tests/test_kdetools.py on lines 171..173
src/wafo/kdetools/tests/test_kdetools.py on lines 184..186
src/wafo/kdetools/tests/test_kdetools.py on lines 202..204
src/wafo/kdetools/tests/test_kdetools.py on lines 222..224

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_gridding.py and 12 other locations - About 1 hr to fix
src/wafo/kdetools/tests/test_kdetools.py on lines 413..415
src/wafo/kdetools/tests/test_kernels.py on lines 146..148
src/wafo/sg_filter/tests/test_sg_filter.py on lines 78..80
src/wafo/spectrum/tests/test_models.py on lines 131..132
src/wafo/tests/test_bitwise.py on lines 36..38
src/wafo/tests/test_containers.py on lines 56..58
src/wafo/tests/test_dct_pack.py on lines 65..67
src/wafo/tests/test_gaussian.py on lines 169..171
src/wafo/tests/test_integrate.py on lines 122..124
src/wafo/tests/test_integrate_oscillating.py on lines 391..393
src/wafo/tests/test_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 3 locations. Consider refactoring.
Open

        X = np.vstack((x, x, x))
Severity: Major
Found in src/wafo/kdetools/tests/test_gridding.py and 2 other locations - About 55 mins to fix
src/wafo/interpolate.py on lines 104..104
src/wafo/sg_filter/demos.py on lines 173..173

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

        X = np.vstack((x, x))
Severity: Major
Found in src/wafo/kdetools/tests/test_gridding.py and 34 other locations - About 50 mins to fix
src/wafo/integrate.py on lines 1160..1160
src/wafo/integrate_oscillating.py on lines 294..294
src/wafo/kdetools/demo.py on lines 274..274
src/wafo/markov.py on lines 62..62
src/wafo/markov.py on lines 217..217
src/wafo/markov.py on lines 273..273
src/wafo/markov.py on lines 400..400
src/wafo/markov.py on lines 498..498
src/wafo/markov.py on lines 631..631
src/wafo/markov.py on lines 800..800
src/wafo/markov.py on lines 1170..1170
src/wafo/markov.py on lines 1171..1171
src/wafo/markov.py on lines 1175..1175
src/wafo/markov.py on lines 1176..1176
src/wafo/markov.py on lines 1185..1185
src/wafo/markov.py on lines 1186..1186
src/wafo/misc.py on lines 2300..2300
src/wafo/misc.py on lines 2471..2471
src/wafo/misc.py on lines 2477..2477
src/wafo/misc.py on lines 2552..2552
src/wafo/objects.py on lines 785..785
src/wafo/objects.py on lines 1012..1012
src/wafo/sg_filter/demos.py on lines 123..124
src/wafo/sg_filter/demos.py on lines 172..172
src/wafo/sg_filter/demos.py on lines 185..185
src/wafo/spectrum/core.py on lines 1707..1707
src/wafo/stats/core.py on lines 965..965
src/wafo/stats/core.py on lines 972..972
src/wafo/stats/core.py on lines 1281..1281
src/wafo/stats/core.py on lines 1314..1314
src/wafo/stats/core.py on lines 1315..1315
src/wafo/stats/estimation.py on lines 1225..1225
src/wafo/wavemodels.py on lines 119..119
src/wafo/wavemodels.py on lines 220..220

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

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

        assert_allclose(c.sum(), N)
Severity: Major
Found in src/wafo/kdetools/tests/test_gridding.py and 2 other locations - About 40 mins to fix
src/wafo/kdetools/tests/test_gridding.py on lines 37..37
src/wafo/kdetools/tests/test_gridding.py on lines 56..56

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

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

        assert_allclose(c.sum(), N)
Severity: Major
Found in src/wafo/kdetools/tests/test_gridding.py and 2 other locations - About 40 mins to fix
src/wafo/kdetools/tests/test_gridding.py on lines 37..37
src/wafo/kdetools/tests/test_gridding.py on lines 107..107

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

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

        assert_allclose(c.sum(), N)
Severity: Major
Found in src/wafo/kdetools/tests/test_gridding.py and 2 other locations - About 40 mins to fix
src/wafo/kdetools/tests/test_gridding.py on lines 56..56
src/wafo/kdetools/tests/test_gridding.py on lines 107..107

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

        X = np.vstack((x, x, x, x))
Severity: Minor
Found in src/wafo/kdetools/tests/test_gridding.py and 1 other location - About 40 mins to fix
src/wafo/stats/estimation.py on lines 442..442

Duplicated Code

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

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

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

Tuning

This issue has a mass of 12.

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

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

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

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

Refactorings

Further Reading

There are no issues that match your filters.

Category
Status