Consider possible security implications associated with subprocess module. Open
import subprocess
- Exclude checks
subprocess call - check for execution of untrusted input. Open
process = subprocess.Popen(
cmd,
stdin=subprocess.DEVNULL,
stdout=subprocess.PIPE,
stderr=subprocess.DEVNULL,
- Exclude checks
File runnable.py
has 420 lines of code (exceeds 250 allowed). Consider refactoring. Open
import base64
import collections
import json
import logging
import subprocess
Runnable
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class Runnable:
"""
Describes an entity that be executed in the context of a task
A instance of :class:`BaseRunner` is the entity that will actually
Function get_command_args
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def get_command_args(self):
"""
Returns the command arguments that adhere to the runner interface
This is useful for building 'runnable-run' and 'task-run' commands
- 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 __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, kind, uri, *args, config=None, **kwargs):
Function from_avocado_config
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def from_avocado_config(cls, kind, uri, *args, config=None, **kwargs):
Function pick_runner_command
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def pick_runner_command(kind, runners_registry=None):
"""Selects a runner command based on the runner kind.
And when finding a suitable runner, keeps found runners in registry.
- 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 get_dict
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_dict(self):
"""
Returns a dictionary representation for the current runnable
This is usually the format that will be converted to a format
- 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"