Repository Analysis

chenglou/pretext

Fast, accurate & comprehensive text measurement & layout

4.4 Likely human-written View on GitHub
4.4
Adjusted Score
4.4
Raw Score
100%
Time Factor
2026-05-23
Last Push
47,959
Stars
TypeScript
Language
44,471
Lines of Code
118
Files
133
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 0HIGH 1MEDIUM 26LOW 106

Pattern Findings

133 matches across 6 categories. Click a row to expand file-level details.

Hyper-Verbose Identifiers94 hits · 93 pts
SeverityFileLineSnippet
LOWshared/navigation-state.ts23export function buildNavigationReportHash(report: unknown): string {
LOWscripts/browser-automation.ts40function getFrontmostApplicationName(): string | null {
LOWscripts/browser-automation.ts52function restoreFrontmostApplication(name: string | null): void {
LOWscripts/browser-automation.ts167export async function acquireBrowserAutomationLock(
LOWscripts/build-demo-site.ts88function rewriteDemoLinksForStaticRoot(html: string, targetRelativePath: string): string {
LOWpages/corpus.ts289function getEnvironmentFingerprint(): EnvironmentFingerprint {
LOWpages/accuracy.ts99function getEnvironmentFingerprint(): EnvironmentFingerprint {
LOWpages/benchmark.ts255function buildLongBreakableStressText(repeatCount: number): string {
LOWpages/benchmark.ts273function buildRichInlineStressItems(text: string): RichInlineItem[] {
LOWpages/benchmark.ts320function buildPreWrapChunkStressText(seed: number, lineCount: number): string {
LOWpages/benchmark.ts406function profilePrepareForBenchmark(text: string, font: string): PrepareProfile {
LOWpages/benchmark.ts564function buildRichInlineBenchmarks(
LOWpages/demos/dynamic-layout.ts236function getPreparedSingleLineWidth(prepared: PreparedTextWithSegments): number {
LOWpages/demos/dynamic-layout.ts892 requestAnimationFrame(function renderAndMaybeScheduleAnotherRender(now) {
LOWpages/demos/markdown-chat.model.ts243export function createPreparedChatTemplates(
LOWpages/demos/markdown-chat.model.ts510function buildPreparedInlineBlocks(
LOWpages/demos/markdown-chat.model.ts844function resolveListMarkerClassName(
LOWpages/demos/markdown-chat.model.ts905function stripSingleTrailingNewline(text: string): string {
LOWpages/demos/markdown-chat.model.ts1011export function materializeTemplateBlocks(message: ChatMessageInstance): BlockLayout[] {
LOWpages/demos/wrap-geometry.ts73export function getPolygonIntervalForBand(
LOWpages/demos/editorial-engine.ts610function isTextSelectionInteractionActive(): boolean {
LOWpages/demos/editorial-engine.ts617 scheduledRaf = requestAnimationFrame(function renderAndMaybeScheduleEditorialFrame(now) {
LOWpages/demos/justification-comparison.ts73 requestAnimationFrame(function syncCssOverlayAfterLayout() {
LOWpages/demos/justification-comparison.model.ts233function buildMeasuredLineFromLayoutResult(
LOWpages/demos/justification-comparison.model.ts354function getLineStatsFromBreakCandidates(
LOWpages/demos/justification-comparison.model.ts436function buildMeasuredLineFromCandidateRange(
LOWpages/demos/bubbles.html10 (function syncInitialBubbleGeometry() {
LOWpages/demos/bubbles.html212 (function applyInitialBubbleControls() {
LOWpages/demos/bubbles.html285 (function applyInitialShrinkwrapRender() {
LOWpages/demos/masonry/index.ts101function getOrCreateCardNode(cardIndex: number): HTMLDivElement {
LOWpages/demos/masonry/index.ts120 scheduledRaf = requestAnimationFrame(function renderAndMaybeScheduleAnotherRender() {
LOWsrc/line-break.ts50function normalizeLineStartSegmentIndex(
LOWsrc/line-break.ts89function getTabTrailingLetterSpacing(
LOWsrc/line-break.ts101function getWholeSegmentFitContribution(
LOWsrc/line-break.ts114function getBreakOpportunityFitContribution(
LOWsrc/line-break.ts124function getLineEndPaintContribution(
LOWsrc/line-break.ts135function getBreakableGraphemeAdvance(
LOWsrc/line-break.ts145function getBreakableCandidateFitWidth(
LOWsrc/line-break.ts154function getNextPreferredBreakIndex(
LOWsrc/line-break.ts234function normalizeLineStartInChunk(
LOWsrc/line-break.ts264export function normalizePreparedLineStart(
LOWsrc/line-break.ts275function normalizeLineStartChunkIndexFromHint(
LOWsrc/line-break.ts370 function appendBreakableSegmentFrom(segmentIndex: number, startGraphemeIndex: number): void {
LOWsrc/line-break.ts593 function updatePendingBreakForWholeSegment(
LOWsrc/line-break.ts610 function appendBreakableSegmentFrom(segmentIndex: number, startGraphemeIndex: number): void {
LOWsrc/line-break.ts787function stepPreparedChunkLineGeometry(
LOWsrc/line-break.ts874 function updatePendingBreakForWholeSegment(
LOWsrc/line-break.ts891 function appendBreakableSegmentFrom(segmentIndex: number, startGraphemeIndex: number): number | null {
LOWsrc/line-break.ts1036function stepPreparedSimpleLineGeometry(
LOWsrc/line-break.ts1161export function stepPreparedLineGeometryFromChunk(
LOWsrc/line-break.ts1184export function measurePreparedLineGeometry(
LOWsrc/measurement.ts119function getSharedGraphemeSegmenter(): Intl.Segmenter {
LOWsrc/measurement.ts185export function getSegmentBreakableFitAdvances(
LOWsrc/layout.ts78function getSharedGraphemeSegmenter(): Intl.Segmenter {
LOWsrc/layout.ts341function countRenderedSpacingGraphemes(
LOWsrc/layout.ts372function getBreakablePreferredBreaks(text: string): number[] | null {
LOWsrc/layout.ts626function mapAnalysisChunksToPreparedChunks(
LOWsrc/layout.test.ts169function reconstructFromLineBoundaries(
LOWsrc/layout.test.ts194function collectStreamedLinesWithWidths(
LOWsrc/layout.test.ts219function reconstructFromWalkedRanges(
34 more matches not shown…
Decorative Section Separators24 hits · 80 pts
SeverityFileLineSnippet
MEDIUMscripts/unicode/DerivedBidiClass-17.0.0.txt2542# ================================================
MEDIUMscripts/unicode/DerivedBidiClass-17.0.0.txt2550# ================================================
MEDIUMscripts/unicode/DerivedBidiClass-17.0.0.txt2558# ================================================
MEDIUMscripts/unicode/DerivedBidiClass-17.0.0.txt2566# ================================================
MEDIUMscripts/unicode/DerivedBidiClass-17.0.0.txt2574# ================================================
MEDIUMscripts/unicode/DerivedBidiClass-17.0.0.txt2582# ================================================
MEDIUMscripts/unicode/DerivedBidiClass-17.0.0.txt2590# ================================================
MEDIUMscripts/unicode/DerivedBidiClass-17.0.0.txt2598# ================================================
MEDIUMscripts/unicode/DerivedBidiClass-17.0.0.txt2606# ================================================
MEDIUMscripts/unicode/DerivedBidiClass-17.0.0.txt10# ================================================
MEDIUMscripts/unicode/DerivedBidiClass-17.0.0.txt126# ================================================
MEDIUMscripts/unicode/DerivedBidiClass-17.0.0.txt1235# ================================================
MEDIUMscripts/unicode/DerivedBidiClass-17.0.0.txt1349# ================================================
MEDIUMscripts/unicode/DerivedBidiClass-17.0.0.txt1370# ================================================
MEDIUMscripts/unicode/DerivedBidiClass-17.0.0.txt1387# ================================================
MEDIUMscripts/unicode/DerivedBidiClass-17.0.0.txt1426# ================================================
MEDIUMscripts/unicode/DerivedBidiClass-17.0.0.txt1442# ================================================
MEDIUMscripts/unicode/DerivedBidiClass-17.0.0.txt1462# ================================================
MEDIUMscripts/unicode/DerivedBidiClass-17.0.0.txt1474# ================================================
MEDIUMscripts/unicode/DerivedBidiClass-17.0.0.txt1484# ================================================
MEDIUMscripts/unicode/DerivedBidiClass-17.0.0.txt1498# ================================================
MEDIUMscripts/unicode/DerivedBidiClass-17.0.0.txt2027# ================================================
MEDIUMscripts/unicode/DerivedBidiClass-17.0.0.txt2071# ================================================
MEDIUMscripts/unicode/DerivedBidiClass-17.0.0.txt2446# ================================================
AI Slop Vocabulary3 hits · 8 pts
SeverityFileLineSnippet
MEDIUMpages/demos/masonry/shower-thoughts.json1["Men's public restrooms are laid out all wrong. It should be urinal, stall, urinal, stall, urinal instead of urinal, ur
MEDIUMpages/demos/masonry/shower-thoughts.json1["Men's public restrooms are laid out all wrong. It should be urinal, stall, urinal, stall, urinal instead of urinal, ur
LOWpages/demos/masonry/shower-thoughts.json1["Men's public restrooms are laid out all wrong. It should be urinal, stall, urinal, stall, urinal instead of urinal, ur
Synthetic Comment Markers1 hit · 8 pts
SeverityFileLineSnippet
HIGHpages/demos/masonry/shower-thoughts.json1["Men's public restrooms are laid out all wrong. It should be urinal, stall, urinal, stall, urinal instead of urinal, ur
Over-Commented Block10 hits · 7 pts
SeverityFileLineSnippet
LOWscripts/unicode/DerivedBidiClass-17.0.0.txt1# DerivedBidiClass-17.0.0.txt
LOWscripts/unicode/DerivedBidiClass-17.0.0.txt21#
LOWscripts/unicode/DerivedBidiClass-17.0.0.txt41# @missing: 07C0..085F; Right_To_Left
LOWscripts/unicode/DerivedBidiClass-17.0.0.txt61# @missing: FE70..FEFF; Arabic_Letter
LOWscripts/unicode/DerivedBidiClass-17.0.0.txt81# 10C00..10C4F Old_Turkic
LOWscripts/unicode/DerivedBidiClass-17.0.0.txt101
LOWpages/demos/wrap-geometry.ts121// Given one allowed horizontal interval and a set of blocked intervals,
LOWsrc/layout.ts1// Text measurement for browser environments using canvas measureText.
LOWsrc/layout.ts21//
LOWsrc/layout.ts661): InternalPreparedText | PreparedTextWithSegments {
Slop Phrases1 hit · 2 pts
SeverityFileLineSnippet
LOWpages/demos/masonry/shower-thoughts.json1["Men's public restrooms are laid out all wrong. It should be urinal, stall, urinal, stall, urinal instead of urinal, ur