endremborza/daskpeeker

View on GitHub

Showing 12 of 12 total issues

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

Severity: Major
Found in docs/conf.py and 1 other location - About 1 day to fix
docs_config/conf.py on lines 0..71

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 149.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

Severity: Major
Found in docs_config/conf.py and 1 other location - About 1 day to fix
docs/conf.py on lines 0..71

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 149.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    File peeker_layout.py has 391 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    from typing import TYPE_CHECKING
    
    import dash
    import dash_bootstrap_components as dbc
    import dash_core_components as dcc
    Severity: Minor
    Found in daskpeeker/peeker_layout.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 add_sidebar_callback has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          def add_sidebar_callback(app):
              @app.callback(
                  [
                      Output(ElemIds.sidebar, "style"),
                      Output(ElemIds.main_content, "style"),
          Severity: Minor
          Found in daskpeeker/peeker_layout.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 _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

          Severity
          Category
          Status
          Source
          Language