SylvainDe/DidYouMean-Python

View on GitHub
didyoumean/didyoumean_re_tests.py

Summary

Maintainability
F
1 wk
Test Coverage

File didyoumean_re_tests.py has 735 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8
"""Unit tests for regexps from didyoumean_re.py."""
import didyoumean_re as re
import sys
from didyoumean_internal import get_subclasses
Severity: Major
Found in didyoumean/didyoumean_re_tests.py - About 1 day to fix

    RegexTests has 73 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class RegexTests(unittest_module.TestCase):
        """Tests to check that error messages match the regexps."""
    
        def assertRegexp(self, text, regex, msg=None):
            """Wrapper around the different names for assertRegexp...."""
    Severity: Major
    Found in didyoumean/didyoumean_re_tests.py - About 1 day to fix

      Function test_attr_name has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          def test_attr_name(self):
              """Test ATTR_NAME."""
              regex = r"^" + re.ATTR_NAME + r"$"
              # Tests based on hardcoded values
              attrs = ["do_stuff", "__magic__"]
      Severity: Minor
      Found in didyoumean/didyoumean_re_tests.py - About 1 hr 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

      Function check_more_about_re has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def check_more_about_re(self, text, regexp):
              """Check various properties about the regexp.
      
              Properties checked are configurable via global constants. These
              properties are not stricly speaking required but they help to
      Severity: Minor
      Found in didyoumean/didyoumean_re_tests.py - About 55 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 2 locations. Consider refactoring.
      Open

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

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 85.

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

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

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

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

      Refactorings

      Further Reading

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

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

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 85.

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

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

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

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

      Refactorings

      Further Reading

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

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

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 68.

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

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

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

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

      Refactorings

      Further Reading

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

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

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 68.

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

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

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

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

      Refactorings

      Further Reading

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

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

      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

      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_re_tests.py and 2 other locations - About 2 hrs to fix
      didyoumean/didyoumean_re_tests.py on lines 34..39
      didyoumean/didyoumean_sugg_tests.py on lines 481..486

      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

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

          def test_result_has_too_many_items(self):
              """Test RESULT_TOO_MANY_ITEMS_RE."""
              # Python 2.6
              msg = "range() result has too many items"
              func = 'range'
      Severity: Major
      Found in didyoumean/didyoumean_re_tests.py and 1 other location - About 2 hrs to fix
      didyoumean/didyoumean_re_tests.py on lines 319..327

      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

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

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

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 56.

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

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

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

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

      Refactorings

      Further Reading

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

              for msg, op, t1, t2 in msgs:
                  groups = op, t1, t2
                  named_groups = {'op': op, 't1': t1, 't2': t2}
                  results = (groups, named_groups)
                  self.re_matches(msg, re.UNSUPPORTED_OP_RE, results)
      Severity: Major
      Found in didyoumean/didyoumean_re_tests.py and 1 other location - About 2 hrs to fix
      didyoumean/didyoumean_re_tests.py on lines 485..489

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

      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

              for msg, func, exp, nb in msgs:
                  groups = (func, exp, nb)
                  named_groups = {'func': func, 'expected': exp, 'actual': nb}
                  results = (groups, named_groups)
                  self.re_matches(msg, re.NB_ARG_RE, results)
      Severity: Major
      Found in didyoumean/didyoumean_re_tests.py and 1 other location - About 2 hrs to fix
      didyoumean/didyoumean_re_tests.py on lines 698..702

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

      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_no_module_named(self):
              """Test NOMODULE_RE."""
              msgs = [
                  # Python 2.6/2.7/3.2/PyPy/PyPy3
                  "No module named fake_module",
      Severity: Major
      Found in didyoumean/didyoumean_re_tests.py and 3 other locations - About 2 hrs to fix
      didyoumean/didyoumean_re_tests.py on lines 387..398
      didyoumean/didyoumean_re_tests.py on lines 436..447
      didyoumean/didyoumean_re_tests.py on lines 763..774

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

      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_outside_function(self):
              """Test OUTSIDE_FUNCTION_RE."""
              msgs = [
                  # Python 2.6/2.7/3.2/3.3/3.4/3.5/PyPy/PyPy3
                  "'return' outside function",
      Severity: Major
      Found in didyoumean/didyoumean_re_tests.py and 3 other locations - About 2 hrs to fix
      didyoumean/didyoumean_re_tests.py on lines 243..254
      didyoumean/didyoumean_re_tests.py on lines 387..398
      didyoumean/didyoumean_re_tests.py on lines 763..774

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

      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_argument_not_iterable(self):
              """Test ARG_NOT_ITERABLE_RE."""
              msgs = [
                  # Python 2.6/2.7/3.2/3.3/3.4/3.5
                  "argument of type 'type' is not iterable",
      Severity: Major
      Found in didyoumean/didyoumean_re_tests.py and 3 other locations - About 2 hrs to fix
      didyoumean/didyoumean_re_tests.py on lines 243..254
      didyoumean/didyoumean_re_tests.py on lines 387..398
      didyoumean/didyoumean_re_tests.py on lines 436..447

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

      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_unhashable_type(self):
              """Test UNHASHABLE_RE."""
              msgs = [
                  # Python 2.6/2.7/3.2/3.3/3.4/3.5
                  "unhashable type: 'list'",
      Severity: Major
      Found in didyoumean/didyoumean_re_tests.py and 3 other locations - About 2 hrs to fix
      didyoumean/didyoumean_re_tests.py on lines 243..254
      didyoumean/didyoumean_re_tests.py on lines 436..447
      didyoumean/didyoumean_re_tests.py on lines 763..774

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

      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

              for msg, func in msgs:
                  groups = (func,)
                  named_groups = {'func': func}
                  results = (groups, named_groups)
                  self.re_matches(msg, re.MISSING_POS_ARG_RE, results)
      Severity: Major
      Found in didyoumean/didyoumean_re_tests.py and 1 other location - About 1 hr to fix
      didyoumean/didyoumean_re_tests.py on lines 358..362

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

      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

              for func, msg in msgs:
                  groups = (func, )
                  named_groups = {'func': func}
                  results = (groups, named_groups)
                  self.re_matches(msg, re.FUNC_TAKES_NO_KEYWORDARG_RE, results)
      Severity: Major
      Found in didyoumean/didyoumean_re_tests.py and 1 other location - About 1 hr to fix
      didyoumean/didyoumean_re_tests.py on lines 503..507

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

      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_cannot_concat(self):
              """Test CANNOT_CONCAT_RE."""
              msg = "cannot concatenate 'str' and 'int' objects"
              groups = ('str', 'int')
              results = (groups, dict())
      Severity: Major
      Found in didyoumean/didyoumean_re_tests.py and 4 other locations - About 1 hr to fix
      didyoumean/didyoumean_re_tests.py on lines 535..541
      didyoumean/didyoumean_re_tests.py on lines 569..575
      didyoumean/didyoumean_re_tests.py on lines 660..665
      didyoumean/didyoumean_re_tests.py on lines 667..672

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

      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_expected_length(self):
              """Test EXPECTED_LENGTH_RE."""
              # PyPy
              msg = "expected length 3, got 2"
              groups = ('3', '2')
      Severity: Major
      Found in didyoumean/didyoumean_re_tests.py and 4 other locations - About 1 hr to fix
      didyoumean/didyoumean_re_tests.py on lines 535..541
      didyoumean/didyoumean_re_tests.py on lines 660..665
      didyoumean/didyoumean_re_tests.py on lines 667..672
      didyoumean/didyoumean_re_tests.py on lines 674..679

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

      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_invalid_literal(self):
              """Test INVALID_LITERAL_RE."""
              # Python 2.6/2.7/3.2/3.3/3.4/3.5/PyPy/PyPy3
              msg = "invalid literal for int() with base 10: 'toto'"
              groups = ('int', 'toto')
      Severity: Major
      Found in didyoumean/didyoumean_re_tests.py and 4 other locations - About 1 hr to fix
      didyoumean/didyoumean_re_tests.py on lines 569..575
      didyoumean/didyoumean_re_tests.py on lines 660..665
      didyoumean/didyoumean_re_tests.py on lines 667..672
      didyoumean/didyoumean_re_tests.py on lines 674..679

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

      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_cant_convert(self):
              """Test CANT_CONVERT_RE."""
              msg = "Can't convert 'int' object to str implicitly"
              groups = ('int', 'str')
              results = (groups, dict())
      Severity: Major
      Found in didyoumean/didyoumean_re_tests.py and 4 other locations - About 1 hr to fix
      didyoumean/didyoumean_re_tests.py on lines 535..541
      didyoumean/didyoumean_re_tests.py on lines 569..575
      didyoumean/didyoumean_re_tests.py on lines 667..672
      didyoumean/didyoumean_re_tests.py on lines 674..679

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

      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_must_be_type1_not_type2(self):
              """Test MUST_BE_TYPE1_NOT_TYPE2_RE."""
              msg = "must be str, not int"
              groups = ('str', 'int')
              results = (groups, dict())
      Severity: Major
      Found in didyoumean/didyoumean_re_tests.py and 4 other locations - About 1 hr to fix
      didyoumean/didyoumean_re_tests.py on lines 535..541
      didyoumean/didyoumean_re_tests.py on lines 569..575
      didyoumean/didyoumean_re_tests.py on lines 660..665
      didyoumean/didyoumean_re_tests.py on lines 674..679

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

      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_future_feature_not_def(self):
              """Test FUTURE_FEATURE_NOT_DEF_RE."""
              # Python 2.6/2.7/3.2/3.3/3.4/3.5/PyPy/PyPy3
              msg = "future feature divisio is not defined"
              groups = ('divisio',)
      Severity: Major
      Found in didyoumean/didyoumean_re_tests.py and 2 other locations - About 1 hr to fix
      didyoumean/didyoumean_re_tests.py on lines 740..745
      didyoumean/didyoumean_re_tests.py on lines 806..811

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

          def test_not_callable(self):
              """Test NOT_CALLABLE_RE."""
              msg = "'list' object is not callable"
              groups = ('list',)
              results = (groups, dict())
      Severity: Major
      Found in didyoumean/didyoumean_re_tests.py and 2 other locations - About 1 hr to fix
      didyoumean/didyoumean_re_tests.py on lines 588..594
      didyoumean/didyoumean_re_tests.py on lines 806..811

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

          def test_nobinding_nonlocal(self):
              """Test NO_BINDING_NONLOCAL_RE."""
              msg = "no binding for nonlocal 'foo' found"
              groups = ('foo',)
              results = (groups, dict())
      Severity: Major
      Found in didyoumean/didyoumean_re_tests.py and 2 other locations - About 1 hr to fix
      didyoumean/didyoumean_re_tests.py on lines 588..594
      didyoumean/didyoumean_re_tests.py on lines 740..745

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

              for msg, typ in msgs.items():
                  results = ((typ,), dict())
                  self.re_matches(msg, re.INDICES_MUST_BE_INT_RE, results)
      Severity: Major
      Found in didyoumean/didyoumean_re_tests.py and 2 other locations - About 1 hr to fix
      didyoumean/didyoumean_re_tests.py on lines 406..408
      didyoumean/didyoumean_re_tests.py on lines 417..419

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 38.

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

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

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

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

      Refactorings

      Further Reading

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

          def test_invalid_syntax(self):
              """Test INVALID_SYNTAX_RE."""
              msgs = [
                  # Python 2.6/2.7/3.2/3.3/3.4/3.5/PyPy3
                  "invalid syntax",
      Severity: Major
      Found in didyoumean/didyoumean_re_tests.py and 1 other location - About 1 hr to fix
      didyoumean/didyoumean_re_tests.py on lines 606..623

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 38.

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

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

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

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

      Refactorings

      Further Reading

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

              for msg, typ in msgs.items():
                  results = ((typ,), dict())
                  self.re_matches(msg, re.CANNOT_BE_INTERPRETED_INT_RE, results)
      Severity: Major
      Found in didyoumean/didyoumean_re_tests.py and 2 other locations - About 1 hr to fix
      didyoumean/didyoumean_re_tests.py on lines 417..419
      didyoumean/didyoumean_re_tests.py on lines 432..434

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 38.

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

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

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

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

      Refactorings

      Further Reading

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

          def test_unqualified_exec(self):
              """Test UNQUALIFIED_EXEC_RE."""
              msgs = [
                  # Python 2.6
                  "unqualified exec is not allowed in function 'func_name' "
      Severity: Major
      Found in didyoumean/didyoumean_re_tests.py and 1 other location - About 1 hr to fix
      didyoumean/didyoumean_re_tests.py on lines 543..555

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 38.

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

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

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

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

      Refactorings

      Further Reading

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

              for msg, typ in msgs.items():
                  results = ((typ,), dict())
                  self.re_matches(msg, re.INTEGER_EXPECTED_GOT_RE, results)
      Severity: Major
      Found in didyoumean/didyoumean_re_tests.py and 2 other locations - About 1 hr to fix
      didyoumean/didyoumean_re_tests.py on lines 406..408
      didyoumean/didyoumean_re_tests.py on lines 432..434

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 38.

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

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

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

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

      Refactorings

      Further Reading

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

          def test_need_more_values_to_unpack(self):
              """Test NEED_MORE_VALUES_RE."""
              msgs = [
                  # Python 2.6/2.7/3.2/3.3/3.4/3.5(?)/PyPy3
                  "need more than 2 values to unpack",
      Severity: Major
      Found in didyoumean/didyoumean_re_tests.py and 6 other locations - About 50 mins to fix
      didyoumean/didyoumean_re_tests.py on lines 376..385
      didyoumean/didyoumean_re_tests.py on lines 577..586
      didyoumean/didyoumean_re_tests.py on lines 848..857
      didyoumean/didyoumean_re_tests.py on lines 859..869
      didyoumean/didyoumean_re_tests.py on lines 883..891
      didyoumean/didyoumean_re_tests.py on lines 893..902

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 36.

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

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

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

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

      Refactorings

      Further Reading

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

          def test_op_not_supported_between_instances(self):
              """Test OP_NOT_SUPP_BETWEEN_INSTANCES_RE."""
              msgs = [
                  # Python 3.6
                  "'<' not supported between instances of 'int' and 'NoneType'",
      Severity: Major
      Found in didyoumean/didyoumean_re_tests.py and 6 other locations - About 50 mins to fix
      didyoumean/didyoumean_re_tests.py on lines 376..385
      didyoumean/didyoumean_re_tests.py on lines 509..518
      didyoumean/didyoumean_re_tests.py on lines 577..586
      didyoumean/didyoumean_re_tests.py on lines 848..857
      didyoumean/didyoumean_re_tests.py on lines 859..869
      didyoumean/didyoumean_re_tests.py on lines 893..902

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 36.

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

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

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

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

      Refactorings

      Further Reading

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

          def test_max_recursion_depth(self):
              """Test MAX_RECURSION_DEPTH_RE."""
              msgs = [
                  # Most versions
                  'maximum recursion depth exceeded',
      Severity: Major
      Found in didyoumean/didyoumean_re_tests.py and 6 other locations - About 50 mins to fix
      didyoumean/didyoumean_re_tests.py on lines 376..385
      didyoumean/didyoumean_re_tests.py on lines 509..518
      didyoumean/didyoumean_re_tests.py on lines 577..586
      didyoumean/didyoumean_re_tests.py on lines 848..857
      didyoumean/didyoumean_re_tests.py on lines 859..869
      didyoumean/didyoumean_re_tests.py on lines 883..891

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 36.

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

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

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

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

      Refactorings

      Further Reading

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

          def test_exc_must_derive_from(self):
              """Test EXC_MUST_DERIVE_FROM_RE."""
              msgs = [
                  # Python 2.7
                  "exceptions must be old-style classes or derived from "
      Severity: Major
      Found in didyoumean/didyoumean_re_tests.py and 6 other locations - About 50 mins to fix
      didyoumean/didyoumean_re_tests.py on lines 376..385
      didyoumean/didyoumean_re_tests.py on lines 509..518
      didyoumean/didyoumean_re_tests.py on lines 577..586
      didyoumean/didyoumean_re_tests.py on lines 848..857
      didyoumean/didyoumean_re_tests.py on lines 883..891
      didyoumean/didyoumean_re_tests.py on lines 893..902

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 36.

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

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

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

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

      Refactorings

      Further Reading

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

          def test_future_first(self):
              """Test FUTURE_FIRST_RE."""
              msgs = [
                  # Python 2.6/2.7/3.2/3.3/3.4/3.5
                  "from __future__ imports must occur at the beginning of the file",
      Severity: Major
      Found in didyoumean/didyoumean_re_tests.py and 6 other locations - About 50 mins to fix
      didyoumean/didyoumean_re_tests.py on lines 376..385
      didyoumean/didyoumean_re_tests.py on lines 509..518
      didyoumean/didyoumean_re_tests.py on lines 848..857
      didyoumean/didyoumean_re_tests.py on lines 859..869
      didyoumean/didyoumean_re_tests.py on lines 883..891
      didyoumean/didyoumean_re_tests.py on lines 893..902

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 36.

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

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

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

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

      Refactorings

      Further Reading

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

          def test_too_many_values(self):
              """Test TOO_MANY_VALUES_UNPACK_RE."""
              msgs = [
                  # Python 2.6/2.7
                  "too many values to unpack",
      Severity: Major
      Found in didyoumean/didyoumean_re_tests.py and 6 other locations - About 50 mins to fix
      didyoumean/didyoumean_re_tests.py on lines 509..518
      didyoumean/didyoumean_re_tests.py on lines 577..586
      didyoumean/didyoumean_re_tests.py on lines 848..857
      didyoumean/didyoumean_re_tests.py on lines 859..869
      didyoumean/didyoumean_re_tests.py on lines 883..891
      didyoumean/didyoumean_re_tests.py on lines 893..902

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 36.

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

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

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

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

      Refactorings

      Further Reading

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

          def test_exception_group_parenthesized(self):
              """Test EXC_GROUP_PARENTH_RE."""
              msgs = [
                  # Python 3.10 alpha & beta.1
                  "exception group must be parenthesized",
      Severity: Major
      Found in didyoumean/didyoumean_re_tests.py and 6 other locations - About 50 mins to fix
      didyoumean/didyoumean_re_tests.py on lines 376..385
      didyoumean/didyoumean_re_tests.py on lines 509..518
      didyoumean/didyoumean_re_tests.py on lines 577..586
      didyoumean/didyoumean_re_tests.py on lines 859..869
      didyoumean/didyoumean_re_tests.py on lines 883..891
      didyoumean/didyoumean_re_tests.py on lines 893..902

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 36.

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

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

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

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

      Refactorings

      Further Reading

      There are no issues that match your filters.

      Category
      Status