AI Slop Code RIsk Monitor

cocotb/cocotb

cocotb: Python-based chip (RTL) verification

17.3 Elevated pattern signal View on GitHub

Maintenance and Governance Review

This report summarizes scanner evidence for cocotb/cocotb, a Python project with 2,538 GitHub stars. SynthScan examined 69,992 lines of code across 320 source files, recording 945 pattern matches distributed across 17 syntactic categories. The legacy adjusted pattern signal is 17.3 (Elevated pattern signal); it is not an authorship estimate.

Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.

17.3
Adjusted Signal
17.3
Raw Pattern Score
100%
Time Factor
2026-10-09
Last Push
2.5K
Stars
Python
Language
70.0K
Lines of Code
320
Files
945
Pattern Hits
2026-10-12
Scan Date
0.16
HC Hit Rate

Risk Review · v3

Use each vector to guide manual verification of the underlying findings.

Cognitive Ownership Risk 42.0/100 · MEDIUM

Can maintainers explain intent, assumptions, and trade-offs? 617 finding(s).

Hallucinated Dependency & Supply Chain Risk 16.7/100 · LOW

Are imports declared and package/API names verified? 262 finding(s).

Agent Over-Engineering Ratio 33.5/100 · MEDIUM

Are wrappers, guards, and repeated structures necessary? 431 finding(s).

PR Review Velocity Impact 59.4/100 · HIGH

Which changes need focused human review? 945 finding(s).

What These Metrics Mean

Adjusted Signal
Legacy pattern score normalized per 1,000 scanned lines and multiplied by the repository-level time factor. It is not an estimate of AI authorship.
Raw Pattern Score
Sum of severity- and context-weighted pattern findings before applying the time factor.
Time Factor
A coarse multiplier based on repository last-push metadata. It does not identify when individual code was written.
Pattern Hits
Count of configured pattern findings. Review each location and surrounding code before acting.
HC Hit Rate
High- and critical-severity findings per scanned file. Severity is a configured detector weight, not proof of a vulnerability or authorship.
Lines / Files
Scan coverage denominators used by the legacy normalized score.

Pattern-Signal History

This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.

Severity Breakdown

Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.

CRITICAL 0HIGH 50MEDIUM 34LOW 861

Directory Score Breakdown

This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.

Pattern Findings

The scanner identified 945 distinct pattern matches across 17 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.

Hyper-Verbose Identifiers356 hits · 367 pts
SeverityFileLineSnippetContext
LOWnoxfile.py107def build_cocotb_for_dev_test(session: nox.Session) -> None:CODE
LOWnoxfile.py452def release_install_from_sdist(session: nox.Session) -> None:CODE
LOWnoxfile.py498def release_install_from_wheel(session: nox.Session) -> None:CODE
LOWtests/pytest_plugin/test_fixture.py33async def x_async_generator_fixture() -> AsyncGenerator[int, None]:CODE
LOWtests/pytest_plugin/test_fixture.py48async def test_fixture_asynchronous_value(dut, x_async: int) -> None:CODE
LOWtests/pytest_plugin/test_fixture.py53async def test_fixture_asynchronous_generator(dut, x_async_generator: int) -> None:CODE
LOWtests/pytest_plugin/test_timeout.py16async def test_timeout_with_positional_arguments(dut) -> None:CODE
LOWtests/pytest_plugin/test_timeout.py24async def test_timeout_with_named_arguments(dut) -> None:CODE
LOW⚡tests/pytest_plugin/test_cocotb.py94async def test_xfail_condition_false(dut) -> None:CODE
LOW⚡tests/pytest_plugin/test_cocotb.py99async def test_xfail_condition_true(dut) -> None:CODE
LOW⚡tests/pytest_plugin/test_cocotb.py105async def test_xfail_reason_message(dut) -> None:CODE
LOWtests/pytest_plugin/test_sample_module.py81def test_sample_module_parametrize(sample_module: HDL, int_param: int) -> None:CODE
LOWtests/pytest/test_ipython_support.py65def test_ipython_support_interactive(tmp_path: Path) -> None:CODE
LOWtests/pytest/test_logging_with_envs.py23def _restore_root_handler_filters() -> Iterator[None]:CODE
LOWtests/pytest/test_logging_with_envs.py80def test_logging_boolean_envs(CODE
LOWtests/pytest/test_logging_with_envs.py113def test_default_config_no_simulator(caplog: LogCaptureFixture) -> None:CODE
LOWtests/pytest/test_xunit_reporter.py279def test_file_outside_workspace(tmp_path: Path) -> None:CODE
LOWtests/pytest/test_preview.py109def test_envvar_empty_feature(monkeypatch: pytest.MonkeyPatch) -> None:CODE
LOWtests/pytest/test_preview.py118def test_envvar_unknown_feature(monkeypatch: pytest.MonkeyPatch) -> None:CODE
LOWtests/pytest/test_array.py13def test_value_only_construction():CODE
LOWtests/pytest/test_array.py30def test_range_int_construction():CODE
LOWtests/pytest/test_array.py137def test_slicing_infered_start_stop():CODE
LOW⚡tests/pytest/test_array.py151def test_slice_direction_mismatch():CODE
LOW⚡tests/pytest/test_array.py159def test_set_slice_wrong_length():CODE
LOW⚡tests/pytest/test_array.py165def test_slice_correct_infered():CODE
LOWtests/pytest/test_logic_array.py13def test_logic_array_str_construction():CODE
LOWtests/pytest/test_logic_array.py31def test_logic_array_iterable_construction():CODE
LOWtests/pytest/test_logic_array.py53def test_logic_array_int_construction():CODE
LOWtests/pytest/test_logic_array.py71def test_logic_array_copy_construction():CODE
LOWtests/pytest/test_logic_array.py87def test_logic_array_bad_construction():CODE
LOWtests/pytest/test_logic_array.py98def test_logic_array_unsigned_conversion():CODE
LOWtests/pytest/test_logic_array.py121def test_logic_array_signed_conversion():CODE
LOWtests/pytest/test_logic_array.py148def test_logic_array_bytes_conversion():CODE
LOWtests/pytest/test_logic_array.py171def test_logic_array_properties():CODE
LOWtests/pytest/test_logic_array.py176def test_logic_array_properties_deprecated():CODE
LOWtests/pytest/test_logic_array.py278def test_logic_array_literal_casts():CODE
LOWtests/pytest/test_logic_array.py283def test_logic_array_index_casts():CODE
LOWtests/pytest/test_logic_array.py391def test_slicing_infered_start_stop():CODE
LOW⚡tests/pytest/test_logic_array.py405def test_slice_direction_mismatch():CODE
LOW⚡tests/pytest/test_logic_array.py413def test_set_slice_wrong_length():CODE
LOW⚡tests/pytest/test_logic_array.py419def test_slice_correct_infered():CODE
LOWtests/pytest/test_env.py45def test_env_exists_undefined(monkeypatch: MonkeyPatch) -> None:CODE
LOWtests/pytest/test_env.py224def test_env_cocotb_testcase_deprecated(monkeypatch: MonkeyPatch) -> None:CODE
LOWtests/pytest/test_env.py235def test_env_cocotb_test_modules_empty(monkeypatch: MonkeyPatch) -> None:CODE
LOWtests/pytest/test_env.py249def test_env_cocotb_test_modules_undefined(monkeypatch: MonkeyPatch) -> None:CODE
LOWtests/pytest/test_env.py263def test_env_cocotb_testcase_with_cocotb_test_filter(monkeypatch: MonkeyPatch) -> None:CODE
LOWtests/pytest/test_env.py277def test_env_cocotb_random_seed(monkeypatch: MonkeyPatch) -> None:CODE
LOWtests/pytest/test_env.py288def test_env_random_seed_deprecated(monkeypatch: MonkeyPatch) -> None:CODE
LOWtests/pytest/test_env.py300def test_plusargs_ntb_random_seed_deprecated(monkeypatch: MonkeyPatch) -> None:CODE
LOWtests/pytest/test_env.py313def test_plusargs_seed_deprecated(monkeypatch: MonkeyPatch) -> None:CODE
LOWtests/pytest/test_env.py326def test_env_cocotb_enable_profiling(monkeypatch: MonkeyPatch) -> None:CODE
LOWtests/pytest/test_env.py338def test_env_cocotb_resolve_x_weak(monkeypatch: MonkeyPatch) -> None:CODE
LOWtests/pytest/test_env.py352def test_env_cocotb_resolve_x_value_error(monkeypatch: MonkeyPatch) -> None:CODE
LOWtests/pytest/test_env.py363def test_env_cocotb_resolve_x_invalid(monkeypatch: MonkeyPatch) -> None:CODE
LOWtests/pytest/test_env.py377def test_env_cocotb_resolve_x_logic_conversion(resolver: str, tmp_path: Path) -> None:CODE
LOWtests/pytest/test_gpi.py16def test_gpi_impl_missing_entry_point() -> None:CODE
LOWtests/pytest/test_runner.py55def test_sv_literal_conversion():CODE
LOWtests/pytest/test_runner.py79def test_vhdl_literal_conversion():CODE
LOWtests/pytest/test_bootstrap.py33def test_bootstrap_entry_point_failure(entry_point: str, expected_message: str) -> None:CODE
LOWtests/pytest/test_parameterize.py44def test_parametrize_bad_args():CODE
296 more matches not shown…
Unused Imports262 hits · 256 pts
SeverityFileLineSnippetContext
LOWsetup.py5CODE
LOWnoxfile.py4CODE
LOWtests/pytest_plugin/conftest.py7CODE
LOWtests/pytest_plugin/test_fixture.py7CODE
LOWtests/pytest_plugin/test_timeout.py7CODE
LOWtests/pytest_plugin/test_cocotb.py7CODE
LOWtests/pytest_plugin/test_session.py7CODE
LOWtests/pytest_plugin/test_xfail.py7CODE
LOWtests/pytest_plugin/test_parametrize.py7CODE
LOWtests/pytest_plugin/test_sample_module_1.py7CODE
LOWtests/pytest_plugin/test_caplog.py7CODE
LOWtests/pytest_plugin/test_sample_module_2.py7CODE
LOWtests/pytest_plugin/test_cocotb_top.py7CODE
LOWtests/pytest_plugin/test_end_test.py7CODE
LOWtests/pytest_plugin/test_sample_module.py7CODE
LOWtests/pytest/test_ipython_support.py4CODE
LOWtests/pytest/test_logging_with_envs.py7CODE
LOWtests/pytest/test_vhdl_libraries_multiple.py4CODE
LOWtests/pytest/test_plusargs.py4CODE
LOWtests/pytest/test_xunit_reporter.py7CODE
LOWtests/pytest/test_timescale.py1CODE
LOWtests/pytest/test_preview.py4CODE
LOWtests/pytest/test_cocotb.py4CODE
LOWtests/pytest/test_waves.py1CODE
LOWtests/pytest/test_array.py4CODE
LOWtests/pytest/test_logic_array.py4CODE
LOWtests/pytest/test_env.py8CODE
LOWtests/pytest/test_env.py30CODE
LOWtests/pytest/test_gpi.py7CODE
LOWtests/pytest/test_runner.py4CODE
LOWtests/pytest/test_logs.py4CODE
LOWtests/pytest/test_lib_metadata.py4CODE
LOWtests/pytest/test_bootstrap.py7CODE
LOWtests/pytest/test_parameterize.py4CODE
LOWtests/pytest/test_range.py4CODE
LOWtests/pytest/test_parallel_cocotb.py4CODE
LOWtests/pytest/test_logic.py4CODE
LOWtests/pytest/test_no_previews.py4CODE
LOW…ses/test_verilator_timing_c/test_verilator_timing_c.py4CODE
LOW…test_cases/test_iteration_verilog/test_iteration_es.py5CODE
LOW…ses/test_verilator_timing_d/test_verilator_timing_d.py4CODE
LOW…_cases/test_indexing_warning/indexing_warning_tests.py4CODE
LOW…t_cases/test_indexing_warning/test_indexing_warning.py4CODE
LOWtests/test_cases/test_select_testcase_error/x_tests.py4CODE
LOWtests/test_cases/test_skip/test_skip.py4CODE
LOWtests/test_cases/test_exit_error/test_exit.py1CODE
LOWtests/test_cases/test_plusargs/plusargs.py11CODE
LOWtests/test_cases/test_deadlock/test_deadlock.py5CODE
LOWtests/test_cases/test_array/test_array.py5CODE
LOW…ses/test_verilator_timing_b/test_verilator_timing_b.py4CODE
LOW…_skipped_explicitly_run/test_skipped_explicitly_run.py4CODE
LOWtests/test_cases/test_vhdl_integer/test_vhdl_integer.py4CODE
LOWtests/test_cases/test_max_failures/test_max_failures.py4CODE
LOWtests/test_cases/test_select_testcase/y_tests.py4CODE
LOWtests/test_cases/test_select_testcase/x_tests.py4CODE
LOWtests/test_cases/test_select_testcase/y_tests_again.py4CODE
LOW…incident_triggers/test_first_on_coincident_triggers.py4CODE
LOWtests/test_cases/test_null_ranges/test_null_ranges.py4CODE
LOWtests/test_cases/test_iteration_vhdl/test_iteration.py5CODE
LOW…t_cases/test_forked_exception/test_forked_exception.py11CODE
202 more matches not shown…
Over-Commented Block158 hits · 153 pts
SeverityFileLineSnippetContext
LOWpyproject.toml221# - CPython on Linux x86_64 with glibcCOMMENT
LOWnoxfile.py381 )COMMENT
LOWnoxfile.py841 )COMMENT
LOWtests/test_cases/test_discovery/test_discovery.py521COMMENT
LOWdocs/source/conf.py161# non-false value, then it is used:COMMENT
LOWdocs/source/conf.py181# add_function_parentheses = TrueCOMMENT
LOWdocs/source/conf.py221 },COMMENT
LOWdocs/source/conf.py241# html_theme_path = []COMMENT
LOWdocs/source/conf.py261html_js_files = ["cocotb.js"]COMMENT
LOWdocs/source/conf.py281# If false, no index is generated.COMMENT
LOWdocs/source/conf.py301# This is the file name suffix for HTML files (e.g. ".xhtml").COMMENT
LOWdocs/source/conf.py321latex_documents = [COMMENT
LOWdocs/source/conf.py341COMMENT
LOWdocs/source/_static/cocotb.css401// dl.field-list.simple ~ *:not(.versionadded):not(.versionchanged):not(.deprecated):not(.versionremoved) {COMMENT
LOW.github/workflows/backport.yml1# Copyright cocotb contributorsCOMMENT
LOW.github/workflows/ecosystem-compat.yml1# Copyright cocotb contributorsCOMMENT
LOW.github/workflows/release-3-backport-notes.yml1# Copyright cocotb contributorsCOMMENT
LOW.github/workflows/release-1-prepare.yml1# Copyright cocotb contributorsCOMMENT
LOW.github/workflows/release-1-prepare.yml21# Always pass the *final* version here, even when the plan is to tag one orCOMMENT
LOW.github/workflows/release-2-tag.yml1# Copyright cocotb contributorsCOMMENT
LOWsrc/cocotb_tools/_vendor/__init__.py1# Copyright cocotb contributorsCOMMENT
LOWsrc/cocotb_tools/_vendor/distutils_version.py1# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,COMMENT
LOWsrc/cocotb_tools/_vendor/distutils_version.py81COMMENT
LOWsrc/cocotb_tools/_vendor/distutils_version.py201 assert False, "never get here"COMMENT
LOWsrc/cocotb_tools/_vendor/distutils_version.py221# However, people insist on putting letters into their version numbers;COMMENT
LOWsrc/cocotb_tools/_vendor/distutils_version.py241# Two possible solutions come to mind. The first is to tie theCOMMENT
LOWsrc/cocotb_tools/_pytest/_controller.py61 """COMMENT
LOWsrc/cocotb/_vendor/vpi/vpi_compatibility.h21#if VPI_COMPATIBILITY_VERSION_1800v2017COMMENT
LOWsrc/cocotb/_vendor/vpi/vpi_compatibility.h41#define vpi_put_value vpi_put_value_1364v1995COMMENT
LOWsrc/cocotb/_vendor/vpi/vpi_compatibility.h61#define vpi_put_value vpi_put_value_1364v2001COMMENT
LOWsrc/cocotb/_vendor/vpi/vpi_compatibility.h81#define vpi_put_value vpi_put_value_1364v2005COMMENT
LOWsrc/cocotb/_vendor/vpi/vpi_compatibility.h101#define vpi_put_value vpi_put_value_1800v2005COMMENT
LOWsrc/cocotb/_vendor/vpi/vpi_compatibility.h121#define vpi_put_value vpi_put_value_1800v2009COMMENT
LOWsrc/cocotb/_vendor/vpi/vpi_compatibility.h141#define vpi_put_value vpi_put_value_1800v2012COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h21* - propertiesCOMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h41#define vpiModport 606COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h61#define vpiClassObj 621COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h81#define vpiUnionTypespec 639COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h101#define vpiThread 647COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h121#define vpiSequenceDecl 661COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h141#define vpiForeachStmt 675COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h161#define vpiStructNet 683COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h181#define vpiIndexTypespec 702COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h201COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h241#define vpiExternAcc 2COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h261#define vpiModportPort 2COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h281COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h301#define vpiMethod 645COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h321#define vpiMode1364v2001 2COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h341#define vpiDPIContext 666COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h361#define vpiUntilOp 92 /* until operator */COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h381#define vpiIffOp 68 /* iff operator */COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h441#define vpiAssertCoverage 760COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h461#define vpiFsmStates 775COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h481#define cbAssertionUnlock 662COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h501#define cbAssertionSysReset 619COMMENT
LOWsrc/cocotb/_vendor/vpi/sv_vpi_user.h521#define vpiAssertionSysOn 627COMMENT
LOWsrc/cocotb/_vendor/vpi/vpi_user.h61#ifndef PLI_DLLISPECCOMMENT
LOWsrc/cocotb/_vendor/vpi/vpi_user.h81#ifndef PLI_EXTERNCOMMENT
LOWsrc/cocotb/_vendor/vpi/vpi_user.h101COMMENT
98 more matches not shown…
Docstring Block Structure24 hits · 120 pts
SeverityFileLineSnippetContext
HIGHsrc/cocotb_tools/runner.py501Run the tests. Args: test_module: Name(s) of the Python module(s) containing the tests to run. STRING
HIGHsrc/cocotb_tools/sim_versions.py132Parse the output of ``verilator --version``. Example: >>> cmdline = "Verilator 5.041 devel rev v5.0STRING
HIGHsrc/cocotb_tools/_env.py47Convert value of environment variable to Python boolean type. Function is case-insensitive. Args: nameSTRING
HIGHsrc/cocotb_tools/_pytest/mark.py81Mark coroutine function with simulation time duration before the test is forced to fail. Example usage: .. codSTRING
HIGHsrc/cocotb_tools/_pytest/hdl.py337Test HDL design. Args: test_module: Name(s) of the Python module(s) containing the STRING
HIGHsrc/cocotb/_concurrent_waiters.py70Await on all given *awaitables* concurrently and block until the *return_when* condition is met. Every :class:`~colSTRING
HIGHsrc/cocotb/_concurrent_waiters.py209Await on all given *awaitables* concurrently and return the index and result of the first to complete. After the fiSTRING
HIGHsrc/cocotb/handle.py367Translate a discovered child object name into a key. Args: name: The GPI name of the child object. STRING
HIGHsrc/cocotb/handle.py485Query the simulator for an object with the specified *name*. If *extended* is ``True``, run the query only for STRING
HIGHsrc/cocotb/handle.py1897Factory function to create the correct type of `SimHandle` object. Args: handle: The GPI handle to the simuSTRING
HIGHsrc/cocotb/clock.py275Start driving the clock signal. You can later stop the clock by calling :meth:`stop`. Args: STRING
HIGHsrc/cocotb/_extended_awaitables.py302Wait on any awaitable, throw an exception if it waits longer than the given time. When a :term:`python:coroutine` iSTRING
HIGHsrc/cocotb/_test_manager.py226 Schedule a :term:`coroutine` to be run concurrently in a :class:`~cocotb.task.Task`. Note that this is not an STRING
HIGHsrc/cocotb/_bridge.py37Converts a coroutine function into a blocking function. This allows a :term:`coroutine function` that awaits cocotbSTRING
HIGHsrc/cocotb/utils.py36Calculate simulation time in the specified *unit* from the *steps* based on the simulator precision. Args: STRING
HIGHsrc/cocotb/utils.py72Calculates the number of simulation time steps for a given amount of *time*. When *round_mode* is ``"error"``, a :eSTRING
HIGHsrc/cocotb/simtime.py127Retrieve the simulation time from the simulator. Args: unit: String specifying the unit of the result STRING
HIGHsrc/cocotb/simtime.py227Retrieve the ``log10()`` of the scale factor for a given time unit. Args: unit: String specifying the unit STRING
HIGHsrc/cocotb/types/_logic_array.py364Construct a :class:`!LogicArray` from an :class:`int` with unsigned representation. The :class:`int` is treatedSTRING
HIGHsrc/cocotb/types/_logic_array.py442Construct a :class:`!LogicArray` from an :class:`int` with two's complement representation. The :class:`int` isSTRING
HIGHsrc/cocotb/types/_logic_array.py523Construct a :class:`!LogicArray` from :class:`bytes`. The :class:`bytes` is first converted to an unsigned inteSTRING
HIGHsrc/cocotb/types/_logic_array.py980Resolves non-0/1 values to 0/1. The possible values of the *resolver* argument are: * ``"weak"``: STRING
HIGHsrc/cocotb/types/_logic.py271Resolve non-``0``/``1`` values to ``0``/``1``. The possible values of the *resolver* argument are: * `STRING
HIGHsrc/cocotb/types/_abstract_array.py95Find first occurrence of value. Args: value: Value to search for. start: Index to startSTRING
Empty Error Handlers20 hits · 100 pts
SeverityFileLineSnippetContext
HIGH…incident_triggers/test_first_on_coincident_triggers.py30except AssertionError:CODE
HIGHtests/test_cases/test_cocotb/test_task_manager.py892except CancelledError:CODE
HIGHtests/test_cases/test_cocotb/test_task_manager.py906except CancelledError:CODE
HIGHtests/test_cases/test_cocotb/test_task_manager.py817except CancelledError:CODE
HIGHtests/test_cases/test_cocotb/test_task_manager.py867except CancelledError:CODE
HIGHtests/test_cases/test_cocotb/test_task_manager.py1363except CancelledError:CODE
HIGHtests/test_cases/test_cocotb/test_task_manager.py1411except CancelledError:CODE
HIGHtests/test_cases/test_cocotb/test_task_manager.py1493except CancelledError:CODE
HIGHtests/test_cases/test_cocotb/test_async_coroutines.py36except MyException:CODE
HIGH…t_cases/test_cocotb/test_synchronization_primitives.py69except RuntimeError:CODE
HIGHsrc/cocotb_tools/combine_results.py137except ValueError:CODE
HIGHsrc/cocotb_tools/_vendor/distutils_version.py318except ValueError:CODE
HIGHsrc/cocotb_tools/_pytest/_logging.py73except RecursionError:CODE
HIGHsrc/cocotb_tools/_pytest/_regression.py921except Exit:CODE
HIGHsrc/cocotb_tools/_pytest/_regression.py788except StopAsyncIteration:CODE
HIGHsrc/cocotb/handle.py1914except KeyError:CODE
HIGHsrc/cocotb/handle.py326except KeyError:CODE
HIGHsrc/cocotb/handle.py1093except KeyError:CODE
HIGHsrc/cocotb/handle.py1381except KeyError:CODE
HIGHsrc/cocotb/_xunit_reporter.py248except ValueError:CODE
Self-Referential Comments21 hits · 66 pts
SeverityFileLineSnippetContext
MEDIUMtests/test_cases/test_cocotb/test_edge_triggers.py483 # Create a fresh trigger (not the cached dut.clk.rising_edge) so thatCOMMENT
MEDIUMdocs/source/conf.py5# This file is execfile()d with the current directory set to its containing dir.COMMENT
MEDIUMexamples/analog_model/afe.py1# This file is public domain, it can be freely copied without restrictions.COMMENT
MEDIUMexamples/analog_model/test_analog_model.py1# This file is public domain, it can be freely copied without restrictions.COMMENT
MEDIUMexamples/simple_dff/test_dff.py1# This file is public domain, it can be freely copied without restrictions.COMMENT
MEDIUMexamples/simple_dff/test_dff.py24 # Create a 10us period clock driver on port `clk`COMMENT
MEDIUMexamples/mixed_signal/tests/test_rescap.py1# This file is public domain, it can be freely copied without restrictions.COMMENT
MEDIUMexamples/mixed_signal/tests/test_regulator_plot.py1# This file is public domain, it can be freely copied without restrictions.COMMENT
MEDIUMexamples/mixed_signal/tests/test_regulator_trim.py1# This file is public domain, it can be freely copied without restrictions.COMMENT
MEDIUMexamples/mixed_signal/tests/test_rescap_minimalist.py1# This file is public domain, it can be freely copied without restrictions.COMMENT
MEDIUMexamples/adder/tests/test_adder.py1# This file is public domain, it can be freely copied without restrictions.COMMENT
MEDIUMexamples/adder/model/adder_model.py1# This file is public domain, it can be freely copied without restrictions.COMMENT
MEDIUMexamples/first_steps/counter_tests.py1# This file is public domain, it can be freely copied without restrictions.COMMENT
MEDIUM…les/matrix_multiplier/tests/matrix_multiplier_tests.py1# This file is public domain, it can be freely copied without restrictions.COMMENT
MEDIUM…les/matrix_multiplier/tests/matrix_multiplier_tests.py442 # Create the testbench, start it and go through resetCOMMENT
MEDIUM…ples/matrix_multiplier/tests/test_matrix_multiplier.py1# This file is public domain, it can be freely copied without restrictions.COMMENT
MEDIUMsrc/cocotb_tools/_pytest/_regression.py163 # Initialize configuration object needed for pytestCOMMENT
MEDIUMsrc/cocotb/_task_manager.py111 # Create the Task and tie it to this TaskManager via the done callback.STRING
MEDIUM⚡src/cocotb/_bridge.py255 # Create a threadCOMMENT
MEDIUM⚡src/cocotb/_bridge.py256 # Create a trigger that is called as a result of the thread finishingCOMMENT
MEDIUM⚡src/cocotb/_bridge.py257 # Create an Event object that the caller can await onCOMMENT
Deep Nesting41 hits · 40 pts
SeverityFileLineSnippetContext
LOWtests/pytest/test_waves.py77CODE
LOWtests/test_cases/test_array/test_array.py191CODE
LOW…les/matrix_multiplier/tests/matrix_multiplier_tests.py182CODE
LOW…ples/matrix_multiplier/tests/test_matrix_multiplier.py18CODE
LOWsrc/cocotb_tools/runner.py119CODE
LOWsrc/cocotb_tools/runner.py236CODE
LOWsrc/cocotb_tools/runner.py1478CODE
LOWsrc/cocotb_tools/runner.py1666CODE
LOWsrc/cocotb_tools/config.py306CODE
LOWsrc/cocotb_tools/combine_results.py82CODE
LOWsrc/cocotb_tools/_vendor/distutils_version.py167CODE
LOWsrc/cocotb_tools/_pytest/hdl.py438CODE
LOWsrc/cocotb_tools/_pytest/_regression.py750CODE
LOWsrc/cocotb_tools/_pytest/_controller.py244CODE
LOWsrc/cocotb_tools/_pytest/_controller.py362CODE
LOWsrc/cocotb_tools/_pytest/plugin.py671CODE
LOWsrc/cocotb_tools/_pytest/plugin.py739CODE
LOWsrc/cocotb_tools/_pytest/_option.py68CODE
LOWsrc/cocotb/task.py107CODE
LOWsrc/cocotb/task.py232CODE
LOWsrc/cocotb/task.py326CODE
LOWsrc/cocotb/task.py455CODE
LOWsrc/cocotb/task.py586CODE
LOWsrc/cocotb/_task_manager.py228CODE
LOWsrc/cocotb/regression.py246CODE
LOWsrc/cocotb/regression.py511CODE
LOWsrc/cocotb/regression.py979CODE
LOWsrc/cocotb/_init.py169CODE
LOWsrc/cocotb/_extended_awaitables.py240CODE
LOWsrc/cocotb/_bridge.py162CODE
LOWsrc/cocotb/_decorators.py245CODE
LOWsrc/cocotb/_decorators.py446CODE
LOWsrc/cocotb/_decorators.py608CODE
LOWsrc/cocotb/_decorators.py168CODE
LOWsrc/cocotb/_decorators.py650CODE
LOWsrc/cocotb/simtime.py195CODE
LOWsrc/cocotb/_event_loop.py44CODE
LOWsrc/cocotb/_test_factory.py140CODE
LOWsrc/cocotb/types/_logic_array.py241CODE
LOWsrc/cocotb/types/_logic_array.py589CODE
LOWsrc/cocotb/types/_logic_array.py1023CODE
Decorative Section Separators10 hits · 33 pts
SeverityFileLineSnippetContext
MEDIUM⚡tests/test_cases/test_cocotb/test_testfactory.py121# -----------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/test_cases/test_cocotb/test_testfactory.py123# -----------------------------------------------------------------------------COMMENT
MEDIUMtests/test_cases/test_cocotb/test_testfactory.py174# -----------------------------------------------------------------------------COMMENT
MEDIUMtests/test_cases/test_cocotb/test_testfactory.py176# -----------------------------------------------------------------------------COMMENT
MEDIUMsrc/cocotb/types/_logic.py154 # -----------------------------------------------------COMMENT
MEDIUMsrc/cocotb/types/_logic.py156 # -----------------------------------------------------COMMENT
MEDIUMsrc/cocotb/types/_logic.py177 # -----------------------------------------------------COMMENT
MEDIUMsrc/cocotb/types/_logic.py179 # -----------------------------------------------------COMMENT
MEDIUMsrc/cocotb/types/_logic.py200 # -----------------------------------------------------COMMENT
MEDIUMsrc/cocotb/types/_logic.py202 # -----------------------------------------------------COMMENT
Cross-File Repetition6 hits · 30 pts
SeverityFileLineSnippetContext
HIGHexamples/mixed_language/tests/test_mixed_language.py0simulate the matrix_multiplier example using the python runner. this file can be run directly or via pytest discovery.STRING
HIGHexamples/adder/tests/test_adder.py0simulate the matrix_multiplier example using the python runner. this file can be run directly or via pytest discovery.STRING
HIGH…ples/matrix_multiplier/tests/test_matrix_multiplier.py0simulate the matrix_multiplier example using the python runner. this file can be run directly or via pytest discovery.STRING
HIGHsrc/cocotb/_extended_awaitables.py0a collection of triggers which a testbench can :keyword:`await`.STRING
HIGHsrc/cocotb/_gpi_triggers.py0a collection of triggers which a testbench can :keyword:`await`.STRING
HIGHsrc/cocotb/_base_triggers.py0a collection of triggers which a testbench can :keyword:`await`.STRING
Modern Structural Boilerplate23 hits · 22 pts
SeverityFileLineSnippetContext
LOWtests/pytest/test_logging_with_envs.py60def _set_env(monkeypatch: MonkeyPatch, name: str, value: str | None) -> None:CODE
LOWsrc/cocotb_tools/runner.py276 def _set_env_common(self) -> None:CODE
LOWsrc/cocotb_tools/runner.py308 def _set_env_build(self) -> None:CODE
LOWsrc/cocotb_tools/runner.py311 def _set_env_test(self) -> None:CODE
LOWsrc/cocotb_tools/runner.py789 def _set_vhdl_sources(self, sources: Sequence[PathLike | VHDL]) -> None:CODE
LOWsrc/cocotb_tools/runner.py837 def _set_build_args(self, build_args: Sequence[str | Verilog | VHDL]) -> None:CODE
LOWsrc/cocotb_tools/runner.py913 def _set_env_test(self) -> None:CODE
LOWsrc/cocotb_tools/runner.py1407 def _set_env_test(self) -> None:CODE
LOWsrc/cocotb_tools/runner.py1554 def _set_env_test(self) -> None:CODE
LOWsrc/cocotb_tools/runner.py1651 def _set_env_build(self) -> None:CODE
LOWsrc/cocotb_tools/runner.py1878 def _set_env_test(self) -> None:CODE
LOWsrc/cocotb_tools/runner.py2189 def _set_env_build(self) -> None:CODE
LOWsrc/cocotb_tools/runner.py2195 def _set_env_test(self) -> None:CODE
LOWsrc/cocotb_tools/runner.py2299 def _set_env_test(self) -> None:CODE
LOWsrc/cocotb_tools/_pytest/_regression.py391 def _setup_completed(self) -> None:CODE
LOWsrc/cocotb/logging.py157 def set_level(logger_name: str, envvar: str) -> None:CODE
LOWsrc/cocotb/logging.py180def _setup_gpi_logger() -> None:CODE
LOWsrc/cocotb/task.py191 def set_name(self, value: object) -> None:STRING
LOWsrc/cocotb/regression.py300 def set_mode(self, mode: RegressionMode) -> None:CODE
LOWsrc/cocotb/regression.py1144def _setup_regression_manager() -> None:CODE
LOWsrc/cocotb/_init.py169def _setup_random_seed() -> None:CODE
LOWsrc/cocotb/_init.py206def _setup_root_handle() -> None:CODE
LOWsrc/cocotb/_deprecation.py14__all__ = ["deprecated"]CODE
AI Structural Patterns9 hits · 8 pts
SeverityFileLineSnippetContext
LOWtests/test_cases/test_async_bridge/test_async_bridge.py188CODE
LOWtests/test_cases/test_async_bridge/test_async_bridge.py192CODE
LOWsrc/cocotb_tools/runner.py338CODE
LOWsrc/cocotb_tools/runner.py476CODE
LOWsrc/cocotb_tools/_pytest/hdl.py218CODE
LOWsrc/cocotb_tools/_pytest/hdl.py316CODE
LOWsrc/cocotb_tools/_pytest/_regression.py91CODE
LOWsrc/cocotb/_decorators.py282CODE
LOWsrc/cocotb/_test_factory.py140CODE
Excessive Try-Catch Wrapping5 hits · 6 pts
SeverityFileLineSnippetContext
LOWsrc/cocotb_tools/_pytest/_regression.py763 except Exception: # noqa: BLE001CODE
LOWsrc/pygpi/entry.py32 except Exception as e:CODE
LOWsrc/cocotb/task.py445 except Exception as e: # noqa: BLE001STRING
LOWsrc/cocotb/regression.py411 except Exception: # noqa: BLE001CODE
MEDIUMsrc/cocotb/_decorators.py336def my_test(dut):CODE
Redundant / Tautological Comments5 hits · 4 pts
SeverityFileLineSnippetContext
LOW…ts/test_cases/test_force_release/test_force_release.py209 # Check if the driven signal is actually released.COMMENT
LOWsrc/cocotb_tools/_pytest/_runner.py55 # Check if test_module exists as Python fileCOMMENT
LOWsrc/cocotb/task.py382 # Print the message only if it existsSTRING
LOWsrc/cocotb/task.py560 # Set state to do cancelSTRING
LOWsrc/cocotb/task.py609 # Set state to do cancelSTRING
Dead Code2 hits · 4 pts
SeverityFileLineSnippetContext
MEDIUMtests/test_cases/test_kill_sim/kill_sim_tests.py59CODE
MEDIUMtests/test_cases/test_kill_sim/kill_sim_tests.py86CODE
TODO Padding1 hit · 2 pts
SeverityFileLineSnippetContext
LOW⚡tests/test_cases/test_discovery/test_discovery.py330# TODO: add tests for Verilog "string_input_port" and "STRING_LOCALPARAM" (see issue #802)COMMENT
Slop Phrases1 hit · 2 pts
SeverityFileLineSnippetContext
LOWsrc/cocotb_tools/config.py56 # NOTE: make sure to keep "helpmsg" aligned with docs/source/library_reference.rstCOMMENT
Overly Generic Function Names1 hit · 1 pts
SeverityFileLineSnippetContext
LOWtests/test_cases/test_cocotb/test_deprecated.py178 async def do_something():CODE