SylvainDe/DidYouMean-Python

View on GitHub

Showing 113 of 142 total issues

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 85.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 85.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 83.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 83.

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

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

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

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

Refactorings

Further Reading

Severity
Category
Status
Source
Language