SylvainDe/DidYouMean-Python

View on GitHub

Showing 142 of 142 total issues

NameErrorTests has 40 functions (exceeds 20 allowed). Consider refactoring.
Open

class NameErrorTests(GetSuggestionsTests):
    """Class for tests related to NameError."""

    aiter_sugg = []
    try:
Severity: Minor
Found in didyoumean/didyoumean_sugg_tests.py - About 5 hrs to fix

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

        def test_unordered_builtin(self):
            """Test for UNORDERABLE exception on builtin types."""
            before, mid, after = before_mid_and_after((3, 0), (3, 6))
            for op in ['>', '>=', '<', '<=']:
                code = "'10' {0} 2".format(op)
    Severity: Major
    Found in didyoumean/didyoumean_sugg_tests.py and 2 other locations - About 4 hrs to fix
    didyoumean/didyoumean_sugg_tests.py on lines 2025..2032
    didyoumean/didyoumean_sugg_tests.py on lines 2034..2041

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

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

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

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

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

    Refactorings

    Further Reading

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

        def test_unordered_custom2(self):
            """Test for UNORDERABLE exception on custom types."""
            before, mid, after = before_mid_and_after((3, 0), (3, 6))
            for op in ['>', '>=', '<', '<=']:
                code = "CustomClass() {0} 2".format(op)
    Severity: Major
    Found in didyoumean/didyoumean_sugg_tests.py and 2 other locations - About 4 hrs to fix
    didyoumean/didyoumean_sugg_tests.py on lines 2016..2023
    didyoumean/didyoumean_sugg_tests.py on lines 2025..2032

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

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

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

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

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

    Refactorings

    Further Reading

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

        def test_unordered_custom(self):
            """Test for UNORDERABLE exception on custom types."""
            before, mid, after = before_mid_and_after((3, 0), (3, 6))
            for op in ['>', '>=', '<', '<=']:
                code = "CustomClass() {0} CustomClass()".format(op)
    Severity: Major
    Found in didyoumean/didyoumean_sugg_tests.py and 2 other locations - About 4 hrs to fix
    didyoumean/didyoumean_sugg_tests.py on lines 2016..2023
    didyoumean/didyoumean_sugg_tests.py on lines 2034..2041

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

    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

        def test_unexpected_kw_arg4(self):
            """Test UNEXPECTED_KEYWORDARG4_RE."""
            # Python 3.7
            msgs = [
                ("'this_doesnt_exist' is an invalid keyword argument for int()",
    Severity: Major
    Found in didyoumean/didyoumean_re_tests.py and 1 other location - About 4 hrs to fix
    didyoumean/didyoumean_re_tests.py on lines 277..293

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

    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

        def test_unexpected_kw_arg(self):
            """Test UNEXPECTED_KEYWORDARG_RE."""
            msgs = [
                # Python 2.6/2.7/3.2/3.3/3.4/3.5/PyPy/PyPy3
                ("some_func() got an unexpected keyword argument 'a'",
    Severity: Major
    Found in didyoumean/didyoumean_re_tests.py and 1 other location - About 4 hrs to fix
    didyoumean/didyoumean_re_tests.py on lines 329..344

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

    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

        def test_no_module(self):
            """Should be 'math'."""
            code = 'import {0}'
            typo, good = 'maths', 'math'
            self.assertTrue(good in STAND_MODULES)
    Severity: Major
    Found in didyoumean/didyoumean_sugg_tests.py and 5 other locations - About 4 hrs to fix
    didyoumean/didyoumean_sugg_tests.py on lines 2066..2074
    didyoumean/didyoumean_sugg_tests.py on lines 2076..2084
    didyoumean/didyoumean_sugg_tests.py on lines 2086..2094
    didyoumean/didyoumean_sugg_tests.py on lines 2096..2104
    didyoumean/didyoumean_sugg_tests.py on lines 2106..2114

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

    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

        def test_no_module3(self):
            """Should be 'math'."""
            code = 'import {0} as my_imported_math'
            typo, good = 'maths', 'math'
            self.assertTrue(good in STAND_MODULES)
    Severity: Major
    Found in didyoumean/didyoumean_sugg_tests.py and 5 other locations - About 4 hrs to fix
    didyoumean/didyoumean_sugg_tests.py on lines 2056..2064
    didyoumean/didyoumean_sugg_tests.py on lines 2066..2074
    didyoumean/didyoumean_sugg_tests.py on lines 2086..2094
    didyoumean/didyoumean_sugg_tests.py on lines 2096..2104
    didyoumean/didyoumean_sugg_tests.py on lines 2106..2114

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

    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

        def test_import_future_nomodule(self):
            """Should be '__future__'."""
            code = 'import {0}'
            typo, good = '__future_', '__future__'
            self.assertTrue(good in STAND_MODULES)
    Severity: Major
    Found in didyoumean/didyoumean_sugg_tests.py and 5 other locations - About 4 hrs to fix
    didyoumean/didyoumean_sugg_tests.py on lines 2056..2064
    didyoumean/didyoumean_sugg_tests.py on lines 2066..2074
    didyoumean/didyoumean_sugg_tests.py on lines 2076..2084
    didyoumean/didyoumean_sugg_tests.py on lines 2086..2094
    didyoumean/didyoumean_sugg_tests.py on lines 2096..2104

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

    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

        def test_no_module5(self):
            """Should be 'math'."""
            code = '__import__("{0}")'
            typo, good = 'maths', 'math'
            self.assertTrue(good in STAND_MODULES)
    Severity: Major
    Found in didyoumean/didyoumean_sugg_tests.py and 5 other locations - About 4 hrs to fix
    didyoumean/didyoumean_sugg_tests.py on lines 2056..2064
    didyoumean/didyoumean_sugg_tests.py on lines 2066..2074
    didyoumean/didyoumean_sugg_tests.py on lines 2076..2084
    didyoumean/didyoumean_sugg_tests.py on lines 2086..2094
    didyoumean/didyoumean_sugg_tests.py on lines 2106..2114

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

    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

        def test_wrongmethod(self):
            """Should be 'lst.append(1)'."""
            code = '[0].{0}(1)'
            typo, typo2, good = 'add', 'push', 'append'
            sugg = quote(good)
    Severity: Major
    Found in didyoumean/didyoumean_sugg_tests.py and 1 other location - About 4 hrs to fix
    didyoumean/didyoumean_sugg_tests.py on lines 1041..1049

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

    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

        def test_wrongmethod5(self):
            """Should be 's.add()'."""
            code = 'set().{0}(1)'
            typo, typo2, good = 'append', 'push', 'add'
            sugg = quote(good)
    Severity: Major
    Found in didyoumean/didyoumean_sugg_tests.py and 1 other location - About 4 hrs to fix
    didyoumean/didyoumean_sugg_tests.py on lines 1002..1010

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

    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

        def test_no_module2(self):
            """Should be 'math'."""
            code = 'from {0} import pi'
            typo, good = 'maths', 'math'
            self.assertTrue(good in STAND_MODULES)
    Severity: Major
    Found in didyoumean/didyoumean_sugg_tests.py and 5 other locations - About 4 hrs to fix
    didyoumean/didyoumean_sugg_tests.py on lines 2056..2064
    didyoumean/didyoumean_sugg_tests.py on lines 2076..2084
    didyoumean/didyoumean_sugg_tests.py on lines 2086..2094
    didyoumean/didyoumean_sugg_tests.py on lines 2096..2104
    didyoumean/didyoumean_sugg_tests.py on lines 2106..2114

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

    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

        def test_no_module4(self):
            """Should be 'math'."""
            code = 'from {0} import pi as three_something'
            typo, good = 'maths', 'math'
            self.assertTrue(good in STAND_MODULES)
    Severity: Major
    Found in didyoumean/didyoumean_sugg_tests.py and 5 other locations - About 4 hrs to fix
    didyoumean/didyoumean_sugg_tests.py on lines 2056..2064
    didyoumean/didyoumean_sugg_tests.py on lines 2066..2074
    didyoumean/didyoumean_sugg_tests.py on lines 2076..2084
    didyoumean/didyoumean_sugg_tests.py on lines 2096..2104
    didyoumean/didyoumean_sugg_tests.py on lines 2106..2114

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

    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

        def test_removed_has_key(self):
            """Method has_key is removed from dict."""
            code = 'dict().has_key(1)'
            new_code = '1 in dict()'
            sugg = "'key in dict' (has_key is removed)"
    Severity: Major
    Found in didyoumean/didyoumean_sugg_tests.py and 1 other location - About 3 hrs to fix
    didyoumean/didyoumean_sugg_tests.py on lines 992..1000

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

        def test_local(self):
            """Should be 'foo'."""
            code = "foo = 0\n{0}"
            typo, good = "foob", "foo"
            sugg = "'{0}' (local)".format(good)
    Severity: Major
    Found in didyoumean/didyoumean_sugg_tests.py and 2 other locations - About 3 hrs to fix
    didyoumean/didyoumean_sugg_tests.py on lines 569..576
    didyoumean/didyoumean_sugg_tests.py on lines 578..585

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

        def test_import2(self):
            """Should be my_imported_math."""
            code = 'import math as my_imported_math\n{0}'
            typo, good = 'my_imported_maths', 'my_imported_math'
            sugg = "'{0}' (local)".format(good)
    Severity: Major
    Found in didyoumean/didyoumean_sugg_tests.py and 2 other locations - About 3 hrs to fix
    didyoumean/didyoumean_sugg_tests.py on lines 500..507
    didyoumean/didyoumean_sugg_tests.py on lines 569..576

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

        def test_import(self):
            """Should be math."""
            code = 'import math\n{0}'
            typo, good = 'maths', 'math'
            sugg = "'{0}' (local)".format(good)
    Severity: Major
    Found in didyoumean/didyoumean_sugg_tests.py and 2 other locations - About 3 hrs to fix
    didyoumean/didyoumean_sugg_tests.py on lines 500..507
    didyoumean/didyoumean_sugg_tests.py on lines 578..585

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

        def test_builtin2(self):
            """Should be 'next(gen)'."""
            code = 'my_generator().next()'
            new_code = 'next(my_generator())'
            sugg = "'next(generator)'"
    Severity: Major
    Found in didyoumean/didyoumean_sugg_tests.py and 1 other location - About 3 hrs to fix
    didyoumean/didyoumean_sugg_tests.py on lines 1130..1138

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

        def test_not_enough_values(self):
            """Unpack 2 values in 3 variables."""
            code = 'a, b, c = [1, 2]'
            before, after = before_and_after((3, 0))
            self.throws(code, EXPECTEDLENGTH, [], before, 'pypy')
    Severity: Major
    Found in didyoumean/didyoumean_sugg_tests.py and 1 other location - About 3 hrs to fix
    didyoumean/didyoumean_sugg_tests.py on lines 2540..2546

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

    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

    Severity
    Category
    Status
    Source
    Language