Showing 124 of 124 total issues
Standard pseudo-random generators are not suitable for security/cryptographic purposes. Open
currentBird = random.choice(birds)
- Exclude checks
Standard pseudo-random generators are not suitable for security/cryptographic purposes. Open
if random.randint(0, 1) == 1:
- Exclude checks
Remove this commented out code. Open
"user_id": 0, # not set = 0
- Read upRead up
- Exclude checks
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)
- Exclude checks
Pickle and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue. Open
return pickle.loads(data)
- Exclude checks
Standard pseudo-random generators are not suitable for security/cryptographic purposes. Open
bird = random.choice(birdList)
- Exclude checks
Refactor this function to reduce its Cognitive Complexity from 22 to the 15 allowed. Open
def bird_setup(ctx, bird: str):
- Read upRead up
- Exclude checks
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_(
- Read upRead up
- Exclude checks
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)
- Exclude checks
Standard pseudo-random generators are not suitable for security/cryptographic purposes. Open
await ctx.send(random.choice(memeList))
- Exclude checks
Refactor this function to reduce its Cognitive Complexity from 16 to the 15 allowed. Open
async def user_setup(ctx):
- Read upRead up
- Exclude checks
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"))
- Read upRead up
- Exclude checks
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)
- Exclude checks
Standard pseudo-random generators are not suitable for security/cryptographic purposes. Open
currentBird = random.choice(id_list)
- Exclude checks
Standard pseudo-random generators are not suitable for security/cryptographic purposes. Open
bird = random.choice(screech_owls)
- Exclude checks
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
- Exclude checks
Standard pseudo-random generators are not suitable for security/cryptographic purposes. Open
session_id = random.randint(420000000, 420999999)
- Exclude checks
Either merge this branch with the identical one on line "268" or change one of the implementations. Open
media = "image"
- Read upRead up
- Exclude checks
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):
- Read upRead up
- Exclude checks
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
- Read upRead up
- Exclude checks
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"