goodplay/ansible_support/callback_plugin/goodplay.py
CallbackModule
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class CallbackModule(CallbackBase):
CALLBACK_VERSION = 2.0
CALLBACK_TYPE = 'notification'
CALLBACK_NAME = 'goodplay'
Function monkeypatch_play_context
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
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)
- Read upRead up
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
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:
- Read upRead up
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"