The following issues were found
ports/stm32/uart.c
2 issues
Line: 489
CWE codes:
908
}
}
uart_obj->uartx = UARTx;
// Set the initialisation parameters for the UART.
UART_HandleTypeDef huart;
memset(&huart, 0, sizeof(huart));
huart.Instance = UARTx;
Reported by Cppcheck.
Line: 494
CWE codes:
908
// Set the initialisation parameters for the UART.
UART_HandleTypeDef huart;
memset(&huart, 0, sizeof(huart));
huart.Instance = UARTx;
huart.Init.BaudRate = baudrate;
huart.Init.WordLength = bits;
huart.Init.StopBits = stop;
huart.Init.Parity = parity;
huart.Init.Mode = UART_MODE_TX_RX;
Reported by Cppcheck.
tests/basics/array_add.py
2 issues
Line: 9
Column: 9
import array
except ImportError:
print("SKIP")
raise SystemExit
a1 = array.array('I', [1])
a2 = array.array('I', [2])
print(a1 + a2)
Reported by Pylint.
Line: 1
Column: 1
# test array + array
try:
import uarray as array
except ImportError:
try:
import array
except ImportError:
print("SKIP")
raise SystemExit
Reported by Pylint.
tests/float/complex1_intbig.py
2 issues
Line: 1
Column: 1
# test basic complex number functionality
# convert bignum to complex on rhs
ans = 1j + (1 << 70)
print("%.5g %.5g" % (ans.real, ans.imag))
Reported by Pylint.
Line: 4
Column: 1
# test basic complex number functionality
# convert bignum to complex on rhs
ans = 1j + (1 << 70)
print("%.5g %.5g" % (ans.real, ans.imag))
Reported by Pylint.
tests/extmod/uctypes_native_float.py
2 issues
Line: 5
Column: 5
import uctypes
except ImportError:
print("SKIP")
raise SystemExit
desc = {
"f32": uctypes.FLOAT32 | 0,
"f64": uctypes.FLOAT64 | 0,
}
Reported by Pylint.
Line: 1
Column: 1
try:
import uctypes
except ImportError:
print("SKIP")
raise SystemExit
desc = {
"f32": uctypes.FLOAT32 | 0,
"f64": uctypes.FLOAT64 | 0,
Reported by Pylint.
tests/extmod/ure_split.py
2 issues
Line: 8
Column: 9
import re
except ImportError:
print("SKIP")
raise SystemExit
r = re.compile(" ")
s = r.split("a b c foobar")
print(s)
Reported by Pylint.
Line: 1
Column: 1
try:
import ure as re
except ImportError:
try:
import re
except ImportError:
print("SKIP")
raise SystemExit
Reported by Pylint.
tests/basics/bytes_add_endian.py
2 issues
Line: 9
Column: 9
import array
except ImportError:
print("SKIP")
raise SystemExit
print(b"123" + array.array('i', [1]))
Reported by Pylint.
Line: 1
Column: 1
# test bytes + other
try:
import uarray as array
except ImportError:
try:
import array
except ImportError:
print("SKIP")
raise SystemExit
Reported by Pylint.
tests/extmod/ure_split_empty.py
2 issues
Line: 11
Column: 5
import ure as re
except ImportError:
print("SKIP")
raise SystemExit
r = re.compile(" *")
s = r.split("a b c foobar")
print(s)
Reported by Pylint.
Line: 1
Column: 1
# test splitting with pattern matches that can be empty
#
# CPython 3.5 issues a FutureWarning for these tests because their
# behaviour will change in a future version. MicroPython just stops
# splitting as soon as an empty match is found.
try:
import ure as re
except ImportError:
Reported by Pylint.
tests/cpydiff/modules_random_getrandbits.py
2 issues
Line: 4
Column: 1
"""
categories: Modules,random
description: ``getrandbits`` method can only return a maximum of 32 bits at a time.
cause: PRNG's internal state is only 32bits so it can only return a maximum of 32 bits of data at a time.
workaround: If you need a number that has more than 32 bits then utilize the random module from micropython-lib.
"""
import random
Reported by Pylint.
Line: 5
Column: 1
categories: Modules,random
description: ``getrandbits`` method can only return a maximum of 32 bits at a time.
cause: PRNG's internal state is only 32bits so it can only return a maximum of 32 bits of data at a time.
workaround: If you need a number that has more than 32 bits then utilize the random module from micropython-lib.
"""
import random
Reported by Pylint.
tests/cpydiff/modules3/__init__.py
2 issues
Line: 1
Column: 12
__all__ = ["foo"]
Reported by Pylint.
Line: 1
Column: 1
__all__ = ["foo"]
Reported by Pylint.
tests/extmod/ure_split_notimpl.py
2 issues
Line: 5
Column: 5
import ure as re
except ImportError:
print("SKIP")
raise SystemExit
r = re.compile("( )")
try:
s = r.split("a b c foobar")
except NotImplementedError:
Reported by Pylint.
Line: 1
Column: 1
try:
import ure as re
except ImportError:
print("SKIP")
raise SystemExit
r = re.compile("( )")
try:
s = r.split("a b c foobar")
Reported by Pylint.