Switch hosts quickly!
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).
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 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.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | .github/workflows/release.yml | 1 | # SwitchHosts v5 (Tauri) release workflow. | COMMENT |
| LOW | .github/workflows/release.yml | 21 | # Tauri updater signing: | COMMENT |
| LOW | .github/workflows/release.yml | 61 | # This block is the *inter-run* safety net. | COMMENT |
| LOW | .github/workflows/release.yml | 381 | APPLE_ID: ${{ secrets.APPLE_ID }} | COMMENT |
| LOW | .github/workflows/release.yml | 401 | # `updater-manifest` job. Letting tauri-action also write a | COMMENT |
| LOW | .github/workflows/release.yml | 541 | # Read VERSION from package.json (the same source of truth | COMMENT |
| LOW | .github/workflows/release.yml | 581 | return 1 | COMMENT |
| LOW | src-tauri/tests/window_config.rs | 1 | //! Structural canaries for window setup that have no behavioural | COMMENT |
| LOW | src-tauri/tests/window_config.rs | 341 | #[test] | COMMENT |
| LOW | src-tauri/tests/window_config.rs | 361 | // silently break lightweight mode on Windows/Linux — and macOS never | COMMENT |
| LOW | src-tauri/src/http_api.rs | 1 | //! Local HTTP API server. | COMMENT |
| LOW | src-tauri/src/http_api.rs | 21 | //! - `stop()` aborts the join handle and clears the slot. | COMMENT |
| LOW | src-tauri/src/import_export.rs | 1 | //! Manual import / export of v3, v4, and v5 backup JSON files. | COMMENT |
| LOW | src-tauri/src/import_export.rs | 161 | } | COMMENT |
| LOW | src-tauri/src/lib.rs | 161 | if id.starts_with("tray-") { | COMMENT |
| LOW | src-tauri/src/lib.rs | 241 | // path handles the first tray-triggered show identically to | COMMENT |
| LOW | src-tauri/src/lib.rs | 261 | // window from the tray. This is intentional: a hidden- | COMMENT |
| LOW | src-tauri/src/lib.rs | 301 | // recovery dialog — otherwise the user might unknowingly operate | COMMENT |
| LOW | src-tauri/src/lib.rs | 381 | } | COMMENT |
| LOW | src-tauri/src/lib.rs | 401 | // Defer side effects that read/write or expose that fallback root | COMMENT |
| LOW | src-tauri/src/lib.rs | 561 | // state and the closing window is the last live webview, arm | COMMENT |
| LOW | src-tauri/src/tray.rs | 1 | //! System tray for the v5 main app. | COMMENT |
| LOW | src-tauri/src/tray.rs | 41 | COMMENT | |
| LOW | src-tauri/src/tray.rs | 61 | COMMENT | |
| LOW | src-tauri/src/tray.rs | 161 | .map(|cfg| cfg.tray_mini_window) | COMMENT |
| LOW | src-tauri/src/tray.rs | 541 | /// `CGDisplayBounds`, which is in **logical** Cocoa points, but | COMMENT |
| LOW | src-tauri/src/tray.rs | 661 | COMMENT | |
| LOW | src-tauri/src/commands.rs | 1 | //! Tauri commands. | COMMENT |
| LOW | src-tauri/src/commands.rs | 721 | } | COMMENT |
| LOW | src-tauri/src/commands.rs | 1201 | .unwrap_or_else(|| path.to_string()); | COMMENT |
| LOW | src-tauri/src/commands.rs | 1521 | let proxy = proxy_url | COMMENT |
| LOW | src-tauri/src/commands.rs | 1601 | COMMENT | |
| LOW | src-tauri/src/commands.rs | 1781 | .map_err(|e| StorageError::InvalidDataDirChoice { | COMMENT |
| LOW | src-tauri/src/commands.rs | 1821 | /// Reset the data directory back to the default `~/.SwitchHosts`: clear | COMMENT |
| LOW | src-tauri/src/app_menu.rs | 1 | //! Application menu — the macOS menu bar / Windows+Linux window menu. | COMMENT |
| LOW | src-tauri/src/refresh.rs | 1 | //! Remote `hosts` refresh, both renderer-driven and time-driven. | COMMENT |
| LOW | src-tauri/src/lifecycle.rs | 1 | //! Window lifecycle plumbing for the v5 main window. | COMMENT |
| LOW | src-tauri/src/lifecycle.rs | 41 | const GEOMETRY_PERSIST_THROTTLE_MS: u64 = 200; | COMMENT |
| LOW | src-tauri/src/lifecycle.rs | 61 | /// summon the window from the tray, which bypasses — and permanently | COMMENT |
| LOW | src-tauri/src/lifecycle.rs | 101 | } | COMMENT |
| LOW | src-tauri/src/lifecycle.rs | 121 | /// | COMMENT |
| LOW | src-tauri/src/lifecycle.rs | 141 | /// `ExitRequested` while hidden — including Dock → Quit and system | COMMENT |
| LOW | src-tauri/src/lifecycle.rs | 201 | .map(|cfg| cfg.lightweight_mode) | COMMENT |
| LOW | src-tauri/src/lifecycle.rs | 481 | x: logical_pos.x.round() as i32, | COMMENT |
| LOW | src-tauri/src/lifecycle.rs | 1041 | /// Callback registered with `tauri-plugin-single-instance`. A second | COMMENT |
| LOW | src-tauri/src/lifecycle.rs | 1201 | /// process never loads until the user explicitly brings it up from | COMMENT |
| LOW | src-tauri/src/find.rs | 1 | //! Find / replace window plumbing. | COMMENT |
| LOW | src-tauri/src/find.rs | 181 | // Escape regex metacharacters so the user gets a literal | COMMENT |
| LOW | src-tauri/src/bin/swh_helper.rs | 1 | //! `swh_helper` — the SwitchHosts privileged helper daemon (macOS). | COMMENT |
| LOW | src-tauri/src/hosts_apply/elevation.rs | 1 | //! Privileged write to the system hosts file. | COMMENT |
| LOW | src-tauri/src/hosts_apply/elevation.rs | 21 | //! with a process-lifetime cached `AuthorizationRef` (single prompt) | COMMENT |
| LOW | src-tauri/src/hosts_apply/elevation.rs | 221 | // writes reuse it without re-prompting. | COMMENT |
| LOW | src-tauri/src/hosts_apply/elevation.rs | 521 | /// obtained (errAuthorizationInvalidRef or errAuthorizationDenied | COMMENT |
| LOW | src-tauri/src/hosts_apply/elevation.rs | 581 | message: format!( | COMMENT |
| LOW | src-tauri/src/hosts_apply/elevation.rs | 601 | // on unconditionally. NTFS allows `%` in file names, and Windows | COMMENT |
| LOW | src-tauri/src/hosts_apply/elevation.rs | 681 | // worker threads our async commands run on do not carry COM | COMMENT |
| LOW | src-tauri/src/hosts_apply/error.rs | 1 | //! Apply-time error type. | COMMENT |
| LOW | src-tauri/src/hosts_apply/error.rs | 21 | #[allow(dead_code)] | COMMENT |
| LOW | src-tauri/src/hosts_apply/write.rs | 1 | //! System hosts write orchestration. | COMMENT |
| LOW | src-tauri/src/hosts_apply/aggregate.rs | 1 | //! Selected-content aggregation. | COMMENT |
| 37 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | .github/workflows/release.yml | 9 | # ── Required GitHub Secrets ────────────────────────────────────────── | COMMENT |
| MEDIUM | .github/workflows/release.yml | 25 | # ── First-time setup ──────────────────────────────────────────────── | COMMENT |
| MEDIUM | .github/workflows/release.yml | 41 | # ───────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | .github/workflows/release.yml | 174 | # ── Create the draft release ONCE before the matrix builds ──────── | COMMENT |
| MEDIUM | .github/workflows/release.yml | 286 | # ── macOS ────────────────────────────────────────────── | COMMENT |
| MEDIUM | .github/workflows/release.yml | 296 | # ── Linux ────────────────────────────────────────────── | COMMENT |
| MEDIUM | .github/workflows/release.yml | 505 | # ── Finalize release after all platform builds complete ─────────── | COMMENT |
| MEDIUM | .github/workflows/release.yml | 890 | # ── Generate latest.json after release assets are finalized ─────── | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | src-tauri/src/commands.rs | 218 | // Step 1: under a short cfg lock, derive the proposed `next` value | COMMENT |
| LOW | src-tauri/src/commands.rs | 233 | // Step 2: apply the OS-side change first, then persist to disk. If | COMMENT |
| LOW | src-tauri/src/commands.rs | 250 | // Step 3: re-acquire the lock briefly to publish the new value. | COMMENT |
| LOW | src-tauri/src/commands.rs | 697 | // Step 1: previous content, only if not redundant. | COMMENT |
| LOW | src-tauri/src/commands.rs | 712 | // Step 2: new content. | COMMENT |
| LOW | src-tauri/src/refresh.rs | 92 | // Step 1: snapshot the node from the current manifest. No lock — | COMMENT |
| LOW⚡ | src-tauri/src/refresh.rs | 109 | // Step 2: fetch the new content. May take seconds; lockless. | COMMENT |
| LOW⚡ | src-tauri/src/refresh.rs | 112 | // Step 3: compare with the entries file (always LF on disk). The | COMMENT |
| LOW | src-tauri/src/refresh.rs | 131 | // Step 4: re-acquire the manifest under the store lock and stamp | COMMENT |
| LOW | src-tauri/src/refresh.rs | 155 | // Step 5: tell the UI. Both events match the Electron broadcast | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | src-tauri/src/commands.rs | 218 | // Step 1: under a short cfg lock, derive the proposed `next` value | COMMENT |
| LOW | src-tauri/src/commands.rs | 233 | // Step 2: apply the OS-side change first, then persist to disk. If | COMMENT |
| LOW | src-tauri/src/commands.rs | 250 | // Step 3: re-acquire the lock briefly to publish the new value. | COMMENT |
| LOW | src-tauri/src/commands.rs | 697 | // Step 1: previous content, only if not redundant. | COMMENT |
| LOW | src-tauri/src/commands.rs | 712 | // Step 2: new content. | COMMENT |
| LOW | src-tauri/src/refresh.rs | 92 | // Step 1: snapshot the node from the current manifest. No lock — | COMMENT |
| LOW⚡ | src-tauri/src/refresh.rs | 109 | // Step 2: fetch the new content. May take seconds; lockless. | COMMENT |
| LOW⚡ | src-tauri/src/refresh.rs | 112 | // Step 3: compare with the entries file (always LF on disk). The | COMMENT |
| LOW | src-tauri/src/refresh.rs | 131 | // Step 4: re-acquire the manifest under the store lock and stamp | COMMENT |
| LOW | src-tauri/src/refresh.rs | 155 | // Step 5: tell the UI. Both events match the Electron broadcast | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | e2e/preferences.spec.ts | 13 | async function expectVerticalCentersAligned(label: Locator, control: Locator) { | CODE |
| LOW | src/renderer/core/notify.ts | 37 | export function getFriendlyUpdateErrorMessage( | CODE |
| LOW | src/renderer/core/notify.ts | 137 | export function updateSuccessNotification(id: string, { title, message }: AppNotificationOptions) { | CODE |
| LOW | src/renderer/components/Pref/configSync.ts | 7 | export function mergeConfigUpdateIntoDraft( | CODE |
| LOW | src/renderer/components/Pref/languageOptions.ts | 27 | export function normalizeLanguageOptionValue( | CODE |
| LOW | src/renderer/components/Pref/languageOptions.ts | 38 | export function resolveLanguageSelectValue( | CODE |
| LOW | src/renderer/pages/find.tsx | 122 | export function sanitizeFindResultColumnWidths(widths?: number[] | null): ResultColumnWidths | null { | CODE |
| LOW | src/renderer/pages/find.tsx | 132 | export function getDefaultFindResultFixedColumnWidths( | CODE |
| LOW | src/renderer/pages/find.tsx | 148 | export function getFindResultColumnWidths( | CODE |
| LOW⚡ | src/renderer/pages/find.tsx | 162 | function normalizeFindResultColumnMaxWidth(maxColumnWidth?: number) { | CODE |
| LOW⚡ | src/renderer/pages/find.tsx | 168 | function normalizeFindResultColumnWidth(width: number) { | CODE |
| LOW⚡ | src/renderer/pages/find.tsx | 172 | function getFindResultDragColumnMaxWidth(currentWidth: number, maxColumnWidth: number) { | CODE |
| LOW⚡ | src/renderer/pages/find.tsx | 176 | function clampFindResultColumnWidthForDrag( | CODE |
| LOW | src/renderer/pages/find.tsx | 187 | export function resizeFindResultFixedColumnWidths( | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | .github/workflows/release.yml | 40 | # Set APPLE_TEAM_ID to J5J6USUX2F. | COMMENT |