Repository Analysis

micropython/micropython

MicroPython - a lean and efficient Python implementation for microcontrollers and constrained systems

11.2 Low AI signal View on GitHub
11.2
Adjusted Score
11.2
Raw Score
100%
Time Factor
2026-05-29
Last Push
21,759
Stars
C
Language
630,661
Lines of Code
4612
Files
6823
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 3HIGH 157MEDIUM 151LOW 6512

Pattern Findings

6823 matches across 18 categories. Click a row to expand file-level details.

Over-Commented Block5850 hits · 5018 pts
SeverityFileLineSnippet
LOWtools/uncrustify.cfg1# Uncrustify-0.71.0_f
LOWtools/uncrustify.cfg21#
LOWtools/uncrustify.cfg41tok_split_gte = false # true/false
LOWtools/uncrustify.cfg81#
LOWtools/uncrustify.cfg101
LOWtools/uncrustify.cfg221# prototype or function definition.
LOWtools/uncrustify.cfg381#
LOWtools/uncrustify.cfg701
LOWtools/uncrustify.cfg721sp_member = remove # ignore/add/remove/force
LOWtools/uncrustify.cfg781# (OC) Add or remove space between '@selector' and '(',
LOWtools/uncrustify.cfg821
LOWtools/uncrustify.cfg881
LOWtools/uncrustify.cfg921
LOWtools/uncrustify.cfg941# The continuation indent, only for class header line(s). If non-zero, this
LOWtools/uncrustify.cfg1101# Indentation column for standalone 'throw' qualifier on a function
LOWtools/uncrustify.cfg1161# >0: Absolute column where 1 is the leftmost column
LOWtools/uncrustify.cfg1181# line so that it lines up after the open parenthesis (not recommended).
LOWtools/uncrustify.cfg1241# followed by a newline, the next line indent is one tab.
LOWtools/uncrustify.cfg1261indent_oc_msg_colon = 0 # unsigned number
LOWtools/uncrustify.cfg1281
LOWtools/uncrustify.cfg1301#
LOWtools/uncrustify.cfg1541
LOWtools/uncrustify.cfg1581# Add or remove newline between 'namespace' and '{'.
LOWtools/uncrustify.cfg1601
LOWtools/uncrustify.cfg1621
LOWtools/uncrustify.cfg1641# Add or remove newline between 'class' and '{'.
LOWtools/uncrustify.cfg1661
LOWtools/uncrustify.cfg1841# Whether to add a newline after a virtual brace open with a non-empty body.
LOWtools/uncrustify.cfg1961# is only one line so that the entire definition (prototype, braces, body) is
LOWtools/uncrustify.cfg2021# Requires nl_class_leave_one_liners=true. Overrides nl_before_func_body_def
LOWtools/uncrustify.cfg2041# of a function body.
LOWtools/uncrustify.cfg2061
LOWtools/uncrustify.cfg2101
LOWtools/uncrustify.cfg2121nl_after_namespace = 0 # unsigned number
LOWtools/uncrustify.cfg2141#
LOWtools/uncrustify.cfg2181
LOWtools/uncrustify.cfg2321# The span for aligning function-call parameters for single line functions.
LOWtools/uncrustify.cfg2341# 1: Part of the variable 'void *foo;'
LOWtools/uncrustify.cfg2381#
LOWtools/uncrustify.cfg2401# 0: Don't align (default).
LOWtools/uncrustify.cfg2421# The gap for aligning class member definitions.
LOWtools/uncrustify.cfg2441align_struct_init_span = 0 # unsigned number
LOWtools/uncrustify.cfg2461# 1: Part of type name: 'typedef int *pint;'
LOWtools/uncrustify.cfg2481# an effect.
LOWtools/uncrustify.cfg2561# on the ':'.
LOWtools/uncrustify.cfg2581#
LOWtools/uncrustify.cfg2641# and last lines of the comment are the same length.
LOWtools/uncrustify.cfg2661cmt_insert_file_footer = "" # string
LOWtools/uncrustify.cfg2681cmt_insert_oc_msg_header = "" # string
LOWtools/uncrustify.cfg2721# Whether to enforce that all blocks of an 'if'/'else if'/'else' chain either
LOWtools/uncrustify.cfg2741mod_full_brace_nl = 0 # unsigned number
LOWtools/uncrustify.cfg2861# (OC) Weight of getter type ('getter=') when organizing properties.
LOWtools/uncrustify.cfg2921# Whether to indent case statements between #if, #else, and #endif.
LOWtools/uncrustify.cfg2941
LOWtools/uncrustify.cfg2961
LOWtools/uncrustify.cfg2981# To prevent the double use of the indentation value, use this option with the
LOWtools/uncrustify.cfg3001# by default.
LOWtools/uncrustify.cfg3021# Warn levels - 1: error, 2: warning (default), 3: note
LOWtools/uncrustify.cfg3041# Ignore - do not do any changes
LOWtools/uncrustify.cfg3061# Example:
5790 more matches not shown…
Cross-File Repetition112 hits · 560 pts
SeverityFileLineSnippet
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> level ‘1’ // enables the approx 2ma output // stage
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> level ‘1’ // enables the approx 2ma output // stage
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> level ‘1’ // enables the approx 2ma output // stage
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> level ‘1’ // enables the approx 2ma output // stage
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> level ‘1’ // enables the approx 2ma output // stage
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> level ‘1’ // enables the approx 2ma output // stage
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> level ‘1’ // enables the approx 2ma output // stage
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> level ‘1’ // enables the approx 2ma output // stage
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> level ‘1’ // enables the approx 2ma output // stage
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> level ‘1’ // enables the approx 2ma output // stage
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> level ‘1’ // enables the approx 2ma output // stage
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> level ‘1’ // enables the approx 2ma output // stage
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> level ‘1’ // enables the approx 2ma output // stage
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> level ‘1’ // enables the approx 2ma output // stage
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> level ‘1’ // enables the approx 2ma output // stage
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> level ‘1’ // enables the approx 2ma output // stage
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> level ‘1’ // enables the approx 2ma output // stage
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> level ‘1’ // enables the approx 2ma output // stage
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" // --> level ‘1’ enables the approx // 4ma output stage
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" // --> level ‘1’ enables the approx // 4ma output stage
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" // --> level ‘1’ enables the approx // 4ma output stage
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" // --> level ‘1’ enables the approx // 4ma output stage
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" // --> level ‘1’ enables the approx // 4ma output stage
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" // --> level ‘1’ enables the approx // 4ma output stage
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" // --> level ‘1’ enables the approx // 4ma output stage
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" // --> level ‘1’ enables the approx // 4ma output stage
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" // --> level ‘1’ enables the approx // 4ma output stage
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" // --> level ‘1’ enables the approx // 4ma output stage
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" // --> level ‘1’ enables the approx // 4ma output stage
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" // --> level ‘1’ enables the approx // 4ma output stage
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" // --> level ‘1’ enables the approx // 4ma output stage
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" // --> level ‘1’ enables the approx // 4ma output stage
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" // --> level ‘1’ enables the approx // 4ma output stage
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" // --> level ‘1’ enables the approx // 4ma output stage
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" // --> level ‘1’ enables the approx // 4ma output stage
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" // --> level ‘1’ enables the approx // 4ma output stage
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> level ‘1’ // enables the approx 8ma output // stage. note: any drive strength // between 2ma and 14ma can be // ob
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> level ‘1’ // enables the approx 8ma output // stage. note: any drive strength // between 2ma and 14ma can be // ob
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> level ‘1’ // enables the approx 8ma output // stage. note: any drive strength // between 2ma and 14ma can be // ob
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> level ‘1’ // enables the approx 8ma output // stage. note: any drive strength // between 2ma and 14ma can be // ob
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> level ‘1’ // enables the approx 8ma output // stage. note: any drive strength // between 2ma and 14ma can be // ob
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> level ‘1’ // enables the approx 8ma output // stage. note: any drive strength // between 2ma and 14ma can be // ob
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> level ‘1’ // enables the approx 8ma output // stage. note: any drive strength // between 2ma and 14ma can be // ob
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> level ‘1’ // enables the approx 8ma output // stage. note: any drive strength // between 2ma and 14ma can be // ob
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> level ‘1’ // enables the approx 8ma output // stage. note: any drive strength // between 2ma and 14ma can be // ob
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> level ‘1’ // enables the approx 8ma output // stage. note: any drive strength // between 2ma and 14ma can be // ob
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> level ‘1’ // enables the approx 8ma output // stage. note: any drive strength // between 2ma and 14ma can be // ob
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> level ‘1’ // enables the approx 8ma output // stage. note: any drive strength // between 2ma and 14ma can be // ob
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> level ‘1’ // enables the approx 8ma output // stage. note: any drive strength // between 2ma and 14ma can be // ob
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> level ‘1’ // enables the approx 8ma output // stage. note: any drive strength // between 2ma and 14ma can be // ob
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> level ‘1’ // enables the approx 8ma output // stage. note: any drive strength // between 2ma and 14ma can be // ob
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> level ‘1’ // enables the approx 8ma output // stage. note: any drive strength // between 2ma and 14ma can be // ob
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> level ‘1’ // enables the approx 8ma output // stage. note: any drive strength // between 2ma and 14ma can be // ob
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> level ‘1’ // enables the approx 8ma output // stage. note: any drive strength // between 2ma and 14ma can be // ob
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> output enable // value. level ‘0’ enables the ido // to pad path. else pad is // tristated (except for the pu/pd /
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> output enable // value. level ‘0’ enables the ido // to pad path. else pad is // tristated (except for the pu/pd /
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> output enable // value. level ‘0’ enables the ido // to pad path. else pad is // tristated (except for the pu/pd /
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> output enable // value. level ‘0’ enables the ido // to pad path. else pad is // tristated (except for the pu/pd /
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> output enable // value. level ‘0’ enables the ido // to pad path. else pad is // tristated (except for the pu/pd /
HIGHports/cc3200/hal/inc/hw_ocp_shared.h0" --> output enable // value. level ‘0’ enables the ido // to pad path. else pad is // tristated (except for the pu/pd /
52 more matches not shown…
Excessive Try-Catch Wrapping236 hits · 326 pts
SeverityFileLineSnippet
LOWtools/manifestfile.py255 except Exception as er:
LOWtools/manifestfile.py397 except Exception as e:
MEDIUMtools/manifestfile.py633 print("Error: No mode specified.", file=sys.stderr)
MEDIUMtools/pyboard.py243 print("Error: unable to find PTY device in startup line:", pty_line)
MEDIUMtools/gen-cpydiff.py144 print("Error: Test has same output in CPython vs MicroPython: " + test_fullpath)
LOWtools/ar_util.py76 except Exception:
LOWtools/ar_util.py86 except Exception:
MEDIUMtools/mpremote/mpremote/romfs.py141 print("Error: OSError {}".format(er), file=sys.stderr)
LOWtools/autobuild/build-downloads.py98 except Exception as e:
LOWtests/misc/print_exception.py37except Exception as e:
LOWtests/misc/print_exception.py53except Exception as e:
LOWtests/misc/print_exception.py63except Exception as e:
LOWtests/misc/print_exception.py71 except Exception as e:
LOWtests/misc/print_exception.py75except Exception as e:
LOWtests/misc/print_exception.py89except Exception as e:
LOWtests/misc/sys_settrace_subdir/sys_settrace_generic.py25 except Exception:
MEDIUMtests/misc/sys_settrace_subdir/sys_settrace_generic.py21def test_exception():
LOWtests/basics/class_setname_hazard.py135except Exception as e: # CPython raises RuntimeError, MicroPython propagates the original exception
LOWtests/basics/string_tstring_parser1.py39except Exception as e:
LOWtests/basics/string_tstring_parser1.py47except Exception as e:
LOWtests/basics/string_tstring_parser1.py54except Exception as e:
LOWtests/basics/string_tstring_parser1.py62except Exception as e:
LOWtests/basics/string_tstring_parser1.py107except Exception as e:
LOWtests/basics/string_tstring_parser1.py114except Exception as e:
LOWtests/basics/string_tstring_parser1.py121except Exception as e:
LOWtests/basics/string_tstring_parser1.py129except Exception as e:
LOWtests/basics/string_tstring_parser1.py136except Exception as e:
LOWtests/basics/string_tstring_parser1.py191except Exception as e:
LOWtests/basics/string_tstring_parser1.py200except Exception as e:
LOWtests/basics/string_tstring_parser1.py208except Exception as e:
LOWtests/basics/string_tstring_parser1.py255except Exception as e:
LOWtests/basics/string_tstring_parser1.py265except Exception as e:
LOWtests/basics/string_tstring_parser1.py275except Exception as e:
LOWtests/basics/string_tstring_parser1.py78except Exception as e:
LOWtests/basics/string_tstring_parser1.py89except Exception as e:
LOWtests/basics/string_tstring_parser1.py96except Exception as e:
LOWtests/basics/string_tstring_parser1.py161except Exception as e:
LOWtests/basics/string_tstring_parser1.py178except Exception as e:
LOWtests/basics/string_tstring_parser1.py219except Exception as e:
LOWtests/basics/string_tstring_parser1.py229except Exception as e:
LOWtests/basics/string_tstring_parser1.py244except Exception as e:
LOWtests/basics/string_tstring_parser1.py287except Exception as e:
LOWtests/basics/generator_throw_nested.py11 except Exception:
LOWtests/basics/generator_throw_nested.py15 except Exception:
LOWtests/basics/generator_throw_nested.py19 except Exception:
MEDIUMtests/basics/generator_throw_nested.py4def gen():
LOWtests/basics/string_tstring_basic1.py128except Exception as e:
LOWtests/basics/string_tstring_errors1.py35except Exception as e:
LOWtests/basics/string_tstring_errors1.py56except Exception as e:
LOWtests/basics/string_tstring_errors1.py62except Exception as e:
LOWtests/basics/string_tstring_errors1.py87except Exception as e:
LOWtests/basics/string_tstring_errors1.py96except Exception as e:
LOWtests/basics/string_tstring_errors1.py102except Exception as e:
LOWtests/basics/string_tstring_errors1.py111except Exception as e:
LOWtests/basics/string_tstring_errors1.py120except Exception as e:
LOWtests/basics/string_tstring_errors1.py211except Exception as e:
LOWtests/basics/string_tstring_errors1.py218except Exception as e:
LOWtests/basics/string_tstring_errors1.py225except Exception as e:
LOWtests/basics/string_tstring_errors1.py232except Exception as e:
LOWtests/basics/exception_chain.py13except Exception:
176 more matches not shown…
Self-Referential Comments95 hits · 280 pts
SeverityFileLineSnippet
MEDIUMtools/metrics.py3# This file is part of the MicroPython project, http://micropython.org/
MEDIUMtools/manifestfile.py3# This file is part of the MicroPython project, http://micropython.org/
MEDIUMtools/codeformat.py3# This file is part of the MicroPython project, http://micropython.org/
MEDIUMtools/hci_trace_to_pcap.py3# This file is part of the MicroPython project, http://micropython.org/
MEDIUMtools/pyboard.py3# This file is part of the MicroPython project, http://micropython.org/
MEDIUMtools/gen-cpydiff.py1# This file is part of the MicroPython project, http://micropython.org/
MEDIUMtools/ar_util.py3# This file is part of the MicroPython project, http://micropython.org/
MEDIUMtools/ar_util.py55 "# This file is a cache directory tag created by MicroPython.\n"
MEDIUMtools/boardgen.py1# This file is part of the MicroPython project, http://micropython.org/
MEDIUMtools/mpy-tool.py3# This file is part of the MicroPython project, http://micropython.org/
MEDIUMtools/mpy-tool.py326 # Create a dict mapping opcode value to opcode name.
MEDIUMtools/mpy-tool.py1565 # Create the outer-level compiled module representing the whole .mpy file.
MEDIUMtools/mpy-tool.py1709 # Define the string of frozen module names.
MEDIUMtools/mpy-tool.py1724 # Define the array of pointers to frozen module content.
MEDIUMtools/mpy_ld.py3# This file is part of the MicroPython project, http://micropython.org/
MEDIUMtools/mpy_ld.py563 # Create a relocation for each GOT entry
MEDIUMtools/makemanifest.py3# This file is part of the MicroPython project, http://micropython.org/
MEDIUMtools/pydfu.py2# This file is part of the OpenMV project.
MEDIUMtools/pydfu.py7"""This module implements enough functionality to program the STM32F4xx over
MEDIUMtools/mpremote/mpremote/transport_serial.py3# This file is part of the MicroPython project, http://micropython.org/
MEDIUMtools/mpremote/mpremote/transport.py3# This file is part of the MicroPython project, http://micropython.org/
MEDIUMtools/mpremote/mpremote/commands.py282 # Create the destination if necessary.
MEDIUMtools/mpremote/tests/test_filesystem.sh92# Create a local directory structure and copy it to `:` on the device.
MEDIUMtools/mpremote/tests/test_mip_local_install.sh17# Create the smallest permissible ramdisk.
MEDIUMtools/mpremote/tests/test_mount.sh6# Create a local directory structure and mount the parent directory on the device.
MEDIUMtools/autobuild/build-downloads.py81 # Create the board markdown, which is the concatenation of the
MEDIUMtests/test_utils.py1# This file is part of the MicroPython project, http://micropython.org/
MEDIUMtests/run-multitests.py3# This file is part of the MicroPython project, http://micropython.org/
MEDIUMtests/run-natmodtests.py3# This file is part of the MicroPython project, http://micropython.org/
MEDIUMtests/run-perfbench.py3# This file is part of the MicroPython project, http://micropython.org/
MEDIUMtests/misc/cexample_subclass.py28 # Initialize base class.
MEDIUMtests/basics/namedtuple1.py89# Creating an empty namedtuple should not segfault
MEDIUMtests/multi_bluetooth/ble_gap_device_name.py65 # Create an empty service and start advertising.
MEDIUMtests/cmdline/repl_autocomplete_underscore.py27# Create an instance
MEDIUMtests/extmod/asyncio_lock_cancel.py26 # Create a lock and acquire it so the tasks below must wait
MEDIUMtests/extmod/deflate_compress_memory_error.py16# Create a compressor object.
MEDIUMtests/extmod/select_poll_eintr.py49# Create the poller object.
MEDIUMtests/extmod/select_ipoll.py35# Create a second socket.
MEDIUMtests/extmod/vfs_fat_mtime.py46 # Create an empty file, should have a timestamp.
MEDIUMtests/extmod/btree_gc.py11# Create a BytesIO but don't keep a reference to it.
MEDIUMtests/extmod/asyncio_event.py43 # Create a task waiting on the already-set event
MEDIUMtests/extmod/vfs_lfs_mtime.py49 # Create an empty file, should have a timestamp.
MEDIUMtests/extmod/vfs_lfs_superblock.py35# Create the block device from the static data (it will be read-only).
MEDIUMtests/extmod/vfs_lfs_superblock.py38# Create the VFS explicitly, no auto-detection is needed for this.
MEDIUMtests/extmod/asyncio_set_exception_handler.py29 # Create a task that raises and uses the custom exception handler
MEDIUMtests/extmod/asyncio_set_exception_handler.py42 # Create a task, let it run, then await it (no exception should be printed)
MEDIUMtests/extmod/asyncio_await_return.py18 # Create a task and await on it
MEDIUMtests/multi_net/tcp_client_rst.py35 # Create a poller for the connected socket.
MEDIUMtests/multi_net/tls_dtls_server_client.py30 # Create a UDP socket and bind it to accept incoming connections.
MEDIUMtests/multi_net/tls_dtls_server_client.py73 # Create a UDP socket and connect to the server.
MEDIUMtests/multi_net/tls_dtls_server_client.py79 # Create a DTLS context and load the certificate.
MEDIUMtests/ports/unix/mod_os.py1# This module is not entirely compatible with CPython
MEDIUMextmod/asyncio/task.py4# This file contains the core TaskQueue based on a pairing heap, and the core Task class.
MEDIUMextmod/asyncio/core.py246# Create a new task from a coroutine and run it until it finishes
MEDIUMextmod/asyncio/stream.py96# Create a TCP stream connection to a remote host
MEDIUMdocs/conf.py7# This file is execfile()d with the current directory set to its
MEDIUMmpy-cross/mpy_cross/__init__.py3# This file is part of the MicroPython project, http://micropython.org/
MEDIUMmpy-cross/mpy_cross/__main__.py3# This file is part of the MicroPython project, http://micropython.org/
MEDIUMexamples/network/https_client_nonblocking.py50 # Create a TCP socket and connect to the server in non-blocking mode.
MEDIUMexamples/network/https_client_nonblocking.py59 # Create an object to poll the SSL stream for readability/writability.
35 more matches not shown…
Deep Nesting182 hits · 180 pts
SeverityFileLineSnippet
LOWtools/metrics.py108
LOWtools/metrics.py123
LOWtools/manifestfile.py577
LOWtools/manifestfile.py258
LOWtools/manifestfile.py290
LOWtools/manifestfile.py336
LOWtools/codeformat.py91
LOWtools/codeformat.py136
LOWtools/pyboard.py706
LOWtools/pyboard.py805
LOWtools/pyboard.py269
LOWtools/pyboard.py339
LOWtools/pyboard.py442
LOWtools/pyboard.py477
LOWtools/pyboard.py636
LOWtools/uf2conv.py64
LOWtools/uf2conv.py214
LOWtools/uf2conv.py258
LOWtools/uf2conv.py330
LOWtools/gen-cpydiff.py211
LOWtools/ar_util.py118
LOWtools/boardgen.py205
LOWtools/boardgen.py242
LOWtools/mpy-tool.py372
LOWtools/mpy-tool.py404
LOWtools/mpy-tool.py1389
LOWtools/mpy-tool.py1429
LOWtools/mpy-tool.py1509
LOWtools/mpy-tool.py1858
LOWtools/mpy-tool.py2086
LOWtools/mpy-tool.py605
LOWtools/mpy-tool.py720
LOWtools/mpy_ld.py484
LOWtools/mpy_ld.py532
LOWtools/mpy_ld.py604
LOWtools/mpy_ld.py895
LOWtools/mpy_ld.py1136
LOWtools/mpy_ld.py1191
LOWtools/mpy_ld.py1383
LOWtools/mpy_ld.py1522
LOWtools/makemanifest.py73
LOWtools/makemanifest.py125
LOWtools/pydfu.py500
LOWtools/mpremote/mpremote/transport_serial.py52
LOWtools/mpremote/mpremote/transport_serial.py121
LOWtools/mpremote/mpremote/transport_serial.py218
LOWtools/mpremote/mpremote/transport_serial.py253
LOWtools/mpremote/mpremote/transport_serial.py328
LOWtools/mpremote/mpremote/transport_serial.py1024
LOWtools/mpremote/mpremote/romfs.py76
LOWtools/mpremote/mpremote/mip.py95
LOWtools/mpremote/mpremote/mip.py134
LOWtools/mpremote/mpremote/mip.py165
LOWtools/mpremote/mpremote/repl.py6
LOWtools/mpremote/mpremote/main.py487
LOWtools/mpremote/mpremote/commands.py20
LOWtools/mpremote/mpremote/commands.py134
LOWtools/mpremote/mpremote/commands.py304
LOWtools/mpremote/mpremote/commands.py345
LOWtools/mpremote/mpremote/commands.py380
122 more matches not shown…
Unused Imports172 hits · 172 pts
SeverityFileLineSnippet
LOWtools/manifestfile.py31
LOWtools/boardgen.py72
LOWtools/mpremote/mpremote/romfs.py3
LOWtools/mpremote/mpremote/repl.py1
LOWtests/run-internalbench.py11
LOWtests/run-tests.py17
LOWtests/run-tests.py17
LOWtests/run-tests.py17
LOWtests/run-perfbench.py11
LOWtests/basics/op_error.py59
LOWtests/basics/import_star_nonmodule.py24
LOWtests/basics/import_star_nonmodule.py29
LOWtests/basics/import_star_nonmodule.py49
LOWtests/basics/import_star_nonmodule.py54
LOWtests/basics/import_star_nonmodule.py62
LOWtests/micropython/const_math.py8
LOWtests/micropython/const_error.py3
LOWtests/extmod_hardware/machine_encoder.py13
LOWtests/cmdline/cmd_showbc.py160
LOWtests/extmod/vfs_fat_ramdisk.py2
LOWtests/extmod/machine_uart_irq_txidle.py12
LOWtests/extmod/vfs_fat_more.py115
LOWtests/extmod/vfs_rom.py4
LOWtests/extmod/vfs_fat_finaliser.py4
LOWtests/extmod/vfs_fat_finaliser.py4
LOWtests/extmod/vfs_fat_finaliser.py34
LOWtests/extmod/vfs_fat_finaliser.py34
LOWtests/extmod/vfs_fat_finaliser.py53
LOWtests/extmod/vfs_fat_finaliser.py53
LOWtests/extmod/vfs_fat_oldproto.py2
LOWtests/extmod/vfs_fat_oldproto.py2
LOWtests/extmod/vfs_lfs.py4
LOWtests/extmod/ssl_poll.py2
LOWtests/extmod/vfs_userfs.py87
LOWtests/extmod/vfs_userfs.py103
LOWtests/extmod/vfs_userfs.py107
LOWtests/extmod/vfs_userfs.py91
LOWtests/extmod/vfs_userfs.py97
LOWtests/extmod/framebuf_palette.py3
LOWtests/extmod/vfs_fat_ramdisklarge.py4
LOWtests/extmod/vfs_fat_mtime.py4
LOWtests/extmod/vfs_lfs_mount.py61
LOWtests/extmod/vfs_lfs_mount.py67
LOWtests/extmod/vfs_lfs_mount.py73
LOWtests/extmod/machine_spi_rate.py4
LOWtests/extmod/vfs_fat_ilistdir_del.py4
LOWtests/extmod/vfs_posix_readonly.py4
LOWtests/multi_extmod/machine_can_04_tx_order.py2
LOW…ts/multi_net/asyncio_tls_server_client_verify_error.py4
LOWtests/multi_net/ssl_cert_ec.py5
LOWtests/multi_net/ssl_cert_ec.py5
LOWtests/multi_net/sslcontext_server_client_files.py4
LOW…i_net/asyncio_tls_server_client_cert_required_error.py4
LOWtests/multi_net/sslcontext_getpeercert.py5
LOWtests/multi_net/asyncio_tls_server_client_readline.py4
LOWtests/multi_net/sslcontext_check_hostname_error.py4
LOWtests/multi_net/ssl_cert_rsa.py5
LOWtests/multi_net/ssl_cert_rsa.py5
LOWtests/multi_net/sslcontext_server_client_ciphers.py4
LOWtests/multi_net/sslcontext_server_client.py4
112 more matches not shown…
Cross-Language Confusion31 hits · 168 pts
SeverityFileLineSnippet
HIGHtests/extmod/json_loads.py22my_print(json.loads("[null]"))
HIGHtests/extmod/json_loads.py23my_print(json.loads("[null,false,true]"))
HIGHtests/extmod/json_loads.py24my_print(json.loads(" [ null , false , true ] "))
HIGHtests/extmod/json_loads.py27my_print(json.loads('{"a":null, "b":false, "c":true}'))
HIGHtests/extmod/json_loads.py71 my_print(json.loads("[null] a"))
HIGHtests/extmod/json_loads_bytes.py10print(json.loads(bytearray(b"[null]")))
HIGHtests/jni/list.py14print(l.toString())
HIGHtests/import/pkgstar_default/__init__.py1# When __all__ is undefined, star import should only
HIGHtests/perf_bench/misc_raytrace.py28 l = self.length()
HIGHtests/perf_bench/misc_raytrace.py173 light_dist = light_vec.length()
HIGHextmod/asyncio/task.py150 self.state.push(core.cur_task)
HIGHextmod/asyncio/task.py171 core._task_queue.push(self)
HIGHextmod/asyncio/task.py175 core._task_queue.push(self)
HIGHextmod/asyncio/event.py21 core._task_queue.push(self.waiting.pop())
HIGHextmod/asyncio/event.py31 self.waiting.push(core.cur_task)
HIGHextmod/asyncio/core.py45 _task_queue.push(cur_task, self.state)
HIGHextmod/asyncio/core.py119 _task_queue.push(sm[0])
HIGHextmod/asyncio/core.py123 _task_queue.push(sm[1])
HIGHextmod/asyncio/core.py147 _task_queue.push(t)
HIGHextmod/asyncio/core.py219 _task_queue.push(t.state.pop())
HIGHextmod/asyncio/core.py227 _task_queue.push(t)
HIGHextmod/asyncio/core.py281 _task_queue.push(_stop_task)
HIGHextmod/asyncio/funcs.py84 core._task_queue.push(gather_task)
HIGHextmod/asyncio/lock.py27 core._task_queue.push(self.state)
HIGHextmod/asyncio/lock.py36 self.waiting.push(core.cur_task)
HIGHports/webassembly/asyncio/core.py42 _task_queue.push(cur_task, self.state)
HIGHports/webassembly/asyncio/core.py89 _task_queue.push(self.waiting)
HIGHports/webassembly/asyncio/core.py98 _task_queue.push(self.waiting)
HIGHports/webassembly/asyncio/core.py184 _task_queue.push(t.state.pop())
HIGHports/webassembly/asyncio/core.py192 _task_queue.push(t)
HIGHports/webassembly/asyncio/core.py213 _task_queue.push(t)
Redundant / Tautological Comments44 hits · 70 pts
SeverityFileLineSnippet
LOWtools/codeformat.py92 # Read file.
LOWtools/mpy-tool.py416 # Check if the bytecode_offset is small enough to use a 1-byte encoding.
LOWtools/makemanifest.py217 # Check if output file needs generating
LOWtools/mpremote/mpremote/mip.py48# Check if the specified path exists and matches the hash.
LOWtools/mpremote/mpremote/main.py447 # Check if config file exists.
LOWtools/mpremote/mpremote/commands.py662 # Check if ROMFS image is valid
LOWtools/mpremote/mpremote/commands.py667 # Check if ROMFS filesystem image will fit in the target partition.
LOWpy/makeversionhdr.py132 # Check if the file contents changed from last time
LOWtests/serial_test.py155 # Print results.
LOWtests/serial_test.py222 # Print results.
LOWtests/serial_test.py261 # Print results.
LOWtests/run-multitests.py513 # Check if truth exists in a file, and read it in
LOWtests/run-multitests.py531 # Print result of test
LOWtests/run-natmodtests.py224 # Print result
LOWtests/run-tests.py774 # Check if micropython.native is supported, and skip such tests if it's not
LOWtests/run-tests.py779 # Check if arbitrary-precision integers are supported, and skip such tests if it's not
LOWtests/run-tests.py784 # Check if 'long long' precision integers are supported, even if arbitrary precision is not
LOWtests/run-tests.py789 # Check if bytearray is supported, and skip such tests if it's not
LOWtests/run-tests.py794 # Check if set type (and set literals) is supported, and skip such tests if it's not
LOWtests/run-tests.py799 # Check if slice is supported, and skip such tests if it's not
LOWtests/run-tests.py804 # Check if async/await keywords are supported, and skip such tests if it's not
LOWtests/run-tests.py809 # Check if const keyword (MicroPython extension) is supported, and skip such tests if it's not
LOWtests/run-tests.py814 # Check if __rOP__ special methods are supported, and skip such tests if it's not
LOWtests/run-tests.py819 # Check if fstring feature is enabled, and skip such tests if it doesn't
LOWtests/run-tests.py824 # Check if tstring feature is enabled, and skip such tests if it doesn't
LOWtests/run-tests.py840 # Check if emacs repl is supported, and skip such tests if it's not
LOWtests/run-tests.py845 # Check if words movement in repl is supported, and skip such tests if it's not
LOWtests/run-tests.py1018 # Check if the target requested to skip this test.
LOWtests/run-perfbench.py103 # Check if test should be skipped
LOWtests/basics/string_tstring_errors1.py242 # Check if we get the specific error message or generic one
LOWtests/extmod/machine_rtc.py14# Set datetime to a known value.
LOWtests/extmod/deflate_decompress.py2 # Check if deflate is available.
LOWtests/extmod/deflate_compress_memory_error.py4 # Check if deflate is available.
LOWtests/extmod/deflate_compress_memory_error.py11# Check if compression is enabled.
LOWtests/extmod/asyncio_gather_finished_early.py59 # Print results.
LOWtests/extmod/deflate_stream_error.py4 # Check if deflate & IOBase are available.
LOWtests/extmod/deflate_stream_error.py12# Check if compression is enabled.
LOWtests/extmod/deflate_compress.py2 # Check if deflate is available.
LOWtests/extmod/deflate_compress.py9# Check if compression is enabled.
LOWtests/perf_bench/misc_raytrace.py155 # Check if any objects hit
LOWtests/stress/bytecode_limit.py16# Print results at the end in case an intermediate value of n fails with MemoryError.
LOWextmod/asyncio/task.py158 # Check if task is already finished.
LOWports/esp32/boards/UM_TINYPICO/modules/dotstar.py86 # Set auto_write to False temporarily so brightness setter does _not_
LOWports/mimxrt/boards/make-flexram-config.py95 # Check if DTCM and ITCM size is either multiple of 32k or 4k,8k or 16k
Cross-Language Confusion (JS/TS)8 hits · 60 pts
SeverityFileLineSnippet
HIGHtests/ports/webassembly/register_js_module.js27print(js_module2.yes)
HIGHtests/ports/webassembly/register_js_module.js28print(js_module2.add1(1))
HIGHtests/ports/webassembly/register_js_module.js29print(js_module2.getThis())
HIGHtests/ports/webassembly/register_js_module.js30print(js_module2.getThis().yes)
HIGHtests/ports/webassembly/register_js_module.js39print(yes)
HIGHtests/ports/webassembly/register_js_module.js40print(add1(2))
HIGHtests/ports/webassembly/register_js_module.js41print(getThis())
HIGHtests/ports/webassembly/register_js_module.js42print(getThis().yes)
Synthetic Comment Markers6 hits · 45 pts
SeverityFileLineSnippet
HIGHports/renesas-ra/README.md66## Board definition auto-generated code
HIGHports/cc3200/hal/timer.c261 // Set the output levels as requested.
HIGHports/cc3200/hal/uart.c743 // Set the flow control mode as requested.
HIGHports/cc3200/hal/uart.c1101 // Set the break condition as requested.
HIGHports/esp8266/machine_pin.c285 // configure the GPIO as requested
HIGHports/stm32/pin.c387 // configure the GPIO as requested
Hyper-Verbose Identifiers41 hits · 39 pts
SeverityFileLineSnippet
LOWtools/pyboard.py386 def _enter_raw_repl_unprotected(self, soft_reset, timeout_overall):
LOWtools/verifygitlog.py120def verify_subject_line_prefix(prefix, err):
LOWtools/mpy-tool.py1085 def get_opcode_annotations_labels(
LOWtools/mpy-tool.py1781def adjust_bytecode_qstr_obj_indices(bytecode_in, qstr_table_base, obj_table_base):
LOWtools/makemanifest.py73def generate_frozen_str_content(modules):
LOWtools/mpremote/mpremote/transport.py58def _convert_filesystem_error(e, info):
LOWtools/mpremote/mpremote/main.py465def prepare_command_expansions(config):
LOWtools/mpremote/mpremote/commands.py198def do_filesystem_recursive_cp(state, src, dest, multiple, check_hash):
LOWtools/mpremote/mpremote/commands.py304def do_filesystem_recursive_rm(state, path, args):
LOWpy/makeversionhdr.py22def get_version_info_from_git(repo_path):
LOWpy/makeversionhdr.py71def get_version_info_from_mpconfig(repo_path):
LOWpy/make_root_pointers.py17def find_root_pointer_registrations(filename):
LOWpy/make_root_pointers.py27def generate_root_pointer_header(root_pointers):
LOWpy/makemoduledefs.py34def find_module_registrations(filename):
LOWpy/makemoduledefs.py47def generate_module_table_header(modules):
LOWpy/makemoduledefs.py109def generate_module_delegations(delegations):
LOWtests/test_utils.py131 def run_script_on_remote_target(self, args, test_file, is_special, requires_target_wiring):
LOWtests/test_utils.py194def convert_device_shortcut_to_real_device(device):
LOWtests/test_utils.py227def prepare_script_for_target(args, *, script_text=None, force_plain=False):
LOWtests/test_utils.py263def run_script_on_remote_target(pyb, args, test_file, is_special, requires_target_wiring):
LOWtests/run-tests.py414def detect_target_wiring_script(pyb, args):
LOWtests/micropython/heapalloc_fail_tstring.py235def test_many_interpolations_heap():
LOWtests/micropython/heapalloc_fail_tstring.py266def test_template_concat_heap():
LOWtests/extmod/vfs_posix.py80def write_files_without_closing():
LOWtests/extmod/asyncio_wait_for.py47async def task_wait_for_cancel_ignore(t_wait):
LOWtests/extmod/marshal_fun_nested.py36def f_with_child_closure_defargs():
LOWtests/extmod/marshal_fun_nested.py46def f_with_list_comprehension(a):
LOWtests/extmod/asyncio_wait_for_fwd.py26async def test_cancellation_forwarded(catch, catch_inside):
LOWtests/net_inet/resolve_on_connect.py20 def test_bind_resolves_localhost(self):
LOWtests/net_inet/resolve_on_connect.py30 def test_connect_non_existent(self):
LOWtests/net_hosted/connect_nonblock_xfer.py119 def test_plain_sockets_to_nowhere(self):
LOWtests/net_hosted/connect_nonblock_xfer.py123 def test_ssl_sockets_to_nowhere(self):
LOWtests/ports/rp2/rp2_dma.py86 def test_time_taken_for_large_memory_copy(self):
LOWtests/ports/stm32_hardware/sdcard_dma_align.py158 def test_interrupted_read_write(self):
LOWtests/ports/stm32_hardware/spi_dma_align.py19 def test_variable_offset_fixed_length(self):
LOWtests/ports/stm32_hardware/spi_dma_align.py30 def test_variable_offset_and_lengths(self):
LOWextmod/asyncio/core.py294 def default_exception_handler(loop, context):
LOWports/stm32/boards/pllvalues.py229def search_header_for_hsx_values(filename):
LOWports/stm32/boards/LEGO_HUB_NO6/appupdate.py19def _copy_file_to_raw_filesystem(filename, flash, block):
LOWports/nrf/examples/ubluepy_eddystone.py31def generate_eddystone_adv_packet(url):
LOWports/webassembly/asyncio/core.py242 def default_exception_handler(loop, context):
AI Slop Vocabulary13 hits · 38 pts
SeverityFileLineSnippet
MEDIUMtools/uncrustify.cfg3004# Whether to apply special formatting for Qt SIGNAL/SLOT macros. Essentially,
MEDIUMpy/emitnative.c27// Essentially normal Python has 1 type: Python objects
MEDIUMpy/objmodule.c205 // built-in. Essentially, this makes it as if all the extensible
MEDIUMtests/basics/string_format2.py1# comprehensive functionality test for {} format string
LOWtests/basics/struct_micropython.py23# putting this in a dedicated test that can be skipped we simply pass
MEDIUMtests/float/string_format2.py1# Change the following to True to get a much more comprehensive set of tests
MEDIUMtests/thread/stress_aes.py10# and then the test harness at the bottom. It can be tuned to be more/less
MEDIUMtests/perf_bench/misc_aes.py7# and then the test harness at the bottom.
MEDIUMexamples/natmod/features4/features4.c31// Essentially Factorial.__new__ (but also kind of __init__).
MEDIUMports/esp32/modespnow.c842 // from the non-802.11b 6Mbit rate, for more robust error correction
MEDIUMports/stm32/sdcard.c188 // makes it more robust to have the pins always pulled high
MEDIUMports/stm32/boards/LEGO_HUB_NO6/board_init.c94// This makes the update robust to power failures: if the update does not complete then
MEDIUMports/stm32/boards/LEGO_HUB_NO7/board_init.c64// This makes the update robust to power failures: if the update does not complete then
Hallucination Indicators3 hits · 30 pts
SeverityFileLineSnippet
CRITICALtests/basics/fun_code_colines.py21 obj.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.fun() # line 21: bc+31 line+1; bc+27 line+0
CRITICALtests/basics/fun_code_colines.py30 obj2.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.fun() # line 30: bc+31 line+3; bc+27 line+0
CRITICALtests/basics/fun_code_colines.py60 return obj3.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.fun() # line 60: bc+31 line+27; bc+27 line+0
Dead Code9 hits · 18 pts
SeverityFileLineSnippet
MEDIUMtests/basics/gen_yield_from_stopped.py6
MEDIUMtests/basics/stopiteration.py34
MEDIUMtests/basics/generator_exc.py18
MEDIUMtests/basics/generator_exc.py19
MEDIUMtests/cmdline/cmd_showbc_opt.py7
MEDIUMtests/cmdline/cmd_showbc_opt.py19
MEDIUMtests/extmod/asyncio_exception.py14
MEDIUMtests/extmod/asyncio_exception.py27
MEDIUMtests/extmod/asyncio_exception.py54
Verbosity Indicators9 hits · 16 pts
SeverityFileLineSnippet
LOWports/samd/machine_uart.c483 // Step 1: Configure the Pin mux.
LOWports/samd/mcu/samd21/clock_config.c224 // Step 1: Set up the reference clock
LOWports/samd/mcu/samd21/clock_config.c251 // Step 2: Set the coarse and fine values.
LOWports/samd/mcu/samd21/clock_config.c262 // Step 3: Set the multiplication values. The offset of 16384 to the freq is for rounding.
LOWports/samd/mcu/samd21/clock_config.c267 // Step 4: Start the DFLL and wait for the PLL lock. We just wait for the fine lock, since
LOWports/samd/mcu/samd51/clock_config.c262 // Step 1: Peripheral channel 0 is driven by GCLK4 and it feeds DFLL48M
LOWports/samd/mcu/samd51/clock_config.c266 // Step 2: Set the multiplication values. The offset of 16384 to the freq is for rounding.
LOWports/samd/mcu/samd51/clock_config.c271 // Step 3: Set the mode to closed loop
LOWports/samd/mcu/samd51/clock_config.c278 // Step 4: Start the DFLL.
Decorative Section Separators5 hits · 14 pts
SeverityFileLineSnippet
MEDIUMtools/mpy-tool.py191 MP_BC_BASE_RESERVED = (0x00) # ----------------
MEDIUM…stm32/boards/LEGO_HUB_NO6/bluetooth_init_cc2564C_1.5.c30 // #--------------------------------------------------------------------------------
MEDIUM…stm32/boards/LEGO_HUB_NO6/bluetooth_init_cc2564C_1.5.c43 // #--------------------------------------------------------------------------------
MEDIUM…stm32/boards/LEGO_HUB_NO6/bluetooth_init_cc2564C_1.5.c557 // ##--------------------------------------------------------------------------------
MEDIUM…stm32/boards/LEGO_HUB_NO6/bluetooth_init_cc2564C_1.5.c559 // ##--------------------------------------------------------------------------------
Example Usage Blocks5 hits · 8 pts
SeverityFileLineSnippet
LOWports/renesas-ra/machine_rtc.c54/// Example usage:
LOWports/stm32/rtc.c47/// Example usage:
LOWports/stm32/dac.c46/// Example usage:
LOWports/stm32/accel.c46/// Example usage:
LOWports/nrf/examples/powerup.py34# Example usage:
Slop Phrases2 hits · 4 pts
SeverityFileLineSnippet
MEDIUMexamples/network/http_server_simplistic_commented.py61 # ten lines of code, and you can use this technique for quick hacks
MEDIUMports/stm32/boards/NUCLEO_WB55/mboot_keys.h5// The above keys are for demonstration purposes only, do not use them in production!