sylvchev/mdla

View on GitHub
experiments/experiment_dictionary_recovering.py

Summary

Maintainability
F
6 days
Test Coverage

File experiment_dictionary_recovering.py has 267 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""Dictionary recovering experiment for univariate random dataset"""
import pickle
from os.path import exists

import matplotlib.pyplot as plt
Severity: Minor
Found in experiments/experiment_dictionary_recovering.py - About 2 hrs to fix

    Function plot_recov has 9 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def plot_recov(wc, wfs, hc, hfs, bd, dr99, dr97, n_iter, figname):
    Severity: Major
    Found in experiments/experiment_dictionary_recovering.py - About 1 hr to fix

      Function _generate_testbed has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def _generate_testbed(
      Severity: Major
      Found in experiments/experiment_dictionary_recovering.py - About 50 mins to fix

        Function _generate_testbed has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        def _generate_testbed(
            kernel_init_len,
            n_nonzero_coefs,
            n_kernels,
            n_samples=10,
        Severity: Minor
        Found in experiments/experiment_dictionary_recovering.py - About 35 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

        def _generate_testbed(
            kernel_init_len,
            n_nonzero_coefs,
            n_kernels,
            n_samples=10,
        Severity: Major
        Found in experiments/experiment_dictionary_recovering.py and 1 other location - About 3 days to fix
        experiments/experiment_multivariate_recovering.py on lines 23..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 385.

        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

                metbeta.annotate(
                    "SNR " + s,
                    xy=(0.51, 1.0 - i * 1.0 / 3.0 + i * 0.01 - 0.001),
        Severity: Major
        Found in experiments/experiment_dictionary_recovering.py and 2 other locations - About 3 hrs to fix
        experiments/experiment_multivariate_recovering.py on lines 128..130
        experiments/experiment_multivariate_recovering.py on lines 185..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 70.

        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

            wc, wfs, hc, hfs = o["wc"], o["wfs"], o["hc"], o["hfs"]
        Severity: Major
        Found in experiments/experiment_dictionary_recovering.py and 3 other locations - About 1 hr to fix
        experiments/experiment_multivariate_recovering.py on lines 246..246
        experiments/experiment_multivariate_recovering.py on lines 247..247
        experiments/experiment_multivariate_recovering.py on lines 248..248

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

        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

                    d = MiniBatchMultivariateDictLearning(
        Severity: Major
        Found in experiments/experiment_dictionary_recovering.py and 1 other location - About 1 hr to fix
        experiments/experiment_multivariate_recovering.py on lines 278..278

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

        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

                medianlt97 = [median.get_ydata()[0] for n, median in enumerate(det97["medians"])]
        Severity: Major
        Found in experiments/experiment_dictionary_recovering.py and 8 other locations - About 50 mins to fix
        examples/plot_bci_dict.py on lines 115..115
        experiments/experiment_dictionary_recovering.py on lines 73..73
        experiments/experiment_dictionary_recovering.py on lines 108..108
        experiments/experiment_dictionary_recovering.py on lines 118..118
        experiments/experiment_dictionary_recovering.py on lines 140..140
        experiments/experiment_dictionary_recovering.py on lines 150..150
        experiments/experiment_dictionary_recovering.py on lines 173..173
        experiments/experiment_multivariate_recovering.py on lines 77..77

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

                medianwc = [median.get_ydata()[0] for n, median in enumerate(wassch["medians"])]
        Severity: Major
        Found in experiments/experiment_dictionary_recovering.py and 8 other locations - About 50 mins to fix
        examples/plot_bci_dict.py on lines 115..115
        experiments/experiment_dictionary_recovering.py on lines 73..73
        experiments/experiment_dictionary_recovering.py on lines 87..87
        experiments/experiment_dictionary_recovering.py on lines 108..108
        experiments/experiment_dictionary_recovering.py on lines 118..118
        experiments/experiment_dictionary_recovering.py on lines 150..150
        experiments/experiment_dictionary_recovering.py on lines 173..173
        experiments/experiment_multivariate_recovering.py on lines 77..77

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

                medianlt99 = [median.get_ydata()[0] for n, median in enumerate(det99["medians"])]
        Severity: Major
        Found in experiments/experiment_dictionary_recovering.py and 8 other locations - About 50 mins to fix
        examples/plot_bci_dict.py on lines 115..115
        experiments/experiment_dictionary_recovering.py on lines 87..87
        experiments/experiment_dictionary_recovering.py on lines 108..108
        experiments/experiment_dictionary_recovering.py on lines 118..118
        experiments/experiment_dictionary_recovering.py on lines 140..140
        experiments/experiment_dictionary_recovering.py on lines 150..150
        experiments/experiment_dictionary_recovering.py on lines 173..173
        experiments/experiment_multivariate_recovering.py on lines 77..77

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

                medianhfs = [median.get_ydata()[0] for n, median in enumerate(hausfs["medians"])]
        Severity: Major
        Found in experiments/experiment_dictionary_recovering.py and 8 other locations - About 50 mins to fix
        examples/plot_bci_dict.py on lines 115..115
        experiments/experiment_dictionary_recovering.py on lines 73..73
        experiments/experiment_dictionary_recovering.py on lines 87..87
        experiments/experiment_dictionary_recovering.py on lines 108..108
        experiments/experiment_dictionary_recovering.py on lines 140..140
        experiments/experiment_dictionary_recovering.py on lines 150..150
        experiments/experiment_dictionary_recovering.py on lines 173..173
        experiments/experiment_multivariate_recovering.py on lines 77..77

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

                medianwfs = [median.get_ydata()[0] for n, median in enumerate(wassfs["medians"])]
        Severity: Major
        Found in experiments/experiment_dictionary_recovering.py and 8 other locations - About 50 mins to fix
        examples/plot_bci_dict.py on lines 115..115
        experiments/experiment_dictionary_recovering.py on lines 73..73
        experiments/experiment_dictionary_recovering.py on lines 87..87
        experiments/experiment_dictionary_recovering.py on lines 108..108
        experiments/experiment_dictionary_recovering.py on lines 118..118
        experiments/experiment_dictionary_recovering.py on lines 140..140
        experiments/experiment_dictionary_recovering.py on lines 173..173
        experiments/experiment_multivariate_recovering.py on lines 77..77

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

                medianbd = [median.get_ydata()[0] for n, median in enumerate(betad["medians"])]
        Severity: Major
        Found in experiments/experiment_dictionary_recovering.py and 8 other locations - About 50 mins to fix
        examples/plot_bci_dict.py on lines 115..115
        experiments/experiment_dictionary_recovering.py on lines 73..73
        experiments/experiment_dictionary_recovering.py on lines 87..87
        experiments/experiment_dictionary_recovering.py on lines 108..108
        experiments/experiment_dictionary_recovering.py on lines 118..118
        experiments/experiment_dictionary_recovering.py on lines 140..140
        experiments/experiment_dictionary_recovering.py on lines 150..150
        experiments/experiment_multivariate_recovering.py on lines 77..77

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

                medianhc = [median.get_ydata()[0] for n, median in enumerate(hausch["medians"])]
        Severity: Major
        Found in experiments/experiment_dictionary_recovering.py and 8 other locations - About 50 mins to fix
        examples/plot_bci_dict.py on lines 115..115
        experiments/experiment_dictionary_recovering.py on lines 73..73
        experiments/experiment_dictionary_recovering.py on lines 87..87
        experiments/experiment_dictionary_recovering.py on lines 118..118
        experiments/experiment_dictionary_recovering.py on lines 140..140
        experiments/experiment_dictionary_recovering.py on lines 150..150
        experiments/experiment_dictionary_recovering.py on lines 173..173
        experiments/experiment_multivariate_recovering.py on lines 77..77

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

                _ = methaus.plot(
                    arange(1, n_iter + 1),
                    medianhfs,
        Severity: Major
        Found in experiments/experiment_dictionary_recovering.py and 6 other locations - About 35 mins to fix
        experiments/experiment_dictionary_recovering.py on lines 74..76
        experiments/experiment_dictionary_recovering.py on lines 88..90
        experiments/experiment_dictionary_recovering.py on lines 109..110
        experiments/experiment_dictionary_recovering.py on lines 141..142
        experiments/experiment_dictionary_recovering.py on lines 151..153
        experiments/experiment_dictionary_recovering.py on lines 174..176

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 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

                _ = methaus.plot(
                    arange(1, n_iter + 1), medianhc, linewidth=1, label=r"$1-d_H^c$", color="cyan"
        Severity: Major
        Found in experiments/experiment_dictionary_recovering.py and 6 other locations - About 35 mins to fix
        experiments/experiment_dictionary_recovering.py on lines 74..76
        experiments/experiment_dictionary_recovering.py on lines 88..90
        experiments/experiment_dictionary_recovering.py on lines 119..121
        experiments/experiment_dictionary_recovering.py on lines 141..142
        experiments/experiment_dictionary_recovering.py on lines 151..153
        experiments/experiment_dictionary_recovering.py on lines 174..176

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 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

                _ = detection.plot(
                    arange(1, n_iter + 1),
                    medianlt99,
        Severity: Major
        Found in experiments/experiment_dictionary_recovering.py and 6 other locations - About 35 mins to fix
        experiments/experiment_dictionary_recovering.py on lines 88..90
        experiments/experiment_dictionary_recovering.py on lines 109..110
        experiments/experiment_dictionary_recovering.py on lines 119..121
        experiments/experiment_dictionary_recovering.py on lines 141..142
        experiments/experiment_dictionary_recovering.py on lines 151..153
        experiments/experiment_dictionary_recovering.py on lines 174..176

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 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

                _ = metbeta.plot(
                    arange(1, n_iter + 1),
                    medianbd,
        Severity: Major
        Found in experiments/experiment_dictionary_recovering.py and 6 other locations - About 35 mins to fix
        experiments/experiment_dictionary_recovering.py on lines 74..76
        experiments/experiment_dictionary_recovering.py on lines 88..90
        experiments/experiment_dictionary_recovering.py on lines 109..110
        experiments/experiment_dictionary_recovering.py on lines 119..121
        experiments/experiment_dictionary_recovering.py on lines 141..142
        experiments/experiment_dictionary_recovering.py on lines 151..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 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

                _ = detection.plot(
                    arange(1, n_iter + 1),
                    medianlt97,
        Severity: Major
        Found in experiments/experiment_dictionary_recovering.py and 6 other locations - About 35 mins to fix
        experiments/experiment_dictionary_recovering.py on lines 74..76
        experiments/experiment_dictionary_recovering.py on lines 109..110
        experiments/experiment_dictionary_recovering.py on lines 119..121
        experiments/experiment_dictionary_recovering.py on lines 141..142
        experiments/experiment_dictionary_recovering.py on lines 151..153
        experiments/experiment_dictionary_recovering.py on lines 174..176

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 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

                _ = metwass.plot(
                    arange(1, n_iter + 1),
                    medianwfs,
        Severity: Major
        Found in experiments/experiment_dictionary_recovering.py and 6 other locations - About 35 mins to fix
        experiments/experiment_dictionary_recovering.py on lines 74..76
        experiments/experiment_dictionary_recovering.py on lines 88..90
        experiments/experiment_dictionary_recovering.py on lines 109..110
        experiments/experiment_dictionary_recovering.py on lines 119..121
        experiments/experiment_dictionary_recovering.py on lines 141..142
        experiments/experiment_dictionary_recovering.py on lines 174..176

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 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

                _ = metwass.plot(
                    arange(1, n_iter + 1), medianwc, linewidth=1, label=r"$1-d_W^c$", color="red"
        Severity: Major
        Found in experiments/experiment_dictionary_recovering.py and 6 other locations - About 35 mins to fix
        experiments/experiment_dictionary_recovering.py on lines 74..76
        experiments/experiment_dictionary_recovering.py on lines 88..90
        experiments/experiment_dictionary_recovering.py on lines 109..110
        experiments/experiment_dictionary_recovering.py on lines 119..121
        experiments/experiment_dictionary_recovering.py on lines 151..153
        experiments/experiment_dictionary_recovering.py on lines 174..176

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 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

        There are no issues that match your filters.

        Category
        Status