endremborza/daskpeeker

View on GitHub
daskpeeker/peeker_class.py

Summary

Maintainability
D
1 day
Test Coverage

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
Severity: Minor
Found in daskpeeker/peeker_class.py - About 5 hrs to fix

    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"),
    Severity: Minor
    Found in daskpeeker/peeker_class.py - About 3 hrs 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

    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
    Severity: Minor
    Found in daskpeeker/peeker_class.py - About 3 hrs to fix

      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 = []
      Severity: Minor
      Found in daskpeeker/peeker_class.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 __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def __init__(
      Severity: Minor
      Found in daskpeeker/peeker_class.py - About 45 mins to fix

        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"),
        Severity: Minor
        Found in daskpeeker/peeker_class.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 _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)):
        Severity: Minor
        Found in daskpeeker/peeker_class.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

        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:
        Severity: Minor
        Found in daskpeeker/peeker_class.py - About 25 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