Showing 494 of 703 total issues
Function register_option
has 16 arguments (exceeds 4 allowed). Consider refactoring. Open
def register_option(
Function file_has_content
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def file_has_content(file_path, content, regex):
"""Check if a file has `content`."""
if os.path.isfile(file_path):
with open(file_path, "r", encoding="utf-8") as f:
lines = f.readlines()
- 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 to_str
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def to_str(self, summary, variants, **kwargs):
"""
Return human readable representation
The summary/variants accepts verbosity where 0 means silent and
- 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 _mapping_to_tree_loader
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def _mapping_to_tree_loader(loader, node, looks_like_node=False):
"""Maps yaml mapping tag to TreeNode structure"""
_value = []
for key_node, value_node in node.value:
# Allow only strings as dict keys
- 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 pre
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def pre(self, job):
for suite in job.test_suites:
dependency_file_path = suite.config.get("job.run.dependency")
if dependency_file_path:
try:
- 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_nslist_with_pci
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def get_nslist_with_pci(pci_address):
"""
Fetches and returns list of namespaces for specified pci_address
:param pci_address: pci_address of any nvme adapter
- 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 provides
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def provides(self, name):
"""
Return a list of packages that provide [name of package/file].
:param name: File name.
- 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 parse_unified_diff_output
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def parse_unified_diff_output(lines):
"""
Parses the unified diff output of two files.
:param lines: diff lines
- 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 map_method_with_return
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def map_method_with_return(self, method_name, *args, **kwargs):
"""
The same as `map_method` but additionally reports the list of returned
values and optionally deepcopies the passed arguments
- 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_environment
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def get_environment(self):
"""Get node environment (values + preceding envs)"""
if self._environment is None:
self._environment = (
self.parent.environment.copy() if self.parent else TreeEnvironment()
- 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 a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, namespace, invoke_kwds=None):
super().__init__(namespace, invoke_kwds)
namespace = f"{self.settings_section()}.order"
configured_order = settings.as_dict().get(namespace)
ordered = []
- 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 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(
self,
methodName="test",
name=None,
params=None,
Function cover_combination
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def cover_combination(self, row, parameters):
"""
Cover combination of specific parameters by one row from possible solution
:param row: one row from solution
- 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 reserve_slot
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def reserve_slot(self, runtime_task):
"""
Reserve a free or custom remote host slot for the runtime task.
:param runtime_task: runtime task to reserve the slot for
- 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 resolve
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def resolve(reference): # pylint: disable=W0221
if GO_BIN is None:
return ReferenceResolution(
reference,
- 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 uncover_combination
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def uncover_combination(self, row, parameters):
"""
Uncover combination of specific parameters by one row from possible solution
:param row: one row from solution
- 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 tests
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def tests(self):
mapping = {
"SKIP": "warning",
"ERROR": "danger",
"FAIL": "danger",
- 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 is_valid_combination
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def is_valid_combination(self, row, parameters):
"""
Is the specific parameters from solution row match the constraints.
:param row: one row from solution
- 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 name_for_file_contains
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def name_for_file_contains(self):
"""
Get the distro if the :attr:`CHECK_FILE` is set and has content
"""
if self.check_name_for_file_contains():
- 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 analyze_unpickable_item
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def analyze_unpickable_item(path_prefix, obj):
"""
Recursive method to obtain unpickable objects along with location
:param path_prefix: Path to this object
- 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"