avocado-framework/avocado

View on GitHub

Showing 188 of 901 total issues

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

    def test_import_alias(self):
        statement = ast.parse("import os as operatingsystem").body[0]
        self.assertEqual({"os": "operatingsystem"}, get_statement_import_as(statement))
Severity: Major
Found in selftests/unit/safeloader_utils.py and 3 other locations - About 1 hr to fix
selftests/unit/safeloader_utils.py on lines 9..11
selftests/unit/safeloader_utils.py on lines 17..19
selftests/unit/safeloader_utils.py on lines 21..23

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

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_tag_keyval_double(self):
        raw = ":avocado: tags=fast,arch:x86_64,arch:ppc64"
        exp = {"fast": None, "arch": set(["x86_64", "ppc64"])}
        self.assertEqual(get_docstring_directives_tags(raw), exp)
Severity: Major
Found in selftests/unit/safeloader_docstring.py and 1 other location - About 1 hr to fix
selftests/unit/safeloader_docstring.py on lines 157..160

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

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

    def test_cpu_vendor_power9(self):
        with unittest.mock.patch(
            "builtins.open", return_value=self._get_data_mock("power9")
        ):
            self.assertEqual(cpu.get_vendor(), "ibm")
Severity: Major
Found in selftests/unit/utils/cpu.py and 10 other locations - About 1 hr to fix
selftests/unit/utils/cpu.py on lines 51..55
selftests/unit/utils/cpu.py on lines 57..61
selftests/unit/utils/cpu.py on lines 76..80
selftests/unit/utils/cpu.py on lines 82..86
selftests/unit/utils/cpu.py on lines 88..92
selftests/unit/utils/cpu.py on lines 94..98
selftests/unit/utils/cpu.py on lines 100..104
selftests/unit/utils/cpu.py on lines 106..110
selftests/unit/utils/cpu.py on lines 112..116
selftests/unit/utils/cpu.py on lines 118..122

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

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

    def test_cpu_arch_s390(self):
        with unittest.mock.patch(
            "builtins.open", return_value=self._get_data_mock("s390x")
        ):
            self.assertEqual(cpu.get_arch(), "s390")
Severity: Major
Found in selftests/unit/utils/cpu.py and 10 other locations - About 1 hr to fix
selftests/unit/utils/cpu.py on lines 51..55
selftests/unit/utils/cpu.py on lines 57..61
selftests/unit/utils/cpu.py on lines 76..80
selftests/unit/utils/cpu.py on lines 82..86
selftests/unit/utils/cpu.py on lines 94..98
selftests/unit/utils/cpu.py on lines 100..104
selftests/unit/utils/cpu.py on lines 106..110
selftests/unit/utils/cpu.py on lines 112..116
selftests/unit/utils/cpu.py on lines 118..122
selftests/unit/utils/cpu.py on lines 124..128

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

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

    def test_cpu_arch_arm_v7(self):
        with unittest.mock.patch(
            "builtins.open", return_value=self._get_data_mock("armv7")
        ):
            self.assertEqual(cpu.get_arch(), "arm")
Severity: Major
Found in selftests/unit/utils/cpu.py and 10 other locations - About 1 hr to fix
selftests/unit/utils/cpu.py on lines 51..55
selftests/unit/utils/cpu.py on lines 57..61
selftests/unit/utils/cpu.py on lines 76..80
selftests/unit/utils/cpu.py on lines 82..86
selftests/unit/utils/cpu.py on lines 88..92
selftests/unit/utils/cpu.py on lines 100..104
selftests/unit/utils/cpu.py on lines 106..110
selftests/unit/utils/cpu.py on lines 112..116
selftests/unit/utils/cpu.py on lines 118..122
selftests/unit/utils/cpu.py on lines 124..128

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

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

    def test_cpu_vendor_intel(self):
        with unittest.mock.patch(
            "builtins.open", return_value=self._get_data_mock("x86_64")
        ):
            self.assertEqual(cpu.get_vendor(), "intel")
Severity: Major
Found in selftests/unit/utils/cpu.py and 10 other locations - About 1 hr to fix
selftests/unit/utils/cpu.py on lines 51..55
selftests/unit/utils/cpu.py on lines 57..61
selftests/unit/utils/cpu.py on lines 76..80
selftests/unit/utils/cpu.py on lines 82..86
selftests/unit/utils/cpu.py on lines 88..92
selftests/unit/utils/cpu.py on lines 94..98
selftests/unit/utils/cpu.py on lines 100..104
selftests/unit/utils/cpu.py on lines 106..110
selftests/unit/utils/cpu.py on lines 118..122
selftests/unit/utils/cpu.py on lines 124..128

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

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

    def test_cpu_arch_power9(self):
        with unittest.mock.patch(
            "builtins.open", return_value=self._get_data_mock("power9")
        ):
            self.assertEqual(cpu.get_arch(), "powerpc")
Severity: Major
Found in selftests/unit/utils/cpu.py and 10 other locations - About 1 hr to fix
selftests/unit/utils/cpu.py on lines 51..55
selftests/unit/utils/cpu.py on lines 57..61
selftests/unit/utils/cpu.py on lines 76..80
selftests/unit/utils/cpu.py on lines 88..92
selftests/unit/utils/cpu.py on lines 94..98
selftests/unit/utils/cpu.py on lines 100..104
selftests/unit/utils/cpu.py on lines 106..110
selftests/unit/utils/cpu.py on lines 112..116
selftests/unit/utils/cpu.py on lines 118..122
selftests/unit/utils/cpu.py on lines 124..128

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

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

    def test_cpu_vendor_power8(self):
        with unittest.mock.patch(
            "builtins.open", return_value=self._get_data_mock("power8")
        ):
            self.assertEqual(cpu.get_vendor(), "ibm")
Severity: Major
Found in selftests/unit/utils/cpu.py and 10 other locations - About 1 hr to fix
selftests/unit/utils/cpu.py on lines 51..55
selftests/unit/utils/cpu.py on lines 57..61
selftests/unit/utils/cpu.py on lines 76..80
selftests/unit/utils/cpu.py on lines 82..86
selftests/unit/utils/cpu.py on lines 88..92
selftests/unit/utils/cpu.py on lines 94..98
selftests/unit/utils/cpu.py on lines 100..104
selftests/unit/utils/cpu.py on lines 106..110
selftests/unit/utils/cpu.py on lines 112..116
selftests/unit/utils/cpu.py on lines 124..128

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

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

    def test_cpu_arch_power8(self):
        with unittest.mock.patch(
            "builtins.open", return_value=self._get_data_mock("power8")
        ):
            self.assertEqual(cpu.get_arch(), "powerpc")
Severity: Major
Found in selftests/unit/utils/cpu.py and 10 other locations - About 1 hr to fix
selftests/unit/utils/cpu.py on lines 51..55
selftests/unit/utils/cpu.py on lines 57..61
selftests/unit/utils/cpu.py on lines 82..86
selftests/unit/utils/cpu.py on lines 88..92
selftests/unit/utils/cpu.py on lines 94..98
selftests/unit/utils/cpu.py on lines 100..104
selftests/unit/utils/cpu.py on lines 106..110
selftests/unit/utils/cpu.py on lines 112..116
selftests/unit/utils/cpu.py on lines 118..122
selftests/unit/utils/cpu.py on lines 124..128

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

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

    def test_cpu_arch_risc_v(self):
        with unittest.mock.patch(
            "builtins.open", return_value=self._get_data_mock("risc_v")
        ):
            self.assertEqual(cpu.get_arch(), "riscv")
Severity: Major
Found in selftests/unit/utils/cpu.py and 10 other locations - About 1 hr to fix
selftests/unit/utils/cpu.py on lines 51..55
selftests/unit/utils/cpu.py on lines 57..61
selftests/unit/utils/cpu.py on lines 76..80
selftests/unit/utils/cpu.py on lines 82..86
selftests/unit/utils/cpu.py on lines 88..92
selftests/unit/utils/cpu.py on lines 94..98
selftests/unit/utils/cpu.py on lines 100..104
selftests/unit/utils/cpu.py on lines 112..116
selftests/unit/utils/cpu.py on lines 118..122
selftests/unit/utils/cpu.py on lines 124..128

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

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

    def test_cpu_arch_arm_v8(self):
        with unittest.mock.patch(
            "builtins.open", return_value=self._get_data_mock("armv8")
        ):
            self.assertEqual(cpu.get_arch(), "aarch64")
Severity: Major
Found in selftests/unit/utils/cpu.py and 10 other locations - About 1 hr to fix
selftests/unit/utils/cpu.py on lines 51..55
selftests/unit/utils/cpu.py on lines 57..61
selftests/unit/utils/cpu.py on lines 76..80
selftests/unit/utils/cpu.py on lines 82..86
selftests/unit/utils/cpu.py on lines 88..92
selftests/unit/utils/cpu.py on lines 94..98
selftests/unit/utils/cpu.py on lines 106..110
selftests/unit/utils/cpu.py on lines 112..116
selftests/unit/utils/cpu.py on lines 118..122
selftests/unit/utils/cpu.py on lines 124..128

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

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

    def test_cpu_arch_i386(self):
        with unittest.mock.patch(
            "builtins.open", return_value=self._get_data_mock("i386")
        ):
            self.assertEqual(cpu.get_arch(), "i386")
Severity: Major
Found in selftests/unit/utils/cpu.py and 10 other locations - About 1 hr to fix
selftests/unit/utils/cpu.py on lines 57..61
selftests/unit/utils/cpu.py on lines 76..80
selftests/unit/utils/cpu.py on lines 82..86
selftests/unit/utils/cpu.py on lines 88..92
selftests/unit/utils/cpu.py on lines 94..98
selftests/unit/utils/cpu.py on lines 100..104
selftests/unit/utils/cpu.py on lines 106..110
selftests/unit/utils/cpu.py on lines 112..116
selftests/unit/utils/cpu.py on lines 118..122
selftests/unit/utils/cpu.py on lines 124..128

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

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

    def test_cpu_arch_x86_64(self):
        with unittest.mock.patch(
            "builtins.open", return_value=self._get_data_mock("x86_64")
        ):
            self.assertEqual(cpu.get_arch(), "x86_64")
Severity: Major
Found in selftests/unit/utils/cpu.py and 10 other locations - About 1 hr to fix
selftests/unit/utils/cpu.py on lines 51..55
selftests/unit/utils/cpu.py on lines 76..80
selftests/unit/utils/cpu.py on lines 82..86
selftests/unit/utils/cpu.py on lines 88..92
selftests/unit/utils/cpu.py on lines 94..98
selftests/unit/utils/cpu.py on lines 100..104
selftests/unit/utils/cpu.py on lines 106..110
selftests/unit/utils/cpu.py on lines 112..116
selftests/unit/utils/cpu.py on lines 118..122
selftests/unit/utils/cpu.py on lines 124..128

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

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_values(self):
        self.assertEqual(data_structures.DataSize("10m").b, 10485760)
        self.assertEqual(data_structures.DataSize("10M").b, 10485760)
Severity: Major
Found in selftests/unit/utils/data_structures.py and 1 other location - About 1 hr to fix
selftests/unit/utils/data_structures.py on lines 138..140

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

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_check_name_for_file_contains_fail(self):
        class MyProbe(distro.Probe):
            CHECK_FILE = "/etc/issue"
            CHECK_FILE_CONTAINS = "text"

Severity: Major
Found in selftests/unit/utils/distro.py and 1 other location - About 1 hr to fix
selftests/unit/utils/distro.py on lines 15..21

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

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_value_and_type(self):
        self.assertEqual(data_structures.DataSize("0b").b, 0)
        self.assertEqual(data_structures.DataSize("0t").b, 0)
Severity: Major
Found in selftests/unit/utils/data_structures.py and 1 other location - About 1 hr to fix
selftests/unit/utils/data_structures.py on lines 142..144

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

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_check_name_for_file(self):
        class MyProbe(distro.Probe):
            CHECK_FILE = "/etc/issue"
            CHECK_FILE_DISTRO_NAME = "superdistro"

Severity: Major
Found in selftests/unit/utils/distro.py and 1 other location - About 1 hr to fix
selftests/unit/utils/distro.py on lines 23..29

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

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_fedora_38(self):
        """
        :avocado: dependency={"type": "podman-image", "uri": "registry.fedoraproject.org/fedora:38"}
        """
        self.run_job(
Severity: Major
Found in selftests/functional/utils/distro.py and 1 other location - About 1 hr to fix
selftests/functional/utils/distro.py on lines 46..54

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

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_rhel_9_1(self):
        """
        :avocado: dependency={"type": "podman-image", "uri": "registry.access.redhat.com/ubi9:9.1"}
        """
        self.run_job(
Severity: Major
Found in selftests/functional/utils/distro.py and 1 other location - About 1 hr to fix
selftests/functional/utils/distro.py on lines 35..43

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

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_is_not_ar(self):
        path = os.path.join(BASEDIR, "selftests", ".data", "hello.rpm")
        self.assertFalse(ar.Ar(path).is_valid())
Severity: Major
Found in selftests/unit/utils/ar.py and 1 other location - About 1 hr to fix
selftests/unit/utils/ar.py on lines 9..11

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

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