src/ej_dataviz/roles.py
Function prepare_dataframe
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
def prepare_dataframe(df, id="stats-table", pc=False):
"""
Renders dataframe in a HTML table.
"""
if pc is True:
- 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 conversation_download_data
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def conversation_download_data(conversation, *, which, formats=None, cluster=None, **url_kwargs):
Function stats_table
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def stats_table(conversation, stats=None, data="votes", request=None, **kwargs):
Function render_dataframe
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def render_dataframe(df, index=False, *, col_display=None, **kwargs):
Function conversation_download_data
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def conversation_download_data(conversation, *, which, formats=None, cluster=None, **url_kwargs):
if ":" not in which:
which = f"boards:dataviz-{which}"
if cluster is not None:
which += "-cluster"
- 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"