The following issues were found
tools/pyboard.py
98 issues
Line: 95
Suggestion:
https://bandit.readthedocs.io/en/latest/blacklists/blacklist_imports.html#b401-import-telnetlib
class TelnetToSerial:
def __init__(self, ip, user, password, read_timeout=None):
self.tn = None
import telnetlib
self.tn = telnetlib.Telnet(ip, timeout=15)
self.read_timeout = read_timeout
if b"Login as:" in self.tn.read_until(b"Login as:", timeout=read_timeout):
self.tn.write(bytes(user, "ascii") + b"\r\n")
Reported by Bandit.
Line: 97
Suggestion:
https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html#b312-telnetlib
self.tn = None
import telnetlib
self.tn = telnetlib.Telnet(ip, timeout=15)
self.read_timeout = read_timeout
if b"Login as:" in self.tn.read_until(b"Login as:", timeout=read_timeout):
self.tn.write(bytes(user, "ascii") + b"\r\n")
if b"Password:" in self.tn.read_until(b"Password:", timeout=read_timeout):
Reported by Bandit.
Line: 166
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b602_subprocess_popen_with_shell_equals_true.html
self.subp = subprocess.Popen(
cmd,
bufsize=0,
shell=True,
preexec_fn=os.setsid,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
)
Reported by Bandit.
Line: 662
Column: 16
group.add_argument(
"--soft-reset",
default=True,
action=argparse.BooleanOptionalAction,
help="Whether to perform a soft reset when connecting to the board.",
)
group.add_argument(
"--follow",
action="store_true",
Reported by Pylint.
Line: 163
Column: 21
def __init__(self, cmd):
import subprocess
self.subp = subprocess.Popen(
cmd,
bufsize=0,
shell=True,
preexec_fn=os.setsid,
stdin=subprocess.PIPE,
Reported by Pylint.
Line: 219
Column: 21
import re
import serial
self.subp = subprocess.Popen(
cmd.split(),
bufsize=0,
shell=False,
preexec_fn=os.setsid,
stdin=subprocess.PIPE,
Reported by Pylint.
Line: 499
Column: 71
with open(dest, "wb") as f:
while True:
data = bytearray()
self.exec_("print(r(%u))" % chunk_size, data_consumer=lambda d: data.extend(d))
assert data.endswith(b"\r\n\x04")
try:
data = ast.literal_eval(str(data[:-3], "ascii"))
if not isinstance(data, bytes):
raise ValueError("Not bytes")
Reported by Pylint.
Line: 506
Column: 21
if not isinstance(data, bytes):
raise ValueError("Not bytes")
except (UnicodeError, ValueError) as e:
raise PyboardError("fs_get: Could not interpret received data: %s" % str(e))
if not data:
break
f.write(data)
self.exec_("f.close()")
Reported by Pylint.
Line: 525
Column: 24
self.exec_("w(" + repr(data) + ")")
self.exec_("f.close()")
def fs_mkdir(self, dir):
self.exec_("import uos\nuos.mkdir('%s')" % dir)
def fs_rmdir(self, dir):
self.exec_("import uos\nuos.rmdir('%s')" % dir)
Reported by Pylint.
Line: 528
Column: 24
def fs_mkdir(self, dir):
self.exec_("import uos\nuos.mkdir('%s')" % dir)
def fs_rmdir(self, dir):
self.exec_("import uos\nuos.rmdir('%s')" % dir)
def fs_rm(self, src):
self.exec_("import uos\nuos.remove('%s')" % src)
Reported by Pylint.
extmod/uasyncio/core.py
91 issues
Line: 4
Column: 1
# MicroPython uasyncio module
# MIT license; Copyright (c) 2019 Damien P. George
from time import ticks_ms as ticks, ticks_diff, ticks_add
import sys, select
# Import TaskQueue and Task, preferring built-in C code over Python code
try:
from _uasyncio import TaskQueue, Task
Reported by Pylint.
Line: 4
Column: 1
# MicroPython uasyncio module
# MIT license; Copyright (c) 2019 Damien P. George
from time import ticks_ms as ticks, ticks_diff, ticks_add
import sys, select
# Import TaskQueue and Task, preferring built-in C code over Python code
try:
from _uasyncio import TaskQueue, Task
Reported by Pylint.
Line: 4
Column: 1
# MicroPython uasyncio module
# MIT license; Copyright (c) 2019 Damien P. George
from time import ticks_ms as ticks, ticks_diff, ticks_add
import sys, select
# Import TaskQueue and Task, preferring built-in C code over Python code
try:
from _uasyncio import TaskQueue, Task
Reported by Pylint.
Line: 11
Column: 5
try:
from _uasyncio import TaskQueue, Task
except:
from .task import TaskQueue, Task
################################################################################
# Exceptions
Reported by Pylint.
Line: 190
Column: 28
# This task is done, check if it's the main task and then loop should stop
if t is main_task:
if isinstance(er, StopIteration):
return er.value
raise er
if t.state:
# Task was running but is now finished.
waiting = False
if t.state is True:
Reported by Pylint.
Line: 190
Column: 28
# This task is done, check if it's the main task and then loop should stop
if t is main_task:
if isinstance(er, StopIteration):
return er.value
raise er
if t.state:
# Task was running but is now finished.
waiting = False
if t.state is True:
Reported by Pylint.
Line: 239
Column: 5
class Loop:
_exc_handler = None
def create_task(coro):
return create_task(coro)
def run_forever():
global _stop_task
_stop_task = Task(_stopper(), globals())
Reported by Pylint.
Line: 242
Column: 5
def create_task(coro):
return create_task(coro)
def run_forever():
global _stop_task
_stop_task = Task(_stopper(), globals())
run_until_complete(_stop_task)
# TODO should keep running until .stop() is called, even if there're no tasks left
Reported by Pylint.
Line: 248
Column: 5
run_until_complete(_stop_task)
# TODO should keep running until .stop() is called, even if there're no tasks left
def run_until_complete(aw):
return run_until_complete(_promote_to_task(aw))
def stop():
global _stop_task
if _stop_task is not None:
Reported by Pylint.
Line: 251
Column: 5
def run_until_complete(aw):
return run_until_complete(_promote_to_task(aw))
def stop():
global _stop_task
if _stop_task is not None:
_task_queue.push_head(_stop_task)
# If stop() is called again, do nothing
_stop_task = None
Reported by Pylint.
tests/basics/lexer.py
89 issues
Line: 4
Column: 5
# test the lexer
try:
eval
exec
except NameError:
print("SKIP")
raise SystemExit
Reported by Pylint.
Line: 5
Column: 5
try:
eval
exec
except NameError:
print("SKIP")
raise SystemExit
# __debug__ is a special symbol
Reported by Pylint.
Line: 8
Column: 5
exec
except NameError:
print("SKIP")
raise SystemExit
# __debug__ is a special symbol
print(type(__debug__))
# short input
Reported by Pylint.
Line: 14
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b102_exec_used.html
print(type(__debug__))
# short input
exec("")
exec("\n")
exec("\n\n")
exec("\r")
exec("\r\r")
exec("\t")
Reported by Bandit.
Line: 14
Column: 1
print(type(__debug__))
# short input
exec("")
exec("\n")
exec("\n\n")
exec("\r")
exec("\r\r")
exec("\t")
Reported by Pylint.
Line: 15
Column: 1
# short input
exec("")
exec("\n")
exec("\n\n")
exec("\r")
exec("\r\r")
exec("\t")
exec("\r\n")
Reported by Pylint.
Line: 15
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b102_exec_used.html
# short input
exec("")
exec("\n")
exec("\n\n")
exec("\r")
exec("\r\r")
exec("\t")
exec("\r\n")
Reported by Bandit.
Line: 16
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b102_exec_used.html
# short input
exec("")
exec("\n")
exec("\n\n")
exec("\r")
exec("\r\r")
exec("\t")
exec("\r\n")
exec("\nprint(1)")
Reported by Bandit.
Line: 16
Column: 1
# short input
exec("")
exec("\n")
exec("\n\n")
exec("\r")
exec("\r\r")
exec("\t")
exec("\r\n")
exec("\nprint(1)")
Reported by Pylint.
Line: 17
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b102_exec_used.html
exec("")
exec("\n")
exec("\n\n")
exec("\r")
exec("\r\r")
exec("\t")
exec("\r\n")
exec("\nprint(1)")
exec("\rprint(2)")
Reported by Bandit.
tools/upip.py
87 issues
Line: 10
Column: 1
#
import sys
import gc
import uos as os
import uerrno as errno
import ujson as json
import uzlib
import upip_utarfile as tarfile
Reported by Pylint.
Line: 11
Column: 1
import sys
import gc
import uos as os
import uerrno as errno
import ujson as json
import uzlib
import upip_utarfile as tarfile
gc.collect()
Reported by Pylint.
Line: 12
Column: 1
import gc
import uos as os
import uerrno as errno
import ujson as json
import uzlib
import upip_utarfile as tarfile
gc.collect()
Reported by Pylint.
Line: 13
Column: 1
import uos as os
import uerrno as errno
import ujson as json
import uzlib
import upip_utarfile as tarfile
gc.collect()
Reported by Pylint.
Line: 118
Column: 1
return s
import ussl
import usocket
warn_ussl = True
Reported by Pylint.
Line: 119
Column: 1
import ussl
import usocket
warn_ussl = True
def url_open(url):
Reported by Pylint.
Line: 221
Column: 26
def install(to_install, install_path=None):
# Calculate gzip dictionary size to use
global gzdict_sz
sz = gc.mem_free() + gc.mem_alloc()
if sz <= 65536:
gzdict_sz = 16 + 12
if install_path is None:
install_path = get_install_path()
Reported by Pylint.
Line: 221
Column: 10
def install(to_install, install_path=None):
# Calculate gzip dictionary size to use
global gzdict_sz
sz = gc.mem_free() + gc.mem_alloc()
if sz <= 65536:
gzdict_sz = 16 + 12
if install_path is None:
install_path = get_install_path()
Reported by Pylint.
Line: 49
Column: 21
# Expects *file* name
def _makedirs(name, mode=0o777):
ret = False
s = ""
comps = name.rstrip("/").split("/")[:-1]
if comps[0] == "":
s = "/"
Reported by Pylint.
Line: 70
Column: 5
def save_file(fname, subf):
global file_buf
with open(fname, "wb") as outf:
while True:
sz = subf.readinto(file_buf)
if not sz:
break
Reported by Pylint.
tools/mpremote/mpremote/pyboardextended.py
85 issues
Line: 3
Column: 1
import io, os, re, serial, struct, time
from errno import EPERM
from .console import VT_ENABLED
try:
from .pyboard import Pyboard, PyboardError, stdout_write_bytes, filesystem_command
except ImportError:
import sys
Reported by Pylint.
Line: 1
Column: 1
import io, os, re, serial, struct, time
from errno import EPERM
from .console import VT_ENABLED
try:
from .pyboard import Pyboard, PyboardError, stdout_write_bytes, filesystem_command
except ImportError:
import sys
Reported by Pylint.
Line: 6
Column: 5
from .console import VT_ENABLED
try:
from .pyboard import Pyboard, PyboardError, stdout_write_bytes, filesystem_command
except ImportError:
import sys
sys.path.append(os.path.dirname(__file__) + "/../..")
from pyboard import Pyboard, PyboardError, stdout_write_bytes, filesystem_command
Reported by Pylint.
Line: 6
Column: 5
from .console import VT_ENABLED
try:
from .pyboard import Pyboard, PyboardError, stdout_write_bytes, filesystem_command
except ImportError:
import sys
sys.path.append(os.path.dirname(__file__) + "/../..")
from pyboard import Pyboard, PyboardError, stdout_write_bytes, filesystem_command
Reported by Pylint.
Line: 6
Column: 5
from .console import VT_ENABLED
try:
from .pyboard import Pyboard, PyboardError, stdout_write_bytes, filesystem_command
except ImportError:
import sys
sys.path.append(os.path.dirname(__file__) + "/../..")
from pyboard import Pyboard, PyboardError, stdout_write_bytes, filesystem_command
Reported by Pylint.
Line: 413
Column: 13
try:
stat = os.lstat(self.data_ilistdir[0] + "/" + entry)
mode = stat.st_mode & 0xC000
except OSError as er:
mode = 0
self.wr_str(entry)
self.wr_u32(mode)
else:
self.wr_str("")
Reported by Pylint.
Line: 426
Column: 17
# self.log_cmd(f"open {path} {mode}")
try:
self.path_check(path)
f = open(path, mode)
except OSError as er:
self.wr_s8(-abs(er.errno))
else:
is_text = mode.find("b") == -1
try:
Reported by Pylint.
Line: 513
Column: 24
class SerialIntercept:
def __init__(self, serial, cmd):
self.orig_serial = serial
self.cmd = cmd
self.buf = b""
self.orig_serial.timeout = 5.0
Reported by Pylint.
Line: 571
Column: 9
if self.eval('"RemoteFS" in globals()') == b"False":
self.exec_(fs_hook_code)
self.exec_("__mount()")
self.cmd = PyboardCommand(self.serial, fout, path)
self.serial = SerialIntercept(self.serial, self.cmd)
def soft_reset_with_mount(self, out_callback):
self.serial.write(b"\x04")
if not self.mounted:
Reported by Pylint.
Line: 572
Column: 9
self.exec_(fs_hook_code)
self.exec_("__mount()")
self.cmd = PyboardCommand(self.serial, fout, path)
self.serial = SerialIntercept(self.serial, self.cmd)
def soft_reset_with_mount(self, out_callback):
self.serial.write(b"\x04")
if not self.mounted:
return
Reported by Pylint.
tests/wipy/os.py
83 issues
Line: 5
Column: 1
os module test for the CC3200 based boards
"""
from machine import SD
import os
mch = os.uname().machine
if "LaunchPad" in mch:
sd_pins = ("GP16", "GP17", "GP15")
Reported by Pylint.
Line: 8
Column: 7
from machine import SD
import os
mch = os.uname().machine
if "LaunchPad" in mch:
sd_pins = ("GP16", "GP17", "GP15")
elif "WiPy" in mch:
sd_pins = ("GP10", "GP11", "GP15")
else:
Reported by Pylint.
Line: 18
Column: 1
sd = SD(pins=sd_pins)
os.mount(sd, "/sd")
os.mkfs("/sd")
os.chdir("/flash")
print(os.listdir())
os.chdir("/sd")
Reported by Pylint.
Line: 19
Column: 1
sd = SD(pins=sd_pins)
os.mount(sd, "/sd")
os.mkfs("/sd")
os.chdir("/flash")
print(os.listdir())
os.chdir("/sd")
print(os.listdir())
Reported by Pylint.
Line: 20
Column: 1
os.mount(sd, "/sd")
os.mkfs("/sd")
os.chdir("/flash")
print(os.listdir())
os.chdir("/sd")
print(os.listdir())
Reported by Pylint.
Line: 21
Column: 7
os.mount(sd, "/sd")
os.mkfs("/sd")
os.chdir("/flash")
print(os.listdir())
os.chdir("/sd")
print(os.listdir())
# create a test directory in flash
Reported by Pylint.
Line: 23
Column: 1
os.chdir("/flash")
print(os.listdir())
os.chdir("/sd")
print(os.listdir())
# create a test directory in flash
os.mkdir("/flash/test")
os.chdir("/flash/test")
Reported by Pylint.
Line: 24
Column: 7
print(os.listdir())
os.chdir("/sd")
print(os.listdir())
# create a test directory in flash
os.mkdir("/flash/test")
os.chdir("/flash/test")
print(os.getcwd())
Reported by Pylint.
Line: 27
Column: 1
print(os.listdir())
# create a test directory in flash
os.mkdir("/flash/test")
os.chdir("/flash/test")
print(os.getcwd())
os.chdir("..")
print(os.getcwd())
os.chdir("test")
Reported by Pylint.
Line: 28
Column: 1
# create a test directory in flash
os.mkdir("/flash/test")
os.chdir("/flash/test")
print(os.getcwd())
os.chdir("..")
print(os.getcwd())
os.chdir("test")
print(os.getcwd())
Reported by Pylint.
tests/thread/stress_aes.py
75 issues
Line: 85
Column: 9
# all inputs must be size 16
def aes_add_round_key(state, w):
for i in range(16):
state[i] ^= w[i]
# combined sub_bytes, shift_rows, mix_columns, add_round_key
# all inputs must be size 16
Reported by Pylint.
Line: 93
Column: 9
# all inputs must be size 16
def aes_sb_sr_mc_ark(state, w, w_idx, temp):
temp_idx = 0
for i in range(4):
x0 = aes_s_box_table[state[i * 4]]
x1 = aes_s_box_table[state[1 + ((i + 1) & 3) * 4]]
x2 = aes_s_box_table[state[2 + ((i + 2) & 3) * 4]]
x3 = aes_s_box_table[state[3 + ((i + 3) & 3) * 4]]
temp[temp_idx] = aes_gf8_mul_2(x0) ^ aes_gf8_mul_3(x1) ^ x2 ^ x3 ^ w[w_idx]
Reported by Pylint.
Line: 112
Column: 9
# all inputs must be size 16
def aes_sb_sr_ark(state, w, w_idx, temp):
temp_idx = 0
for i in range(4):
x0 = aes_s_box_table[state[i * 4]]
x1 = aes_s_box_table[state[1 + ((i + 1) & 3) * 4]]
x2 = aes_s_box_table[state[2 + ((i + 2) & 3) * 4]]
x3 = aes_s_box_table[state[3 + ((i + 3) & 3) * 4]]
temp[temp_idx] = x0 ^ w[w_idx]
Reported by Pylint.
Line: 132
Column: 9
def aes_state(state, w, temp, nr):
aes_add_round_key(state, w)
w_idx = 16
for i in range(nr - 1):
aes_sb_sr_mc_ark(state, w, w_idx, temp)
w_idx += 16
aes_sb_sr_ark(state, w, w_idx, temp)
Reported by Pylint.
Line: 132
Column: 9
def aes_state(state, w, temp, nr):
aes_add_round_key(state, w)
w_idx = 16
for i in range(nr - 1):
aes_sb_sr_mc_ark(state, w, w_idx, temp)
w_idx += 16
aes_sb_sr_ark(state, w, w_idx, temp)
Reported by Pylint.
Line: 141
Column: 9
# expand 'key' to 'w' for use with aes_state
# key has size 4 * Nk, w has size 16 * (Nr + 1), temp has size 16
def aes_key_expansion(key, w, temp, nk, nr):
for i in range(4 * nk):
w[i] = key[i]
w_idx = 4 * nk - 4
for i in range(nk, 4 * (nr + 1)):
t = temp
t_idx = 0
Reported by Pylint.
Line: 189
Column: 13
self.state_pos = 16
def set_iv(self, iv):
for i in range(16):
self.state[i] = iv[i]
self.state_pos = 16
def get_some_state(self, n_needed):
if self.state_pos >= 16:
Reported by Pylint.
Line: 208
Column: 17
while n > 0:
ln = self.get_some_state(n)
n -= ln
for i in range(ln):
data[idx + i] ^= self.state[self.state_pos + i]
idx += ln
self.state_pos += n
Reported by Pylint.
Line: 238
Column: 18
count = LockedCounter()
def thread_entry(n_loop):
global count
aes = AES(256)
key = bytearray(256 // 8)
iv = bytearray(16)
Reported by Pylint.
Line: 239
Column: 5
def thread_entry(n_loop):
global count
aes = AES(256)
key = bytearray(256 // 8)
iv = bytearray(16)
data = bytearray(128)
Reported by Pylint.
tests/run-tests.py
71 issues
Line: 777
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b605_start_process_with_a_shell.html
testbase = exp[:-4]
print()
print("FAILURE {0}".format(testbase))
os.system("{0} {1}.exp {1}.out".format(DIFF, testbase))
sys.exit(0)
if args.clean_failures:
for f in glob(os.path.join(args.result_dir, "*.exp")) + glob(
Reported by Bandit.
Line: 191
Column: 16
pyb.enter_raw_repl()
try:
output_mupy = pyb.execfile(test_file)
except pyboard.PyboardError as e:
had_crash = True
if not is_special and e.args[0] == "exception":
output_mupy = e.args[1] + e.args[2] + b"CRASH"
else:
output_mupy = bytes(e.args[0], "ascii") + b"\nCRASH"
Reported by Pylint.
Line: 799
Column: 9
elif args.target in EXTERNAL_TARGETS:
global pyboard
sys.path.append(base_path("../tools"))
import pyboard
pyb = pyboard.Pyboard(args.device, args.baudrate, args.user, args.password)
pyb.enter_raw_repl()
else:
raise ValueError("target must be one of %s" % ", ".join(LOCAL_TARGETS + EXTERNAL_TARGETS))
Reported by Pylint.
Line: 164
Suggestion:
https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html#b306-mktemp-q
# if running via .mpy, first compile the .py file
if args.via_mpy:
mpy_modname = tempfile.mktemp(dir="")
mpy_filename = mpy_modname + ".mpy"
subprocess.check_output(
[MPYCROSS]
+ args.mpy_cross_flags.split()
+ ["-o", mpy_filename, "-X", "emit=" + args.emit, test_file]
Reported by Bandit.
Line: 249
Column: 34
return output_mupy
def run_feature_check(pyb, args, base_path, test_file):
if pyb is not None and test_file.startswith("repl_"):
# REPL feature tests will not run via pyboard because they require prompt interactivity
return b""
return run_micropython(pyb, args, base_path("feature_check", test_file), is_special=True)
Reported by Pylint.
Line: 663
Column: 5
def __init__(self, option_strings, dest, **kwargs):
super().__init__(option_strings, dest, default=[], **kwargs)
def __call__(self, parser, args, value, option):
if not hasattr(args, self.dest):
args.filters = []
if option.startswith(("-e", "--e")):
option = "exclude"
else:
Reported by Pylint.
Line: 797
Column: 9
if args.target in LOCAL_TARGETS or args.list_tests:
pyb = None
elif args.target in EXTERNAL_TARGETS:
global pyboard
sys.path.append(base_path("../tools"))
import pyboard
pyb = pyboard.Pyboard(args.device, args.baudrate, args.user, args.password)
pyb.enter_raw_repl()
Reported by Pylint.
Line: 1
Column: 1
#! /usr/bin/env python3
import os
import subprocess
import sys
import platform
import argparse
import inspect
import re
Reported by Pylint.
Line: 1
Column: 1
#! /usr/bin/env python3
import os
import subprocess
import sys
import platform
import argparse
import inspect
import re
Reported by Pylint.
Line: 4
Suggestion:
https://bandit.readthedocs.io/en/latest/blacklists/blacklist_imports.html#b404-import-subprocess
#! /usr/bin/env python3
import os
import subprocess
import sys
import platform
import argparse
import inspect
import re
Reported by Bandit.
tests/misc/features.py
70 issues
Line: 106
Column: 9
x = c25()
print(x.x)
raise
except:
print(26)
print(27 + zero)
break
print(28)
Reported by Pylint.
Line: 129
Column: 5
print(k)
for i in [1, 2, 3]:
class A:
def __init__(self, c):
self.a = i + 10 * c
b = A(3)
print(b.a)
Reported by Pylint.
Line: 133
Column: 9
def __init__(self, c):
self.a = i + 10 * c
b = A(3)
print(b.a)
print(34)
p = 0
for i in range(35, -1, -1):
print(i)
Reported by Pylint.
Line: 149
Column: 51
print(p)
for i in [38]:
print(i)
print(int(exec("def foo(): return 38") == None) + foo())
d = {}
exec("def bar(): return 40", d)
print(d["bar"]())
Reported by Pylint.
Line: 171
Column: 1
i = 43
def f(i=i):
print(i)
i = 44
f()
Reported by Pylint.
Line: 5
Column: 5
str.count
except AttributeError:
print("SKIP")
raise SystemExit
# mad.py
# Alf Clement 27-Mar-2014
#
zero = 0
Reported by Pylint.
Line: 25
Column: 1
print(3 + 4)
try:
a = 4 // zero
except:
print(8)
print("xxxxxxxxx".count("x"))
def ten():
Reported by Pylint.
Line: 40
Column: 1
a.append(i)
print(a[11])
print(a[-1])
str = "0123456789"
print(str[1] + str[3])
def p(s):
print(s)
Reported by Pylint.
Line: 59
Column: 19
def print(self):
print(self.a)
def set(self, b):
self.a = b
a = A()
a.print()
Reported by Pylint.
Line: 96
Column: 13
try:
def gcheck():
global a
print(a)
gcheck()
class c25:
Reported by Pylint.
ports/stm32/boards/pllvalues.py
69 issues
Line: 147
Column: 22
def verify_pll(hse, pll):
M, N, P, Q = pll
vco_in, vco_out, pllck, pll48ck = compute_derived(hse, pll)
# verify ints
assert close_int(M)
assert close_int(N)
assert close_int(P)
Reported by Pylint.
Line: 147
Column: 29
def verify_pll(hse, pll):
M, N, P, Q = pll
vco_in, vco_out, pllck, pll48ck = compute_derived(hse, pll)
# verify ints
assert close_int(M)
assert close_int(N)
assert close_int(P)
Reported by Pylint.
Line: 203
Column: 30
for sys, (M, N, P, Q) in valid_plls:
print(" (%u << %u) | (%u << %u) | %u," % (M, m_shift, P // 2 - 1, p_shift, sys), end="")
if M >= 2:
vco_in, vco_out, pllck, pll48ck = compute_derived(hse, (M, N, P, Q))
print(
" // M=%u N=%u P=%u Q=%u vco_in=%.2f vco_out=%.2f pll48=%.2f"
% (M, N, P, Q, vco_in, vco_out, pll48ck),
end="",
)
Reported by Pylint.
Line: 245
Column: 5
def main():
global mcu
global out_format
# parse input args
import sys
Reported by Pylint.
Line: 246
Column: 5
def main():
global mcu
global out_format
# parse input args
import sys
argv = sys.argv[1:]
Reported by Pylint.
Line: 11
Column: 1
import re
class MCU:
def __init__(
self, range_sysclk, range_m, range_n, range_p, range_q, range_vco_in, range_vco_out
):
self.range_sysclk = range_sysclk
self.range_m = range_m
Reported by Pylint.
Line: 11
Column: 1
import re
class MCU:
def __init__(
self, range_sysclk, range_m, range_n, range_p, range_q, range_vco_in, range_vco_out
):
self.range_sysclk = range_sysclk
self.range_m = range_m
Reported by Pylint.
Line: 12
Column: 5
class MCU:
def __init__(
self, range_sysclk, range_m, range_n, range_p, range_q, range_vco_in, range_vco_out
):
self.range_sysclk = range_sysclk
self.range_m = range_m
self.range_n = range_n
Reported by Pylint.
Line: 56
Column: 1
}
def close_int(x):
return abs(x - round(x)) < 0.01
# original version that requires N/M to be an integer (for simplicity)
def compute_pll(hse, sys):
Reported by Pylint.
Line: 56
Column: 1
}
def close_int(x):
return abs(x - round(x)) < 0.01
# original version that requires N/M to be an integer (for simplicity)
def compute_pll(hse, sys):
Reported by Pylint.