Telefonica/toolium

View on GitHub
toolium/pageelements/page_element.py

Summary

Maintainability
A
1 hr
Test Coverage

Function _find_web_element has a Cognitive Complexity of 20 (exceeds 10 allowed). Consider refactoring.
Open

    def _find_web_element(self):
        """Find WebElement using element locator and save it in _web_element attribute"""
        if not self._web_element or not self.driver_wrapper.config.getboolean_optional('Driver', 'save_web_element'):
            # check context for mobile webviews
            if self.driver_wrapper.config.getboolean_optional('Driver', 'automatic_context_selection'):
Severity: Minor
Found in toolium/pageelements/page_element.py - About 1 hr to fix

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 9 arguments (exceeds 6 allowed). Consider refactoring.
Wontfix

    def __init__(self, by, value, parent=None, order=None, wait=False, shadowroot=None, webview=False,
Severity: Major
Found in toolium/pageelements/page_element.py - About 50 mins to fix

    There are no issues that match your filters.

    Category
    Status