Repository Analysis

python-trio/trio

Trio – a friendly Python library for async concurrency and I/O

28.0 Moderate AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of python-trio/trio, a Python project with 7,295 GitHub stars. SynthScan v2.0 examined 52,145 lines of code across 185 source files, recording 1684 pattern matches distributed across 17 syntactic categories. The overall adjusted score of 28.0 places this repository in the Moderate AI signal band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

28.0
Adjusted Score
28.0
Raw Score
100%
Time Factor
2026-07-13
Last Push
7.3K
Stars
Python
Language
52.1K
Lines of Code
185
Files
1.7K
Pattern Hits
2026-07-14
Scan Date
0.17
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 0HIGH 31MEDIUM 18LOW 1635

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 1684 distinct pattern matches across 17 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. 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 diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Unused Imports952 hits · 601 pts
SeverityFileLineSnippetContext
LOWdocs/source/conf.py19CODE
LOWdocs/source/conf.py35CODE
LOWdocs/source/local_customization.py1CODE
LOWdocs/source/local_customization.py5CODE
LOWdocs/source/local_customization.py8CODE
LOWdocs/source/local_customization.py8CODE
LOWdocs/source/local_customization.py8CODE
LOWdocs/source/local_customization.py8CODE
LOWdocs/source/typevars.py6CODE
LOWsrc/trio/_signals.py1CODE
LOWsrc/trio/_path.py1CODE
LOWsrc/trio/_highlevel_open_unix_stream.py1CODE
LOWsrc/trio/_ssl.py1CODE
LOWsrc/trio/_highlevel_open_tcp_listeners.py1CODE
LOWsrc/trio/_socket.py1CODE
LOWsrc/trio/_abc.py1CODE
LOWsrc/trio/_subprocess.py1CODE
LOWsrc/trio/_highlevel_serve_listeners.py1CODE
LOWsrc/trio/_channel.py1CODE
LOWsrc/trio/_timeouts.py1CODE
LOWsrc/trio/to_thread.py1CODE
LOWsrc/trio/to_thread.py1CODE
LOWsrc/trio/_deprecate.py1CODE
LOWsrc/trio/_windows_pipes.py1CODE
LOWsrc/trio/__init__.py3CODE
LOWsrc/trio/__init__.py22CODE
LOWsrc/trio/__init__.py26CODE
LOWsrc/trio/__init__.py26CODE
LOWsrc/trio/__init__.py26CODE
LOWsrc/trio/__init__.py26CODE
LOWsrc/trio/__init__.py26CODE
LOWsrc/trio/__init__.py33CODE
LOWsrc/trio/__init__.py33CODE
LOWsrc/trio/__init__.py33CODE
LOWsrc/trio/__init__.py33CODE
LOWsrc/trio/__init__.py33CODE
LOWsrc/trio/__init__.py33CODE
LOWsrc/trio/__init__.py33CODE
LOWsrc/trio/__init__.py33CODE
LOWsrc/trio/__init__.py33CODE
LOWsrc/trio/__init__.py33CODE
LOWsrc/trio/__init__.py33CODE
LOWsrc/trio/__init__.py33CODE
LOWsrc/trio/__init__.py33CODE
LOWsrc/trio/__init__.py33CODE
LOWsrc/trio/__init__.py33CODE
LOWsrc/trio/__init__.py50CODE
LOWsrc/trio/__init__.py51CODE
LOWsrc/trio/__init__.py51CODE
LOWsrc/trio/__init__.py51CODE
LOWsrc/trio/__init__.py56CODE
LOWsrc/trio/__init__.py56CODE
LOWsrc/trio/__init__.py57CODE
LOWsrc/trio/__init__.py57CODE
LOWsrc/trio/__init__.py61CODE
LOWsrc/trio/__init__.py61CODE
LOWsrc/trio/__init__.py65CODE
LOWsrc/trio/__init__.py66CODE
LOWsrc/trio/__init__.py67CODE
LOWsrc/trio/__init__.py68CODE
892 more matches not shown…
Hyper-Verbose Identifiers457 hits · 432 pts
SeverityFileLineSnippetContext
LOWdocs/source/conf.py147def autodoc_process_signature(CODE
LOWdocs/source/conf.py181def autodoc_process_docstring(CODE
LOWsrc/trio/_path.py92def _wrap_method_path_iterable(CODE
LOWsrc/trio/_ssl.py869 async def wait_send_all_might_not_block(self) -> None:STRING
LOWsrc/trio/_socket.py101def set_custom_hostname_resolver(CODE
LOWsrc/trio/_socket.py135def set_custom_socket_factory(CODE
LOWsrc/trio/_socket.py386def _sniff_sockopts_for_fileno(CODE
LOWsrc/trio/_socket.py433def _make_simple_sock_method_wrapper(CODE
LOWsrc/trio/_abc.py357 async def wait_send_all_might_not_block(self) -> None:CODE
LOWsrc/trio/_windows_pipes.py73 async def wait_send_all_might_not_block(self) -> None:CODE
LOWsrc/trio/_highlevel_generic.py98 async def wait_send_all_might_not_block(self) -> None:CODE
LOWsrc/trio/_highlevel_ssl_helpers.py80async def open_ssl_over_tcp_listeners(CODE
LOWsrc/trio/_threads.py87async def wait_all_threads_completed() -> None:CODE
LOWsrc/trio/_threads.py126def current_default_thread_limiter() -> CapacityLimiter:CODE
LOWsrc/trio/_threads.py366 def report_back_in_trio_thread_fn(result: outcome.Outcome[RetT]) -> None:CODE
LOWsrc/trio/_threads.py367 def do_release_then_return_result() -> RetT:CODE
LOWsrc/trio/_threads.py461def from_thread_check_cancelled() -> None:CODE
LOWsrc/trio/_util.py63 def _return_value_looks_like_wrong_library(value: object) -> bool:CODE
LOWsrc/trio/_util.py344def raise_single_exception_from_group(CODE
LOWsrc/trio/_dtls.py121def part_of_handshake_untrusted(packet: bytes) -> bool:CODE
LOWsrc/trio/_dtls.py128def is_client_hello_untrusted(packet: bytes) -> bool:CODE
LOWsrc/trio/_dtls.py210def decode_handshake_fragment_untrusted(payload: bytes) -> HandshakeFragment:CODE
LOWsrc/trio/_dtls.py240def encode_handshake_fragment(hsf: HandshakeFragment) -> bytes:CODE
LOWsrc/trio/_dtls.py251def decode_client_hello_untrusted(packet: bytes) -> tuple[int, bytes, bytes]:CODE
LOWsrc/trio/_dtls.py676async def handle_client_hello_untrusted(CODE
LOWsrc/trio/_sync.py319 def acquire_on_behalf_of_nowait(self, borrower: Task | object) -> None:CODE
LOWsrc/trio/_unix_pipes.py155 async def wait_send_all_might_not_block(self) -> None:CODE
LOWsrc/trio/_highlevel_socket.py44def _translate_socket_errors_to_stream_errors() -> Generator[None, None, None]:CODE
LOWsrc/trio/_highlevel_socket.py126 async def wait_send_all_might_not_block(self) -> None:CODE
LOWsrc/trio/_tests/test_scheduler_determinism.py27def test_the_trio_scheduler_is_not_deterministic() -> None:CODE
LOWsrc/trio/_tests/test_scheduler_determinism.py33def test_the_trio_scheduler_is_deterministic_if_seeded(CODE
LOWsrc/trio/_tests/test_highlevel_open_unix_stream.py40async def test_open_with_bad_filename_type(filename: float) -> None:CODE
LOWsrc/trio/_tests/test_testing_raisesgroup.py75def test_incorrect_number_exceptions() -> None:CODE
LOWsrc/trio/_tests/test_testing_raisesgroup.py260def test_catch_unwrapped_exceptions() -> None:CODE
LOWsrc/trio/_tests/test_testing_raisesgroup.py400def test_unwrapped_match_check() -> None:CODE
LOWsrc/trio/_tests/test_testing_raisesgroup.py683def test_suggestion_on_nested_and_brief_error() -> None:CODE
LOWsrc/trio/_tests/test_testing_raisesgroup.py748def test_assert_message_nested() -> None:CODE
LOWsrc/trio/_tests/test_testing_raisesgroup.py835def test_check_no_patched_repr() -> None:CODE
LOWsrc/trio/_tests/test_testing_raisesgroup.py895def test_brief_error_on_one_fail() -> None:CODE
LOWsrc/trio/_tests/test_testing_raisesgroup.py1087def test_raisesgroup_tostring() -> None:CODE
LOWsrc/trio/_tests/test_testing_raisesgroup.py1117def test_raisesgroup_matcher_deprecation() -> None:CODE
LOWsrc/trio/_tests/test_exports.py39def _ensure_mypy_cache_updated() -> None:CODE
LOWsrc/trio/_tests/test_exports.py68def test_core_is_properly_reexported() -> None:CODE
LOWsrc/trio/_tests/test_exports.py141def test_static_tool_sees_all_symbols(tool: str, modname: str, tmp_path: Path) -> None:CODE
LOWsrc/trio/_tests/test_exports.py265def test_static_tool_sees_class_members(CODE
LOWsrc/trio/_tests/test_exports.py600def test_pyright_recognizes_init_attributes() -> None:CODE
LOWsrc/trio/_tests/test_tracing.py40async def test_task_iter_await_frames() -> None:CODE
LOWsrc/trio/_tests/test_tracing.py57async def test_task_iter_await_frames_async_gen() -> None:CODE
LOWsrc/trio/_tests/test_tracing.py74async def test_closed_task_iter_await_frames() -> None:CODE
LOWsrc/trio/_tests/test_signals.py17async def test_open_signal_receiver() -> None:CODE
LOWsrc/trio/_tests/test_signals.py41async def test_open_signal_receiver_restore_handler_after_one_bad_signal() -> None:CODE
LOWsrc/trio/_tests/test_signals.py53def test_open_signal_receiver_empty_fail() -> None:CODE
LOWsrc/trio/_tests/test_signals.py59async def test_open_signal_receiver_restore_handler_after_duplicate_signal() -> None:CODE
LOWsrc/trio/_tests/test_signals.py67async def test_catch_signals_wrong_thread() -> None:CODE
LOWsrc/trio/_tests/test_signals.py76async def test_open_signal_receiver_conflict() -> None:CODE
LOWsrc/trio/_tests/test_signals.py86async def wait_run_sync_soon_idempotent_queue_barrier() -> None:CODE
LOWsrc/trio/_tests/test_signals.py93async def test_open_signal_receiver_no_starvation() -> None:CODE
LOWsrc/trio/_tests/test_signals.py124async def test_catch_signals_race_condition_on_exit() -> None:CODE
LOWsrc/trio/_tests/test_highlevel_ssl_helpers.py78async def test_open_ssl_over_tcp_stream_and_everything_else(CODE
LOWsrc/trio/_tests/test_highlevel_ssl_helpers.py152async def test_open_ssl_over_tcp_listeners() -> None:CODE
397 more matches not shown…
Over-Commented Block141 hits · 136 pts
SeverityFileLineSnippetContext
LOWtest-requirements.txt1# This file was autogenerated by uv via the following command:COMMENT
LOWtest-requirements.txt21certifi==2026.6.17COMMENT
LOWtest-requirements.txt41coverage==7.14.3COMMENT
LOWtest-requirements.txt61filelock==3.29.4COMMENT
LOWtest-requirements.txt81 # via sphinxCOMMENT
LOWtest-requirements.txt101packaging==26.2COMMENT
LOWtest-requirements.txt121 # via -r test-requirements.inCOMMENT
LOWtest-requirements.txt161 # via sphinxCOMMENT
LOWtest-requirements.txt181trustme==1.2.1COMMENT
LOWtest-requirements.txt201 # exceptiongroupCOMMENT
LOWdocs-requirements.txt1# This file was autogenerated by uv via the following command:COMMENT
LOWdocs-requirements.txt21click==8.4.2COMMENT
LOWdocs-requirements.txt41immutables==0.21COMMENT
LOWdocs-requirements.txt61 # via sphinxCOMMENT
LOWdocs-requirements.txt81 # -r docs-requirements.inCOMMENT
LOWdocs-requirements.txt101 # via sphinxCOMMENT
LOWtox.ini1[tox]COMMENT
LOWci.sh61# If we're testing with a LSP installed, then it might break networkCOMMENT
LOWdocs/source/conf.py1#!/usr/bin/env python3COMMENT
LOWdocs/source/conf.py101# methods to help it resolve links.COMMENT
LOWdocs/source/conf.py361COMMENT
LOWdocs/source/conf.py401# -- Options for HTMLHelp output ------------------------------------------COMMENT
LOWsrc/trio/_signals.py21# the only available API.COMMENT
LOWsrc/trio/_signals.py41# manipulate signal state (e.g. setting SIG_IGN) which as far as Python isCOMMENT
LOWsrc/trio/_ssl.py21 Ts = TypeVarTuple("Ts")COMMENT
LOWsrc/trio/_ssl.py41#COMMENT
LOWsrc/trio/_ssl.py61# might require some arbitrary sequence of sends and receives from the remoteCOMMENT
LOWsrc/trio/_ssl.py81# handshake, and then to turn around and do a second handshake (=COMMENT
LOWsrc/trio/_ssl.py101# it does a handshake, which remember is a process with multiple roundCOMMENT
LOWsrc/trio/_ssl.py121# *exactly that method call* later – in particular, if a 'write' failed, weCOMMENT
LOWsrc/trio/_ssl.py141# task calling receive_some, those two tasks might end up both wanting to callCOMMENT
LOWsrc/trio/_ssl.py161COMMENT
LOWsrc/trio/_ssl.py181# Ideally, when the user calls SSLStream.receive_some() with no argument, thenCOMMENT
LOWsrc/trio/_ssl.py481 #COMMENT
LOWsrc/trio/_ssl.py541 #COMMENT
LOWsrc/trio/_ssl.py561 # might have to do, and any given operation might requireCOMMENT
LOWsrc/trio/_ssl.py581 # we have to do both is very unusual (only during aCOMMENT
LOWsrc/trio/_ssl.py601 try:COMMENT
LOWsrc/trio/_ssl.py801 await self.transport_stream.aclose()COMMENT
LOWsrc/trio/_ssl.py821 # time. (Like e.g. anyone using Python ssl in synchronous mode.)COMMENT
LOWsrc/trio/_ssl.py841 # to _retry will do is send the close_notify alert, so that'sCOMMENT
LOWsrc/trio/_ssl.py881 # task calling self.receive_some -> transport_stream.send_all, inCOMMENT
LOWsrc/trio/_highlevel_open_tcp_listeners.py21# Having the backlog too low can cause practical problems (a perfectly healthyCOMMENT
LOWsrc/trio/_socket.py41# and the return type of several methods in SocketType will depend on those. TypeshedCOMMENT
LOWsrc/trio/_socket.py221 family,COMMENT
LOWsrc/trio/_socket.py981 # '"kwargs" member of ParamSpec is valid only when used with **kwargs parameter'COMMENT
LOWsrc/trio/_socket.py1001 # for read *before* we call accept, then we'll be waitingCOMMENT
LOWsrc/trio/_socket.py1041 async def connect(self, address: AddressFormat) -> None:COMMENT
LOWsrc/trio/_socket.py1061 #COMMENT
LOWsrc/trio/_socket.py1081 # confirmed this is true there:COMMENT
LOWsrc/trio/_socket.py1101 # We can't really cancel a connect, and the socket is in anCOMMENT
LOWsrc/trio/_socket.py1321 # Intentionally omitted:COMMENT
LOWsrc/trio/_subprocess.py61 # this workaround is needed on:COMMENT
LOWsrc/trio/_subprocess.py781 else:COMMENT
LOWsrc/trio/__init__.py1"""Trio - A friendly Python library for async concurrency and I/O"""COMMENT
LOWsrc/trio/_dtls.py101COMMENT
LOWsrc/trio/_dtls.py281 #COMMENT
LOWsrc/trio/_dtls.py481 if packet:COMMENT
LOWsrc/trio/_dtls.py501# second ClientHello, this time with the magic cookie included, and after weCOMMENT
LOWsrc/trio/_dtls.py521# the HMAC digest, for both the current time and the current time minus 30 seconds, andCOMMENT
81 more matches not shown…
Cross-File Repetition18 hits · 90 pts
SeverityFileLineSnippetContext
HIGHsrc/trio/_core/_generated_io_windows.py0block until the kernel reports that the given object is readable. on unix systems, ``fd`` must either be an integer fileSTRING
HIGHsrc/trio/_core/_io_windows.py0block until the kernel reports that the given object is readable. on unix systems, ``fd`` must either be an integer fileSTRING
HIGHsrc/trio/_core/_io_kqueue.py0block until the kernel reports that the given object is readable. on unix systems, ``fd`` must either be an integer fileSTRING
HIGHsrc/trio/_core/_generated_io_epoll.py0block until the kernel reports that the given object is readable. on unix systems, ``fd`` must either be an integer fileSTRING
HIGHsrc/trio/_core/_io_epoll.py0block until the kernel reports that the given object is readable. on unix systems, ``fd`` must either be an integer fileSTRING
HIGHsrc/trio/_core/_generated_io_kqueue.py0block until the kernel reports that the given object is readable. on unix systems, ``fd`` must either be an integer fileSTRING
HIGHsrc/trio/_core/_generated_io_windows.py0block until the kernel reports that the given object is writable. see `wait_readable` for the definition of ``fd``. :raiSTRING
HIGHsrc/trio/_core/_io_windows.py0block until the kernel reports that the given object is writable. see `wait_readable` for the definition of ``fd``. :raiSTRING
HIGHsrc/trio/_core/_io_kqueue.py0block until the kernel reports that the given object is writable. see `wait_readable` for the definition of ``fd``. :raiSTRING
HIGHsrc/trio/_core/_generated_io_epoll.py0block until the kernel reports that the given object is writable. see `wait_readable` for the definition of ``fd``. :raiSTRING
HIGHsrc/trio/_core/_io_epoll.py0block until the kernel reports that the given object is writable. see `wait_readable` for the definition of ``fd``. :raiSTRING
HIGHsrc/trio/_core/_generated_io_kqueue.py0block until the kernel reports that the given object is writable. see `wait_readable` for the definition of ``fd``. :raiSTRING
HIGHsrc/trio/_core/_generated_io_windows.py0notify waiters of the given object that it will be closed. call this before closing a file descriptor (on unix) or sockeSTRING
HIGHsrc/trio/_core/_io_kqueue.py0notify waiters of the given object that it will be closed. call this before closing a file descriptor (on unix) or sockeSTRING
HIGHsrc/trio/_core/_generated_io_epoll.py0notify waiters of the given object that it will be closed. call this before closing a file descriptor (on unix) or sockeSTRING
HIGHsrc/trio/_core/_io_epoll.py0notify waiters of the given object that it will be closed. call this before closing a file descriptor (on unix) or sockeSTRING
HIGHsrc/trio/_core/_generated_io_kqueue.py0notify waiters of the given object that it will be closed. call this before closing a file descriptor (on unix) or sockeSTRING
HIGHsrc/trio/_core/_io_windows.py0notify waiters of the given object that it will be closed. call this before closing a file descriptor (on unix) or sockeSTRING
Docstring Block Structure10 hits · 50 pts
SeverityFileLineSnippetContext
HIGHsrc/trio/_highlevel_open_unix_stream.py41Opens a connection to the specified `Unix domain socket <https://en.wikipedia.org/wiki/Unix_domain_socket>`__. STRING
HIGHsrc/trio/_highlevel_open_tcp_listeners.py63Create :class:`SocketListener` objects to listen for TCP connections. Args: port (int): The port to listen oSTRING
HIGHsrc/trio/_abc.py438Wait until there is data available on this stream, and then return some of it. A return value of ``b""`STRING
HIGHsrc/trio/_subprocess.py314Execute a child program in a new process. After construction, you can interact with the child process by writing daSTRING
HIGHsrc/trio/_subprocess.py477Run ``command`` in a subprocess and wait for it to complete. This function can be called in two different ways. STRING
HIGHsrc/trio/_subprocess.py830Execute a child program in a new process. After construction, you can interact with the child process by wrSTRING
HIGHsrc/trio/_subprocess.py893Run ``command`` in a subprocess and wait for it to complete. This function can be called in two different wSTRING
HIGHsrc/trio/_threads.py264Convert a blocking operation into an async operation using a thread. These two lines are equivalent:: syncSTRING
HIGHsrc/trio/_highlevel_open_tcp_stream.py192Connect to the given host and port over TCP. If the given ``host`` has multiple IP addresses associated with it, thSTRING
HIGHsrc/trio/_core/_run.py2432Run a Trio-flavored async function, and return the result. Calling:: run(async_fn, *args) is the equivSTRING
Deep Nesting43 hits · 34 pts
SeverityFileLineSnippetContext
LOWdocs/source/typevars.py21CODE
LOWsrc/trio/_ssl.py461CODE
LOWsrc/trio/_highlevel_open_tcp_listeners.py57CODE
LOWsrc/trio/_channel.py508CODE
LOWsrc/trio/_channel.py581CODE
LOWsrc/trio/_threads.py257CODE
LOWsrc/trio/_dtls.py356CODE
LOWsrc/trio/_dtls.py744CODE
LOWsrc/trio/_dtls.py411CODE
LOWsrc/trio/_dtls.py932CODE
LOWsrc/trio/_unix_pipes.py130CODE
LOWsrc/trio/_unix_pipes.py161CODE
LOWsrc/trio/_highlevel_socket.py109CODE
LOWsrc/trio/_tests/test_highlevel_open_unix_stream.py55CODE
LOWsrc/trio/_tests/test_exports.py141CODE
LOWsrc/trio/_tests/test_exports.py265CODE
LOWsrc/trio/_tests/test_signals.py93CODE
LOWsrc/trio/_tests/test_socket.py620CODE
LOWsrc/trio/_tests/test_socket.py764CODE
LOWsrc/trio/_tests/test_socket.py840CODE
LOWsrc/trio/_tests/test_socket.py926CODE
LOWsrc/trio/_tests/test_dtls.py141CODE
LOWsrc/trio/_tests/test_dtls.py507CODE
LOWsrc/trio/_tests/test_dtls.py155CODE
LOWsrc/trio/_tests/test_ssl.py105CODE
LOWsrc/trio/_tests/test_ssl.py279CODE
LOWsrc/trio/_tests/check_type_completeness.py114CODE
LOWsrc/trio/_core/_io_windows.py558CODE
LOWsrc/trio/_core/_run.py2713CODE
LOWsrc/trio/_core/_run.py477CODE
LOWsrc/trio/_core/_run.py632CODE
LOWsrc/trio/_core/_run.py761CODE
LOWsrc/trio/_core/_run.py1558CODE
LOWsrc/trio/_core/_tests/test_run.py459CODE
LOWsrc/trio/_core/_tests/test_run.py512CODE
LOWsrc/trio/_core/_tests/test_io.py388CODE
LOWsrc/trio/_core/_tests/test_guest_mode.py48CODE
LOWsrc/trio/_core/_tests/test_windows.py121CODE
LOWsrc/trio/_tools/mypy_annotate.py85CODE
LOWsrc/trio/_tools/sync_requirements.py41CODE
LOWsrc/trio/testing/_raises_group.py513CODE
LOWsrc/trio/testing/_raises_group.py794CODE
LOWsrc/trio/testing/_raises_group.py945CODE
Modern Structural Boilerplate18 hits · 18 pts
SeverityFileLineSnippetContext
LOWsrc/trio/_socket.py610 def set_inheritable(self, inheritable: bool) -> None:STRING
LOWsrc/trio/_socket.py871 def set_inheritable(self, inheritable: bool) -> None:CODE
LOWsrc/trio/to_thread.py4__all__ = ["current_default_thread_limiter", "run_sync"]CODE
LOWsrc/trio/from_thread.py13__all__ = ["check_cancelled", "run", "run_sync"]CODE
LOWsrc/trio/_dtls.py408 def set_first_record_number(self, n: int) -> None:CODE
LOWsrc/trio/_dtls.py859 def _set_replaced(self) -> None:CODE
LOWsrc/trio/_dtls.py1105 def set_ciphertext_mtu(self, new_mtu: int) -> None:CODE
LOWsrc/trio/_dtls.py1372def set_ssl_context_options(ctx: SSL.Context) -> None:CODE
LOWsrc/trio/_core/_generated_io_windows.py24__all__ = [CODE
LOWsrc/trio/_core/_generated_instrumentation.py14__all__ = ["add_instrument", "remove_instrument"]CODE
LOWsrc/trio/_core/_generated_io_epoll.py18__all__ = ["notify_closing", "wait_readable", "wait_writable"]CODE
LOWsrc/trio/_core/_io_epoll.py264 def _update_registrations(self, fd: int) -> None:CODE
LOWsrc/trio/_core/_generated_io_kqueue.py24__all__ = [CODE
LOWsrc/trio/_core/_generated_run.py23__all__ = [CODE
LOWsrc/trio/_core/_tests/test_guest_mode.py214 def set_deadline(cscope: trio.CancelScope, new_deadline: float) -> None:CODE
LOWsrc/trio/_core/_tests/test_guest_mode.py357 def set_deadline(cscope: trio.CancelScope, new_deadline: float) -> None:CODE
LOWsrc/trio/testing/_raises_group.py976 def set_result(self, expected: int, actual: int, result: str | None) -> None:CODE
LOWsrc/trio/testing/_fake_net.py575 def set_inheritable(self, inheritable: bool) -> None:CODE
Decorative Section Separators6 hits · 18 pts
SeverityFileLineSnippetContext
MEDIUMsrc/trio/_highlevel_socket.py214# =====================COMMENT
MEDIUMsrc/trio/_highlevel_socket.py217# -----------------COMMENT
MEDIUMsrc/trio/_highlevel_socket.py258# -----------COMMENT
MEDIUMsrc/trio/_highlevel_socket.py305# ------------------COMMENT
MEDIUMsrc/trio/_core/_io_epoll.py42# ----------------------COMMENT
MEDIUMsrc/trio/_core/_io_epoll.py123# -----------------------------COMMENT
Cross-Language Confusion3 hits · 18 pts
SeverityFileLineSnippetContext
HIGHsrc/trio/_tests/test_socket.py644 got = await sock._resolve_address_nocp((null, 80), local=True)CODE
HIGHsrc/trio/_tests/test_socket.py647 got = await sock._resolve_address_nocp((null, 80), local=False)CODE
HIGHsrc/trio/_core/_windows_cffi.py135 # this is wrong (it's not always null)COMMENT
AI Slop Vocabulary8 hits · 16 pts
SeverityFileLineSnippetContext
MEDIUMci.sh15# Curl's built-in retry system is not very robust; it gives up on lots ofCOMMENT
MEDIUMsrc/trio/_ssl.py167# Definitely keep an eye on Cory's TLS API ideas on security-sig etc.COMMENT
LOWsrc/trio/_highlevel_open_tcp_listeners.py43# so this is unnecessary -- we can just pass in "infinity" and get the maximumCOMMENT
LOWsrc/trio/_util.py120 # function. So we have to just call it and then check whether theCOMMENT
MEDIUMsrc/trio/_dtls.py64# comprehensive collection look here:COMMENT
LOWsrc/trio/_dtls.py339# just pass it through unchanged. (Fortunately, the payload is only a single hash value,COMMENT
LOWsrc/trio/_core/_io_windows.py153# IOCTL_AFD_POLL. This means we can't just use the wait_overlapped machinery.COMMENT
LOWsrc/trio/_core/_io_windows.py358 # If this is not a Komodia-intercepted socket, we can just useCOMMENT
Self-Referential Comments5 hits · 15 pts
SeverityFileLineSnippetContext
MEDIUMdocs/source/conf.py6# This file is execfile()d with the current directory set to itsCOMMENT
MEDIUMsrc/trio/_version.py1# This file is imported from __init__.py and parsed by setuptoolsCOMMENT
MEDIUMsrc/trio/_core/_tests/test_run.py2109 # This function isn't testing task_status, it's using task_status as aCOMMENT
MEDIUMsrc/trio/_core/_tests/test_run.py2352 # This function is async so that we have access to a task object we canCOMMENT
MEDIUMsrc/trio/_tools/gen_exports.py239 # Create the function definition including the bodyCOMMENT
Excessive Try-Catch Wrapping7 hits · 8 pts
SeverityFileLineSnippetContext
LOWdocs/source/tutorial/echo-server.py28 except Exception as exc:CODE
LOWsrc/trio/_tests/test_ssl.py144 except Exception as exc:CODE
LOWsrc/trio/_tests/test_threads.py244 except Exception:CODE
LOWsrc/trio/_core/_thread_cache.py67 except Exception: # pragma: no coverCODE
LOWsrc/trio/_core/_exceptions.py62 except Exception:STRING
MEDIUMsrc/trio/_core/_tests/test_run.py940def unstarted_task() -> None:CODE
LOWsrc/trio/_core/_tests/test_exceptiongroup_gc.py43 except Exception as exc:CODE
Slop Phrases5 hits · 6 pts
SeverityFileLineSnippetContext
LOWsrc/trio/_ssl.py458 # comments, though, just make sure to think carefully if you ever have toSTRING
LOWsrc/trio/_file_io.py36# This list is also in the docs, make sure to keep them in syncCOMMENT
LOWsrc/trio/_file_io.py58# This list is also in the docs, make sure to keep them in syncCOMMENT
LOWsrc/trio/_tests/test_unix_pipes.py45 # make sure to write >PIPE_BUF bytes each time, which disablesCOMMENT
LOWsrc/trio/_core/_thread_cache.py81 # Just need to make sure to call it correctlyCOMMENT
Dead Code3 hits · 6 pts
SeverityFileLineSnippetContext
MEDIUMsrc/trio/_tests/test_channel.py575CODE
MEDIUMsrc/trio/_tests/test_channel.py726CODE
MEDIUMsrc/trio/_tests/test_channel.py460CODE
Overly Generic Function Names4 hits · 4 pts
SeverityFileLineSnippetContext
LOW…cs/source/reference-core/thread-contextvars-example.py24async def handle_request(current_user_id):CODE
LOWdocs/source/reference-core/contextvar-example.py18async def handle_request(tag):CODE
LOW…_tests/test_deprecate_strict_exception_groups_false.py35 def helper(fun: Callable[[], Awaitable[None]], num: int) -> None:CODE
LOWsrc/trio/_tests/test_subprocess.py655 async def do_stuff() -> None:CODE
Example Usage Blocks3 hits · 4 pts
SeverityFileLineSnippetContext
LOWpyproject.toml245# Usage:STRING
LOWsrc/trio/_socket.py53# Usage:COMMENT
LOWsrc/trio/_core/_tests/tutil.py92# Example usage:COMMENT
Redundant / Tautological Comments1 hit · 2 pts
SeverityFileLineSnippetContext
LOWsrc/trio/_dtls.py730 # Check if we have an existing associationCOMMENT