Repository Analysis

tokio-rs/tokio

A runtime for writing reliable asynchronous applications with Rust. Provides I/O, networking, scheduling, timers, ...

12.6 Low AI signal View on GitHub
12.6
Adjusted Score
12.6
Raw Score
100%
Time Factor
2026-05-29
Last Push
32,141
Stars
Rust
Language
185,314
Lines of Code
837
Files
2682
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 2HIGH 1MEDIUM 34LOW 2645

Pattern Findings

2682 matches across 8 categories. Click a row to expand file-level details.

Over-Commented Block2614 hits · 2141 pts
SeverityFileLineSnippet
LOWtokio-stream/src/pending.rs21/// immediately empty but returns no values.
LOWtokio-stream/src/empty.rs21///
LOWtokio-stream/src/lib.rs21//! an asynchronous version of the standard library's `Iterator` trait.
LOWtokio-stream/src/lib.rs41//! while let Some(value) = stream.next().await {
LOWtokio-stream/src/lib.rs61//! The opposite conversion from an [`AsyncRead`] into a `Stream` is also
LOWtokio-stream/src/iter.rs21///
LOWtokio-stream/src/stream_close.rs1use crate::Stream;
LOWtokio-stream/src/stream_close.rs21 /// # async fn main() {
LOWtokio-stream/src/stream_ext.rs81///
LOWtokio-stream/src/stream_ext.rs101/// ```
LOWtokio-stream/src/stream_ext.rs121 /// crate.
LOWtokio-stream/src/stream_ext.rs141 /// assert_eq!(stream.next().await, None);
LOWtokio-stream/src/stream_ext.rs161 /// but returns a [`Result<Option<T>, E>`](Result) rather than
LOWtokio-stream/src/stream_ext.rs181 /// assert_eq!(stream.try_next().await, Ok(Some(1)));
LOWtokio-stream/src/stream_ext.rs201 /// wrapped version of it, similar to the existing `map` methods in the
LOWtokio-stream/src/stream_ext.rs221 F: FnMut(Self::Item) -> T,
LOWtokio-stream/src/stream_ext.rs241 ///
LOWtokio-stream/src/stream_ext.rs261 fn map_while<T, F>(self, f: F) -> MapWhile<Self, F>
LOWtokio-stream/src/stream_ext.rs281 /// returned by this method. To handle this, you can use `tokio::pin!` as in
LOWtokio-stream/src/stream_ext.rs301 /// assert_eq!(stream.next().await, Some(5));
LOWtokio-stream/src/stream_ext.rs321 /// will break the fairness of the merging.
LOWtokio-stream/src/stream_ext.rs341 /// # /*
LOWtokio-stream/src/stream_ext.rs361 /// }) as Pin<Box<dyn Stream<Item = usize> + Send>>;
LOWtokio-stream/src/stream_ext.rs381 ///
LOWtokio-stream/src/stream_ext.rs401 Self: Sized,
LOWtokio-stream/src/stream_ext.rs421 /// ```
LOWtokio-stream/src/stream_ext.rs441 Filter::new(self, f)
LOWtokio-stream/src/stream_ext.rs461 ///
LOWtokio-stream/src/stream_ext.rs481
LOWtokio-stream/src/stream_ext.rs501 ///
LOWtokio-stream/src/stream_ext.rs521 /// # #[tokio::main(flavor = "current_thread")]
LOWtokio-stream/src/stream_ext.rs541 /// }
LOWtokio-stream/src/stream_ext.rs561 ///
LOWtokio-stream/src/stream_ext.rs581 /// stream until the predicate `f` resolves to `false`. Once one element
LOWtokio-stream/src/stream_ext.rs601 F: FnMut(&Self::Item) -> bool,
LOWtokio-stream/src/stream_ext.rs621 /// assert_eq!(Some(10), stream.next().await);
LOWtokio-stream/src/stream_ext.rs641 /// # Examples
LOWtokio-stream/src/stream_ext.rs661 }
LOWtokio-stream/src/stream_ext.rs681 ///
LOWtokio-stream/src/stream_ext.rs701 /// ```
LOWtokio-stream/src/stream_ext.rs721 AllFuture::new(self, f)
LOWtokio-stream/src/stream_ext.rs741 /// An empty stream returns `false`.
LOWtokio-stream/src/stream_ext.rs761 /// # #[tokio::main(flavor = "current_thread")]
LOWtokio-stream/src/stream_ext.rs781 }
LOWtokio-stream/src/stream_ext.rs801 /// assert_eq!(stream.next().await, Some(1));
LOWtokio-stream/src/stream_ext.rs821 /// Equivalent to:
LOWtokio-stream/src/stream_ext.rs841 where
LOWtokio-stream/src/stream_ext.rs861 ///
LOWtokio-stream/src/stream_ext.rs881 /// # #[tokio::main(flavor = "current_thread")]
LOWtokio-stream/src/stream_ext.rs901 /// let values: Result<Vec<i32>, &str> =
LOWtokio-stream/src/stream_ext.rs921 T: FromStream<Self::Item>,
LOWtokio-stream/src/stream_ext.rs941 /// This function consumes the stream passed into it and returns a
LOWtokio-stream/src/stream_ext.rs961 /// // When no items time out, we get the 3 elements in succession:
LOWtokio-stream/src/stream_ext.rs981 /// assert_eq!(int_stream.try_next().await, Ok(None));
LOWtokio-stream/src/stream_ext.rs1001 /// # }
LOWtokio-stream/src/stream_ext.rs1021 /// becomes available before the deadline is reached, additional errors are
LOWtokio-stream/src/stream_ext.rs1041 /// use std::time::Duration;
LOWtokio-stream/src/stream_ext.rs1061 /// // If we want to stop consuming the source stream the first time an
LOWtokio-stream/src/stream_ext.rs1081 /// tokio::pin!(timeout_stream);
LOWtokio-stream/src/stream_ext.rs1101 ///
2554 more matches not shown…
Decorative Section Separators22 hits · 84 pts
SeverityFileLineSnippet
MEDIUMtokio-stream/tests/stream_fused.rs9// ── map ──────────────────────────────────────────────────────────────────────
MEDIUMtokio-stream/tests/stream_fused.rs25// ── filter ───────────────────────────────────────────────────────────────────
MEDIUMtokio-stream/tests/stream_fused.rs41// ── filter_map ───────────────────────────────────────────────────────────────
MEDIUMtokio-stream/tests/stream_fused.rs57// ── skip ─────────────────────────────────────────────────────────────────────
MEDIUMtokio-stream/tests/stream_fused.rs73// ── skip_while ───────────────────────────────────────────────────────────────
MEDIUMtokio-stream/tests/stream_fused.rs89// ── take ─────────────────────────────────────────────────────────────────────
MEDIUMtokio-stream/tests/stream_fused.rs114// ── take_while ───────────────────────────────────────────────────────────────
MEDIUMtokio-stream/tests/stream_fused.rs132// ── then ─────────────────────────────────────────────────────────────────────
MEDIUMtokio-stream/tests/stream_fused.rs151// ── chain ────────────────────────────────────────────────────────────────────
MEDIUMtokio-stream/tests/stream_fused.rs169// ── merge ────────────────────────────────────────────────────────────────────
MEDIUMtokio-util/src/codec/framed_impl.rs144 // ┌────────────────────────────────────────────────────────┐
MEDIUMtokio-util/src/codec/framed_impl.rs147 // ┌─────┐ │ `decode_eof` returns After returning │
MEDIUMtokio-util/src/codec/framed_impl.rs148 // Read 0 bytes ├─────▼──┴┐ `Ok(None)` ┌────────┐ ◄───┐ `None` ┌───▼─────┐
MEDIUMtokio-util/src/codec/framed_impl.rs149 // ┌────────────────►│ Pausing ├───────────────────────►│ Paused ├─┐ └───────────┤ Errored │
MEDIUMtokio-util/src/codec/framed_impl.rs150 // │ └─────────┘ └─┬──▲───┘ │ └───▲───▲─┘
MEDIUMtokio-util/src/codec/framed_impl.rs152 // ┌──────┐ │ `decode` returns `Some` │ └─────┘ │ │
MEDIUMtokio-util/src/codec/framed_impl.rs153 // │ │ │ ┌──────┐ │ Pending │ │
MEDIUMtokio-util/src/codec/framed_impl.rs154 // │ ┌────▼──┴─┐ Read n>0 bytes ┌┴──────▼─┐ read n>0 bytes │ read │ │
MEDIUMtokio-util/src/codec/framed_impl.rs155 // └─┤ Reading ├───────────────►│ Framing │◄────────────────────────┘ │ │
MEDIUMtokio-util/src/codec/framed_impl.rs156 // └──┬─▲────┘ └─────┬──┬┘ │ │
MEDIUMtokio-util/src/codec/framed_impl.rs158 // │ └───decode` returns `None`──┘ └───────────────────────────────────────────────────────┘ │
MEDIUMtokio-util/src/codec/framed_impl.rs160 // └────────────────────────────────────────────────────────────────────────────────────────────┘
Redundant / Tautological Comments28 hits · 42 pts
SeverityFileLineSnippet
LOWtokio/src/net/udp.rs511 /// # Return value
LOWtokio/src/net/udp.rs587 /// # Return value
LOWtokio/src/net/udp.rs736 /// # Return value
LOWtokio/src/net/udp.rs807 /// # Return value
LOWtokio/src/net/udp.rs1203 /// # Return value
LOWtokio/src/net/udp.rs1341 /// # Return value
LOWtokio/src/net/udp.rs1601 /// # Return value
LOWtokio/src/net/udp.rs1746 /// # Return value
LOWtokio/src/net/unix/stream.rs254 /// # Return value
LOWtokio/src/net/unix/stream.rs570 /// # Return value
LOWtokio/src/net/unix/pipe.rs585 /// # Return value
LOWtokio/src/net/unix/pipe.rs1137 /// # Return value
LOWtokio/src/net/unix/datagram/socket.rs260 /// # Return value
LOWtokio/src/net/unix/datagram/socket.rs356 /// # Return value
LOWtokio/src/net/unix/datagram/socket.rs1168 /// # Return value
LOWtokio/src/net/unix/datagram/socket.rs1208 /// # Return value
LOWtokio/src/net/unix/datagram/socket.rs1243 /// # Return value
LOWtokio/src/net/unix/datagram/socket.rs1272 /// # Return value
LOWtokio/src/net/tcp/stream.rs335 /// # Return value
LOWtokio/src/net/tcp/stream.rs543 /// # Return value
LOWtokio/src/net/tcp/stream.rs855 /// # Return value
LOWtokio/src/net/windows/named_pipe.rs375 /// # Return value
LOWtokio/src/net/windows/named_pipe.rs682 /// # Return value
LOWtokio/src/net/windows/named_pipe.rs1169 /// # Return value
LOWtokio/src/net/windows/named_pipe.rs1473 /// # Return value
LOWtokio/src/io/async_write.rs95 /// # Return value
LOWtokio/src/io/util/copy_bidirectional.rs71/// # Return value
LOWtokio/src/sync/oneshot.rs793 /// # Return value
AI Slop Vocabulary11 hits · 33 pts
SeverityFileLineSnippet
MEDIUMtokio-util/src/io/sync_bridge.rs16/// might not fully leverage the async capabilities of the system.
MEDIUMtokio-util/src/io/sync_bridge.rs121/// blocking and inefficient code. Instead, you can utilize an async compression library
MEDIUMtokio/src/runtime/time_alt/entry.rs83/// An ZST to allow [`super::registration_queue`] to utilize the [`Entry::extra_pointers`]
MEDIUMtokio/src/runtime/time_alt/entry.rs114/// An ZST to allow [`super::cancellation_queue`] to utilize the [`Entry::cancel_pointers`]
MEDIUMtokio/src/runtime/time_alt/entry.rs145/// An ZST to allow [`super::WakeQueue`] to utilize the [`Entry::extra_pointers`]
MEDIUMtokio/src/runtime/task/trace/tree.rs14 /// There should only be one root, but the code is robust to multiple roots.
MEDIUMtokio/src/sync/semaphore.rs200/// work, but it doesn't matter which test runs first. We can leverage a
MEDIUMtokio/src/sync/mod.rs129//! given time. Properly setting this value is key in implementing robust
MEDIUMtokio/src/process/mod.rs662 /// a [`Child`] handle where possible, and instead utilize `child.wait().await`
MEDIUMexamples/print_each_packet.rs89 // Essentially here we're executing a new task to run concurrently,
MEDIUMexamples/echo-tcp.rs57 // Essentially here we're executing a new task to run concurrently,
Hallucination Indicators2 hits · 20 pts
SeverityFileLineSnippet
CRITICALtokio/src/runtime/scheduler/multi_thread/worker.rs634 let task = self.worker.handle.shared.owned.assert_owner(task);
CRITICALtokio/src/runtime/scheduler/multi_thread/worker.rs750 let task = self.worker.handle.shared.owned.assert_owner(task);
Synthetic Comment Markers1 hit · 8 pts
SeverityFileLineSnippet
HIGHtokio/src/runtime/metrics/histogram/h2_histogram.rs251 // this by one to ensure we are at least as granular as requested.
Slop Phrases2 hits · 4 pts
SeverityFileLineSnippet
MEDIUMtokio-util/src/codec/length_delimited.rs366//! Here is a simple example, given a `FramedWrite` with the following
LOWexamples/udp-client.rs24//! Don't forget to pass `EOF` to the standard input of the client!
Example Usage Blocks2 hits · 3 pts
SeverityFileLineSnippet
LOWtokio/src/runtime/dump.rs237 /// Example usage:
LOWtokio/src/macros/cfg.rs8/// ## Example usage: