Function regex_page_data_table
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def regex_page_data_table(pattern, content):
"""
Extract data from a table on the text based on an id and value.
:param pattern: id and value of element to parse
- 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 regex_page_data
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def regex_page_data(pattern, content, rtype = None):
"""
Get a value from page data based on a regex pattern.
:param pattern: regex pattern to match against
- 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 last_element.replace('_', ' ') != row_data[headings[i]]:
row_data[headings[i]] = last_element.replace('_', ' ')
table_data.append(row_data)
Function parse_data_points
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def parse_data_points(content):
"""
Parse the page data and look for expected contents based on regular expressions.
:param content: content to search
- 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"