mangroveorg/datawinners

View on GitHub
func_tests/framework/drivers/driver_wrapper.py

Summary

Maintainability
C
7 hrs
Test Coverage

DriverWrapper has 21 functions (exceeds 20 allowed). Consider refactoring.
Open

class DriverWrapper(object):
    """
    DriverWrapper class is for creating an wrapper over traditional webdriver
     class. To do some additional function on different web elements
    """
Severity: Minor
Found in func_tests/framework/drivers/driver_wrapper.py - About 2 hrs to fix

    Function wait_until_element_is_not_present has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def wait_until_element_is_not_present(self, time_out_in_seconds, locator):
            current_time = datetime.datetime.now()
            end_time = current_time + datetime.timedelta(0, time_out_in_seconds)
    
            while True:
    Severity: Minor
    Found in func_tests/framework/drivers/driver_wrapper.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 wait_until_web_element_is_not_present has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def wait_until_web_element_is_not_present(self, time_out_in_seconds, element):
            current_time = datetime.datetime.now()
            end_time = current_time + datetime.timedelta(0, time_out_in_seconds)
    
            while True:
    Severity: Minor
    Found in func_tests/framework/drivers/driver_wrapper.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 wait_for_element has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def wait_for_element(self, time_out_in_seconds, object_id, want_visible=None):
            """Finds elements by their id by waiting till timeout.
    
            Note that implicitly_wait mostly largely eliminates the need for this"""
    
    Severity: Minor
    Found in func_tests/framework/drivers/driver_wrapper.py - About 55 mins 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 get_driver_for_browser has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    def get_driver_for_browser(browser):
        browser = browser if browser else get_default_browser_name()
        #sys.stderr.write("using driver for browser: %s\n" % browser)
        if browser == "firefox":
            fprofile = FirefoxProfile()
    Severity: Minor
    Found in func_tests/framework/drivers/driver_wrapper.py - About 45 mins 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 wait_for_page_with_title has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def wait_for_page_with_title(self, time_out_in_seconds, title, debug=False):
            current_time = datetime.datetime.now()
            end_time = current_time + datetime.timedelta(0, time_out_in_seconds)
    
            while True:
    Severity: Minor
    Found in func_tests/framework/drivers/driver_wrapper.py - About 35 mins 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

    There are no issues that match your filters.

    Category
    Status