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,
- 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 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,
- 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 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}",
- 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 barplots
has 49 arguments (exceeds 4 allowed). Consider refactoring. Open
def barplots(
Function barplot
has 43 arguments (exceeds 4 allowed). Consider refactoring. Open
def barplot(
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
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
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,
- 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_axes
has 17 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_axes(
Function plot_bar_labels
has 16 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_bar_labels(
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(
- 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 plot_bars
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_bars(
Function remove_duplicated_legend_labels
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def remove_duplicated_legend_labels(
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,
- 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 plot_bar
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_bar(
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,
- 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 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,
- 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 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
- 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"