SforAiDl/genrl

View on GitHub

Showing 54 of 58 total issues

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

    def __init__(
Severity: Minor
Found in genrl/trainers/bandit.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/td3/td3.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/ppo1/ppo1.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/bayesian.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/neural.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/classical/sarsa/sarsa.py - About 35 mins to fix

              Function _create_model has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  def _create_model(self, **kwargs) -> None:
                      """Initializes class objects
              
                      Initializes actor-critic architecture, replay buffer and optimizers
                      """
              Severity: Minor
              Found in genrl/agents/deep/sac/sac.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

              Function AtariEnv has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              def AtariEnv(
                  env_id: str,
                  wrapper_list: List = [
                      AtariPreprocessing,
                      NoopReset,
              Severity: Minor
              Found in genrl/environments/suite.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

              Function __init__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  def __init__(
                      self,
                      network: Any,
                      env: Any,
                      create_model: bool = True,
              Severity: Minor
              Found in genrl/agents/deep/base/base.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

              Function _create_model has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def _create_model(self) -> None:
                      """Function to initialize Actor-Critic architecture
              
                      This will create the Actor-Critic net for the agent and initialise the action noise
                      """
              Severity: Minor
              Found in genrl/agents/deep/ddpg/ddpg.py - About 25 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 evaluate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def evaluate(self, eval_ep: int = 100) -> float:
                      """
                      Evaluate function.
              
                      :param eval_ep: Number of episodes you want to evaluate for
              Severity: Minor
              Found in genrl/trainers/classical.py - About 25 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 _create_model has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def _create_model(self) -> None:
                      """Initializes class objects
              
                      Initializes actor-critic architecture, replay buffer and optimizers
                      """
              Severity: Minor
              Found in genrl/agents/deep/td3/td3.py - About 25 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 a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def __init__(
                      self,
                      agent: Any,
                      env: gym.Env,
                      mode: str = "learn",
              Severity: Minor
              Found in genrl/trainers/classical.py - About 25 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 train_model has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def train_model(self, db: TransitionDB, epochs: int, batch_size: int):
                      """Trains the network on a given database for given epochs and batch_size.
              
                      Args:
                          db (TransitionDB): The database of transitions to train on.
              Severity: Minor
              Found in genrl/agents/bandits/contextual/common/base_model.py - About 25 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

              Severity
              Category
              Status
              Source
              Language