kjappelbaum/pyepal

View on GitHub

Showing 47 of 103 total issues

File pal_base.py has 607 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: Major
Found in src/pyepal/pal/pal_base.py - About 1 day to fix

    PALBase has 42 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class PALBase:  # pylint:disable=too-many-instance-attributes, too-many-public-methods
        """PAL base class"""
    
        def __init__(  # pylint:disable=too-many-arguments
            self,
    Severity: Minor
    Found in src/pyepal/pal/pal_base.py - About 5 hrs to fix

      File __init__.py has 374 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      # Copyright 2020 PyePAL authors
      #
      # Licensed under the Apache License, Version 2.0 (the "License");
      # you may not use this file except in compliance with the License.
      Severity: Minor
      Found in src/pyepal/plotting/__init__.py - About 5 hrs to fix

        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

        Function validate_goals has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
        Open

        def validate_goals(goals: Any, ndim: int) -> np.ndarray:  # pylint:disable=too-many-branches
            """Create a valid array of goals. 1 for maximization, -1
                for objectives that are to be minimized.
        
            Args:
        Severity: Minor
        Found in src/pyepal/pal/validate_inputs.py - About 3 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 validate_inputs.py has 329 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        # Copyright 2020 PyePAL authors
        #
        # Licensed under the Apache License, Version 2.0 (the "License");
        # you may not use this file except in compliance with the License.
        Severity: Minor
        Found in src/pyepal/pal/validate_inputs.py - About 3 hrs to fix

          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 validate_epsilon has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

            def validate_epsilon(epsilon: Any, ndim: int) -> np.ndarray:
                """Validate epsilon and return a np.array
            
                Args:
                    epsilon (Any): Epsilon hyperparameter
            Severity: Minor
            Found in src/pyepal/pal/validate_inputs.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

            File utils.py has 257 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            # Copyright 2020 PyePAL authors
            #
            # Licensed under the Apache License, Version 2.0 (the "License");
            # you may not use this file except in compliance with the License.
            Severity: Minor
            Found in src/pyepal/pal/utils.py - About 2 hrs to fix

              Function recursive_hypervolume has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

                  def recursive_hypervolume(self, dimension: int) -> float:
                      """Recursive hypervolume computation. The algorithm is provided by Algorithm 3.
                      of the original paper."""
                      if self.multilist.chain_length(dimension - 1) == 0:
                          return 0
              Severity: Minor
              Found in src/pyepal/pal/_hypervolume.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 plot_jointplot has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

              def plot_jointplot(  # pylint:disable=invalid-name
                  y: np.array,
                  palinstance: PALBase,
                  labels: Union[List[str], None] = None,
                  figsize: tuple = (8.0, 6.0),
              Severity: Minor
              Found in src/pyepal/plotting/__init__.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 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 __init__ has 10 arguments (exceeds 4 allowed). Consider refactoring.
              Open

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

                Function validate_gbdt_models has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                def validate_gbdt_models(models: Any, ndim: int) -> List[Iterable]:
                    """Make sure that the number of iterables is equal to the number of objectives
                    and that every iterable contains three LGBMRegressors.
                    Also, we check that at least the first and last models use quantile loss"""
                
                
                Severity: Minor
                Found in src/pyepal/pal/validate_inputs.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 _ensemble_train_one_finite_width has 10 arguments (exceeds 4 allowed). Consider refactoring.
                Open

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

                  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 __init__ has 9 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def __init__(  # pylint:disable=too-many-arguments
                    Severity: Major
                    Found in src/pyepal/models/coregionalized.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 plot_learning_curve has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def plot_learning_curve(  # pylint:disable=dangerous-default-value, too-many-arguments, too-many-locals
                          palinstance,
                          observations: np.ndarray,
                          indices: np.ndarray = None,
                          num_steps: int = 5,
                      Severity: Minor
                      Found in src/pyepal/plotting/__init__.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 __init__ has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          def __init__(  # pylint:disable=too-many-arguments
                              self,
                              X_design: np.array,
                              models: list,
                              ndim: int,
                      Severity: Minor
                      Found in src/pyepal/pal/pal_base.py - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language