The following issues were found
tests/extmod/ucryptolib_aes256_cbc.py
3 issues
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.
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.
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
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.
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.
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
Line: 1
Column: 1
import bench
def test(num):
zero = 0
while num != zero:
num -= 1
Reported by Pylint.
Line: 1
Column: 1
import bench
def test(num):
zero = 0
while num != zero:
num -= 1
Reported by Pylint.
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
Line: 1
Column: 1
include("$(PORT_DIR)/boards/manifest.py")
freeze("modules")
Reported by Pylint.
Line: 2
Column: 1
include("$(PORT_DIR)/boards/manifest.py")
freeze("modules")
Reported by Pylint.
Line: 1
Column: 1
include("$(PORT_DIR)/boards/manifest.py")
freeze("modules")
Reported by Pylint.
ports/unix/variants/dev/manifest.py
3 issues
Line: 1
Column: 1
include("$(PORT_DIR)/variants/manifest.py")
include("$(MPY_DIR)/extmod/uasyncio/manifest.py")
Reported by Pylint.
Line: 3
Column: 1
include("$(PORT_DIR)/variants/manifest.py")
include("$(MPY_DIR)/extmod/uasyncio/manifest.py")
Reported by Pylint.
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
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.
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.
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
Line: 1
Column: 1
include("$(PORT_DIR)/boards/manifest.py")
freeze("modules")
Reported by Pylint.
Line: 2
Column: 1
include("$(PORT_DIR)/boards/manifest.py")
freeze("modules")
Reported by Pylint.
Line: 1
Column: 1
include("$(PORT_DIR)/boards/manifest.py")
freeze("modules")
Reported by Pylint.
tests/basics/deque1.py
3 issues
Line: 66
Column: 5
# Unsupported unary op
try:
~d
except TypeError:
print("TypeError")
Reported by Pylint.
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.
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
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.
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.
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
Line: 5
Column: 1
gl = {}
exec(
"""
@micropython.viper
def f():
return x
""",
Reported by Pylint.
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.
Line: 1
Column: 1
# test that viper functions capture their globals context
gl = {}
exec(
"""
@micropython.viper
def f():
return x
Reported by Pylint.