avocado-framework/avocado

View on GitHub
selftests/unit/tap.py

Summary

Maintainability
F
1 wk
Test Coverage

TapParserTests has 35 functions (exceeds 20 allowed). Consider refactoring.
Open

class TapParserTests(unittest.TestCase):
    def assert_test(self, events, **kwargs):
        if "explanation" not in kwargs:
            kwargs["explanation"] = None
        self.assertEqual(next(events), TapParser.Test(**kwargs))
Severity: Minor
Found in selftests/unit/tap.py - About 4 hrs to fix

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

        def test_too_few(self):
            events = self.parse_tap("ok 1\nnot ok 2\n1..3")
            self.assert_test(events, number=1, name="", result=TestResult.PASS)
            self.assert_test(events, number=2, name="", result=TestResult.FAIL)
            self.assert_plan(events, count=3, late=True)
    Severity: Major
    Found in selftests/unit/tap.py and 1 other location - About 1 day to fix
    selftests/unit/tap.py on lines 204..217

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

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

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

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

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

    Refactorings

    Further Reading

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

        def test_too_many(self):
            events = self.parse_tap("ok 1\nnot ok 2\n1..1")
            self.assert_test(events, number=1, name="", result=TestResult.PASS)
            self.assert_test(events, number=2, name="", result=TestResult.FAIL)
            self.assert_plan(events, count=1, late=True)
    Severity: Major
    Found in selftests/unit/tap.py and 1 other location - About 1 day to fix
    selftests/unit/tap.py on lines 219..232

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

    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_directive_case(self):
            events = self.parse_tap("ok 1 abc # skip")
            self.assert_test(events, number=1, name="abc", result=TestResult.SKIP)
            self.assert_last(events)
    
    
    Severity: Major
    Found in selftests/unit/tap.py and 1 other location - About 5 hrs to fix
    selftests/unit/tap.py on lines 112..119

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

    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_one_test_todo(self):
            events = self.parse_tap("not ok 1 abc # TODO")
            self.assert_test(events, number=1, name="abc", result=TestResult.XFAIL)
            self.assert_last(events)
    
    
    Severity: Major
    Found in selftests/unit/tap.py and 1 other location - About 5 hrs to fix
    selftests/unit/tap.py on lines 149..156

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

    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_one_test_early_plan(self):
            events = self.parse_tap("1..1\nok")
            self.assert_plan(events, count=1, late=False)
            self.assert_test(events, number=1, name="", result=TestResult.PASS)
            self.assert_last(events)
    Severity: Major
    Found in selftests/unit/tap.py and 2 other locations - About 3 hrs to fix
    selftests/unit/tap.py on lines 258..262
    selftests/unit/tap.py on lines 264..268

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

    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_unexpected(self):
            events = self.parse_tap("1..1\ninvalid\nok 1")
            self.assert_plan(events, count=1, late=False)
            self.assert_test(events, number=1, name="", result=TestResult.PASS)
            self.assert_last(events)
    Severity: Major
    Found in selftests/unit/tap.py and 2 other locations - About 3 hrs to fix
    selftests/unit/tap.py on lines 171..175
    selftests/unit/tap.py on lines 258..262

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

    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_empty_line(self):
            events = self.parse_tap("1..1\n\nok 1")
            self.assert_plan(events, count=1, late=False)
            self.assert_test(events, number=1, name="", result=TestResult.PASS)
            self.assert_last(events)
    Severity: Major
    Found in selftests/unit/tap.py and 2 other locations - About 3 hrs to fix
    selftests/unit/tap.py on lines 171..175
    selftests/unit/tap.py on lines 264..268

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

    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_one_test_ok(self):
            events = self.parse_tap("ok")
            self.assert_test(events, number=1, name="", result=TestResult.PASS)
            self.assert_last(events)
    Severity: Major
    Found in selftests/unit/tap.py and 5 other locations - About 1 hr to fix
    selftests/unit/tap.py on lines 97..100
    selftests/unit/tap.py on lines 102..105
    selftests/unit/tap.py on lines 107..110
    selftests/unit/tap.py on lines 121..124
    selftests/unit/tap.py on lines 126..129

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 47.

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

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

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

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

    Refactorings

    Further Reading

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

        def test_one_test_skip_failure(self):
            events = self.parse_tap("not ok 1 abc # SKIP")
            self.assert_test(events, number=1, name="abc", result=TestResult.FAIL)
            self.assert_last(events)
    Severity: Major
    Found in selftests/unit/tap.py and 5 other locations - About 1 hr to fix
    selftests/unit/tap.py on lines 92..95
    selftests/unit/tap.py on lines 97..100
    selftests/unit/tap.py on lines 102..105
    selftests/unit/tap.py on lines 107..110
    selftests/unit/tap.py on lines 121..124

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 47.

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

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

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

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

    Refactorings

    Further Reading

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

        def test_one_test_skip(self):
            events = self.parse_tap("ok 1 abc # SKIP")
            self.assert_test(events, number=1, name="abc", result=TestResult.SKIP)
            self.assert_last(events)
    Severity: Major
    Found in selftests/unit/tap.py and 5 other locations - About 1 hr to fix
    selftests/unit/tap.py on lines 92..95
    selftests/unit/tap.py on lines 97..100
    selftests/unit/tap.py on lines 102..105
    selftests/unit/tap.py on lines 107..110
    selftests/unit/tap.py on lines 126..129

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 47.

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

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

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

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

    Refactorings

    Further Reading

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

        def test_one_test_not_ok(self):
            events = self.parse_tap("not ok")
            self.assert_test(events, number=1, name="", result=TestResult.FAIL)
            self.assert_last(events)
    Severity: Major
    Found in selftests/unit/tap.py and 5 other locations - About 1 hr to fix
    selftests/unit/tap.py on lines 92..95
    selftests/unit/tap.py on lines 97..100
    selftests/unit/tap.py on lines 102..105
    selftests/unit/tap.py on lines 121..124
    selftests/unit/tap.py on lines 126..129

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 47.

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

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

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

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

    Refactorings

    Further Reading

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

        def test_one_test_with_name(self):
            events = self.parse_tap("ok 1 abc")
            self.assert_test(events, number=1, name="abc", result=TestResult.PASS)
            self.assert_last(events)
    Severity: Major
    Found in selftests/unit/tap.py and 5 other locations - About 1 hr to fix
    selftests/unit/tap.py on lines 92..95
    selftests/unit/tap.py on lines 97..100
    selftests/unit/tap.py on lines 107..110
    selftests/unit/tap.py on lines 121..124
    selftests/unit/tap.py on lines 126..129

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 47.

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

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

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

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

    Refactorings

    Further Reading

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

        def test_one_test_with_number(self):
            events = self.parse_tap("ok 1")
            self.assert_test(events, number=1, name="", result=TestResult.PASS)
            self.assert_last(events)
    Severity: Major
    Found in selftests/unit/tap.py and 5 other locations - About 1 hr to fix
    selftests/unit/tap.py on lines 92..95
    selftests/unit/tap.py on lines 102..105
    selftests/unit/tap.py on lines 107..110
    selftests/unit/tap.py on lines 121..124
    selftests/unit/tap.py on lines 126..129

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 47.

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

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

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

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

    Refactorings

    Further Reading

    There are no issues that match your filters.

    Category
    Status