File peeker_class.py
has 408 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
TODO:
- use conf intervals of metrics (maybe groups of metrics)
- prep for gunicorn
- publish
Function _add_dd_callbacks
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def _add_dd_callbacks(self):
for ind, side_id in enumerate(ElemIds.sides()):
@self.app.callback(
Output(side_id.apply_button, "n_clicks"),
- 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
Peeker
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
class Peeker:
"""
API for creating and launching a peeker app
create a subclass and properly define get_shared_figures
Function _parse_report_elems_to_outputs
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _parse_report_elems_to_outputs(self, elems, name):
metric_out = []
shared_out = []
so_out = []
- 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 __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function _add_table_diff_callbacks
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _add_table_diff_callbacks(self):
for tabid in self._get_table_ids():
@self.app.callback(
Output(tabid.diff, "children"),
- 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 _get_report_output_dependencies
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _get_report_output_dependencies(self, ind):
outputs = []
for eid in self.id_repo.report_elem_ids:
if isinstance(eid, (MetricId, TableId)):
- 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 _report_from_filters
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _report_from_filters(
self, n_clicks, dd_name, input_name, *filter_values
):
if n_clicks == 0:
- 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"