Repository Analysis

oldj/SwitchHosts

Switch hosts quickly!

3.9 Likely human-written View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of oldj/SwitchHosts, a Rust project with 26,945 GitHub stars. SynthScan v2.0 examined 44,466 lines of code across 218 source files, recording 140 pattern matches distributed across 6 syntactic categories. The overall adjusted score of 3.9 places this repository in the Likely human-written 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).

3.9
Adjusted Score
3.9
Raw Score
100%
Time Factor
2026-07-04
Last Push
26.9K
Stars
Rust
Language
44.5K
Lines of Code
218
Files
140
Pattern Hits
2026-07-14
Scan Date
0.00
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 0MEDIUM 8LOW 132

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 140 distinct pattern matches across 6 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 Block97 hits · 97 pts
SeverityFileLineSnippetContext
LOW.github/workflows/release.yml1# SwitchHosts v5 (Tauri) release workflow.COMMENT
LOW.github/workflows/release.yml21# Tauri updater signing:COMMENT
LOW.github/workflows/release.yml61# This block is the *inter-run* safety net.COMMENT
LOW.github/workflows/release.yml381 APPLE_ID: ${{ secrets.APPLE_ID }}COMMENT
LOW.github/workflows/release.yml401 # `updater-manifest` job. Letting tauri-action also write aCOMMENT
LOW.github/workflows/release.yml541 # Read VERSION from package.json (the same source of truthCOMMENT
LOW.github/workflows/release.yml581 return 1COMMENT
LOWsrc-tauri/tests/window_config.rs1//! Structural canaries for window setup that have no behaviouralCOMMENT
LOWsrc-tauri/tests/window_config.rs341#[test]COMMENT
LOWsrc-tauri/tests/window_config.rs361 // silently break lightweight mode on Windows/Linux — and macOS neverCOMMENT
LOWsrc-tauri/src/http_api.rs1//! Local HTTP API server.COMMENT
LOWsrc-tauri/src/http_api.rs21//! - `stop()` aborts the join handle and clears the slot.COMMENT
LOWsrc-tauri/src/import_export.rs1//! Manual import / export of v3, v4, and v5 backup JSON files.COMMENT
LOWsrc-tauri/src/import_export.rs161 }COMMENT
LOWsrc-tauri/src/lib.rs161 if id.starts_with("tray-") {COMMENT
LOWsrc-tauri/src/lib.rs241 // path handles the first tray-triggered show identically toCOMMENT
LOWsrc-tauri/src/lib.rs261 // window from the tray. This is intentional: a hidden-COMMENT
LOWsrc-tauri/src/lib.rs301 // recovery dialog — otherwise the user might unknowingly operateCOMMENT
LOWsrc-tauri/src/lib.rs381 }COMMENT
LOWsrc-tauri/src/lib.rs401 // Defer side effects that read/write or expose that fallback rootCOMMENT
LOWsrc-tauri/src/lib.rs561 // state and the closing window is the last live webview, armCOMMENT
LOWsrc-tauri/src/tray.rs1//! System tray for the v5 main app.COMMENT
LOWsrc-tauri/src/tray.rs41COMMENT
LOWsrc-tauri/src/tray.rs61COMMENT
LOWsrc-tauri/src/tray.rs161 .map(|cfg| cfg.tray_mini_window)COMMENT
LOWsrc-tauri/src/tray.rs541/// `CGDisplayBounds`, which is in **logical** Cocoa points, butCOMMENT
LOWsrc-tauri/src/tray.rs661COMMENT
LOWsrc-tauri/src/commands.rs1//! Tauri commands.COMMENT
LOWsrc-tauri/src/commands.rs721 }COMMENT
LOWsrc-tauri/src/commands.rs1201 .unwrap_or_else(|| path.to_string());COMMENT
LOWsrc-tauri/src/commands.rs1521 let proxy = proxy_urlCOMMENT
LOWsrc-tauri/src/commands.rs1601COMMENT
LOWsrc-tauri/src/commands.rs1781 .map_err(|e| StorageError::InvalidDataDirChoice {COMMENT
LOWsrc-tauri/src/commands.rs1821/// Reset the data directory back to the default `~/.SwitchHosts`: clearCOMMENT
LOWsrc-tauri/src/app_menu.rs1//! Application menu — the macOS menu bar / Windows+Linux window menu.COMMENT
LOWsrc-tauri/src/refresh.rs1//! Remote `hosts` refresh, both renderer-driven and time-driven.COMMENT
LOWsrc-tauri/src/lifecycle.rs1//! Window lifecycle plumbing for the v5 main window.COMMENT
LOWsrc-tauri/src/lifecycle.rs41const GEOMETRY_PERSIST_THROTTLE_MS: u64 = 200;COMMENT
LOWsrc-tauri/src/lifecycle.rs61/// summon the window from the tray, which bypasses — and permanentlyCOMMENT
LOWsrc-tauri/src/lifecycle.rs101 }COMMENT
LOWsrc-tauri/src/lifecycle.rs121///COMMENT
LOWsrc-tauri/src/lifecycle.rs141/// `ExitRequested` while hidden — including Dock → Quit and systemCOMMENT
LOWsrc-tauri/src/lifecycle.rs201 .map(|cfg| cfg.lightweight_mode)COMMENT
LOWsrc-tauri/src/lifecycle.rs481 x: logical_pos.x.round() as i32,COMMENT
LOWsrc-tauri/src/lifecycle.rs1041/// Callback registered with `tauri-plugin-single-instance`. A secondCOMMENT
LOWsrc-tauri/src/lifecycle.rs1201/// process never loads until the user explicitly brings it up fromCOMMENT
LOWsrc-tauri/src/find.rs1//! Find / replace window plumbing.COMMENT
LOWsrc-tauri/src/find.rs181 // Escape regex metacharacters so the user gets a literalCOMMENT
LOWsrc-tauri/src/bin/swh_helper.rs1//! `swh_helper` — the SwitchHosts privileged helper daemon (macOS).COMMENT
LOWsrc-tauri/src/hosts_apply/elevation.rs1//! Privileged write to the system hosts file.COMMENT
LOWsrc-tauri/src/hosts_apply/elevation.rs21//! with a process-lifetime cached `AuthorizationRef` (single prompt)COMMENT
LOWsrc-tauri/src/hosts_apply/elevation.rs221// writes reuse it without re-prompting.COMMENT
LOWsrc-tauri/src/hosts_apply/elevation.rs521/// obtained (errAuthorizationInvalidRef or errAuthorizationDeniedCOMMENT
LOWsrc-tauri/src/hosts_apply/elevation.rs581 message: format!(COMMENT
LOWsrc-tauri/src/hosts_apply/elevation.rs601// on unconditionally. NTFS allows `%` in file names, and WindowsCOMMENT
LOWsrc-tauri/src/hosts_apply/elevation.rs681 // worker threads our async commands run on do not carry COMCOMMENT
LOWsrc-tauri/src/hosts_apply/error.rs1//! Apply-time error type.COMMENT
LOWsrc-tauri/src/hosts_apply/error.rs21 #[allow(dead_code)]COMMENT
LOWsrc-tauri/src/hosts_apply/write.rs1//! System hosts write orchestration.COMMENT
LOWsrc-tauri/src/hosts_apply/aggregate.rs1//! Selected-content aggregation.COMMENT
37 more matches not shown…
Decorative Section Separators8 hits · 24 pts
SeverityFileLineSnippetContext
MEDIUM.github/workflows/release.yml9# ── Required GitHub Secrets ──────────────────────────────────────────COMMENT
MEDIUM.github/workflows/release.yml25# ── First-time setup ────────────────────────────────────────────────COMMENT
MEDIUM.github/workflows/release.yml41# ─────────────────────────────────────────────────────────────────────COMMENT
MEDIUM.github/workflows/release.yml174 # ── Create the draft release ONCE before the matrix builds ────────COMMENT
MEDIUM.github/workflows/release.yml286 # ── macOS ──────────────────────────────────────────────COMMENT
MEDIUM.github/workflows/release.yml296 # ── Linux ──────────────────────────────────────────────COMMENT
MEDIUM.github/workflows/release.yml505 # ── Finalize release after all platform builds complete ───────────COMMENT
MEDIUM.github/workflows/release.yml890 # ── Generate latest.json after release assets are finalized ───────COMMENT
Verbosity Indicators10 hits · 16 pts
SeverityFileLineSnippetContext
LOWsrc-tauri/src/commands.rs218 // Step 1: under a short cfg lock, derive the proposed `next` valueCOMMENT
LOWsrc-tauri/src/commands.rs233 // Step 2: apply the OS-side change first, then persist to disk. IfCOMMENT
LOWsrc-tauri/src/commands.rs250 // Step 3: re-acquire the lock briefly to publish the new value.COMMENT
LOWsrc-tauri/src/commands.rs697 // Step 1: previous content, only if not redundant.COMMENT
LOWsrc-tauri/src/commands.rs712 // Step 2: new content.COMMENT
LOWsrc-tauri/src/refresh.rs92 // Step 1: snapshot the node from the current manifest. No lock —COMMENT
LOWsrc-tauri/src/refresh.rs109 // Step 2: fetch the new content. May take seconds; lockless.COMMENT
LOWsrc-tauri/src/refresh.rs112 // Step 3: compare with the entries file (always LF on disk). TheCOMMENT
LOWsrc-tauri/src/refresh.rs131 // Step 4: re-acquire the manifest under the store lock and stampCOMMENT
LOWsrc-tauri/src/refresh.rs155 // Step 5: tell the UI. Both events match the Electron broadcastCOMMENT
Structural Annotation Overuse10 hits · 16 pts
SeverityFileLineSnippetContext
LOWsrc-tauri/src/commands.rs218 // Step 1: under a short cfg lock, derive the proposed `next` valueCOMMENT
LOWsrc-tauri/src/commands.rs233 // Step 2: apply the OS-side change first, then persist to disk. IfCOMMENT
LOWsrc-tauri/src/commands.rs250 // Step 3: re-acquire the lock briefly to publish the new value.COMMENT
LOWsrc-tauri/src/commands.rs697 // Step 1: previous content, only if not redundant.COMMENT
LOWsrc-tauri/src/commands.rs712 // Step 2: new content.COMMENT
LOWsrc-tauri/src/refresh.rs92 // Step 1: snapshot the node from the current manifest. No lock —COMMENT
LOWsrc-tauri/src/refresh.rs109 // Step 2: fetch the new content. May take seconds; lockless.COMMENT
LOWsrc-tauri/src/refresh.rs112 // Step 3: compare with the entries file (always LF on disk). TheCOMMENT
LOWsrc-tauri/src/refresh.rs131 // Step 4: re-acquire the manifest under the store lock and stampCOMMENT
LOWsrc-tauri/src/refresh.rs155 // Step 5: tell the UI. Both events match the Electron broadcastCOMMENT
Hyper-Verbose Identifiers14 hits · 16 pts
SeverityFileLineSnippetContext
LOWe2e/preferences.spec.ts13async function expectVerticalCentersAligned(label: Locator, control: Locator) {CODE
LOWsrc/renderer/core/notify.ts37export function getFriendlyUpdateErrorMessage(CODE
LOWsrc/renderer/core/notify.ts137export function updateSuccessNotification(id: string, { title, message }: AppNotificationOptions) {CODE
LOWsrc/renderer/components/Pref/configSync.ts7export function mergeConfigUpdateIntoDraft(CODE
LOWsrc/renderer/components/Pref/languageOptions.ts27export function normalizeLanguageOptionValue(CODE
LOWsrc/renderer/components/Pref/languageOptions.ts38export function resolveLanguageSelectValue(CODE
LOWsrc/renderer/pages/find.tsx122export function sanitizeFindResultColumnWidths(widths?: number[] | null): ResultColumnWidths | null {CODE
LOWsrc/renderer/pages/find.tsx132export function getDefaultFindResultFixedColumnWidths(CODE
LOWsrc/renderer/pages/find.tsx148export function getFindResultColumnWidths(CODE
LOWsrc/renderer/pages/find.tsx162function normalizeFindResultColumnMaxWidth(maxColumnWidth?: number) {CODE
LOWsrc/renderer/pages/find.tsx168function normalizeFindResultColumnWidth(width: number) {CODE
LOWsrc/renderer/pages/find.tsx172function getFindResultDragColumnMaxWidth(currentWidth: number, maxColumnWidth: number) {CODE
LOWsrc/renderer/pages/find.tsx176function clampFindResultColumnWidthForDrag(CODE
LOWsrc/renderer/pages/find.tsx187export function resizeFindResultFixedColumnWidths(CODE
Redundant / Tautological Comments1 hit · 2 pts
SeverityFileLineSnippetContext
LOW.github/workflows/release.yml40# Set APPLE_TEAM_ID to J5J6USUX2F.COMMENT