A runtime for writing reliable asynchronous applications with Rust. Provides I/O, networking, scheduling, timers, ...
This report presents the forensic synthetic code analysis of tokio-rs/tokio, a Rust project with 32,530 GitHub stars. SynthScan v2.0 examined 188,469 lines of code across 849 source files, recording 2712 pattern matches distributed across 8 syntactic categories. The overall adjusted score of 12.5 places this repository in the Low 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).
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.
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.
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.
The scanner identified 2712 distinct pattern matches across 8 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.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tokio-stream/src/pending.rs | 21 | /// immediately empty but returns no values. | COMMENT |
| LOW | tokio-stream/src/empty.rs | 21 | /// | COMMENT |
| LOW | tokio-stream/src/lib.rs | 21 | //! an asynchronous version of the standard library's `Iterator` trait. | COMMENT |
| LOW | tokio-stream/src/lib.rs | 41 | //! while let Some(value) = stream.next().await { | COMMENT |
| LOW | tokio-stream/src/lib.rs | 61 | //! The opposite conversion from an [`AsyncRead`] into a `Stream` is also | COMMENT |
| LOW | tokio-stream/src/iter.rs | 21 | /// simply always calls `iter.next()` and returns that. | COMMENT |
| LOW | tokio-stream/src/stream_close.rs | 1 | use crate::Stream; | COMMENT |
| LOW | tokio-stream/src/stream_close.rs | 21 | /// # async fn main() { | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 81 | /// | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 101 | /// ``` | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 121 | /// crate. | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 141 | /// assert_eq!(stream.next().await, None); | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 161 | /// but returns a [`Result<Option<T>, E>`](Result) rather than | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 181 | /// assert_eq!(stream.try_next().await, Ok(Some(1))); | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 201 | /// wrapped version of it, similar to the existing `map` methods in the | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 221 | F: FnMut(Self::Item) -> T, | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 241 | /// | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 261 | fn map_while<T, F>(self, f: F) -> MapWhile<Self, F> | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 281 | /// returned by this method. To handle this, you can use `tokio::pin!` as in | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 301 | /// assert_eq!(stream.next().await, Some(5)); | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 321 | /// will break the fairness of the merging. | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 341 | /// # /* | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 361 | /// }) as Pin<Box<dyn Stream<Item = usize> + Send>>; | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 381 | /// | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 401 | Self: Sized, | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 421 | /// ``` | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 441 | Filter::new(self, f) | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 461 | /// | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 481 | COMMENT | |
| LOW | tokio-stream/src/stream_ext.rs | 501 | /// | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 521 | /// # #[tokio::main(flavor = "current_thread")] | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 541 | /// } | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 561 | /// | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 581 | /// stream until the predicate `f` resolves to `false`. Once one element | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 601 | F: FnMut(&Self::Item) -> bool, | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 621 | /// assert_eq!(Some(10), stream.next().await); | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 641 | /// # Examples | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 661 | } | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 681 | /// | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 701 | /// ``` | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 721 | AllFuture::new(self, f) | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 741 | /// An empty stream returns `false`. | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 761 | /// # #[tokio::main(flavor = "current_thread")] | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 781 | } | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 801 | /// assert_eq!(stream.next().await, Some(1)); | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 821 | /// Equivalent to: | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 841 | where | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 861 | /// | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 881 | /// # #[tokio::main(flavor = "current_thread")] | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 901 | /// let values: Result<Vec<i32>, &str> = | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 921 | T: FromStream<Self::Item>, | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 941 | /// This function consumes the stream passed into it and returns a | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 961 | /// // When no items time out, we get the 3 elements in succession: | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 981 | /// assert_eq!(int_stream.try_next().await, Ok(None)); | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 1001 | /// # } | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 1021 | /// becomes available before the deadline is reached, additional errors are | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 1041 | /// use std::time::Duration; | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 1061 | /// // If we want to stop consuming the source stream the first time an | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 1081 | /// tokio::pin!(timeout_stream); | COMMENT |
| LOW | tokio-stream/src/stream_ext.rs | 1101 | /// | COMMENT |
| 2583 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tokio-stream/tests/stream_fused.rs | 9 | // ── map ────────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tokio-stream/tests/stream_fused.rs | 25 | // ── filter ─────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tokio-stream/tests/stream_fused.rs | 41 | // ── filter_map ─────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tokio-stream/tests/stream_fused.rs | 57 | // ── skip ───────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tokio-stream/tests/stream_fused.rs | 73 | // ── skip_while ─────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tokio-stream/tests/stream_fused.rs | 89 | // ── take ───────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tokio-stream/tests/stream_fused.rs | 114 | // ── take_while ─────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tokio-stream/tests/stream_fused.rs | 132 | // ── map_while ───────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tokio-stream/tests/stream_fused.rs | 152 | // ── then ───────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tokio-stream/tests/stream_fused.rs | 171 | // ── chain ──────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tokio-stream/tests/stream_fused.rs | 189 | // ── merge ──────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM⚡ | tokio-util/src/codec/framed_impl.rs | 144 | // ┌────────────────────────────────────────────────────────┐ | COMMENT |
| MEDIUM⚡ | tokio-util/src/codec/framed_impl.rs | 147 | // ┌─────┐ │ `decode_eof` returns After returning │ | COMMENT |
| MEDIUM⚡ | tokio-util/src/codec/framed_impl.rs | 148 | // Read 0 bytes ├─────▼──┴┐ `Ok(None)` ┌────────┐ ◄───┐ `None` ┌───▼─────┐ | COMMENT |
| MEDIUM⚡ | tokio-util/src/codec/framed_impl.rs | 149 | // ┌────────────────►│ Pausing ├───────────────────────►│ Paused ├─┐ └───────────┤ Errored │ | COMMENT |
| MEDIUM⚡ | tokio-util/src/codec/framed_impl.rs | 150 | // │ └─────────┘ └─┬──▲───┘ │ └───▲───▲─┘ | COMMENT |
| MEDIUM⚡ | tokio-util/src/codec/framed_impl.rs | 152 | // ┌──────┐ │ `decode` returns `Some` │ └─────┘ │ │ | COMMENT |
| MEDIUM⚡ | tokio-util/src/codec/framed_impl.rs | 153 | // │ │ │ ┌──────┐ │ Pending │ │ | COMMENT |
| MEDIUM⚡ | tokio-util/src/codec/framed_impl.rs | 154 | // │ ┌────▼──┴─┐ Read n>0 bytes ┌┴──────▼─┐ read n>0 bytes │ read │ │ | COMMENT |
| MEDIUM⚡ | tokio-util/src/codec/framed_impl.rs | 155 | // └─┤ Reading ├───────────────►│ Framing │◄────────────────────────┘ │ │ | COMMENT |
| MEDIUM⚡ | tokio-util/src/codec/framed_impl.rs | 156 | // └──┬─▲────┘ └─────┬──┬┘ │ │ | COMMENT |
| MEDIUM⚡ | tokio-util/src/codec/framed_impl.rs | 158 | // │ └───decode` returns `None`──┘ └───────────────────────────────────────────────────────┘ │ | COMMENT |
| MEDIUM⚡ | tokio-util/src/codec/framed_impl.rs | 160 | // └────────────────────────────────────────────────────────────────────────────────────────────┘ | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tokio/src/net/udp.rs | 511 | /// # Return value | COMMENT |
| LOW | tokio/src/net/udp.rs | 587 | /// # Return value | COMMENT |
| LOW | tokio/src/net/udp.rs | 736 | /// # Return value | COMMENT |
| LOW | tokio/src/net/udp.rs | 807 | /// # Return value | COMMENT |
| LOW | tokio/src/net/udp.rs | 1203 | /// # Return value | COMMENT |
| LOW | tokio/src/net/udp.rs | 1341 | /// # Return value | COMMENT |
| LOW | tokio/src/net/udp.rs | 1601 | /// # Return value | COMMENT |
| LOW | tokio/src/net/udp.rs | 1746 | /// # Return value | COMMENT |
| LOW | tokio/src/net/unix/stream.rs | 282 | /// # Return value | COMMENT |
| LOW | tokio/src/net/unix/stream.rs | 598 | /// # Return value | COMMENT |
| LOW | tokio/src/net/unix/pipe.rs | 585 | /// # Return value | COMMENT |
| LOW | tokio/src/net/unix/pipe.rs | 1137 | /// # Return value | COMMENT |
| LOW | tokio/src/net/unix/datagram/socket.rs | 260 | /// # Return value | COMMENT |
| LOW | tokio/src/net/unix/datagram/socket.rs | 356 | /// # Return value | COMMENT |
| LOW | tokio/src/net/unix/datagram/socket.rs | 1168 | /// # Return value | COMMENT |
| LOW | tokio/src/net/unix/datagram/socket.rs | 1208 | /// # Return value | COMMENT |
| LOW | tokio/src/net/unix/datagram/socket.rs | 1243 | /// # Return value | COMMENT |
| LOW | tokio/src/net/unix/datagram/socket.rs | 1272 | /// # Return value | COMMENT |
| LOW | tokio/src/net/tcp/stream.rs | 335 | /// # Return value | COMMENT |
| LOW | tokio/src/net/tcp/stream.rs | 543 | /// # Return value | COMMENT |
| LOW | tokio/src/net/tcp/stream.rs | 855 | /// # Return value | COMMENT |
| LOW | tokio/src/net/windows/named_pipe.rs | 375 | /// # Return value | COMMENT |
| LOW | tokio/src/net/windows/named_pipe.rs | 682 | /// # Return value | COMMENT |
| LOW | tokio/src/net/windows/named_pipe.rs | 1169 | /// # Return value | COMMENT |
| LOW | tokio/src/net/windows/named_pipe.rs | 1473 | /// # Return value | COMMENT |
| LOW | tokio/src/io/async_write.rs | 95 | /// # Return value | COMMENT |
| LOW | tokio/src/io/util/copy_bidirectional.rs | 71 | /// # Return value | COMMENT |
| LOW | tokio/src/sync/oneshot.rs | 793 | /// # Return value | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tokio-util/src/io/sync_bridge.rs | 16 | /// might not fully leverage the async capabilities of the system. | COMMENT |
| MEDIUM | tokio-util/src/io/sync_bridge.rs | 121 | /// blocking and inefficient code. Instead, you can utilize an async compression library | COMMENT |
| MEDIUM | tokio/src/runtime/time_alt/entry.rs | 81 | /// An ZST to allow [`super::registration_queue`] to utilize the [`Entry::extra_pointers`] | COMMENT |
| MEDIUM | tokio/src/runtime/time_alt/entry.rs | 112 | /// An ZST to allow [`super::cancellation_queue`] to utilize the [`Entry::cancel_pointers`] | COMMENT |
| MEDIUM | tokio/src/runtime/time_alt/entry.rs | 143 | /// An ZST to allow [`super::WakeQueue`] to utilize the [`Entry::extra_pointers`] | COMMENT |
| MEDIUM | tokio/src/runtime/task/trace/tree.rs | 14 | /// There should only be one root, but the code is robust to multiple roots. | COMMENT |
| MEDIUM | tokio/src/sync/semaphore.rs | 200 | /// work, but it doesn't matter which test runs first. We can leverage a | COMMENT |
| MEDIUM | tokio/src/sync/mod.rs | 129 | //! given time. Properly setting this value is key in implementing robust | COMMENT |
| MEDIUM | tokio/src/process/mod.rs | 662 | /// a [`Child`] handle where possible, and instead utilize `child.wait().await` | COMMENT |
| MEDIUM | examples/print_each_packet.rs | 89 | // Essentially here we're executing a new task to run concurrently, | COMMENT |
| MEDIUM | examples/echo-tcp.rs | 57 | // Essentially here we're executing a new task to run concurrently, | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| CRITICAL | tokio/src/runtime/scheduler/multi_thread/worker.rs | 645 | let task = self.worker.handle.shared.owned.assert_owner(task); | CODE |
| CRITICAL | tokio/src/runtime/scheduler/multi_thread/worker.rs | 764 | let task = self.worker.handle.shared.owned.assert_owner(task); | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | tokio/src/runtime/metrics/histogram/h2_histogram.rs | 251 | // this by one to ensure we are at least as granular as requested. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tokio-util/src/codec/length_delimited.rs | 366 | //! Here is a simple example, given a `FramedWrite` with the following | COMMENT |
| LOW | examples/udp-client.rs | 24 | //! Don't forget to pass `EOF` to the standard input of the client! | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tokio/src/runtime/dump.rs | 237 | /// Example usage: | COMMENT |
| LOW | tokio/src/macros/cfg.rs | 8 | /// ## Example usage: | COMMENT |