A runtime for writing reliable asynchronous applications with Rust. Provides I/O, networking, scheduling, timers, ...
This report summarizes scanner evidence for tokio-rs/tokio, a Rust project with 33,411 GitHub stars. SynthScan examined 198,182 lines of code across 867 source files, recording 2761 pattern matches distributed across 8 syntactic categories. The legacy adjusted pattern signal is 12.1 (Moderate 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.
Use each vector to guide manual verification of the underlying findings.
Can maintainers explain intent, assumptions, and trade-offs? 2734 finding(s).
Are imports declared and package/API names verified? 2 finding(s).
Are wrappers, guards, and repeated structures necessary? 25 finding(s).
Which changes need focused human review? 2761 finding(s).
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.
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.
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.
The scanner identified 2761 distinct pattern matches across 8 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.
| 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 | /// to obtain a stream that is never ready. | 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 | /// `Poll::Pending` to cooperate with the executor. | COMMENT |
| LOW | tokio-stream/src/stream_close.rs | 1 | use crate::Stream; | COMMENT |
| LOW | tokio-stream/src/stream_close.rs | 21 | /// # #[tokio::main(flavor = "current_thread")] | 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 |
| 2630 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tokio-stream/tests/stream_fused.rs | 51 | // ── map ────────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tokio-stream/tests/stream_fused.rs | 67 | // ── filter ─────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tokio-stream/tests/stream_fused.rs | 83 | // ── filter_map ─────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tokio-stream/tests/stream_fused.rs | 99 | // ── skip ───────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tokio-stream/tests/stream_fused.rs | 115 | // ── skip_while ─────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tokio-stream/tests/stream_fused.rs | 131 | // ── take ───────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tokio-stream/tests/stream_fused.rs | 156 | // ── take_while ─────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tokio-stream/tests/stream_fused.rs | 174 | // ── map_while ───────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tokio-stream/tests/stream_fused.rs | 194 | // ── then ───────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tokio-stream/tests/stream_fused.rs | 213 | // ── chain ──────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tokio-stream/tests/stream_fused.rs | 231 | // ── merge ──────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tokio-stream/tests/stream_fused.rs | 272 | // ── timeout ────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tokio-stream/tests/stream_fused.rs | 301 | // ── throttle ───────────────────────────────────────────────────────────────── | 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 | 1172 | /// # Return value | COMMENT |
| LOW | tokio/src/net/unix/datagram/socket.rs | 1212 | /// # Return value | COMMENT |
| LOW | tokio/src/net/unix/datagram/socket.rs | 1247 | /// # Return value | COMMENT |
| LOW | tokio/src/net/unix/datagram/socket.rs | 1276 | /// # Return value | COMMENT |
| LOW | tokio/src/net/tcp/stream.rs | 350 | /// # Return value | COMMENT |
| LOW | tokio/src/net/tcp/stream.rs | 558 | /// # Return value | COMMENT |
| LOW | tokio/src/net/tcp/stream.rs | 870 | /// # Return value | COMMENT |
| LOW | tokio/src/net/windows/named_pipe.rs | 379 | /// # Return value | COMMENT |
| LOW | tokio/src/net/windows/named_pipe.rs | 686 | /// # Return value | COMMENT |
| LOW | tokio/src/net/windows/named_pipe.rs | 1175 | /// # Return value | COMMENT |
| LOW | tokio/src/net/windows/named_pipe.rs | 1479 | /// # Return value | COMMENT |
| LOW | tokio/src/io/async_write.rs | 95 | /// # Return value | COMMENT |
| LOW | tokio/src/io/util/copy_bidirectional.rs | 72 | /// # 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 | 229 | /// 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 | 648 | let task = self.worker.handle.shared.owned.assert_owner(task); | CODE |
| CRITICAL | tokio/src/runtime/scheduler/multi_thread/worker.rs | 768 | 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 | 239 | /// Example usage: | COMMENT |
| LOW | tokio/src/macros/cfg.rs | 8 | /// ## Example usage: | COMMENT |