avocado-framework/avocado

View on GitHub
selftests/unit/test_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/test_tap.py - About 4 hrs to fix

    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/test_tap.py and 1 other location - About 1 day to fix
    selftests/unit/test_tap.py on lines 214..227

    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_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/test_tap.py and 1 other location - About 1 day to fix
    selftests/unit/test_tap.py on lines 199..212

    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/test_tap.py and 1 other location - About 5 hrs to fix
    selftests/unit/test_tap.py on lines 109..116

    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/test_tap.py and 1 other location - About 5 hrs to fix
    selftests/unit/test_tap.py on lines 146..153

    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/test_tap.py and 2 other locations - About 3 hrs to fix
    selftests/unit/test_tap.py on lines 253..257
    selftests/unit/test_tap.py on lines 259..263

    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/test_tap.py and 2 other locations - About 3 hrs to fix
    selftests/unit/test_tap.py on lines 166..170
    selftests/unit/test_tap.py on lines 253..257

    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/test_tap.py and 2 other locations - About 3 hrs to fix
    selftests/unit/test_tap.py on lines 166..170
    selftests/unit/test_tap.py on lines 259..263

    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/test_tap.py and 5 other locations - About 1 hr to fix
    selftests/unit/test_tap.py on lines 94..97
    selftests/unit/test_tap.py on lines 99..102
    selftests/unit/test_tap.py on lines 104..107
    selftests/unit/test_tap.py on lines 118..121
    selftests/unit/test_tap.py on lines 123..126

    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/test_tap.py and 5 other locations - About 1 hr to fix
    selftests/unit/test_tap.py on lines 89..92
    selftests/unit/test_tap.py on lines 94..97
    selftests/unit/test_tap.py on lines 99..102
    selftests/unit/test_tap.py on lines 118..121
    selftests/unit/test_tap.py on lines 123..126

    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/test_tap.py and 5 other locations - About 1 hr to fix
    selftests/unit/test_tap.py on lines 89..92
    selftests/unit/test_tap.py on lines 94..97
    selftests/unit/test_tap.py on lines 99..102
    selftests/unit/test_tap.py on lines 104..107
    selftests/unit/test_tap.py on lines 123..126

    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/test_tap.py and 5 other locations - About 1 hr to fix
    selftests/unit/test_tap.py on lines 89..92
    selftests/unit/test_tap.py on lines 94..97
    selftests/unit/test_tap.py on lines 99..102
    selftests/unit/test_tap.py on lines 104..107
    selftests/unit/test_tap.py on lines 118..121

    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/test_tap.py and 5 other locations - About 1 hr to fix
    selftests/unit/test_tap.py on lines 89..92
    selftests/unit/test_tap.py on lines 94..97
    selftests/unit/test_tap.py on lines 104..107
    selftests/unit/test_tap.py on lines 118..121
    selftests/unit/test_tap.py on lines 123..126

    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/test_tap.py and 5 other locations - About 1 hr to fix
    selftests/unit/test_tap.py on lines 89..92
    selftests/unit/test_tap.py on lines 99..102
    selftests/unit/test_tap.py on lines 104..107
    selftests/unit/test_tap.py on lines 118..121
    selftests/unit/test_tap.py on lines 123..126

    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