Showing 12 of 74 total issues
File test_collection.py
has 423 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
pytest_plugins = 'pytester'
File test_ansible_role_support_integration.py
has 385 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
import tarfile
import pytest
File test_docker_support_integration.py
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
import docker
import docker.errors
import docker.utils
CallbackModule
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class CallbackModule(CallbackBase):
CALLBACK_VERSION = 2.0
CALLBACK_TYPE = 'notification'
CALLBACK_NAME = 'goodplay'
Function create_role
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_role(
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, ctx, fspath, parent=None, config=None, session=None):
Function __iter__
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __iter__(self):
# override default Capture to read lines as long as streams are open,
# thus iteration is not being stopped by large pauses between lines
# being available
while self.streams_open():
- 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 pull_required_images
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def pull_required_images(self):
required_images = set()
for host in self.ctx.inventory.hosts():
required_image = self.get_docker_image_for_host(host)
- 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
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"
Further reading
Function wait_for_event
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def wait_for_event(self, event_name=None, **kwargs):
for event in self.receive_events():
if event['event_name'] == event_name \
and set(kwargs.items()).issubset(set(event['data'].items())):
return event
- 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 platform_manager
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def platform_manager(self):
platform_manager = PlatformManager.from_dicts(self.config['platforms'])
if self.is_platform_matrix_requested:
platforms = self.role_meta_info['galaxy_info'].get('platforms', [])
- 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 role_path
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def role_path(self):
for ancestor_path in self.playbook_path.parts(reverse=True)[1:]:
if ancestor_path.basename == 'tests':
role_path = ancestor_path.dirpath()
is_role_path = role_path.join('meta', 'main.yml').check(file=True)
- 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"