SylvainDe/DidYouMean-Python

View on GitHub
didyoumean/didyoumean_sugg_tests.py

Summary

Maintainability
F
1 mo
Test Coverage

File didyoumean_sugg_tests.py has 2286 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8
"""Unit tests for get_suggestions_for_exception."""
from didyoumean_internal import get_suggestions_for_exception, quote, \
    STAND_MODULES, AVOID_REC_MSG, \
    APPLY_REMOVED_MSG, BUFFER_REMOVED_MSG, CMP_REMOVED_MSG, \
Severity: Major
Found in didyoumean/didyoumean_sugg_tests.py - About 6 days to fix

    TypeErrorTests has 60 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class TypeErrorTests(GetSuggestionsTests):
        """Class for tests related to TypeError."""
    
        def test_unhashable(self):
            """Test for UNHASHABLE exception."""
    Severity: Major
    Found in didyoumean/didyoumean_sugg_tests.py - About 1 day to fix

      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

        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

          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

            Function meth_gen has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def meth_gen(class_name='MyClass', name='some_method',
            Severity: Minor
            Found in didyoumean/didyoumean_sugg_tests.py - About 35 mins to fix

              Function throws has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def throws(self, code, error_info,
              Severity: Minor
              Found in didyoumean/didyoumean_sugg_tests.py - About 35 mins to fix

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

                    def test_keyword_builtin(self):
                        """A few builtins (like int()) have a different error message."""
                        # NICE_TO_HAVE
                        # 'max', 'input', 'len', 'abs', 'all', etc have a specific error
                        # message and are not relevant here
                Severity: Minor
                Found in didyoumean/didyoumean_sugg_tests.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

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

                    def test_nb_args4(self):
                        """Should have 3 args."""
                        typo, good = '', '1, 2, 3'
                        before, after = before_and_after((3, 3))
                        func_code = func_gen(param='so, much, args', args='{0}')
                Severity: Major
                Found in didyoumean/didyoumean_sugg_tests.py and 3 other locations - About 7 hrs to fix
                didyoumean/didyoumean_sugg_tests.py on lines 1458..1468
                didyoumean/didyoumean_sugg_tests.py on lines 1470..1480
                didyoumean/didyoumean_sugg_tests.py on lines 1494..1504

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

                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

                    def test_nb_args3(self):
                        """Should have 3 args."""
                        typo, good = '1', '1, 2, 3'
                        before, after = before_and_after((3, 3))
                        func_code = func_gen(param='so, much, args', args='{0}')
                Severity: Major
                Found in didyoumean/didyoumean_sugg_tests.py and 3 other locations - About 7 hrs to fix
                didyoumean/didyoumean_sugg_tests.py on lines 1458..1468
                didyoumean/didyoumean_sugg_tests.py on lines 1482..1492
                didyoumean/didyoumean_sugg_tests.py on lines 1494..1504

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

                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

                    def test_nb_args2(self):
                        """Should have 1 arg."""
                        typo, good = '', '1'
                        before, after = before_and_after((3, 3))
                        func_code = func_gen(param='a', args='{0}')
                Severity: Major
                Found in didyoumean/didyoumean_sugg_tests.py and 3 other locations - About 7 hrs to fix
                didyoumean/didyoumean_sugg_tests.py on lines 1470..1480
                didyoumean/didyoumean_sugg_tests.py on lines 1482..1492
                didyoumean/didyoumean_sugg_tests.py on lines 1494..1504

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

                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

                    def test_nb_args5(self):
                        """Should have 3 args."""
                        typo, good = '1, 2', '1, 2, 3'
                        before, after = before_and_after((3, 3))
                        func_code = func_gen(param='so, much, args', args='{0}')
                Severity: Major
                Found in didyoumean/didyoumean_sugg_tests.py and 3 other locations - About 7 hrs to fix
                didyoumean/didyoumean_sugg_tests.py on lines 1458..1468
                didyoumean/didyoumean_sugg_tests.py on lines 1470..1480
                didyoumean/didyoumean_sugg_tests.py on lines 1482..1492

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

                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_keyword_arg_method2(self):
                        """Should be the same as previous test but on a method."""
                        before, after = before_and_after((3, 13))
                        typo, good = 'abcdf', 'abcdef'
                        code = 'class MyClass:\n\tdef func(self, ' + good + '):' \
                Severity: Major
                Found in didyoumean/didyoumean_sugg_tests.py and 2 other locations - About 6 hrs to fix
                didyoumean/didyoumean_sugg_tests.py on lines 1600..1611
                didyoumean/didyoumean_sugg_tests.py on lines 1613..1623

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

                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_keyword_arg_class_method2(self):
                        """Should be the same as previous test but on a class method."""
                        before, after = before_and_after((3, 13))
                        typo, good = 'abcdf', 'abcdef'
                        code = 'class MyClass:\n\t@classmethod ' \
                Severity: Major
                Found in didyoumean/didyoumean_sugg_tests.py and 2 other locations - About 6 hrs to fix
                didyoumean/didyoumean_sugg_tests.py on lines 1580..1590
                didyoumean/didyoumean_sugg_tests.py on lines 1613..1623

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

                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_keyword_arg_lambda_method(self):
                        """Test with lambda methods instead of usual methods."""
                        before, after = before_and_after((3, 13))
                        typo, good = 'abcdf', 'abcdef'
                        sugg = quote(good)
                Severity: Major
                Found in didyoumean/didyoumean_sugg_tests.py and 1 other location - About 6 hrs to fix
                didyoumean/didyoumean_sugg_tests.py on lines 1625..1635

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

                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_keyword_arg_multiples_instances(self):
                        """If multiple functions are found, suggestions should be unique."""
                        before, after = before_and_after((3, 13))
                        typo, good = 'abcdf', 'abcdef'
                        code = 'class MyClass:\n\tdef func(self, ' + good + '):' \
                Severity: Major
                Found in didyoumean/didyoumean_sugg_tests.py and 2 other locations - About 6 hrs to fix
                didyoumean/didyoumean_sugg_tests.py on lines 1580..1590
                didyoumean/didyoumean_sugg_tests.py on lines 1600..1611

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

                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_keyword_arg_lambda(self):
                        """Test with lambda functions instead of usual function."""
                        before, after = before_and_after((3, 13))
                        typo, good = 'abcdf', 'abcdef'
                        sugg = quote(good)
                Severity: Major
                Found in didyoumean/didyoumean_sugg_tests.py and 1 other location - About 6 hrs to fix
                didyoumean/didyoumean_sugg_tests.py on lines 1637..1647

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

                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_from_module(self):
                        """Should be math.pi."""
                        code = 'import math\nmath.{0}'
                        typo, good = 'pie', 'pi'
                        sugg = quote(good)
                Severity: Major
                Found in didyoumean/didyoumean_sugg_tests.py and 1 other location - About 5 hrs to fix
                didyoumean/didyoumean_sugg_tests.py on lines 1072..1081

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

                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_from_module2(self):
                        """Should be math.pi."""
                        code = 'import math\nm = math\nm.{0}'
                        typo, good = 'pie', 'pi'
                        sugg = quote(good)
                Severity: Major
                Found in didyoumean/didyoumean_sugg_tests.py and 1 other location - About 5 hrs to fix
                didyoumean/didyoumean_sugg_tests.py on lines 1061..1070

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

                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_nb_args1(self):
                        """Should have 0 args."""
                        typo, good = '1', ''
                        func_code = func_gen(param='', args='{0}')
                        meth_code = meth_gen(param='self', args='{0}')
                Severity: Major
                Found in didyoumean/didyoumean_sugg_tests.py and 1 other location - About 5 hrs to fix
                didyoumean/didyoumean_sugg_tests.py on lines 1438..1446

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

                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_nb_args(self):
                        """Should have 1 arg."""
                        typo, good = '1, 2', '1'
                        func_code = func_gen(param='a', args='{0}')
                        meth_code = meth_gen(param='self, a', args='{0}')
                Severity: Major
                Found in didyoumean/didyoumean_sugg_tests.py and 1 other location - About 5 hrs to fix
                didyoumean/didyoumean_sugg_tests.py on lines 1448..1456

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

                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_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 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 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_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_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 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_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 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 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_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_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_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

                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 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 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_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 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_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 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_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 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

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

                    def assertRegexp(self, text, regex, msg=None):
                        """Wrapper around the different names for assertRegexp...."""
                        for name in ['assertRegex', 'assertRegexpMatches']:
                            if hasattr(self, name):
                                return getattr(self, name)(text, regex, msg)
                Severity: Major
                Found in didyoumean/didyoumean_sugg_tests.py and 2 other locations - About 2 hrs to fix
                didyoumean/didyoumean_re_tests.py on lines 27..32
                didyoumean/didyoumean_re_tests.py on lines 34..39

                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

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

                        for (old_att, new_att, sugg) in attributes:
                            old_code, new_code = format_str(code, old_att, new_att)
                            self.runs(old_code, before)
                            self.throws(old_code, ATTRIBUTEERROR, sugg, after)
                            self.runs(new_code)
                Severity: Major
                Found in didyoumean/didyoumean_sugg_tests.py and 1 other location - About 2 hrs to fix
                didyoumean/didyoumean_sugg_tests.py on lines 1196..1200

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

                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

                        for (old_att, new_att, sugg) in attributes:
                            old_code, new_code = format_str(code, old_att, new_att)
                            self.runs(old_code, before)
                            self.throws(old_code, ATTRIBUTEERROR, sugg, after)
                            self.runs(new_code)
                Severity: Major
                Found in didyoumean/didyoumean_sugg_tests.py and 1 other location - About 2 hrs to fix
                didyoumean/didyoumean_sugg_tests.py on lines 1210..1214

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

                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_keyword(self):
                        """Should be 'pass'."""
                        typo, good = 'passs', 'pass'
                        sugg = "'{0}' (keyword)".format(good)
                        self.throws(typo, NAMEERROR, sugg)
                Severity: Major
                Found in didyoumean/didyoumean_sugg_tests.py and 2 other locations - About 2 hrs to fix
                didyoumean/didyoumean_sugg_tests.py on lines 528..533
                didyoumean/didyoumean_sugg_tests.py on lines 553..558

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

                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_name(self):
                        """Should be '__name__'."""
                        typo, good = '__name_', '__name__'
                        sugg = "'{0}' (global)".format(good)
                        self.throws(typo, NAMEERROR, sugg)
                Severity: Major
                Found in didyoumean/didyoumean_sugg_tests.py and 2 other locations - About 2 hrs to fix
                didyoumean/didyoumean_sugg_tests.py on lines 528..533
                didyoumean/didyoumean_sugg_tests.py on lines 535..540

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

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

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

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

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

                Refactorings

                Further Reading

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

                    def test_ellipsis(self):
                        """Triple dot (...) aka Ellipsis can be used anywhere in Python 3."""
                        before, after = before_and_after((3, 0))
                        code = '...'
                        self.throws(code, INVALIDSYNTAX, [], before)
                Severity: Major
                Found in didyoumean/didyoumean_sugg_tests.py and 4 other locations - About 2 hrs to fix
                didyoumean/didyoumean_sugg_tests.py on lines 2309..2315
                didyoumean/didyoumean_sugg_tests.py on lines 2401..2407
                didyoumean/didyoumean_sugg_tests.py on lines 2421..2427
                didyoumean/didyoumean_sugg_tests.py on lines 2487..2492

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

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

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

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

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

                Refactorings

                Further Reading

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

                    def test_nonlocal(self):
                        """nonlocal keyword is added in Python 3."""
                        # NICE_TO_HAVE
                        before, after = before_and_after((3, 0))
                        code = 'def func():\n\tfoo = 1\n\tdef nested():\n\t\tnonlocal foo'
                Severity: Major
                Found in didyoumean/didyoumean_sugg_tests.py and 4 other locations - About 2 hrs to fix
                didyoumean/didyoumean_sugg_tests.py on lines 2309..2315
                didyoumean/didyoumean_sugg_tests.py on lines 2401..2407
                didyoumean/didyoumean_sugg_tests.py on lines 2487..2492
                didyoumean/didyoumean_sugg_tests.py on lines 2494..2499

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

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

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

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

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

                Refactorings

                Further Reading

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

                    def test_walrus_operator(self):
                        """Operator := introduced in Python 3.8."""
                        # NICE_TO_HAVE
                        before, after = before_and_after((3, 8))
                        code = "if a := 42:\n\tpass"
                Severity: Major
                Found in didyoumean/didyoumean_sugg_tests.py and 4 other locations - About 2 hrs to fix
                didyoumean/didyoumean_sugg_tests.py on lines 2401..2407
                didyoumean/didyoumean_sugg_tests.py on lines 2421..2427
                didyoumean/didyoumean_sugg_tests.py on lines 2487..2492
                didyoumean/didyoumean_sugg_tests.py on lines 2494..2499

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

                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_builtin(self):
                        """Should be 'max'."""
                        typo, good = 'maxi', 'max'
                        sugg = "'{0}' (builtin)".format(good)
                        self.throws(typo, NAMEERROR, sugg)
                Severity: Major
                Found in didyoumean/didyoumean_sugg_tests.py and 2 other locations - About 2 hrs to fix
                didyoumean/didyoumean_sugg_tests.py on lines 535..540
                didyoumean/didyoumean_sugg_tests.py on lines 553..558

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

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

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

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

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

                Refactorings

                Further Reading

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

                    def test_unpack(self):
                        """Extended tuple unpacking does not work prior to Python 3."""
                        # NICE_TO_HAVE
                        before, after = before_and_after((3, 0))
                        code = 'a, *b = (1, 2, 3)'
                Severity: Major
                Found in didyoumean/didyoumean_sugg_tests.py and 4 other locations - About 2 hrs to fix
                didyoumean/didyoumean_sugg_tests.py on lines 2309..2315
                didyoumean/didyoumean_sugg_tests.py on lines 2421..2427
                didyoumean/didyoumean_sugg_tests.py on lines 2487..2492
                didyoumean/didyoumean_sugg_tests.py on lines 2494..2499

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

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

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

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

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

                Refactorings

                Further Reading

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

                    def test_extended_unpacking(self):
                        """Extended iterable unpacking is added with Python 3."""
                        before, after = before_and_after((3, 0))
                        code = '(a, *rest, b) = range(5)'
                        self.throws(code, INVALIDSYNTAX, [], before)
                Severity: Major
                Found in didyoumean/didyoumean_sugg_tests.py and 4 other locations - About 2 hrs to fix
                didyoumean/didyoumean_sugg_tests.py on lines 2309..2315
                didyoumean/didyoumean_sugg_tests.py on lines 2401..2407
                didyoumean/didyoumean_sugg_tests.py on lines 2421..2427
                didyoumean/didyoumean_sugg_tests.py on lines 2494..2499

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

                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_dict_del(self):
                        """Del can be replaces by dict.pop with a default argument."""
                        # NICE_TO_HAVE
                        code = 'd = dict()\n{0}'
                        bad_code, good_code = format_str(code, "del d[42]", "d.pop(42, None)")
                Severity: Major
                Found in didyoumean/didyoumean_sugg_tests.py and 2 other locations - About 1 hr to fix
                didyoumean/didyoumean_sugg_tests.py on lines 2193..2199
                didyoumean/didyoumean_sugg_tests.py on lines 2201..2207

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

                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_keyword_arg_class_method(self):
                        """Should be the same as previous test but on a class method."""
                        code = 'class MyClass:\n\t@classmethod\n\tdef func(cls, a):' \
                               '\n\t\tpass\nMyClass.func({0}=1)'
                        bad_code, good_code = format_str(code, 'babar', 'a')
                Severity: Major
                Found in didyoumean/didyoumean_sugg_tests.py and 5 other locations - About 1 hr to fix
                didyoumean/didyoumean_sugg_tests.py on lines 1572..1578
                didyoumean/didyoumean_sugg_tests.py on lines 1649..1659
                didyoumean/didyoumean_sugg_tests.py on lines 2283..2289
                didyoumean/didyoumean_sugg_tests.py on lines 2291..2297
                didyoumean/didyoumean_sugg_tests.py on lines 2317..2323

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

                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_missing_colon(self):
                        """Missing colon is a classic mistake."""
                        # NICE_TO_HAVE
                        code = "if True{0}\n\tpass"
                        bad_code, good_code = format_str(code, "", ":")
                Severity: Major
                Found in didyoumean/didyoumean_sugg_tests.py and 5 other locations - About 1 hr to fix
                didyoumean/didyoumean_sugg_tests.py on lines 1572..1578
                didyoumean/didyoumean_sugg_tests.py on lines 1592..1598
                didyoumean/didyoumean_sugg_tests.py on lines 1649..1659
                didyoumean/didyoumean_sugg_tests.py on lines 2291..2297
                didyoumean/didyoumean_sugg_tests.py on lines 2317..2323

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

                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_missing_colon2(self):
                        """Missing colon is a classic mistake."""
                        # NICE_TO_HAVE
                        code = "class MyClass{0}\n\tpass"
                        bad_code, good_code = format_str(code, "", ":")
                Severity: Major
                Found in didyoumean/didyoumean_sugg_tests.py and 5 other locations - About 1 hr to fix
                didyoumean/didyoumean_sugg_tests.py on lines 1572..1578
                didyoumean/didyoumean_sugg_tests.py on lines 1592..1598
                didyoumean/didyoumean_sugg_tests.py on lines 1649..1659
                didyoumean/didyoumean_sugg_tests.py on lines 2283..2289
                didyoumean/didyoumean_sugg_tests.py on lines 2317..2323

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

                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_keyword_arg_other_objects_with_name(self):
                        """Mix of previous tests but with more objects defined.
                
                        Non-function object with same same as the function tested are defined
                        to ensure that things do work fine.
                Severity: Major
                Found in didyoumean/didyoumean_sugg_tests.py and 5 other locations - About 1 hr to fix
                didyoumean/didyoumean_sugg_tests.py on lines 1572..1578
                didyoumean/didyoumean_sugg_tests.py on lines 1592..1598
                didyoumean/didyoumean_sugg_tests.py on lines 2283..2289
                didyoumean/didyoumean_sugg_tests.py on lines 2291..2297
                didyoumean/didyoumean_sugg_tests.py on lines 2317..2323

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

                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_dict_pop(self):
                        """Dict.pop takes a default argument."""
                        # NICE_TO_HAVE
                        code = 'd = dict()\nd.pop(42{0})'
                        bad_code, good_code = format_str(code, "", ", None")
                Severity: Major
                Found in didyoumean/didyoumean_sugg_tests.py and 2 other locations - About 1 hr to fix
                didyoumean/didyoumean_sugg_tests.py on lines 2193..2199
                didyoumean/didyoumean_sugg_tests.py on lines 2209..2215

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

                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_keyword_arg_method(self):
                        """Should be the same as previous test but on a method."""
                        code = 'class MyClass:\n\tdef func(self, a):' \
                               '\n\t\tpass\nMyClass().func({0}=1)'
                        bad_code, good_code = format_str(code, 'babar', 'a')
                Severity: Major
                Found in didyoumean/didyoumean_sugg_tests.py and 5 other locations - About 1 hr to fix
                didyoumean/didyoumean_sugg_tests.py on lines 1592..1598
                didyoumean/didyoumean_sugg_tests.py on lines 1649..1659
                didyoumean/didyoumean_sugg_tests.py on lines 2283..2289
                didyoumean/didyoumean_sugg_tests.py on lines 2291..2297
                didyoumean/didyoumean_sugg_tests.py on lines 2317..2323

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

                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_keyword_as_identifier(self):
                        """Using a keyword as a variable name."""
                        # NICE_TO_HAVE
                        code = '{0} = 1'
                        bad_code, good_code = format_str(code, "from", "from_")
                Severity: Major
                Found in didyoumean/didyoumean_sugg_tests.py and 5 other locations - About 1 hr to fix
                didyoumean/didyoumean_sugg_tests.py on lines 1572..1578
                didyoumean/didyoumean_sugg_tests.py on lines 1592..1598
                didyoumean/didyoumean_sugg_tests.py on lines 1649..1659
                didyoumean/didyoumean_sugg_tests.py on lines 2283..2289
                didyoumean/didyoumean_sugg_tests.py on lines 2291..2297

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

                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_set_remove(self):
                        """Set.remove throws when key is not found."""
                        # NICE_TO_HAVE
                        code = 's = set()\ns.{0}(42)'
                        bad_code, good_code = format_str(code, "remove", "discard")
                Severity: Major
                Found in didyoumean/didyoumean_sugg_tests.py and 2 other locations - About 1 hr to fix
                didyoumean/didyoumean_sugg_tests.py on lines 2201..2207
                didyoumean/didyoumean_sugg_tests.py on lines 2209..2215

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

                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_assignment_to_string(self):
                        """Trying to assign to string does not work."""
                        code = "s = 'abc'\ns[1] = 'd'"
                        good_code = "s = 'abc'\nl = list(s)\nl[1] = 'd'\ns = ''.join(l)"
                        sugg = 'convert to list to edit the list and use "join()" on the list'
                Severity: Major
                Found in didyoumean/didyoumean_sugg_tests.py and 1 other location - About 1 hr to fix
                didyoumean/didyoumean_sugg_tests.py on lines 1953..1959

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

                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_deletion_from_string(self):
                        """Delete from string does not work."""
                        code = "s = 'abc'\ndel s[1]"
                        good_code = "s = 'abc'\nl = list(s)\ndel l[1]\ns = ''.join(l)"
                        sugg = 'convert to list to edit the list and use "join()" on the list'
                Severity: Major
                Found in didyoumean/didyoumean_sugg_tests.py and 1 other location - About 1 hr to fix
                didyoumean/didyoumean_sugg_tests.py on lines 1933..1939

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

                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_cls(self):
                        """Should be cls.this_is_cls_mthd."""
                        code = 'FoobarClass().nameerror_cls()'
                        suggs = ["'FoobarClass.this_is_cls_mthd'", "'cls.this_is_cls_mthd'"]
                        self.throws(code, NAMEERROR, suggs)
                Severity: Minor
                Found in didyoumean/didyoumean_sugg_tests.py and 1 other location - About 35 mins to fix
                didyoumean/didyoumean_sugg_tests.py on lines 865..869

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

                    def test_self2(self):
                        """Should be self.this_is_cls_mthd."""
                        code = 'FoobarClass().nameerror_self2()'
                        suggs = ["'FoobarClass.this_is_cls_mthd'", "'self.this_is_cls_mthd'"]
                        self.throws(code, NAMEERROR, suggs)
                Severity: Minor
                Found in didyoumean/didyoumean_sugg_tests.py and 1 other location - About 35 mins to fix
                didyoumean/didyoumean_sugg_tests.py on lines 871..875

                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