eight0153/CartPole-NEAT

View on GitHub

Showing 74 of 82 total issues

Line too long (84 > 79 characters)
Open

                    np.mean(self.fitness_history[episode - self.n_trials:episode]) \
Severity: Minor
Found in neat/main.py by pep8

Limit all lines to a maximum of 79 characters.

There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side.  The default wrapping on such
devices looks ugly.  Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.

Reports error E501.

Line too long (80 > 79 characters)
Open

        Creature.disjointedness_importance = config['disjointedness_importance']
Severity: Minor
Found in neat/main.py by pep8

Limit all lines to a maximum of 79 characters.

There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side.  The default wrapping on such
devices looks ugly.  Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.

Reports error E501.

Line too long (96 > 79 characters)
Open

    run_id = db.Column(db.String(16), db.ForeignKey('run.id'), nullable=False, primary_key=True)
Severity: Minor
Found in web/api/model.py by pep8

Limit all lines to a maximum of 79 characters.

There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side.  The default wrapping on such
devices looks ugly.  Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.

Reports error E501.

Line too long (85 > 79 characters)
Open

            self.weight_velocity[i] = Particle.momentum * self.weight_velocity[i] + \
Severity: Minor
Found in neat/pso.py by pep8

Limit all lines to a maximum of 79 characters.

There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side.  The default wrapping on such
devices looks ugly.  Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.

Reports error E501.

Continuation line over-indented for visual indent
Open

                                    Particle.acceleration_global_best * b * diff_best
Severity: Minor
Found in neat/pso.py by pep8

Continuation lines indentation.

Continuation lines should align wrapped elements either vertically
using Python's implicit line joining inside parentheses, brackets
and braces, or using a hanging indent.

When using a hanging indent these considerations should be applied:
- there should be no arguments on the first line, and
- further indentation should be used to clearly distinguish itself
  as a continuation line.

Okay: a = (\n)
E123: a = (\n    )

Okay: a = (\n    42)
E121: a = (\n   42)
E122: a = (\n42)
E123: a = (\n    42\n    )
E124: a = (24,\n     42\n)
E125: if (\n    b):\n    pass
E126: a = (\n        42)
E127: a = (24,\n      42)
E128: a = (24,\n    42)
E129: if (a or\n    b):\n    pass
E131: a = (\n    42\n 24)

Continuation line over-indented for visual indent
Open

               len(self.members)
Severity: Minor
Found in neat/species.py by pep8

Continuation lines indentation.

Continuation lines should align wrapped elements either vertically
using Python's implicit line joining inside parentheses, brackets
and braces, or using a hanging indent.

When using a hanging indent these considerations should be applied:
- there should be no arguments on the first line, and
- further indentation should be used to clearly distinguish itself
  as a continuation line.

Okay: a = (\n)
E123: a = (\n    )

Okay: a = (\n    42)
E121: a = (\n   42)
E122: a = (\n42)
E123: a = (\n    42\n    )
E124: a = (24,\n     42\n)
E125: if (\n    b):\n    pass
E126: a = (\n        42)
E127: a = (24,\n      42)
E128: a = (24,\n    42)
E129: if (a or\n    b):\n    pass
E131: a = (\n    42\n 24)

Blank line at end of file
Open

Severity: Minor
Found in neat/genome.py by pep8

Trailing blank lines are superfluous.

Okay: spam(1)
W391: spam(1)\n

However the last line should end with a new line (warning W292).

Line too long (82 > 79 characters)
Open

                                    Particle.acceleration_self * a * diff_self + \
Severity: Minor
Found in neat/pso.py by pep8

Limit all lines to a maximum of 79 characters.

There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side.  The default wrapping on such
devices looks ugly.  Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.

Reports error E501.

Standard pseudo-random generators are not suitable for security/cryptographic purposes.
Open

            parent1 = random.choice(pool)
Severity: Info
Found in neat/species.py by bandit

Standard pseudo-random generators are not suitable for security/cryptographic purposes.
Open

            if random.random() < Genome.p_perturb:
Severity: Info
Found in neat/genome.py by bandit

Standard pseudo-random generators are not suitable for security/cryptographic purposes.
Open

        key = random.choice(list(self.adjectives.keys()))
Severity: Info
Found in neat/name_generation.py by bandit

Standard pseudo-random generators are not suitable for security/cryptographic purposes.
Open

        mutate_only = random.random() < Creature.p_mutate_only
Severity: Info
Found in neat/creature.py by bandit

Standard pseudo-random generators are not suitable for security/cryptographic purposes.
Open

        if random.random() < Genome.p_add_node:
Severity: Info
Found in neat/genome.py by bandit

Standard pseudo-random generators are not suitable for security/cryptographic purposes.
Open

        elif random.random() < Genome.p_add_connection:
Severity: Info
Found in neat/genome.py by bandit

Standard pseudo-random generators are not suitable for security/cryptographic purposes.
Open

            if random.random() < Species.p_interspecies_mating:
Severity: Info
Found in neat/species.py by bandit

Standard pseudo-random generators are not suitable for security/cryptographic purposes.
Open

        gene = random.choice(disabled_genes)
Severity: Info
Found in neat/genome.py by bandit

Use of insecure MD2, MD4, MD5, or SHA1 hash function.
Open

        run_id_hash = hashlib.sha1()
Severity: Minor
Found in neat/main.py by bandit

Standard pseudo-random generators are not suitable for security/cryptographic purposes.
Open

        adjective = random.choice(self.adjectives[key])
Severity: Info
Found in neat/name_generation.py by bandit

Standard pseudo-random generators are not suitable for security/cryptographic purposes.
Open

        a = random.random()
Severity: Info
Found in neat/pso.py by bandit

Refactor this function to reduce its Cognitive Complexity from 25 to the 15 allowed.
Open

    def train(self, n_episodes=100, n_steps=200, n_pso_episodes=5,
Severity: Critical
Found in neat/main.py by sonar-python

Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

See

Severity
Category
Status
Source
Language