wafo-project/pywafo

View on GitHub
src/wafo/doc/tutorial_scripts/rainflow_example.py

Summary

Maintainability
F
3 days
Test Coverage

Remove this commented out code.
Open

# m_rfc_a, M_rfc_a = mM_rfc_a.get_minima_and_maxima()

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

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

#xx_sea[:, 1] = A * np.cos(2 * np.pi * xx_sea[:, 0]/Tp)

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

Tlength = xx_sea[-1, 0] - xx_sea[0, 0]
Severity: Major
Found in src/wafo/doc/tutorial_scripts/rainflow_example.py and 1 other location - About 2 hrs to fix
src/wafo/interpolate.py on lines 380..380

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

T_sea = ts.args[-1] - ts.args[0]
Severity: Major
Found in src/wafo/doc/tutorial_scripts/rainflow_example.py and 5 other locations - About 1 hr to fix
src/wafo/covariance/core.py on lines 286..286
src/wafo/covariance/core.py on lines 288..288
src/wafo/doc/tutorial_scripts/chapter4.py on lines 42..42
src/wafo/objects.py on lines 1233..1233
src/wafo/spectrum/core.py on lines 4094..4094

Duplicated Code

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

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

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

Tuning

This issue has a mass of 27.

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

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

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

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

Refactorings

Further Reading

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

    plot_varying_symbols(tp.args[1::2], M1, color='green', size=10)
Severity: Major
Found in src/wafo/doc/tutorial_scripts/rainflow_example.py and 2 other locations - About 1 hr to fix
src/wafo/doc/tutorial_scripts/rainflow_example.py on lines 113..113
src/wafo/doc/tutorial_scripts/rainflow_example.py on lines 114..114

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

    plot_varying_symbols(tp_rfc.args[1::2], M_rfc, color='green', size=10)
Severity: Major
Found in src/wafo/doc/tutorial_scripts/rainflow_example.py and 2 other locations - About 1 hr to fix
src/wafo/doc/tutorial_scripts/rainflow_example.py on lines 113..113
src/wafo/doc/tutorial_scripts/rainflow_example.py on lines 117..117

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

    plot_varying_symbols(tp_rfc.args[0::2], m_rfc, color='red', size=10)
Severity: Major
Found in src/wafo/doc/tutorial_scripts/rainflow_example.py and 2 other locations - About 1 hr to fix
src/wafo/doc/tutorial_scripts/rainflow_example.py on lines 114..114
src/wafo/doc/tutorial_scripts/rainflow_example.py on lines 117..117

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

    hist, bin_edges = np.histogram(
        sig_cp[
Severity: Major
Found in src/wafo/doc/tutorial_scripts/rainflow_example.py and 1 other location - About 1 hr to fix
src/wafo/doc/tutorial_scripts/rainflow_example.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 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

    wm.plot_histgrm(sig_cp[:, 0], bins=n_bins, range=stress_range)
Severity: Major
Found in src/wafo/doc/tutorial_scripts/rainflow_example.py and 1 other location - About 1 hr to fix
src/wafo/doc/tutorial_scripts/rainflow_example.py on lines 160..161

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

wm.plot_histgrm(ampmM_sea, bins=n_bins, range=stress_range)
Severity: Major
Found in src/wafo/doc/tutorial_scripts/rainflow_example.py and 1 other location - About 1 hr to fix
src/wafo/doc/tutorial_scripts/chapter1.py on lines 67..67

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

xx_sea[:, 1] *= 500e6
Severity: Major
Found in src/wafo/doc/tutorial_scripts/rainflow_example.py and 1 other location - About 1 hr to fix
src/wafo/objects.py on lines 245..245

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

MARKERS = ('o', 'x', '+', '.', '<', '>', '^', 'v')
Severity: Major
Found in src/wafo/doc/tutorial_scripts/rainflow_example.py and 4 other locations - About 50 mins to fix
src/wafo/containers.py on lines 494..495
src/wafo/covariance/core.py on lines 128..128
src/wafo/dctpack.py on lines 7..7
src/wafo/stats/tests/test_fit.py on lines 19..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 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 15 locations. Consider refactoring.
Open

tp_rfc = tp1.rainflow_filter(h=100e6)
Severity: Major
Found in src/wafo/doc/tutorial_scripts/rainflow_example.py and 14 other locations - About 45 mins to fix
src/wafo/covariance/core.py on lines 705..705
src/wafo/covariance/core.py on lines 716..716
src/wafo/doc/tutorial_scripts/chapter1.py on lines 46..46
src/wafo/doc/tutorial_scripts/chapter1.py on lines 178..178
src/wafo/doc/tutorial_scripts/chapter2.py on lines 128..128
src/wafo/doc/tutorial_scripts/chapter2.py on lines 142..142
src/wafo/doc/tutorial_scripts/chapter4.py on lines 62..62
src/wafo/doc/tutorial_scripts/chapter5.py on lines 117..117
src/wafo/kdetools/tests/test_kdetools.py on lines 353..353
src/wafo/spectrum/core.py on lines 2624..2624
src/wafo/spectrum/core.py on lines 4371..4371
src/wafo/spectrum/core.py on lines 4378..4378
src/wafo/spectrum/core.py on lines 4387..4387
src/wafo/transform/models.py on lines 223..223

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

mM1 = tp1.cycle_pairs(kind='min2max')
Severity: Major
Found in src/wafo/doc/tutorial_scripts/rainflow_example.py and 7 other locations - About 45 mins to fix
src/wafo/doc/tutorial_scripts/chapter4.py on lines 40..40
src/wafo/doc/tutorial_scripts/rainflow_example.py on lines 70..70
src/wafo/doc/tutorial_scripts/rainflow_example.py on lines 71..71
src/wafo/doc/tutorial_scripts/rainflow_example.py on lines 89..89
src/wafo/doc/tutorial_scripts/rainflow_example.py on lines 91..91
src/wafo/kdetools/tests/test_kdetools.py on lines 193..193
src/wafo/kdetools/tests/test_kdetools.py on lines 212..212

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

mM = tp.cycle_pairs(kind='min2max')
Severity: Major
Found in src/wafo/doc/tutorial_scripts/rainflow_example.py and 7 other locations - About 45 mins to fix
src/wafo/doc/tutorial_scripts/chapter4.py on lines 40..40
src/wafo/doc/tutorial_scripts/rainflow_example.py on lines 71..71
src/wafo/doc/tutorial_scripts/rainflow_example.py on lines 89..89
src/wafo/doc/tutorial_scripts/rainflow_example.py on lines 90..90
src/wafo/doc/tutorial_scripts/rainflow_example.py on lines 91..91
src/wafo/kdetools/tests/test_kdetools.py on lines 193..193
src/wafo/kdetools/tests/test_kdetools.py on lines 212..212

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

Mm1 = tp1.cycle_pairs(kind='max2min')
Severity: Major
Found in src/wafo/doc/tutorial_scripts/rainflow_example.py and 7 other locations - About 45 mins to fix
src/wafo/doc/tutorial_scripts/chapter4.py on lines 40..40
src/wafo/doc/tutorial_scripts/rainflow_example.py on lines 70..70
src/wafo/doc/tutorial_scripts/rainflow_example.py on lines 71..71
src/wafo/doc/tutorial_scripts/rainflow_example.py on lines 89..89
src/wafo/doc/tutorial_scripts/rainflow_example.py on lines 90..90
src/wafo/kdetools/tests/test_kdetools.py on lines 193..193
src/wafo/kdetools/tests/test_kdetools.py on lines 212..212

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

tp2 = ts1.turning_points(wavetype='Mw')
Severity: Major
Found in src/wafo/doc/tutorial_scripts/rainflow_example.py and 7 other locations - About 45 mins to fix
src/wafo/doc/tutorial_scripts/chapter4.py on lines 40..40
src/wafo/doc/tutorial_scripts/rainflow_example.py on lines 70..70
src/wafo/doc/tutorial_scripts/rainflow_example.py on lines 71..71
src/wafo/doc/tutorial_scripts/rainflow_example.py on lines 90..90
src/wafo/doc/tutorial_scripts/rainflow_example.py on lines 91..91
src/wafo/kdetools/tests/test_kdetools.py on lines 193..193
src/wafo/kdetools/tests/test_kdetools.py on lines 212..212

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

Mm = tp.cycle_pairs(kind='max2min')
Severity: Major
Found in src/wafo/doc/tutorial_scripts/rainflow_example.py and 7 other locations - About 45 mins to fix
src/wafo/doc/tutorial_scripts/chapter4.py on lines 40..40
src/wafo/doc/tutorial_scripts/rainflow_example.py on lines 70..70
src/wafo/doc/tutorial_scripts/rainflow_example.py on lines 89..89
src/wafo/doc/tutorial_scripts/rainflow_example.py on lines 90..90
src/wafo/doc/tutorial_scripts/rainflow_example.py on lines 91..91
src/wafo/kdetools/tests/test_kdetools.py on lines 193..193
src/wafo/kdetools/tests/test_kdetools.py on lines 212..212

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

    plt.gca().set_ylim(ylim)
Severity: Minor
Found in src/wafo/doc/tutorial_scripts/rainflow_example.py and 1 other location - About 45 mins to fix
src/wafo/doc/tutorial_scripts/chapter4.py on lines 85..85

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

ylim = plt.gca().get_ylim()
Severity: Minor
Found in src/wafo/doc/tutorial_scripts/rainflow_example.py and 1 other location - About 45 mins to fix
src/wafo/doc/tutorial_scripts/chapter4.py on lines 81..81

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 12.

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

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

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

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

Refactorings

Further Reading

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

    m1, M1 = Mm1.get_minima_and_maxima()
Severity: Major
Found in src/wafo/doc/tutorial_scripts/rainflow_example.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 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/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

m_rfc, M_rfc = mM_rfc.get_minima_and_maxima()
Severity: Major
Found in src/wafo/doc/tutorial_scripts/rainflow_example.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/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/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

    m1, M1 = mM1.get_minima_and_maxima()
Severity: Major
Found in src/wafo/doc/tutorial_scripts/rainflow_example.py and 8 other locations - About 40 mins to fix
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/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 3 locations. Consider refactoring.
Open

sig_tp = ts.turning_points(h=0, wavetype='astm')
Severity: Major
Found in src/wafo/doc/tutorial_scripts/rainflow_example.py and 2 other locations - About 40 mins to fix
src/wafo/doc/tutorial_scripts/chapter1.py on lines 65..65
src/wafo/spectrum/core.py on lines 4385..4385

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

plt.subplot(122),
Severity: Major
Found in src/wafo/doc/tutorial_scripts/rainflow_example.py and 3 other locations - About 35 mins to fix
src/wafo/doc/tutorial_scripts/chapter4.py on lines 65..65
src/wafo/doc/tutorial_scripts/chapter4.py on lines 68..68
src/wafo/doc/tutorial_scripts/rainflow_example.py on lines 125..125

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

plt.subplot(121),
Severity: Major
Found in src/wafo/doc/tutorial_scripts/rainflow_example.py and 3 other locations - About 35 mins to fix
src/wafo/doc/tutorial_scripts/chapter4.py on lines 65..65
src/wafo/doc/tutorial_scripts/chapter4.py on lines 68..68
src/wafo/doc/tutorial_scripts/rainflow_example.py on lines 122..122

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

Rename function "damage_vs_S" to match the regular expression ^[a-z_][a-z0-9_]{2,}$.
Open

def damage_vs_S(S, beta, K):

Shared coding conventions allow teams to collaborate efficiently. This rule checks that all function names match a provided regular expression.

Noncompliant Code Example

With the default provided regular expression: ^[a-z_][a-z0-9_]{2,30}$

def MyFunction(a,b):
    ...

Compliant Solution

def my_function(a,b):
    ...

There are no issues that match your filters.

Category
Status