pylhc_submitter/sixdesk_tools/post_process_da.py
File post_process_da.py
has 273 lines of code (exceeds 250 allowed). Consider refactoring. Invalid
Invalid
"""
Post Process DA
----------------------------------
Tools to process data after sixdb has calculated the
Function _create_stats_df
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
Open
def _create_stats_df(df: pd.DataFrame, parameter: str, global_index: Any = None) -> TfsDataFrame:
""" Calculates the stats over a given parameter.
Note: Could be refactored to use `group_by`.
Args:
- 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_interpolated
has 7 arguments (exceeds 4 allowed). Consider refactoring. Invalid
Invalid
def _plot_interpolated(ax, angles, da_min, da_mean, da_max, da_std, fill):
Function _plot_straight
has 7 arguments (exceeds 4 allowed). Consider refactoring. Invalid
Invalid
def _plot_straight(ax, angles, da_min, da_mean, da_max, da_std, fill):
Function plot_polar
has 5 arguments (exceeds 4 allowed). Consider refactoring. Invalid
Invalid
def plot_polar(
Function _interpolated_line
has 5 arguments (exceeds 4 allowed). Consider refactoring. Invalid
Invalid
def _interpolated_line(ax, x, y, npoints: int = 100, **kwargs):
Function _plot_seeds
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def _plot_seeds(ax, df_da: TfsDataFrame, da_col: str, interpolated: bool) -> Tuple[list, list]:
"""Add the Seed lines to the polar plots, if df_da is given.
Args:
ax: Axes to plot in
- 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"