eight0153/CartPole-NEAT

View on GitHub

Showing 74 of 82 total issues

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

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

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

        combine_by_average = random.random() < Genome.p_mate_average
Severity: Info
Found in neat/genome.py by bandit

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

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

A Flask app appears to be run with debug=True, which exposes the Werkzeug debugger and allows the execution of arbitrary code.
Open

    app.run(host='0.0.0.0', debug=True)
Severity: Major
Found in web/api/run.py by bandit

Either merge this branch with the identical one on line "31" or change one of the implementations.
Open

        fmt = '%dth'
Severity: Major
Found in neat/name_generation.py by sonar-python

Having two branches in the same if structure with the same implementation is at best duplicate code, and at worst a coding error. If the same logic is truly needed for both instances, then they should be combined.

Noncompliant Code Example

if 0 <= a < 10:
    do_the_thing()
elif 10 <= a < 20:
    do_the_other_thing()
elif 20 <= a < 50:
    do_the_thing()  # Noncompliant; duplicates first condition
else:
    do_the_rest()

b = 4 if a > 12 else 4

Compliant Solution

if (0 <= a < 10) or (20 <= a < 50):
    do_the_thing()
elif 10 <= a < 20:
    do_the_other_thing()
else:
    do_the_rest()

b = 4

or

if 0 <= a < 10:
    do_the_thing()
elif 10 <= a < 20:
    do_the_other_thing()
elif 20 <= a < 50:
    do_the_third_thing()
else:
    do_the_rest()

b = 8 if a > 12 else 4

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

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

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

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

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

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

Possible binding to all interfaces.
Open

    app.run(host='0.0.0.0', debug=True)
Severity: Minor
Found in web/api/run.py by bandit

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

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

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

            self.representative = random.choice(self.members)
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_re_enable_connection:
Severity: Info
Found in neat/genome.py by bandit

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

            genes = [gene1 if random.random() < 0.5 else gene2
Severity: Info
Found in neat/genome.py by bandit

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

                parent2 = random.choice(population)
Severity: Info
Found in neat/species.py by bandit
Severity
Category
Status
Source
Language