Async-friendly WebRTC implementation in Rust
This report presents the forensic synthetic code analysis of webrtc-rs/webrtc, a Rust project with 5,131 GitHub stars. SynthScan v2.0 examined 45,613 lines of code across 171 source files, recording 321 pattern matches distributed across 5 syntactic categories. The overall adjusted score of 14.2 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 321 distinct pattern matches across 5 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 |
|---|---|---|---|---|
| MEDIUM | tests/dedicated_reactor_data_channel.rs | 113 | // ── Offerer on a dedicated reactor thread ────────────────────────────────── | COMMENT |
| MEDIUM | tests/dedicated_reactor_data_channel.rs | 158 | // ── Answerer on a dedicated reactor thread ───────────────────────────────── | COMMENT |
| MEDIUM | tests/ice_restart_by_webrtc_interop.rs | 180 | // ──────────── Phase 1: wait for initial connection ──────────── | COMMENT |
| MEDIUM | tests/ice_restart_by_webrtc_interop.rs | 293 | // ──────────── Phase 2: exchange messages before ICE restart ──────────── | COMMENT |
| MEDIUM | tests/ice_restart_by_webrtc_interop.rs | 430 | // ──────────── Phase 3: ICE restart (initiated by WebRTC) ──────────── | COMMENT |
| MEDIUM | tests/ice_restart_by_webrtc_interop.rs | 464 | // ──────────── Phase 4: wait for reconnection ──────────── | COMMENT |
| MEDIUM | tests/ice_restart_by_webrtc_interop.rs | 548 | // ──────────── Phase 5: exchange messages after ICE restart ──────────── | COMMENT |
| MEDIUM | tests/data_channel_send_blocking.rs | 123 | // ── Sender (with an explicit small send-buffer limit ⇒ blocking send) ─────── | COMMENT |
| MEDIUM | tests/data_channel_send_blocking.rs | 165 | // ── Receiver ────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/turn_credential_rotation.rs | 202 | // ── 1. Initial allocation on credential A ───────────────────────────── | COMMENT |
| MEDIUM | tests/turn_credential_rotation.rs | 230 | // ── 2. Rotate credentials and restart ICE ───────────────────────────── | COMMENT |
| MEDIUM | tests/turn_credential_rotation.rs | 297 | // ── What actually happened on the wire ──────────────────────────────── | COMMENT |
| MEDIUM | tests/offer_answer_webrtc2webrtc.rs | 21 | // ── Offerer handler ──────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/offer_answer_webrtc2webrtc.rs | 44 | // ── Answerer handler ─────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/offer_answer_webrtc2webrtc.rs | 96 | // ── Test entry point ─────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/offer_answer_webrtc2webrtc.rs | 115 | // ── Channels ─────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/offer_answer_webrtc2webrtc.rs | 124 | // ── Build offerer peer connection ────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/offer_answer_webrtc2webrtc.rs | 178 | // ── Build answerer peer connection ───────────────────────────────────────── | COMMENT |
| MEDIUM | tests/offer_answer_webrtc2webrtc.rs | 213 | // ── Wait for both peers to connect ───────────────────────────────────────── | COMMENT |
| MEDIUM⚡ | tests/offer_answer_webrtc2webrtc.rs | 224 | // ── Wait for offerer DC to open, then send test message ─────────────────── | COMMENT |
| MEDIUM⚡ | tests/offer_answer_webrtc2webrtc.rs | 232 | // ── Wait for answerer to receive and echo ───────────────────────────────── | COMMENT |
| MEDIUM⚡ | tests/offer_answer_webrtc2webrtc.rs | 239 | // ── Wait for offerer to receive echo ───────────────────────────────────── | COMMENT |
| MEDIUM⚡ | tests/offer_answer_webrtc2webrtc.rs | 246 | // ── Assertions ──────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/renegotiation.rs | 23 | // ── Event Handlers ──────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/renegotiation.rs | 65 | // ── Helper functions ────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/renegotiation.rs | 95 | // ── Test Case ───────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/data_channel_send_backpressure.rs | 141 | // ── Sender (with an explicit small send-buffer limit) ─────────────────────── | COMMENT |
| MEDIUM | tests/data_channel_send_backpressure.rs | 189 | // ── Receiver ────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/data_channel_send_backpressure.rs | 222 | // ── Naive flood: push TOTAL_BYTES with NO bufferedAmount flow control ─────── | COMMENT |
| MEDIUM | tests/ice_restart_by_rtc_interop.rs | 179 | // ──────────── Phase 1: wait for initial connection + DC open ──────────── | COMMENT |
| MEDIUM | tests/ice_restart_by_rtc_interop.rs | 286 | // ──────────── Phase 2: exchange messages before ICE restart ──────────── | COMMENT |
| MEDIUM | tests/ice_restart_by_rtc_interop.rs | 360 | // ──────────── Phase 3: ICE restart (initiated by RTC) ──────────── | COMMENT |
| MEDIUM | tests/ice_restart_by_rtc_interop.rs | 452 | // ──────────── Phase 4: wait for reconnection ──────────── | COMMENT |
| MEDIUM | tests/ice_restart_by_rtc_interop.rs | 536 | // ──────────── Phase 5: exchange message after ICE restart ──────────── | COMMENT |
| MEDIUM | tests/statistics.rs | 22 | // ── Event Handlers ──────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/statistics.rs | 69 | // ── Test Case ───────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/data_channel_survives_send_failure.rs | 46 | // ── A runtime whose UDP sends can be made to fail on demand ──────────────────── | COMMENT |
| MEDIUM | tests/data_channel_survives_send_failure.rs | 155 | // ── Handlers ────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/data_channel_survives_send_failure.rs | 202 | // ── Sender, on the runtime whose sends we can break ─────────────────────── | COMMENT |
| MEDIUM | tests/data_channel_survives_send_failure.rs | 249 | // ── Receiver, on the unmodified runtime ─────────────────────────────────── | COMMENT |
| MEDIUM | tests/data_channel_survives_send_failure.rs | 286 | // ── Break every outgoing datagram, then send ────────────────────────────── | COMMENT |
| MEDIUM | tests/data_channel_send_unbounded.rs | 115 | // ── Sender ──────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/data_channel_send_unbounded.rs | 159 | // ── Receiver ────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/data_channel_send_unbounded.rs | 192 | // ── Naive flood with the gate DISABLED (limit=0 ⇒ usize::MAX) ─────────────── | COMMENT |
| MEDIUM | tests/play_save_disk.rs | 35 | // ── Event Handlers ──────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/play_save_disk.rs | 105 | // ── Streaming Helpers ────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/play_save_disk.rs | 185 | // ── Test Case ───────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/media_rejection.rs | 23 | // ── Event Handlers ──────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/media_rejection.rs | 65 | // ── Test Case ───────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/flexfec03_encoder_decoder.rs | 83 | // ── Interceptors ────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/flexfec03_encoder_decoder.rs | 255 | // ── Handlers ────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/flexfec03_encoder_decoder.rs | 277 | // ── Fixtures ────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/flexfec03_encoder_decoder.rs | 316 | // ── Test ────────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/data_channel_close_wakes_send.rs | 162 | // ── Receiver ────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/data_channel_close_wakes_send.rs | 195 | // ── Flood forever with the BLOCKING send() until it errors ────────────────── | COMMENT |
| MEDIUM | tests/crypto_provider_integration.rs | 50 | // ── Provider selection ───────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/crypto_provider_integration.rs | 114 | // ── Handlers ─────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/crypto_provider_integration.rs | 175 | // ── Helpers ──────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/crypto_provider_integration.rs | 268 | // ── Offer / answer ──────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/crypto_provider_integration.rs | 296 | // ── Media across the link (SRTP) ────────────────────────────────────────── | COMMENT |
| 99 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/data_channel_send_after_close.rs | 1 | //! Regression test for the send-cap **terminal-error-on-close** property across every send | COMMENT |
| LOW | tests/media_only_negotiation_no_sctp.rs | 1 | //! Integration test for media-only async WebRTC negotiation without SCTP. | COMMENT |
| LOW | tests/rtcp_processing_webrtc2webrtc.rs | 1 | //! Async webrtc integration test for RTCP processing. | COMMENT |
| LOW | tests/rtcp_processing_webrtc2webrtc.rs | 81 | /// | COMMENT |
| LOW | tests/data_channel_slow_consumer.rs | 1 | //! A reliable, ordered data channel must deliver **every** message even when the | COMMENT |
| LOW | tests/data_channel_slow_consumer.rs | 401 | COMMENT | |
| LOW | tests/data_channels_create_interop.rs | 1 | /// Integration test for data channels create interop between rtc and webrtc | COMMENT |
| LOW | tests/simulcast_rtc_to_webrtc_interop.rs | 1 | /// Integration test for TRUE simulcast with RID (rtc → webrtc) | COMMENT |
| LOW | tests/remote_certificate_fingerprint.rs | 1 | //! Worked example: reading the peers' DTLS certificate fingerprints out of `get_stats`. | COMMENT |
| LOW | tests/data_channel_send_blocking.rs | 1 | //! Integration test for the **blocking** send back-pressure path: `DataChannel::send` with a | COMMENT |
| LOW | tests/turn_credential_rotation.rs | 1 | //! Reproduction for issue #835 — ICE restart after TURN credential rotation must not 437. | COMMENT |
| LOW | tests/data_channel_send_backpressure.rs | 1 | //! Integration test for data-channel send back-pressure via the **non-blocking** | COMMENT |
| LOW | tests/data_channel_send_backpressure.rs | 21 | //! tiny limit vs a large flood this is deterministic, and it is the strongest teeth: | COMMENT |
| LOW | tests/bind_failures_skip_addresses.rs | 1 | //! An address that cannot be bound is skipped, not fatal — unless nothing binds at all | COMMENT |
| LOW | tests/data_channel_stall_does_not_block_media.rs | 1 | //! A stalled data-channel consumer must not stop media on the same peer connection. | COMMENT |
| LOW | tests/data_channel_survives_send_failure.rs | 1 | //! Regression test for issue #776 — an unreliable data channel must survive failed sends. | COMMENT |
| LOW | tests/data_channel_send_unbounded.rs | 1 | //! Integration test for the send back-pressure **escape hatch**: building a connection with | COMMENT |
| LOW | tests/transport_objects.rs | 1 | //! The W3C transport objects are reachable from the async API, and their identities behave. | COMMENT |
| LOW | tests/ice_restart_rebinds_sockets.rs | 1 | //! An ICE restart replaces the UDP transport when the application asks for it (webrtc#868). | COMMENT |
| LOW | tests/ice_restart_rebinds_sockets.rs | 501 | COMMENT | |
| LOW | tests/ice_restart_rebinds_sockets.rs | 661 | ); | COMMENT |
| LOW | tests/dedicated_reactor_drop.rs | 1 | //! Regression tests for the bounded shared reactor pool (issue #101). | COMMENT |
| LOW | tests/flexfec03_encoder_decoder.rs | 1 | //! FlexFEC-03 end to end: the encoder protects, the path loses, the decoder rebuilds. | COMMENT |
| LOW | tests/flexfec03_encoder_decoder.rs | 61 | const NUM_MEDIA_PACKETS: u32 = 10; | COMMENT |
| LOW | tests/wildcard_bind_expands_interfaces.rs | 1 | //! A wildcard bind address means "every local interface", not the wildcard socket (webrtc#874). | COMMENT |
| LOW | tests/data_channel_close_wakes_send.rs | 1 | //! Regression test for the blocking send back-pressure close/drop liveness hang. | COMMENT |
| LOW | tests/on_data_channel_only_for_remote.rs | 1 | //! `on_data_channel` must fire only for channels the **peer** opened. | COMMENT |
| LOW | tests/crypto_provider_integration.rs | 1 | //! End-to-end validation of crypto-provider selection through the public async API. | COMMENT |
| LOW | tests/custom_runtime_interop.rs | 1 | //! Two peer connections, two different runtimes, one process. | COMMENT |
| LOW | tests/common/mod.rs | 1 | //! Shared helpers for the integration tests. | COMMENT |
| LOW | tests/common/mod.rs | 21 | /// The one runtime instance shared by every helper in this module. | COMMENT |
| LOW | .devcontainer/devcontainer.json | 21 | COMMENT | |
| LOW | examples/save-to-disk-h26x/save-to-disk-h26x.rs | 41 | #[command(version = "0.1.0")] | COMMENT |
| LOW | examples/custom-runtime/my_runtime.rs | 1 | //! A third-party async runtime for `webrtc`, over `async-executor` + `async-io`. | COMMENT |
| LOW | examples/custom-runtime/custom-runtime.rs | 1 | //! A third-party async runtime plugged into `webrtc`. | COMMENT |
| LOW | examples/data-channels/data-channels.rs | 21 | #[derive(Parser)] | COMMENT |
| LOW | examples/insertable-streams/insertable-streams.rs | 41 | const CIPHER_KEY: u8 = 0xAA; | COMMENT |
| LOW | …estimation-from-disk/bandwidth-estimation-from-disk.rs | 1 | //! bandwidth-estimation-from-disk: switch between three pre-encoded renditions as the estimate moves. | COMMENT |
| LOW | …estimation-from-disk/bandwidth-estimation-from-disk.rs | 101 | debug: bool, | COMMENT |
| LOW | …estimation-from-disk/bandwidth-estimation-from-disk.rs | 421 | /// | COMMENT |
| LOW | examples/save-to-disk-vpx/save-to-disk-vpx.rs | 41 | #[command(author = "Rain Liu <yliu@webrtc.rs>")] | COMMENT |
| LOW | examples/save-to-disk-fec/save-to-disk-fec.rs | 1 | //! save-to-disk-fec: receive a FlexFEC-03 protected stream, rebuild what the path lost, save it. | COMMENT |
| LOW | examples/save-to-disk-fec/save-to-disk-fec.rs | 61 | use common::{block_on, runtime}; | COMMENT |
| LOW | examples/save-to-disk-fec/save-to-disk-fec.rs | 81 | struct Cli { | COMMENT |
| LOW | examples/common/mod.rs | 1 | //! Shared runtime helpers for the examples. | COMMENT |
| LOW | examples/common/mod.rs | 21 | COMMENT | |
| LOW | examples/data-channels-create/data-channels-create.rs | 21 | #[derive(Parser)] | COMMENT |
| LOW | examples/play-from-disk-fec/play-from-disk-fec.rs | 1 | //! play-from-disk-fec: send video with FlexFEC-03 repair, over a path that drops packets on purpose. | COMMENT |
| LOW | examples/play-from-disk-fec/play-from-disk-fec.rs | 81 | /// The example drops more than that by default, so the browser will still see gaps. That is the | COMMENT |
| LOW | examples/play-from-disk-fec/play-from-disk-fec.rs | 101 | #[command(about = "An example of play-from-disk with FlexFEC-03 over a lossy path.")] | COMMENT |
| LOW | …ta-channels-stress-bench/data-channels-stress-bench.rs | 1 | //! Multi-pair data-channel stress bench — the reproducible A/B harness for | COMMENT |
| LOW | …ta-channels-stress-bench/data-channels-stress-bench.rs | 21 | //! `outstanding_bytes()` and print it, verifying the send counter drains to ~0 | COMMENT |
| LOW | examples/rtcp-processing/rtcp-processing.rs | 61 | COMMENT | |
| LOW | examples/rtcp-processing/rtcp-processing.rs | 141 | fn unbind_remote_stream(&mut self, _info: &StreamInfo) {} | COMMENT |
| LOW | examples/ice-restart/ice-restart.rs | 1 | //! ICE restart example. | COMMENT |
| LOW | examples/data-channels-close/data-channels-close.rs | 21 | #[derive(Parser)] | COMMENT |
| LOW | …flow-control-multi/data-channels-flow-control-multi.rs | 1 | //! Multi-pair data-channel flow-control bench for a single-`poop` N-connection run. | COMMENT |
| LOW | .github/workflows/cargo.yml | 101 | submodules: recursive | COMMENT |
| LOW | src/lib.rs | 1 | #![doc( | COMMENT |
| LOW | src/lib.rs | 21 | //! * **`Runtime`**: A trait abstracting async operations (timers, spawning, sockets). This allows the crate to | COMMENT |
| 98 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tests/data_channel_send_unbounded.rs | 218 | // byte. This is the robust delivery proof — unlike the app-level `received` counter below, it | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | src/peer_connection/mod.rs | 17 | //! ## Creating a Peer Connection | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | scripts/check-channel-overflow-policy.py | 31 | CODE | |
| LOW | scripts/check-crypto-boundary.py | 16 | CODE |