LucaCappelletti94/histograms

View on GitHub
barplots/barplot.py

Summary

Maintainability
D
2 days
Test Coverage
A
91%

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 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 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

      There are no issues that match your filters.

      Category
      Status