goodplay/goodplay

View on GitHub
goodplay/ansible_support/callback_plugin/goodplay.py

Summary

Maintainability
A
3 hrs
Test Coverage

CallbackModule has 22 functions (exceeds 20 allowed). Consider refactoring.
Open

class CallbackModule(CallbackBase):
    CALLBACK_VERSION = 2.0
    CALLBACK_TYPE = 'notification'
    CALLBACK_NAME = 'goodplay'

Severity: Minor
Found in goodplay/ansible_support/callback_plugin/goodplay.py - About 2 hrs to fix

    Function monkeypatch_play_context has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    def monkeypatch_play_context():
        original_set_task_and_variable_override = PlayContext.set_task_and_variable_override
    
        def goodplay_set_task_and_variable_override(self, task, *args, **kwargs):
            new_info = original_set_task_and_variable_override(self, task, *args, **kwargs)
    Severity: Minor
    Found in goodplay/ansible_support/callback_plugin/goodplay.py - About 45 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function final_test_task_outcome has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def final_test_task_outcome(self):
            if self.per_host_outcomes:
                outcomes = set(x['outcome'] for x in self.per_host_outcomes.values())
                outcome_priority = ('failed', 'skipped', 'passed')
                for outcome in outcome_priority:
    Severity: Minor
    Found in goodplay/ansible_support/callback_plugin/goodplay.py - About 25 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    There are no issues that match your filters.

    Category
    Status