LucaCappelletti94/histograms

View on GitHub

Showing 18 of 18 total issues

Function barplot has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
Open

def barplot(
    df: pd.DataFrame,
    bar_width: float = 0.3,
    space_width: float = 0.2,
    height: Optional[float] = None,
Severity: Minor
Found in barplots/barplot.py - About 1 day 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 plot_bar_labels has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
Open

def plot_bar_labels(
    axes: Axes,
    figure: Figure,
    df: pd.DataFrame,
    vertical: bool,
Severity: Minor
Found in barplots/utils/plot_bar_labels.py - About 1 day 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 barplots has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
Open

def barplots(
    df: pd.DataFrame,
    groupby: Optional[Union[List[str], str]] = None,
    show_standard_deviation: Union[bool, str] = "auto",
    title: str = "{feature}",
Severity: Minor
Found in barplots/barplots.py - About 6 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

Function barplots has 49 arguments (exceeds 4 allowed). Consider refactoring.
Open

def barplots(
Severity: Major
Found in barplots/barplots.py - About 6 hrs to fix

    Function barplot has 43 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def barplot(
    Severity: Major
    Found in barplots/barplot.py - About 5 hrs to fix

      File barplots.py has 354 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      """Module implementing plotting of multiple barplots in parallel and sequential manner."""
      from typing import Dict, List, Tuple, Callable, Union, Optional
      
      import pandas as pd
      import numpy as np
      Severity: Minor
      Found in barplots/barplots.py - About 4 hrs to fix

        File barplot.py has 354 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        """Module implementing plotting of a barplot."""
        import pandas as pd
        from typing import List, Tuple, Dict, Union, Callable, Optional
        from matplotlib.colors import TABLEAU_COLORS as OLD_TABLEAU_COLORS
        from matplotlib.figure import Figure
        Severity: Minor
        Found in barplots/barplot.py - About 4 hrs to fix

          Function get_axes has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
          Open

          def get_axes(
              df: pd.DataFrame,
              bar_width: float,
              space_width: float,
              height: float,
          Severity: Minor
          Found in barplots/utils/get_axes.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

          Function get_axes has 17 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def get_axes(
          Severity: Major
          Found in barplots/utils/get_axes.py - About 2 hrs to fix

            Function plot_bar_labels has 16 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def plot_bar_labels(
            Severity: Major
            Found in barplots/utils/plot_bar_labels.py - About 2 hrs to fix

              Function sanitize_digits has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

              def sanitize_digits(digit: float, unit: Optional[str], normalized: bool):
                  unit = "" if unit is None else unit
                  absolute_digit = abs(digit)
                  if not normalized and digit != 0.0 and (absolute_digit <= 1e-3 or absolute_digit >= 1e3):
                      for (lower_factor, lower_value), (higher_factor, higher_value) in zip(
              Severity: Minor
              Found in barplots/utils/plot_bar_labels.py - About 1 hr 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 plot_bars has 9 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def plot_bars(
              Severity: Major
              Found in barplots/utils/plot_bars.py - About 1 hr to fix

                Function remove_duplicated_legend_labels has 9 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def remove_duplicated_legend_labels(
                Severity: Major
                Found in barplots/utils/remove_duplicated_legend_labels.py - About 1 hr to fix

                  Function plot_bars has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def plot_bars(
                      axes: Axes,
                      df: pd.DataFrame,
                      bar_width: float,
                      space_width: float,
                  Severity: Minor
                  Found in barplots/utils/plot_bars.py - About 1 hr 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 plot_bar has 8 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  def plot_bar(
                  Severity: Major
                  Found in barplots/utils/plot_bar.py - About 1 hr to fix

                    Function bar_positions has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def bar_positions(df: pd.DataFrame, bar_width: float, space_width: float) -> Generator:
                        """Returns a generator of bar positions.
                            df: pd.DataFrame,
                                Dataframe to iterate to extract the necessary data.
                            bar_width:float,
                    Severity: Minor
                    Found in barplots/utils/bar_positions.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 plot_bar has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def plot_bar(
                        axes: Axes,
                        x: float,
                        y: float,
                        std: float,
                    Severity: Minor
                    Found in barplots/utils/plot_bar.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

                    Function text_positions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def text_positions(df: pd.DataFrame, bar_width: float, space_width:float, index_level: int) -> Generator:
                        positions = bar_positions(df, bar_width, space_width)
                        old_index = None
                        previous_jump_position = 0
                        last_position = 0
                    Severity: Minor
                    Found in barplots/utils/text_positions.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