SylvainDe/DidYouMean-Python

View on GitHub

Showing 142 of 142 total issues

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

    def test_too_many_values(self):
        """Unpack 4 values in 3 variables."""
        code = 'a, b, c = [1, 2, 3, 4]'
        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 2548..2554

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

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

    def test_typo_in_method2(self):
        """Should be 'pi'."""
        code = 'from math import e, {0}, log'
        typo, good = 'pie', 'pi'
        sugg = quote(good)
Severity: Major
Found in didyoumean/didyoumean_sugg_tests.py and 6 other locations - About 3 hrs to fix
didyoumean/didyoumean_sugg_tests.py on lines 587..594
didyoumean/didyoumean_sugg_tests.py on lines 596..603
didyoumean/didyoumean_sugg_tests.py on lines 977..984
didyoumean/didyoumean_sugg_tests.py on lines 1012..1019
didyoumean/didyoumean_sugg_tests.py on lines 2130..2137
didyoumean/didyoumean_sugg_tests.py on lines 2148..2155

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

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

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

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

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

Refactorings

Further Reading

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

    def test_typo_in_method3(self):
        """Should be 'pi'."""
        code = 'from math import {0} as three_something'
        typo, good = 'pie', 'pi'
        sugg = quote(good)
Severity: Major
Found in didyoumean/didyoumean_sugg_tests.py and 6 other locations - About 3 hrs to fix
didyoumean/didyoumean_sugg_tests.py on lines 587..594
didyoumean/didyoumean_sugg_tests.py on lines 596..603
didyoumean/didyoumean_sugg_tests.py on lines 977..984
didyoumean/didyoumean_sugg_tests.py on lines 1012..1019
didyoumean/didyoumean_sugg_tests.py on lines 2130..2137
didyoumean/didyoumean_sugg_tests.py on lines 2139..2146

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

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

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

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

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

Refactorings

Further Reading

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

    def test_imported_twice(self):
        """Should be math.pi."""
        code = 'import math\nimport math\n{0}'
        typo, good = 'pi', 'math.pi'
        sugg = quote(good)
Severity: Major
Found in didyoumean/didyoumean_sugg_tests.py and 6 other locations - About 3 hrs to fix
didyoumean/didyoumean_sugg_tests.py on lines 587..594
didyoumean/didyoumean_sugg_tests.py on lines 977..984
didyoumean/didyoumean_sugg_tests.py on lines 1012..1019
didyoumean/didyoumean_sugg_tests.py on lines 2130..2137
didyoumean/didyoumean_sugg_tests.py on lines 2139..2146
didyoumean/didyoumean_sugg_tests.py on lines 2148..2155

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

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

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

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

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

Refactorings

Further Reading

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

    def test_method(self):
        """Should be 'append'."""
        code = '[0].{0}(1)'
        typo, good = 'appendh', 'append'
        sugg = quote(good)
Severity: Major
Found in didyoumean/didyoumean_sugg_tests.py and 6 other locations - About 3 hrs to fix
didyoumean/didyoumean_sugg_tests.py on lines 587..594
didyoumean/didyoumean_sugg_tests.py on lines 596..603
didyoumean/didyoumean_sugg_tests.py on lines 1012..1019
didyoumean/didyoumean_sugg_tests.py on lines 2130..2137
didyoumean/didyoumean_sugg_tests.py on lines 2139..2146
didyoumean/didyoumean_sugg_tests.py on lines 2148..2155

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

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_from_class(self):
        """Should be 'this_is_cls_mthd'."""
        code = 'FoobarClass().{0}()'
        typo, good = 'this_is_cls_mth', 'this_is_cls_mthd'
        bad_code, good_code = format_str(code, typo, 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 1092..1099
didyoumean/didyoumean_sugg_tests.py on lines 2352..2359

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

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_does_not_support(self):
        """Test OBJ_DOES_NOT_SUPPORT_RE."""
        msgs = [
            ("'range' object does not support item assignment",
                ("range", "item assignment")),
Severity: Major
Found in didyoumean/didyoumean_re_tests.py and 1 other location - About 3 hrs to fix
didyoumean/didyoumean_re_tests.py on lines 728..738

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

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_bad_operand_unary(self):
        """Test BAD_OPERAND_UNARY_RE."""
        msgs = [
            ("bad operand type for unary ~: 'set'", ('~', 'set')),
            ("bad operand type for abs(): 'set'", ('abs()', 'set')),
Severity: Major
Found in didyoumean/didyoumean_re_tests.py and 1 other location - About 3 hrs to fix
didyoumean/didyoumean_re_tests.py on lines 646..658

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

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

AttributeErrorTests has 29 functions (exceeds 20 allowed). Consider refactoring.
Open

class AttributeErrorTests(GetSuggestionsTests):
    """Class for tests related to AttributeError."""

    def test_nonetype(self):
        """In-place methods like sort returns None.
Severity: Minor
Found in didyoumean/didyoumean_sugg_tests.py - About 3 hrs to fix

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

        def test_from_class2(self):
            """Should be 'this_is_cls_mthd'."""
            code = 'FoobarClass.{0}()'
            typo, good = 'this_is_cls_mth', 'this_is_cls_mthd'
            bad_code, good_code = format_str(code, typo, 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 1083..1090
    didyoumean/didyoumean_sugg_tests.py on lines 2352..2359

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

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

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

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

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

    Refactorings

    Further Reading

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

        def test_imported(self):
            """Should be math.pi."""
            code = 'import math\n{0}'
            typo, good = 'pi', 'math.pi'
            sugg = quote(good)
    Severity: Major
    Found in didyoumean/didyoumean_sugg_tests.py and 6 other locations - About 3 hrs to fix
    didyoumean/didyoumean_sugg_tests.py on lines 596..603
    didyoumean/didyoumean_sugg_tests.py on lines 977..984
    didyoumean/didyoumean_sugg_tests.py on lines 1012..1019
    didyoumean/didyoumean_sugg_tests.py on lines 2130..2137
    didyoumean/didyoumean_sugg_tests.py on lines 2139..2146
    didyoumean/didyoumean_sugg_tests.py on lines 2148..2155

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

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

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

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

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

    Refactorings

    Further Reading

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

        def test_wrongmethod2(self):
            """Should be 'lst.extend([4, 5, 6])'."""
            code = '[0].{0}([4, 5, 6])'
            typo, good = 'update', 'extend'
            sugg = quote(good)
    Severity: Major
    Found in didyoumean/didyoumean_sugg_tests.py and 6 other locations - About 3 hrs to fix
    didyoumean/didyoumean_sugg_tests.py on lines 587..594
    didyoumean/didyoumean_sugg_tests.py on lines 596..603
    didyoumean/didyoumean_sugg_tests.py on lines 977..984
    didyoumean/didyoumean_sugg_tests.py on lines 2130..2137
    didyoumean/didyoumean_sugg_tests.py on lines 2139..2146
    didyoumean/didyoumean_sugg_tests.py on lines 2148..2155

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

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

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

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

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

    Refactorings

    Further Reading

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

        def test_typo_in_method(self):
            """Should be 'pi'."""
            code = 'from math import {0}'
            typo, good = 'pie', 'pi'
            sugg = quote(good)
    Severity: Major
    Found in didyoumean/didyoumean_sugg_tests.py and 6 other locations - About 3 hrs to fix
    didyoumean/didyoumean_sugg_tests.py on lines 587..594
    didyoumean/didyoumean_sugg_tests.py on lines 596..603
    didyoumean/didyoumean_sugg_tests.py on lines 977..984
    didyoumean/didyoumean_sugg_tests.py on lines 1012..1019
    didyoumean/didyoumean_sugg_tests.py on lines 2139..2146
    didyoumean/didyoumean_sugg_tests.py on lines 2148..2155

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

    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_future_not_def(self):
            """Should be 'division'."""
            code = 'from __future__ import {0}'
            typo, good = 'divisio', 'division'
            bad_code, good_code = format_str(code, typo, 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 1083..1090
    didyoumean/didyoumean_sugg_tests.py on lines 1092..1099

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

    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_exec(self):
            """exec is a function now and needs parenthesis."""
            # NICE_TO_HAVE
            code, new_code = 'exec "1"', 'exec("1")'
            before, after = before_and_after((3, 0))
    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 2239..2247

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

    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

    SyntaxErrorTests has 28 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class SyntaxErrorTests(GetSuggestionsTests):
        """Class for tests related to SyntaxError."""
    
        def test_no_error(self):
            """No error."""
    Severity: Minor
    Found in didyoumean/didyoumean_sugg_tests.py - About 3 hrs to fix

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

          def test_print(self):
              """print is a function now and needs parenthesis."""
              # NICE_TO_HAVE
              code, new_code = 'print ""', 'print("")'
              before, after = before_and_after((3, 0))
      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 2249..2257

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

      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_added_3_7(self):
              """Test for names added in 3.7."""
              before, after = before_and_after((3, 7))
              for name, suggs in {
                      'breakpoint': [BREAKPOINT_ADDED_MSG],
      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 721..728

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

      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_added_2_7(self):
              """Test for names added in 2.7."""
              before, after = before_and_after((2, 7))
              for name, suggs in {
                      'memoryview': [MEMVIEW_ADDED_MSG],
      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 825..832

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

      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_arg3(self):
              """Test UNEXPECTED_KEYWORDARG3_RE."""
              # PyPy/PyPy3
              msg = "invalid keyword arguments to print()"
              func = 'print'
      Severity: Major
      Found in didyoumean/didyoumean_re_tests.py and 1 other location - About 2 hrs to fix
      didyoumean/didyoumean_re_tests.py on lines 596..604

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

      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