Repository Analysis

ratatui/ratatui

A Rust crate for cooking up terminal user interfaces (TUIs) 👨‍🍳🐀 https://ratatui.rs

16.5 Moderate AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of ratatui/ratatui, a Rust project with 21,668 GitHub stars. SynthScan v2.0 examined 100,804 lines of code across 370 source files, recording 1250 pattern matches distributed across 9 syntactic categories. The overall adjusted score of 16.5 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).

16.5
Adjusted Score
16.5
Raw Score
100%
Time Factor
2026-07-13
Last Push
21.7K
Stars
Rust
Language
100.8K
Lines of Code
370
Files
1.2K
Pattern Hits
2026-07-14
Scan Date
0.01
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 4MEDIUM 197LOW 1049

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 1250 distinct pattern matches across 9 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.

Over-Commented Block1039 hits · 914 pts
SeverityFileLineSnippetContext
LOWratatui-termion/src/lib.rs1// show the feature flags in the generated documentationCOMMENT
LOWratatui-termion/src/lib.rs21//! This crate provides the [Termion] backend implementation for Ratatui.COMMENT
LOWratatui-termion/src/lib.rs61/// This is done by calling [`IntoRawMode::into_raw_mode()`] andCOMMENT
LOWratatui-termion/src/lib.rs81/// let writer = stderr().into_raw_mode()?.into_alternate_screen()?;COMMENT
LOWratatui-termion/src/lib.rs101 writer: W,COMMENT
LOWratatui/Cargo.toml21COMMENT
LOWratatui/Cargo.toml101]COMMENT
LOWratatui/tests/state_serde.rs1//! State like [`ListState`], [`TableState`] and [`ScrollbarState`] can be serialized andCOMMENT
LOWratatui/src/lib.rs1#![no_std]COMMENT
LOWratatui/src/lib.rs21//! </div>COMMENT
LOWratatui/src/lib.rs41//! fn main() -> std::io::Result<()> {COMMENT
LOWratatui/src/lib.rs61//! Most application authors should start with one of these entry points:COMMENT
LOWratatui/src/lib.rs81//! contractsCOMMENT
LOWratatui/src/lib.rs101//! You can also watch the [FOSDEM 2024 talk] about Ratatui which gives a brief introduction toCOMMENT
LOWratatui/src/lib.rs121//! - **[`ratatui-macros`]**: Macros for simplifying the boilerplateCOMMENT
LOWratatui/src/lib.rs141//! [Termwiz]).COMMENT
LOWratatui/src/lib.rs161//! if should_quit()? {COMMENT
LOWratatui/src/lib.rs181//! fn main() -> std::io::Result<()> {COMMENT
LOWratatui/src/lib.rs201//! should surround code outside the application closure, and see the [`init` module] documentationCOMMENT
LOWratatui/src/lib.rs221//! [`render_widget`] method. After this closure returns, a diff is performed and only the changesCOMMENT
LOWratatui/src/lib.rs241//! fn render(frame: &mut Frame) {COMMENT
LOWratatui/src/lib.rs261//! - **If you move the cursor directly:**<br> Cursor changes made through backend-specific APIs orCOMMENT
LOWratatui/src/lib.rs281//! KeyCode::Char('q') => return Ok(true),COMMENT
LOWratatui/src/lib.rs301//! use ratatui::Frame;COMMENT
LOWratatui/src/lib.rs321//!COMMENT
LOWratatui/src/lib.rs341//!COMMENT
LOWratatui/src/lib.rs361//! "!".red().on_light_yellow().italic(),COMMENT
LOWratatui/src/lib.rs381//! [Ratatui Website]: https://ratatui.rs/COMMENT
LOWratatui/src/lib.rs401//! [Styling Text]: https://ratatui.rs/recipes/render/style-text/COMMENT
LOWratatui/src/lib.rs421//! [`Style`]: style::StyleCOMMENT
LOWratatui/src/lib.rs441//! [ARCHITECTURE.md]: https://github.com/ratatui/ratatui/blob/main/ARCHITECTURE.mdCOMMENT
LOWratatui/src/lib.rs461//! [`ratatui-crossterm`]: https://crates.io/crates/ratatui-crosstermCOMMENT
LOWratatui/src/lib.rs481/// re-export the `crossterm` crate so that users don't have to add it as a dependencyCOMMENT
LOWratatui/src/init.rs1//! Terminal initialization and restoration functions.COMMENT
LOWratatui/src/init.rs21//!COMMENT
LOWratatui/src/init.rs41//! - [`DefaultTerminal`] - A type alias for `Terminal<CrosstermBackend<Stdout>>`, providing aCOMMENT
LOWratatui/src/init.rs61//! - [`try_restore`] - Same as [`restore`] but returns a `Result` instead of printing errors.COMMENT
LOWratatui/src/init.rs81//!COMMENT
LOWratatui/src/init.rs101//! _ => {}COMMENT
LOWratatui/src/init.rs121//! ```COMMENT
LOWratatui/src/init.rs141//! loop {COMMENT
LOWratatui/src/init.rs161//! let mut terminal = ratatui::try_init_with_options(options)?;COMMENT
LOWratatui/src/init.rs181//!COMMENT
LOWratatui/src/init.rs201use ratatui_core::terminal::{Terminal, TerminalOptions};COMMENT
LOWratatui/src/init.rs221/// This function is a convenience wrapper around [`init`] and [`restore`], and is useful for simpleCOMMENT
LOWratatui/src/init.rs241/// }COMMENT
LOWratatui/src/init.rs261/// terminal.draw(|frame| frame.render_widget(format!("{GREETING}"), frame.area()))?;COMMENT
LOWratatui/src/init.rs281/// }COMMENT
LOWratatui/src/init.rs301/// Ok(())COMMENT
LOWratatui/src/init.rs321{COMMENT
LOWratatui/src/init.rs341///COMMENT
LOWratatui/src/init.rs361///COMMENT
LOWratatui/src/init.rs381/// Ensure that this method is called *after* your app installs any other panic hooks to ensure theCOMMENT
LOWratatui/src/init.rs401 let backend = CrosstermBackend::new(stdout());COMMENT
LOWratatui/src/init.rs421///COMMENT
LOWratatui/src/init.rs441/// ```rust,no_runCOMMENT
LOWratatui/src/init.rs461/// - Raw mode is enabledCOMMENT
LOWratatui/src/init.rs481/// # ExamplesCOMMENT
LOWratatui/src/init.rs501/// This function should be called before the program exits to ensure that the terminal isCOMMENT
LOWratatui/src/init.rs521/// ```rust,no_runCOMMENT
979 more matches not shown…
Decorative Section Separators190 hits · 690 pts
SeverityFileLineSnippetContext
MEDIUMratatui/src/lib.rs323//! Title Bar───────────────────────────────────COMMENT
MEDIUMratatui/src/lib.rs324//! ┌Left────────────────┐┌Right───────────────┐COMMENT
MEDIUMratatui/src/lib.rs326//! └────────────────────┘└────────────────────┘COMMENT
MEDIUMratatui/src/lib.rs327//! Status Bar──────────────────────────────────COMMENT
MEDIUMexamples/apps/constraint-explorer/src/main.rs62/// ┌──────────────┐COMMENT
MEDIUMexamples/apps/constraint-explorer/src/main.rs65/// └──────────────┘COMMENT
MEDIUMratatui-core/src/layout.rs25//! ┌─────────────→COMMENT
MEDIUMratatui-core/src/layout/layout.rs833 // <───────────────────────────────────area_size──────────────────────────────────>COMMENT
MEDIUMratatui-core/src/layout/layout.rs836 // ┌────┬───────────────────┬────┬─────variables─────┬────┬───────────────────┬────┐COMMENT
MEDIUMratatui-core/src/layout/layout.rs839 // ┌ ┐┌──────────────────┐┌ ┐┌──────────────────┐┌ ┐┌──────────────────┐┌ ┐COMMENT
MEDIUMratatui-core/src/layout/layout.rs841 // └ ┘└──────────────────┘└ ┘└──────────────────┘└ ┘└──────────────────┘└ ┘COMMENT
MEDIUMratatui-core/src/layout/layout.rs844 // └─┬──┶━━━━━━━━━┳━━━━━━━━━┵─┬──┶━━━━━━━━━┳━━━━━━━━━┵─┬──┶━━━━━━━━━┳━━━━━━━━━┵─┬──┘COMMENT
MEDIUMratatui-core/src/layout/layout.rs846 // └────────────╂───────────┴────────────╂───────────┴────────────╂──Spacers──┘COMMENT
MEDIUMratatui-core/src/layout/layout.rs848 // ┗━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━Segments━━━━━━━━┛COMMENT
MEDIUMratatui-core/src/layout/layout.rs931 // ┌────┬───────────────────┬────┬─────variables─────┬────┬───────────────────┬────┐COMMENT
MEDIUMratatui-core/src/layout/layout.rs934 // ┌ ┐┌──────────────────┐┌ ┐┌──────────────────┐┌ ┐┌──────────────────┐┌ ┐COMMENT
MEDIUMratatui-core/src/layout/layout.rs936 // └ ┘└──────────────────┘└ ┘└──────────────────┘└ ┘└──────────────────┘└ ┘COMMENT
MEDIUMratatui-core/src/layout/layout.rs1111/// ┌──────┐┌──────┐COMMENT
MEDIUMratatui-core/src/layout/layout.rs1113/// └──────┘└──────┘COMMENT
MEDIUMratatui-core/src/layout/layout.rs1116/// ┌──────┐┌────────────┐COMMENT
MEDIUMratatui-core/src/layout/layout.rs1118/// └──────┘└────────────┘COMMENT
MEDIUMratatui-core/src/layout/layout.rs1301 /// ┌────────┐COMMENT
MEDIUMratatui-core/src/layout/layout.rs1303 /// └────────┘COMMENT
MEDIUMratatui-core/src/layout/layout.rs1308 /// ┌────────┐COMMENT
MEDIUMratatui-core/src/layout/layout.rs1310 /// └────────┘COMMENT
MEDIUMratatui-core/src/layout/layout.rs1315 /// ┌───────────┐COMMENT
MEDIUMratatui-core/src/layout/layout.rs1317 /// └───────────┘COMMENT
MEDIUMratatui-core/src/layout/layout.rs1322 /// ┌───────────────┐COMMENT
MEDIUMratatui-core/src/layout/layout.rs1324 /// └───────────────┘COMMENT
MEDIUMratatui-core/src/layout/layout.rs1329 /// ┌────────────┐COMMENT
MEDIUMratatui-core/src/layout/layout.rs1331 /// └────────────┘COMMENT
MEDIUMratatui-core/src/layout/layout.rs1336 /// ┌────────┐COMMENT
MEDIUMratatui-core/src/layout/layout.rs1338 /// └────────┘COMMENT
MEDIUMratatui-core/src/layout/layout.rs1343 /// ┌────────┐COMMENT
MEDIUMratatui-core/src/layout/layout.rs1345 /// └────────┘COMMENT
MEDIUMratatui-core/src/layout/layout.rs1350 /// ┌─────────────────────┐COMMENT
MEDIUMratatui-core/src/layout/layout.rs1352 /// └─────────────────────┘COMMENT
MEDIUMratatui-core/src/layout/layout.rs1357 /// ┌────────────┐COMMENT
MEDIUMratatui-core/src/layout/layout.rs1359 /// └────────────┘COMMENT
MEDIUMratatui-core/src/layout/layout.rs30// ┌ ┐┌──────────────────┐┌ ┐┌──────────────────┐┌ ┐┌──────────────────┐┌ ┐COMMENT
MEDIUMratatui-core/src/layout/layout.rs32// └ ┘└──────────────────┘└ ┘└──────────────────┘└ ┘└──────────────────┘└ ┘COMMENT
MEDIUMratatui-core/src/layout/layout.rs1371 /// ┌───────┐COMMENT
MEDIUMratatui-core/src/layout/layout.rs1373 /// └───────┘COMMENT
MEDIUMratatui-core/src/layout/constraint.rs82 /// ┌────────────────────────────┐┌──────────────────┐COMMENT
MEDIUMratatui-core/src/layout/constraint.rs84 /// └────────────────────────────┘└──────────────────┘COMMENT
MEDIUMratatui-core/src/layout/constraint.rs90 /// ┌──────────────────────────────────────┐┌────────┐COMMENT
MEDIUMratatui-core/src/layout/constraint.rs92 /// └──────────────────────────────────────┘└────────┘COMMENT
MEDIUMratatui-core/src/layout/constraint.rs105 /// ┌────────────────────────────┐┌──────────────────┐COMMENT
MEDIUMratatui-core/src/layout/constraint.rs107 /// └────────────────────────────┘└──────────────────┘COMMENT
MEDIUMratatui-core/src/layout/constraint.rs113 /// ┌──────────────────────────────────────┐┌────────┐COMMENT
MEDIUMratatui-core/src/layout/constraint.rs115 /// └──────────────────────────────────────┘└────────┘COMMENT
MEDIUMratatui-core/src/layout/constraint.rs128 /// ┌──────────────────┐┌──────────────────┐COMMENT
MEDIUMratatui-core/src/layout/constraint.rs130 /// └──────────────────┘└──────────────────┘COMMENT
MEDIUMratatui-core/src/layout/constraint.rs136 /// ┌──────────────────┐┌────────────────────────────┐COMMENT
MEDIUMratatui-core/src/layout/constraint.rs138 /// └──────────────────┘└────────────────────────────┘COMMENT
MEDIUMratatui-core/src/layout/constraint.rs156 /// ┌────────────────────────────────────┐┌──────────┐COMMENT
MEDIUMratatui-core/src/layout/constraint.rs158 /// └────────────────────────────────────┘└──────────┘COMMENT
MEDIUMratatui-core/src/layout/constraint.rs164 /// ┌───────────────────────┐┌───────────────────────┐COMMENT
MEDIUMratatui-core/src/layout/constraint.rs166 /// └───────────────────────┘└───────────────────────┘COMMENT
MEDIUMratatui-core/src/layout/constraint.rs180 /// ┌───────────────────────┐┌───────────────────────┐COMMENT
130 more matches not shown…
AI Response Leakage3 hits · 22 pts
SeverityFileLineSnippetContext
HIGHratatui-core/src/text/line.rs830/// In this implementation, the `to_line` method panics if the `Display` implementation returns anCOMMENT
HIGHratatui-core/src/text/span.rs488/// In this implementation, the `to_span` method panics if the `Display` implementation returns anCOMMENT
HIGHratatui-core/src/text/text.rs741/// In this implementation, the `to_text` method panics if the `Display` implementation returns anCOMMENT
AI Slop Vocabulary5 hits · 15 pts
SeverityFileLineSnippetContext
MEDIUM…mples/concepts/state/src/bin/nested-stateful-widget.rs5//! and want to leverage the benefits of the StatefulWidget pattern at multiple levels.COMMENT
MEDIUM.github/workflows/ci.yml25# without having to wait for the comprehensive matrix of tests to complete.COMMENT
MEDIUMratatui-core/src/backend.rs71//! This creates a seamless transition between the application and the regular terminal session, asCOMMENT
MEDIUMratatui-widgets/src/clear.rs27/// For a more complete example how to utilize `Clear` to realize popups seeCOMMENT
MEDIUMratatui-widgets/src/block.rs205/// - [Collapse borders recipe] - Techniques for creating seamless layouts (on the ratatui website)COMMENT
Fake / Example Data7 hits · 7 pts
SeverityFileLineSnippetContext
LOWexamples/apps/popup/src/main.rs59 let paragraph = Paragraph::new("Lorem ipsum").block(popup_block);CODE
LOWratatui-widgets/examples/scrollbar.rs109 Line::from_iter(["Lorem ipsum dolor sit amet, consectetur adipiscing elit.".repeat(10)]),CODE
LOWratatui-widgets/examples/scrollbar.rs109 Line::from_iter(["Lorem ipsum dolor sit amet, consectetur adipiscing elit.".repeat(10)]),CODE
LOWratatui-widgets/examples/shadow.rs124 let sentence = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore CODE
LOWratatui-widgets/examples/shadow.rs124 let sentence = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore CODE
LOWratatui-widgets/src/paragraph.rs1325 let paragraph = Paragraph::new("Lorem ipsum");CODE
LOWratatui-widgets/src/paragraph.rs1334 let paragraph = Paragraph::new("Lorem ipsum");CODE
Synthetic Comment Markers1 hit · 5 pts
SeverityFileLineSnippetContext
HIGHCHANGELOG.md641 > This PR was generated by Claude, and validated by me.CODE
Slop Phrases2 hits · 4 pts
SeverityFileLineSnippetContext
LOWexamples/apps/todo-list/src/main.rs80 "Minnak loves to be pet by you! Don't forget to pet and give some treats!",CODE
MEDIUMratatui-core/src/layout.rs82//! Here's a simple example of creating a basic layout using the [`Layout`] struct:COMMENT
Redundant / Tautological Comments2 hits · 3 pts
SeverityFileLineSnippetContext
LOW.github/workflows/check-pr.yml65 # Check if pattern matchesCOMMENT
LOW.github/workflows/ci.yml233 # Check if README.md is up-to-date with the crate's documentation.COMMENT
Self-Referential Comments1 hit · 3 pts
SeverityFileLineSnippetContext
MEDIUM.github/workflows/release-plz.yml44 # Create a PR with the new versions and changelog, preparing the next release.COMMENT