tctree333/Bird-ID

View on GitHub

Showing 124 of 124 total issues

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

            currentBird = random.choice(birds)
Severity: Info
Found in bot/cogs/get_birds.py by bandit

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

        if random.randint(0, 1) == 1:
Severity: Info
Found in bot/functions.py by bandit

Remove this commented out code.
Open

                "user_id": 0,  # not set = 0
Severity: Major
Found in web/data.py by sonar-python

Programmers should not comment out code as it bloats programs and reduces readability.

Unused code should be deleted and can be retrieved from source control history if required.

See

  • MISRA C:2004, 2.4 - Sections of code should not be "commented out".
  • MISRA C++:2008, 2-7-2 - Sections of code shall not be "commented out" using C-style comments.
  • MISRA C++:2008, 2-7-3 - Sections of code should not be "commented out" using C++ comments.
  • MISRA C:2012, Dir. 4.4 - Sections of code should not be "commented out"

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

            _cache.pop(random.choice((*_cache, object())), 0)
Severity: Info
Found in bot/functions.py by bandit

Pickle and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue.
Open

            return pickle.loads(data)
Severity: Minor
Found in bot/functions.py by bandit

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

    bird = random.choice(birdList)
Severity: Info
Found in web/main.py by bandit

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

def bird_setup(ctx, bird: str):
Severity: Critical
Found in bot/data_functions.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

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

    async def send_bird_(
Severity: Critical
Found in bot/cogs/get_birds.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

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

        bird = random.choice(screech_owls)
Severity: Info
Found in web/functions.py by bandit

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

        await ctx.send(random.choice(memeList))
Severity: Info
Found in bot/cogs/other.py by bandit

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

async def user_setup(ctx):
Severity: Critical
Found in bot/data_functions.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

Remove this commented out code.
Open

    # tempScore = int(database.hget(f"web.session:{session_id}", "tempScore"))
Severity: Major
Found in web/practice.py by sonar-python

Programmers should not comment out code as it bloats programs and reduces readability.

Unused code should be deleted and can be retrieved from source control history if required.

See

  • MISRA C:2004, 2.4 - Sections of code should not be "commented out".
  • MISRA C++:2008, 2-7-2 - Sections of code shall not be "commented out" using C-style comments.
  • MISRA C++:2008, 2-7-3 - Sections of code should not be "commented out" using C++ comments.
  • MISRA C:2012, Dir. 4.4 - Sections of code should not be "commented out"

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

            currentBird = random.choice(goatsuckers)
Severity: Info
Found in bot/cogs/get_birds.py by bandit

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

            currentBird = random.choice(id_list)
Severity: Info
Found in web/practice.py by bandit

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

        bird = random.choice(screech_owls)
Severity: Info
Found in bot/core.py by bandit

The pyCrypto library and its module ChaCha20 are no longer actively maintained and have been deprecated. Consider using pyca/cryptography library.
Open

from Crypto.Cipher import ChaCha20
Severity: Major
Found in bot/functions.py by bandit

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

        session_id = random.randint(420000000, 420999999)
Severity: Info
Found in web/data.py by bandit

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

            media = "image"
Severity: Major
Found in bot/cogs/race.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

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

    async def parse(ctx, args_str: str):
Severity: Critical
Found in bot/cogs/get_birds.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

Remove this commented out code.
Open

                "answered": 1,  # true = 1, false = 0
Severity: Major
Found in web/data.py by sonar-python

Programmers should not comment out code as it bloats programs and reduces readability.

Unused code should be deleted and can be retrieved from source control history if required.

See

  • MISRA C:2004, 2.4 - Sections of code should not be "commented out".
  • MISRA C++:2008, 2-7-2 - Sections of code shall not be "commented out" using C-style comments.
  • MISRA C++:2008, 2-7-3 - Sections of code should not be "commented out" using C++ comments.
  • MISRA C:2012, Dir. 4.4 - Sections of code should not be "commented out"
Severity
Category
Status
Source
Language