pylhc/submitter

View on GitHub
pylhc_submitter/sixdesk_tools/post_process_da.py

Summary

Maintainability
A
3 hrs
Test Coverage
D
64%

File post_process_da.py has 273 lines of code (exceeds 250 allowed). Consider refactoring.
Invalid

"""
Post Process DA
----------------------------------

Tools to process data after sixdb has calculated the
Severity: Minor
Found in pylhc_submitter/sixdesk_tools/post_process_da.py - About 2 hrs to fix

    Function _create_stats_df has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    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:
    Severity: Minor
    Found in pylhc_submitter/sixdesk_tools/post_process_da.py - About 2 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 _plot_interpolated has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Invalid

    def _plot_interpolated(ax, angles, da_min, da_mean, da_max, da_std, fill):
    Severity: Major
    Found in pylhc_submitter/sixdesk_tools/post_process_da.py - About 50 mins to fix

      Function _plot_straight has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Invalid

      def _plot_straight(ax, angles, da_min, da_mean, da_max, da_std, fill):
      Severity: Major
      Found in pylhc_submitter/sixdesk_tools/post_process_da.py - About 50 mins to fix

        Function plot_polar has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Invalid

        def plot_polar(
        Severity: Minor
        Found in pylhc_submitter/sixdesk_tools/post_process_da.py - About 35 mins to fix

          Function _interpolated_line has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Invalid

          def _interpolated_line(ax, x, y, npoints: int = 100, **kwargs):
          Severity: Minor
          Found in pylhc_submitter/sixdesk_tools/post_process_da.py - About 35 mins to fix

            Function _plot_seeds has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            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
            Severity: Minor
            Found in pylhc_submitter/sixdesk_tools/post_process_da.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

            There are no issues that match your filters.

            Category
            Status