The following issues were found

tests/extmod/ucryptolib_aes256_cbc.py
3 issues
The pyCrypto library and its module AES are no longer actively maintained and have been deprecated. Consider using pyca/cryptography library.
Security blacklist

Line: 2
Suggestion: https://bandit.readthedocs.io/en/latest/blacklists/blacklist_imports.html#b413-import-pycrypto

              try:
    from Crypto.Cipher import AES

    aes = AES.new
except ImportError:
    try:
        from ucryptolib import aes
    except ImportError:
        print("SKIP")

            

Reported by Bandit.

Consider explicitly re-raising using the 'from' keyword
Error

Line: 10 Column: 9

                      from ucryptolib import aes
    except ImportError:
        print("SKIP")
        raise SystemExit

crypto = aes(b"1234" * 8, 2, b"5678" * 4)
enc = crypto.encrypt(bytes(range(32)))
print(enc)
crypto = aes(b"1234" * 8, 2, b"5678" * 4)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              try:
    from Crypto.Cipher import AES

    aes = AES.new
except ImportError:
    try:
        from ucryptolib import aes
    except ImportError:
        print("SKIP")

            

Reported by Pylint.

tests/extmod/ucryptolib_aes256_ecb.py
3 issues
The pyCrypto library and its module AES are no longer actively maintained and have been deprecated. Consider using pyca/cryptography library.
Security blacklist

Line: 2
Suggestion: https://bandit.readthedocs.io/en/latest/blacklists/blacklist_imports.html#b413-import-pycrypto

              try:
    from Crypto.Cipher import AES

    aes = AES.new
except ImportError:
    try:
        from ucryptolib import aes
    except ImportError:
        print("SKIP")

            

Reported by Bandit.

Consider explicitly re-raising using the 'from' keyword
Error

Line: 10 Column: 9

                      from ucryptolib import aes
    except ImportError:
        print("SKIP")
        raise SystemExit

crypto = aes(b"1234" * 8, 1)
enc = crypto.encrypt(bytes(range(32)))
print(enc)
crypto = aes(b"1234" * 8, 1)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              try:
    from Crypto.Cipher import AES

    aes = AES.new
except ImportError:
    try:
        from ucryptolib import aes
    except ImportError:
        print("SKIP")

            

Reported by Pylint.

tests/internal_bench/loop_count-5.1-while_down_ne_localvar.py
3 issues
Module name "1-while_down_ne_localvar" doesn't conform to snake_case naming style
Error

Line: 1 Column: 1

              import bench


def test(num):
    zero = 0
    while num != zero:
        num -= 1



            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              import bench


def test(num):
    zero = 0
    while num != zero:
        num -= 1



            

Reported by Pylint.

Missing function or method docstring
Error

Line: 4 Column: 1

              import bench


def test(num):
    zero = 0
    while num != zero:
        num -= 1



            

Reported by Pylint.

ports/esp32/boards/UM_TINYPICO/manifest.py
3 issues
Undefined variable 'include'
Error

Line: 1 Column: 1

              include("$(PORT_DIR)/boards/manifest.py")
freeze("modules")

            

Reported by Pylint.

Undefined variable 'freeze'
Error

Line: 2 Column: 1

              include("$(PORT_DIR)/boards/manifest.py")
freeze("modules")

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              include("$(PORT_DIR)/boards/manifest.py")
freeze("modules")

            

Reported by Pylint.

ports/unix/variants/dev/manifest.py
3 issues
Undefined variable 'include'
Error

Line: 1 Column: 1

              include("$(PORT_DIR)/variants/manifest.py")

include("$(MPY_DIR)/extmod/uasyncio/manifest.py")

            

Reported by Pylint.

Undefined variable 'include'
Error

Line: 3 Column: 1

              include("$(PORT_DIR)/variants/manifest.py")

include("$(MPY_DIR)/extmod/uasyncio/manifest.py")

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              include("$(PORT_DIR)/variants/manifest.py")

include("$(MPY_DIR)/extmod/uasyncio/manifest.py")

            

Reported by Pylint.

tests/basics/for_return.py
3 issues
Missing module docstring
Error

Line: 1 Column: 1

              # test returning from within a for loop

def f():
    for i in [1, 2, 3]:
        return i

print(f())

            

Reported by Pylint.

Function name "f" doesn't conform to snake_case naming style
Error

Line: 3 Column: 1

              # test returning from within a for loop

def f():
    for i in [1, 2, 3]:
        return i

print(f())

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 3 Column: 1

              # test returning from within a for loop

def f():
    for i in [1, 2, 3]:
        return i

print(f())

            

Reported by Pylint.

ports/esp32/boards/M5STACK_ATOM/manifest.py
3 issues
Undefined variable 'include'
Error

Line: 1 Column: 1

              include("$(PORT_DIR)/boards/manifest.py")
freeze("modules")

            

Reported by Pylint.

Undefined variable 'freeze'
Error

Line: 2 Column: 1

              include("$(PORT_DIR)/boards/manifest.py")
freeze("modules")

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              include("$(PORT_DIR)/boards/manifest.py")
freeze("modules")

            

Reported by Pylint.

tests/basics/deque1.py
3 issues
bad operand type for unary ~: deque
Error

Line: 66 Column: 5

              
# Unsupported unary op
try:
    ~d
except TypeError:
    print("TypeError")

            

Reported by Pylint.

Consider explicitly re-raising using the 'from' keyword
Error

Line: 8 Column: 5

                      from collections import deque
except ImportError:
    print("SKIP")
    raise SystemExit


d = deque((), 2)
print(len(d))
print(bool(d))

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              try:
    try:
        from ucollections import deque
    except ImportError:
        from collections import deque
except ImportError:
    print("SKIP")
    raise SystemExit


            

Reported by Pylint.

tests/basics/for3.py
3 issues
Missing module docstring
Error

Line: 1 Column: 1

              # test assigning to iterator within the loop
for i in range(2):
    print(i)
    i = 2

# test assigning to range parameter within the loop
# (since we optimise for loops, this needs checking, currently it fails)
n = 2
for i in range(n):

            

Reported by Pylint.

Constant name "n" doesn't conform to UPPER_CASE naming style
Error

Line: 8 Column: 1

              
# test assigning to range parameter within the loop
# (since we optimise for loops, this needs checking, currently it fails)
n = 2
for i in range(n):
    print(i)
    n = 0

            

Reported by Pylint.

Constant name "n" doesn't conform to UPPER_CASE naming style
Error

Line: 11 Column: 5

              n = 2
for i in range(n):
    print(i)
    n = 0

            

Reported by Pylint.

tests/micropython/viper_globals.py
3 issues
Use of exec
Error

Line: 5 Column: 1

              
gl = {}

exec(
    """
@micropython.viper
def f():
    return x
""",

            

Reported by Pylint.

Use of exec detected.
Security

Line: 5
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b102_exec_used.html

              
gl = {}

exec(
    """
@micropython.viper
def f():
    return x
""",

            

Reported by Bandit.

Missing module docstring
Error

Line: 1 Column: 1

              # test that viper functions capture their globals context

gl = {}

exec(
    """
@micropython.viper
def f():
    return x

            

Reported by Pylint.