The following issues were found

tests/extmod/ubinascii_crc32.py
3 issues
Consider explicitly re-raising using the 'from' keyword
Error

Line: 8 Column: 5

                      import binascii
except ImportError:
    print("SKIP")
    raise SystemExit

try:
    binascii.crc32
except AttributeError:
    print("SKIP")

            

Reported by Pylint.

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

Line: 14 Column: 5

                  binascii.crc32
except AttributeError:
    print("SKIP")
    raise SystemExit

print(hex(binascii.crc32(b"The quick brown fox jumps over the lazy dog")))
print(hex(binascii.crc32(b"\x00" * 32)))
print(hex(binascii.crc32(b"\xff" * 32)))
print(hex(binascii.crc32(bytes(range(32)))))

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              try:
    try:
        import ubinascii as binascii
    except ImportError:
        import binascii
except ImportError:
    print("SKIP")
    raise SystemExit


            

Reported by Pylint.

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

Line: 1 Column: 1

              # test integer floor division and modulo

# this tests bignum modulo
a = 987654321987987987987987987987
b = 19
print(a % b)
print(a % -b)
print(-a % b)
print(-a % -b)

            

Reported by Pylint.

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

Line: 4 Column: 1

              # test integer floor division and modulo

# this tests bignum modulo
a = 987654321987987987987987987987
b = 19
print(a % b)
print(a % -b)
print(-a % b)
print(-a % -b)

            

Reported by Pylint.

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

Line: 5 Column: 1

              
# this tests bignum modulo
a = 987654321987987987987987987987
b = 19
print(a % b)
print(a % -b)
print(-a % b)
print(-a % -b)

            

Reported by Pylint.

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

Line: 1 Column: 1

              # test basic int operations

# test conversion of bool on RHS of binary op
a = False
print(1 + a)
a = True
print(1 + a)

            

Reported by Pylint.

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

Line: 4 Column: 1

              # test basic int operations

# test conversion of bool on RHS of binary op
a = False
print(1 + a)
a = True
print(1 + a)

            

Reported by Pylint.

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

Line: 6 Column: 1

              # test conversion of bool on RHS of binary op
a = False
print(1 + a)
a = True
print(1 + a)

            

Reported by Pylint.

ports/esp32/boards/UM_TINYS2/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/extmod/ucryptolib_aes128_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" * 4, 2, b"5678" * 4)
enc = crypto.encrypt(bytes(range(32)))
print(enc)
crypto = aes(b"1234" * 4, 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.

ports/unix/variants/coverage/manifest.py
3 issues
Undefined variable 'freeze_as_str'
Error

Line: 1 Column: 1

              freeze_as_str("frzstr")
freeze_as_mpy("frzmpy")

            

Reported by Pylint.

Undefined variable 'freeze_as_mpy'
Error

Line: 2 Column: 1

              freeze_as_str("frzstr")
freeze_as_mpy("frzmpy")

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              freeze_as_str("frzstr")
freeze_as_mpy("frzmpy")

            

Reported by Pylint.

tests/extmod/ucryptolib_aes128_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" * 4, 1)
enc = crypto.encrypt(bytes(range(32)))
print(enc)
crypto = aes(b"1234" * 4, 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/extmod/ucryptolib_aes128_ecb_enc.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: 5
Suggestion: https://bandit.readthedocs.io/en/latest/blacklists/blacklist_imports.html#b413-import-pycrypto

              # AES128 encryption (anything else, including AES128 decryption,
# is optional).
try:
    from Crypto.Cipher import AES

    aes = AES.new
except ImportError:
    try:
        from ucryptolib import aes

            

Reported by Bandit.

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

Line: 13 Column: 9

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

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

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # This tests minimal configuration of ucrypto module, which is
# AES128 encryption (anything else, including AES128 decryption,
# is optional).
try:
    from Crypto.Cipher import AES

    aes = AES.new
except ImportError:
    try:

            

Reported by Pylint.

tests/basics/dict_fixed.py
3 issues
Consider explicitly re-raising using the 'from' keyword
Error

Line: 7 Column: 5

                  import uerrno
except ImportError:
    print("SKIP")
    raise SystemExit

# Save a copy of uerrno.errorcode, so we can check later
# that it hasn't been modified.
errorcode_copy = uerrno.errorcode.copy()


            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # test that fixed dictionaries cannot be modified

try:
    import uerrno
except ImportError:
    print("SKIP")
    raise SystemExit

# Save a copy of uerrno.errorcode, so we can check later

            

Reported by Pylint.

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Security

Line: 48
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html

              except TypeError:
    print("TypeError")

assert uerrno.errorcode == errorcode_copy

            

Reported by Bandit.

tests/feature_check/reverse_ops.py
3 issues
Missing class docstring
Error

Line: 1 Column: 1

              class Foo:
    def __radd__(self, other):
        pass


try:
    5 + Foo()
except TypeError:
    print("TypeError")

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              class Foo:
    def __radd__(self, other):
        pass


try:
    5 + Foo()
except TypeError:
    print("TypeError")

            

Reported by Pylint.

Too few public methods (1/2)
Error

Line: 1 Column: 1

              class Foo:
    def __radd__(self, other):
        pass


try:
    5 + Foo()
except TypeError:
    print("TypeError")

            

Reported by Pylint.