Function _get_html_row
has 7 arguments (exceeds 6 allowed). Consider refactoring. Wontfix
def _get_html_row(self, result, report_name, image_path, baseline_path, diff_path, message):
Function _add_result_to_report
has 7 arguments (exceeds 6 allowed). Consider refactoring. Invalid
def _add_result_to_report(self, result, report_name, image_path, baseline_path, diff_path, message):
Function assert_screenshot
has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring. Open
def assert_screenshot(self, element, filename, file_suffix=None, threshold=0, exclude_elements=[]):
"""Assert that a screenshot of an element is the same as a screenshot on disk, within a given threshold
:param element: either a WebElement, PageElement or element locator as a tuple (locator_type, locator_value).
If None, a full screenshot is taken.
- 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 exclude_elements
has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring. Open
def exclude_elements(self, img, web_elements):
"""Modify image hiding elements with a black rectangle
:param img: image object
:param web_elements: WebElement objects to be excluded
- 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 compare_files
has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring. Wontfix
def compare_files(self, report_name, image_path, baseline_path, threshold):
"""Compare two image files, generate a new image file with highlighted differences,
calculate the percentage of pixels that are different between both images and add result to the html report
:param report_name: name to show in html report
- 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"