The following issues were found

tests/basics/set_remove.py
2 issues
Missing module docstring
Error

Line: 1 Column: 1

              # basic test
s = {1}
print(s.remove(1))
print(list(s))
try:
    print(s.remove(1), "!!!")
except KeyError as er:
    print('KeyError', er.args[0])
else:

            

Reported by Pylint.

Variable name "er" doesn't conform to snake_case naming style
Error

Line: 7 Column: 1

              print(list(s))
try:
    print(s.remove(1), "!!!")
except KeyError as er:
    print('KeyError', er.args[0])
else:
    print("failed to raise KeyError")

# test sets of varying size

            

Reported by Pylint.

tests/basics/containment.py
2 issues
Missing module docstring
Error

Line: 1 Column: 1

              # sets, see set_containment
for i in 1, 2:
    for o in {1:2}, {1:2}.keys():
        print("{} in {}: {}".format(i, str(o), i in o))
        print("{} not in {}: {}".format(i, str(o), i not in o))

haystack = "supercalifragilistc"
for needle in [haystack[i:] for i in range(len(haystack))]:
    print(needle, "in", haystack, "::", needle in haystack)

            

Reported by Pylint.

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

Line: 7 Column: 1

                      print("{} in {}: {}".format(i, str(o), i in o))
        print("{} not in {}: {}".format(i, str(o), i not in o))

haystack = "supercalifragilistc"
for needle in [haystack[i:] for i in range(len(haystack))]:
    print(needle, "in", haystack, "::", needle in haystack)
    print(needle, "not in", haystack, "::", needle not in haystack)
    print(haystack, "in", needle, "::", haystack in needle)
    print(haystack, "not in", needle, "::", haystack not in needle)

            

Reported by Pylint.

tests/thread/thread_exit1.py
2 issues
Missing module docstring
Error

Line: 1 Column: 1

              # test _thread.exit() function
#
# MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd

try:
    import utime as time
except ImportError:
    import time
import _thread

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 12 Column: 1

              import _thread


def thread_entry():
    _thread.exit()


for i in range(2):
    while True:

            

Reported by Pylint.

tests/thread/thread_exit2.py
2 issues
Missing module docstring
Error

Line: 1 Column: 1

              # test raising SystemExit to finish a thread
#
# MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd

try:
    import utime as time
except ImportError:
    import time
import _thread

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 12 Column: 1

              import _thread


def thread_entry():
    raise SystemExit


for i in range(2):
    while True:

            

Reported by Pylint.

tests/cmdline/cmd_optimise.py
2 issues
Missing module docstring
Error

Line: 1 Column: 1

              # cmdline: -O
# test optimisation output
print(__debug__)
assert 0

            

Reported by Pylint.

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

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

              # cmdline: -O
# test optimisation output
print(__debug__)
assert 0

            

Reported by Bandit.

ports/qemu-arm/startup.c
1 issues
Comparing pointers that point to different objects
Error

Line: 18 CWE codes: 570

                      *dest++ = *src++;
    }
    // zero out .bss section
    for (uint32_t *dest = &_sbss; dest < &_ebss;) {
        *dest++ = 0;
    }
    // jump to board initialisation
    void _start(void);
    _start();

            

Reported by Cppcheck.

py/objarray.c
1 issues
Uninitialized variable: src_len
Error

Line: 467 CWE codes: 908

                              }

                // TODO: check src/dst compat
                mp_int_t len_adj = src_len - (slice.stop - slice.start);
                uint8_t *dest_items = o->items;
                #if MICROPY_PY_BUILTINS_MEMORYVIEW
                if (o->base.type == &mp_type_memoryview) {
                    if (!(o->typecode & MP_OBJ_ARRAY_TYPECODE_FLAG_RW)) {
                        // store to read-only memoryview not allowed

            

Reported by Cppcheck.

tests/cmdline/repl_basic.py
1 issues
invalid syntax (<unknown>, line 3)
Error

Line: 3 Column: 2

              # basic REPL tests
print(1)

2

            

Reported by Pylint.

tests/cmdline/repl_autocomplete.py
1 issues
invalid syntax (<unknown>, line 2)
Error

Line: 2 Column: 7

              # tests for autocompletion
impo	sys
not_exist.	
not_exist	
x = '123'
1, x.isdi	()
i = str
i.lowe	('ABC')
None.	

            

Reported by Pylint.

tests/cmdline/cmd_verbose.py
1 issues
Missing module docstring
Error

Line: 1 Column: 1

              # cmdline: -v -v
# test verbose output
print(1)

            

Reported by Pylint.