Function filter_tags_on_runnables
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
def filter_tags_on_runnables(
resolutions, filter_by_tags, include_empty=False, include_empty_key=False
):
"""
Filters out runnables that do not match the tags criteria given
- 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 _must_key_val_matches
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def _must_key_val_matches(must_key_vals, test_tags, include_empty_key):
"""
Checks if the required key:vals are fulfilled by the test_tags
:rtype: bool
- 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
Avoid deeply nested control flow statements. Open
if not must_flat.issubset(test_tags):
continue
Avoid deeply nested control flow statements. Open
if not _must_key_val_matches(
must_key_val, test_tags, include_empty_key
):
continue
Function _parse_filter_by_tags
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _parse_filter_by_tags(filter_by_tags):
"""
Parses the various filter by tags in "command line" format
The filtering of tests usually happens my means of "--filter-by-tags"
- 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"