The following issues were found
tests/basics/int1.py
2 issues
Line: 1
Column: 1
print(int(False))
print(int(True))
print(int(0))
print(int(1))
print(int(+1))
print(int(-1))
print(int('0'))
Reported by Pylint.
Line: 57
Column: 1
print(int(b"12"))
def test(value, base):
try:
print(int(value, base))
except ValueError:
print('ValueError')
Reported by Pylint.
ports/teensy/memzip_files/main.py
2 issues
Line: 1
Column: 1
import pyb
print("Executing main.py")
led = pyb.LED(1)
led.on()
pyb.delay(100)
led.off()
Reported by Pylint.
Line: 1
Column: 1
import pyb
print("Executing main.py")
led = pyb.LED(1)
led.on()
pyb.delay(100)
led.off()
Reported by Pylint.
tests/basics/builtin_chr.py
2 issues
Line: 1
Column: 1
# test builtin chr (whether or not we support unicode)
print(chr(65))
try:
chr(0x110000)
except ValueError:
print("ValueError")
Reported by Pylint.
Line: 9
Column: 1
chr(0x110000)
except ValueError:
print("ValueError")
Reported by Pylint.
tests/extmod/ujson_dumps_separators.py
2 issues
Line: 8
Column: 9
import json
except ImportError:
print("SKIP")
raise SystemExit
for sep in [
None,
(", ", ": "),
(",", ": "),
Reported by Pylint.
Line: 1
Column: 1
try:
import ujson as json
except ImportError:
try:
import json
except ImportError:
print("SKIP")
raise SystemExit
Reported by Pylint.
tests/import/pkg7/mod1.py
2 issues
Line: 1
Column: 1
print("mod1")
foo = "mod1.foo"
Reported by Pylint.
Line: 2
Column: 1
print("mod1")
foo = "mod1.foo"
Reported by Pylint.
ports/bare-arm/system.c
2 issues
Line: 88
CWE codes:
570
__asm volatile ("ldr sp, =_estack");
// Copy .data section from flash to RAM.
memcpy(&_sdata, &_sidata, (char *)&_edata - (char *)&_sdata);
// Zero out .bss section.
memset(&_sbss, 0, (char *)&_ebss - (char *)&_sbss);
// SCB->CCR: enable 8-byte stack alignment for IRQ handlers, in accord with EABI.
Reported by Cppcheck.
Line: 91
CWE codes:
570
memcpy(&_sdata, &_sidata, (char *)&_edata - (char *)&_sdata);
// Zero out .bss section.
memset(&_sbss, 0, (char *)&_ebss - (char *)&_sbss);
// SCB->CCR: enable 8-byte stack alignment for IRQ handlers, in accord with EABI.
*((volatile uint32_t *)0xe000ed14) |= 1 << 9;
// Initialise the cpu and peripherals.
Reported by Cppcheck.
examples/SDdatalogger/boot.py
2 issues
Line: 9
Column: 1
# * press reset
# * press user switch and hold until orange LED goes out
import pyb
pyb.LED(3).on() # indicate we are waiting for switch press
pyb.delay(2000) # wait for user to maybe press the switch
switch_value = pyb.Switch()() # sample the switch at end of delay
pyb.LED(3).off() # indicate that we finished waiting for the switch
Reported by Pylint.
Line: 1
Column: 1
# boot.py -- runs on boot-up
# Let's you choose which script to run.
# > To run 'datalogger.py':
# * press reset and do nothing else
# > To run 'cardreader.py':
# * press reset
# * press user switch and hold until orange LED goes out
import pyb
Reported by Pylint.
tests/import/pkg7/mod2.py
2 issues
Line: 1
Column: 1
print("mod2")
bar = "mod2.bar"
Reported by Pylint.
Line: 2
Column: 1
print("mod2")
bar = "mod2.bar"
Reported by Pylint.
tests/basics/builtin_divmod_intbig.py
2 issues
Line: 1
Column: 1
# test builtin divmod
try:
divmod(1 << 65, 0)
except ZeroDivisionError:
print("ZeroDivisionError")
# bignum
l = (1 << 65) + 123
Reported by Pylint.
Line: 9
Column: 1
print("ZeroDivisionError")
# bignum
l = (1 << 65) + 123
print(divmod(3, l))
print(divmod(l, 5))
print(divmod(l + 3, l))
print(divmod(l * 20, l + 2))
Reported by Pylint.
tests/basics/builtin_ellipsis.py
2 issues
Line: 1
Column: 1
# tests that .../Ellipsis exists
print(...)
print(Ellipsis)
print(... == Ellipsis)
# Test that Ellipsis can be hashed
print(type(hash(Ellipsis)))
Reported by Pylint.
Line: 6
Column: 7
print(...)
print(Ellipsis)
print(... == Ellipsis)
# Test that Ellipsis can be hashed
print(type(hash(Ellipsis)))
Reported by Pylint.