SforAiDl/genrl

View on GitHub

Showing 54 of 58 total issues

Function step has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def step(self, actions: np.ndarray) -> Tuple:
        """
        Steps through all the environments and records important information

        :param actions: Actions to be taken for the Vectorized Environment
Severity: Minor
Found in genrl/environments/vec_env/monitor.py - About 55 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

Function forward has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def forward(
        self, x: torch.Tensor, kl: bool = True, frozen: bool = False
    ) -> Tuple[torch.Tensor, Optional[torch.Tensor]]:
        """Apply linear transormation to input.

Severity: Minor
Found in genrl/agents/bandits/contextual/common/bayesian.py - About 55 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

Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(
Severity: Minor
Found in genrl/agents/deep/dqn/categorical.py - About 45 mins to fix

    Function _get_val_model has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def _get_val_model(
    Severity: Minor
    Found in genrl/core/values.py - About 45 mins to fix

      Function get_action has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def get_action(
              self, state: torch.Tensor, deterministic: bool = False
          ) -> torch.Tensor:
              """
                      Get action from policy based on input
      Severity: Minor
      Found in genrl/core/base.py - About 45 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

      Function get_env_properties has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      def get_env_properties(
          env: Union[gym.Env, VecEnv], network: Union[str, Any] = "mlp"
      ) -> (Tuple[int]):
          """
              Finds important properties of environment
      Severity: Minor
      Found in genrl/utils/utils.py - About 45 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

      Function generate has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def generate(
      Severity: Minor
      Found in examples/genetic_rl_q_learning.py - About 45 mins to fix

        Function write has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            def write(self, kvs: Dict[str, Any], log_key) -> None:
                """
                Add entry to logger
        
                :param kvs: Entries to be logged
        Severity: Minor
        Found in genrl/utils/logger.py - About 45 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

        Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def __init__(
        Severity: Minor
        Found in genrl/agents/deep/a2c/a2c.py - About 45 mins to fix

          Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def __init__(
          Severity: Minor
          Found in genrl/core/policies.py - About 45 mins to fix

            Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def __init__(
            Severity: Minor
            Found in genrl/core/policies.py - About 45 mins to fix

              Function generate has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def generate(
              Severity: Minor
              Found in examples/genetic_rl.py - About 45 mins to fix

                Function add has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def add(
                Severity: Minor
                Found in genrl/core/rollout_storage.py - About 45 mins to fix

                  Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def __init__(
                  Severity: Minor
                  Found in genrl/agents/deep/sac/sac.py - About 35 mins to fix

                    Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def __init__(
                    Severity: Minor
                    Found in genrl/core/rollout_storage.py - About 35 mins to fix

                      Function _compute_loss has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def _compute_loss(
                      Severity: Minor
                      Found in genrl/agents/bandits/contextual/common/base_model.py - About 35 mins to fix

                        Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def __init__(
                        Severity: Minor
                        Found in genrl/core/base.py - About 35 mins to fix

                          Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def __init__(
                          Severity: Minor
                          Found in genrl/core/noise.py - About 35 mins to fix

                            Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                def __init__(
                            Severity: Minor
                            Found in genrl/core/values.py - About 35 mins to fix

                              Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def __init__(
                              Severity: Minor
                              Found in genrl/agents/deep/dqn/base.py - About 35 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language