The following issues were found

tests/import/import_long_dyn.py
2 issues
Wildcard import import_long_dyn2
Error

Line: 1 Column: 1

              from import_long_dyn2 import *

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from import_long_dyn2 import *

            

Reported by Pylint.

tests/basics/iter0.py
2 issues
Non-iterable value 1 is used in an iterating context
Error

Line: 3 Column: 14

              # builtin type that is not iterable
try:
    for i in 1:
        pass
except TypeError:
    print('TypeError')

# builtin type that is iterable, calling __next__ explicitly
print(iter(range(4)).__next__())

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # builtin type that is not iterable
try:
    for i in 1:
        pass
except TypeError:
    print('TypeError')

# builtin type that is iterable, calling __next__ explicitly
print(iter(range(4)).__next__())

            

Reported by Pylint.

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

Line: 1 Column: 1

              print([1, 2] is [1, 2])
a = [1, 2]
b = a
print(b is a)

            

Reported by Pylint.

Comparison to literal
Error

Line: 1 Column: 7

              print([1, 2] is [1, 2])
a = [1, 2]
b = a
print(b is a)

            

Reported by Pylint.

ports/nrf/device/startup_nrf52840.c
2 issues
Comparing pointers that point to different objects
Error

Line: 49 CWE codes: 570

                  uint32_t * p_src  = &_sidata;
    uint32_t * p_dest = &_sdata;

    while (p_dest < &_edata) {
      *p_dest++ = *p_src++;
    }

    uint32_t * p_bss     = &_sbss;
    uint32_t * p_bss_end = &_ebss;

            

Reported by Cppcheck.

Comparing pointers that point to different objects
Error

Line: 55 CWE codes: 570

              
    uint32_t * p_bss     = &_sbss;
    uint32_t * p_bss_end = &_ebss;
    while (p_bss < p_bss_end) {
        *p_bss++ = 0ul;
    }

    SystemInit();
    _start();

            

Reported by Cppcheck.

ports/nrf/device/startup_nrf52832.c
2 issues
Comparing pointers that point to different objects
Error

Line: 49 CWE codes: 570

                  uint32_t * p_src  = &_sidata;
    uint32_t * p_dest = &_sdata;

    while (p_dest < &_edata) {
      *p_dest++ = *p_src++;
    }

    uint32_t * p_bss     = &_sbss;
    uint32_t * p_bss_end = &_ebss;

            

Reported by Cppcheck.

Comparing pointers that point to different objects
Error

Line: 55 CWE codes: 570

              
    uint32_t * p_bss     = &_sbss;
    uint32_t * p_bss_end = &_ebss;
    while (p_bss < p_bss_end) {
        *p_bss++ = 0ul;
    }

    SystemInit();
    _start();

            

Reported by Cppcheck.

tests/basics/bytearray_construct_array.py
2 issues
Consider explicitly re-raising using the 'from' keyword
Error

Line: 9 Column: 9

                      from array import array
    except ImportError:
        print("SKIP")
        raise SystemExit

# arrays
print(bytearray(array('b', [1, 2])))
print(bytearray(array('h', [0x101, 0x202])))

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # test construction of bytearray from different objects
try:
    from uarray import array
except ImportError:
    try:
        from array import array
    except ImportError:
        print("SKIP")
        raise SystemExit

            

Reported by Pylint.

ports/unix/variants/coverage/frzstr/frzstr_pkg1/__init__.py
2 issues
Missing module docstring
Error

Line: 1 Column: 1

              # test frozen package with __init__.py
print('frzstr_pkg1.__init__')
x = 1

            

Reported by Pylint.

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

Line: 3 Column: 1

              # test frozen package with __init__.py
print('frzstr_pkg1.__init__')
x = 1

            

Reported by Pylint.

ports/nrf/device/startup_nrf51822.c
2 issues
Comparing pointers that point to different objects
Error

Line: 60 CWE codes: 570

                  uint32_t * p_src  = &_sidata;
    uint32_t * p_dest = &_sdata;

    while (p_dest < &_edata) {
      *p_dest++ = *p_src++;
    }

    uint32_t * p_bss     = &_sbss;
    uint32_t * p_bss_end = &_ebss;

            

Reported by Cppcheck.

Comparing pointers that point to different objects
Error

Line: 66 CWE codes: 570

              
    uint32_t * p_bss     = &_sbss;
    uint32_t * p_bss_end = &_ebss;
    while (p_bss < p_bss_end) {
        *p_bss++ = 0ul;
    }

    SystemInit();
    _start();

            

Reported by Cppcheck.

examples/SDdatalogger/datalogger.py
2 issues
Unable to import 'pyb'
Error

Line: 4 Column: 1

              # datalogger.py
# Logs the data from the acceleromter to a file on the SD-card

import pyb

# creating objects
accel = pyb.Accel()
blue = pyb.LED(4)
switch = pyb.Switch()

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # datalogger.py
# Logs the data from the acceleromter to a file on the SD-card

import pyb

# creating objects
accel = pyb.Accel()
blue = pyb.LED(4)
switch = pyb.Switch()

            

Reported by Pylint.

tests/extmod/ujson_dumps.py
2 issues
Consider explicitly re-raising using the 'from' keyword
Error

Line: 8 Column: 9

                      import json
    except ImportError:
        print("SKIP")
        raise SystemExit

print(json.dumps(False))
print(json.dumps(True))
print(json.dumps(None))
print(json.dumps(1))

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              try:
    import ujson as json
except ImportError:
    try:
        import json
    except ImportError:
        print("SKIP")
        raise SystemExit


            

Reported by Pylint.