netzulo/qacode

View on GitHub

Showing 23 of 45 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Confirmed

def find_elements_wait(self, selector,
locator=By.CSS_SELECTOR, driver_wait=None):
"""Search elements using WebDriverWait class
and ElementConditions presence_of_all_elements_located
 
Severity: Major
Found in qacode/core/bots/modules/nav_base.py and 1 other location - About 4 hrs to fix
qacode/core/bots/modules/nav_base.py on lines 239..268

Similar blocks of code found in 2 locations. Consider refactoring.
Confirmed

def find_element_wait(self, selector,
locator=By.CSS_SELECTOR, driver_wait=None):
"""Search element using WebDriverWait class
and ElementConditions presence_of_element_located
 
Severity: Major
Found in qacode/core/bots/modules/nav_base.py and 1 other location - About 4 hrs to fix
qacode/core/bots/modules/nav_base.py on lines 270..299

Similar blocks of code found in 2 locations. Consider refactoring.
Confirmed

def ele_wait_value(self, selector, value,
locator=By.CSS_SELECTOR, timeout=0):
"""Wait if the given value is present in the specified element"""
locator_tuple = (locator, selector)
driver_wait = WebDriverWait(self.driver, timeout)
Severity: Major
Found in qacode/core/bots/modules/nav_base.py and 1 other location - About 3 hrs to fix
qacode/core/bots/modules/nav_base.py on lines 691..700

Similar blocks of code found in 2 locations. Consider refactoring.
Confirmed

def ele_wait_text(self, selector, text,
locator=By.CSS_SELECTOR, timeout=0):
"""Wait if the given text is present in the specified element"""
locator_tuple = (locator, selector)
driver_wait = WebDriverWait(self.driver, timeout)
Severity: Major
Found in qacode/core/bots/modules/nav_base.py and 1 other location - About 3 hrs to fix
qacode/core/bots/modules/nav_base.py on lines 702..711

Similar blocks of code found in 2 locations. Consider refactoring.
Open

@classmethod
def cfg_pages(cls):
"""Obtain inherit dict from 'cls.config' dict named
'config.tests.apps[i].pages'
"""
Severity: Major
Found in qacode/core/testing/test_info.py and 1 other location - About 3 hrs to fix
qacode/core/testing/test_info.py on lines 80..90

Similar blocks of code found in 2 locations. Consider refactoring.
Open

@classmethod
def cfg_controls(cls):
"""Obtain inherit dict from 'cls.config' dict named
'config.tests.apps[i].pages[j].controls'
"""
Severity: Major
Found in qacode/core/testing/test_info.py and 1 other location - About 3 hrs to fix
qacode/core/testing/test_info.py on lines 68..78

Similar blocks of code found in 3 locations. Consider refactoring.
Open

@selector.setter
def selector(self, value):
"""SET for _selector attribute"""
if not value or not isinstance(value, str):
raise AttributeError("Bad param 'selector'")
Severity: Major
Found in qacode/core/webs/controls/control_base.py and 2 other locations - About 2 hrs to fix
qacode/core/webs/controls/control_base.py on lines 423..428
qacode/core/webs/controls/control_base.py on lines 447..452

Similar blocks of code found in 3 locations. Consider refactoring.
Open

@bot.setter
def bot(self, value):
"""SET for _bot attribute"""
if not value or not isinstance(value, BotBase):
raise AttributeError("Bad param 'bot'")
Severity: Major
Found in qacode/core/webs/controls/control_base.py and 2 other locations - About 2 hrs to fix
qacode/core/webs/controls/control_base.py on lines 447..452
qacode/core/webs/controls/control_base.py on lines 459..464

Similar blocks of code found in 3 locations. Consider refactoring.
Open

@name.setter
def name(self, value):
"""SET for _name attribute"""
if not value or not isinstance(value, str):
raise AttributeError("Bad param 'name'")
Severity: Major
Found in qacode/core/webs/controls/control_base.py and 2 other locations - About 2 hrs to fix
qacode/core/webs/controls/control_base.py on lines 423..428
qacode/core/webs/controls/control_base.py on lines 459..464

Function setup_class has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Confirmed

def setup_class(cls, **kwargs):
"""Configure 'cls.attribute'. If name start with 'test_' and have
decorator skipIf with value True, then not open bot
"""
tests_methods = []
Severity: Minor
Found in qacode/core/testing/test_info.py - About 1 hr to fix

Function get_elements has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Confirmed

def get_elements(self, config_controls):
"""Search element on Bot instance, choose selector
from instance or locator param
 
Arguments:
Severity: Minor
Found in qacode/core/webs/pages/page_base.py - About 55 mins to fix

Function __init__ has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Confirmed

def __init__(self, bot, **kwargs):
"""Instance of PageBase class
 
Arguments:
bot {BotBase} -- BotBase or inherit class instance
Severity: Minor
Found in qacode/core/webs/pages/page_base.py - About 45 mins to fix

Function driver_name_filter has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Confirmed

def driver_name_filter(self, driver_name=None):
"""Filter names of driver to search selected on config list
 
Keyword Arguments:
driver_name {str} -- driver_name_format is
Severity: Minor
Found in qacode/core/bots/bot_base.py - About 45 mins to fix

Function read_file has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

def read_file(is_json=False, file_path=None, encoding='utf-8',
Severity: Minor
Found in setup.py - About 35 mins to fix

Function set_css_rule has 5 arguments (exceeds 4 allowed). Consider refactoring.
Confirmed

def set_css_rule(self, css_selector, css_prop, css_value,
Severity: Minor
Found in qacode/core/bots/modules/nav_base.py - About 35 mins to fix

Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
Confirmed

def __init__(self, driver, log, driver_wait=None, driver_actions=None,
Severity: Minor
Found in qacode/core/bots/modules/nav_base.py - About 35 mins to fix

Function get_log has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Confirmed

def get_log(self, log_name='browser', raises=False):
"""Get selenium log by name, this depends of
driver mode and browser what it's using each time
 
Keyword Arguments:
Severity: Minor
Found in qacode/core/bots/modules/nav_base.py - About 35 mins to fix

Function ele_click has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Confirmed

def ele_click(self, element=None, selector=None, locator=By.CSS_SELECTOR):
"""Perform click webelement with locator param or search it by default
CSS_SELECTOR value if element it's none but selector
it's not default value
 
Severity: Minor
Found in qacode/core/bots/modules/nav_base.py - About 25 mins to fix

Function __check_dropdown__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Confirmed

def __check_dropdown__(self, text, by_value=False, by_index=False):
"""Internal funcionality for select/deselect methods"""
if not self._element or not self._dropdown:
self.reload(**self._settings)
if self._dropdown is None:
Severity: Minor
Found in qacode/core/webs/controls/control_dropdown.py - About 25 mins to fix

Function _load has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Confirmed

def _load(self, settings=None):
"""Loads page elements and maximize browser window"""
# TODO: tests passed ?
self.log = self.bot.log
if not settings:
Severity: Minor
Found in qacode/core/webs/pages/page_base.py - About 25 mins to fix
Severity
Category
Status
Source
Language