kjappelbaum/pyepal

View on GitHub
src/pyepal/pal/core.py

Summary

Maintainability
C
1 day
Test Coverage

Function _pareto_classify has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

def _pareto_classify(  # pylint:disable=too-many-arguments, too-many-locals, too-many-branches
    pareto_optimal_0: np.array,
    not_pareto_optimal_0: np.array,
    unclassified_0: np.array,
    rectangle_lows: np.array,
Severity: Minor
Found in src/pyepal/pal/core.py - About 4 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

File core.py has 293 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
# pylint:disable=anomalous-backslash-in-string
# Copyright 2020 PyePAL authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
Severity: Minor
Found in src/pyepal/pal/core.py - About 3 hrs to fix

    Function _get_max_wt has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    def _get_max_wt(  # pylint:disable=too-many-arguments
        rectangle_lows: np.array,
        rectangle_ups: np.array,
        means: np.array,
        pareto_optimal_t: np.array,
    Severity: Minor
    Found in src/pyepal/pal/core.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 _get_max_wt has 9 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def _get_max_wt(  # pylint:disable=too-many-arguments
    Severity: Major
    Found in src/pyepal/pal/core.py - About 1 hr to fix

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

      def _get_max_wt_all(  # pylint:disable=too-many-arguments
          rectangle_lows: np.array,
          rectangle_ups: np.array,
          means: np.array,
          sampled: np.array,
      Severity: Minor
      Found in src/pyepal/pal/core.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 _pareto_classify has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def _pareto_classify(  # pylint:disable=too-many-arguments, too-many-locals, too-many-branches
      Severity: Major
      Found in src/pyepal/pal/core.py - About 1 hr to fix

        Function _get_max_wt_all has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def _get_max_wt_all(  # pylint:disable=too-many-arguments
        Severity: Major
        Found in src/pyepal/pal/core.py - About 50 mins to fix

          There are no issues that match your filters.

          Category
          Status