Switch hosts quickly!
This report summarizes scanner evidence for oldj/SwitchHosts, a TypeScript project with 27,341 GitHub stars. SynthScan examined 64,405 lines of code across 280 source files, recording 139 pattern matches distributed across 7 syntactic categories. The legacy adjusted pattern signal is 3.2 (Low pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Payload schema: 1.0.0 · Engine: 2.0.0 · Scoring: heuristic-density-v1 · Scan date: 2026-10-31.
Can maintainers explain intent, assumptions, and trade-offs? 127 finding(s).
Are imports declared and package/API names verified? 4 finding(s).
Are wrappers, guards, and repeated structures necessary? 24 finding(s).
Which changes need focused human review? 139 finding(s).
This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 139 distinct pattern matches across 7 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. 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 configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| 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 | //! When the toggle is applied in the backend (no renderer, see below) | COMMENT |
| LOW | src-tauri/src/http_api.rs | 41 | //! nobody while the endpoint still answers `ok`. The v5 storage plan | COMMENT |
| LOW | src-tauri/src/lib.rs | 161 | .on_menu_event(|app, event| { | COMMENT |
| LOW | src-tauri/src/lib.rs | 241 | // We build the main window programmatically (rather than | COMMENT |
| LOW | src-tauri/src/lib.rs | 261 | // Only `pages/index.tsx` (the main window's React root) broadcasts | COMMENT |
| LOW | src-tauri/src/lib.rs | 301 | .unwrap_or(false); | COMMENT |
| LOW | src-tauri/src/lib.rs | 401 | // clears the login-launch grace window. | COMMENT |
| LOW | src-tauri/src/lib.rs | 561 | // data dir | COMMENT |
| LOW | src-tauri/src/lib.rs | 581 | // and `prevent_exit` only when the guard above was armed by a | COMMENT |
| LOW | src-tauri/src/tray.rs | 1 | //! System tray for the v5 main app. | COMMENT |
| LOW | src-tauri/src/tray.rs | 61 | /// click-outside monitor after the tray click handler has already | COMMENT |
| LOW | src-tauri/src/tray.rs | 81 | COMMENT | |
| LOW | src-tauri/src/tray.rs | 181 | // paths can interleave differently across platforms, so handle | COMMENT |
| LOW | src-tauri/src/tray.rs | 541 | Ok(window) | COMMENT |
| LOW | src-tauri/src/tray.rs | 561 | /// lookup misses every display and falls back to the primary | COMMENT |
| LOW | src-tauri/src/tray.rs | 681 | // Tauri's `Focused(false)` event is unreliable as a click-outside signal | COMMENT |
| LOW | src-tauri/src/commands.rs | 1 | //! Tauri commands. | COMMENT |
| LOW | src-tauri/src/commands.rs | 241 | // and remember whether launch_at_login is changing. We deliberately | COMMENT |
| LOW | src-tauri/src/commands.rs | 301 | key: "launch_at_login".into(), | COMMENT |
| LOW | src-tauri/src/commands.rs | 1821 | let proxy = proxy_url | COMMENT |
| LOW | src-tauri/src/commands.rs | 1901 | COMMENT | |
| LOW | src-tauri/src/commands.rs | 2081 | data_dir_pointer::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 | 1041 | if window.is_minimized().unwrap_or(false) { | COMMENT |
| LOW | src-tauri/src/lifecycle.rs | 1081 | /// apart. The login-launch grace window armed at setup is that signal: | COMMENT |
| LOW | src-tauri/src/lifecycle.rs | 1221 | COMMENT | |
| LOW | src-tauri/src/find.rs | 1 | //! Find / replace window plumbing. | COMMENT |
| LOW | src-tauri/src/find.rs | 181 | } else { | 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 | 61 | // ---- privileged-write strategy --------------------------------------------- | COMMENT |
| LOW | src-tauri/src/hosts_apply/elevation.rs | 221 | &super::write::windows_system_hosts_path()?, | COMMENT |
| LOW | src-tauri/src/hosts_apply/elevation.rs | 541 | // ---- Linux: pkexec --------------------------------------------------------- | COMMENT |
| LOW | src-tauri/src/hosts_apply/elevation.rs | 601 | COMMENT | |
| LOW | src-tauri/src/hosts_apply/elevation.rs | 681 | let verb = to_wide(OsStr::new("runas")); | COMMENT |
| LOW | src-tauri/src/hosts_apply/elevation.rs | 701 | // CoInitializeEx returns: | COMMENT |
| LOW | src-tauri/src/hosts_apply/error.rs | 1 | //! Apply-time error type. | COMMENT |
| LOW | src-tauri/src/hosts_apply/write.rs | 1 | //! System hosts write orchestration. | COMMENT |
| LOW | src-tauri/src/hosts_apply/write.rs | 341 | /// Rebuild the hosts file around the SwitchHosts-managed section. | COMMENT |
| LOW | src-tauri/src/hosts_apply/write.rs | 381 | result | COMMENT |
| 38 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| CRITICAL | src/renderer/models/useHostsData.test.tsx | 418 | expect(main.result.current.first.hostsData.list.map((node) => node.id)).toEqual(['b', 'a']) | CODE |
| CRITICAL | src/renderer/models/useHostsData.test.tsx | 435 | expect(tray.result.current.first.hostsData.list.map((node) => node.id)).toEqual(['b', 'a']) | CODE |
| CRITICAL | src/renderer/models/useHostsData.test.tsx | 441 | expect(reopenedTray.result.current.first.hostsData.list.map((node) => node.id)).toEqual([ | CODE |
| CRITICAL | src/renderer/models/useHostsData.test.tsx | 453 | expect(reopenedTray.result.current.first.hostsData.list.map((node) => node.id)).toEqual([ | CODE |
| 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 | 881 | # ── Generate latest.json after release assets are finalized ─────── | 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/ApplicationRecoveryNotice.tsx | 8 | export default function ApplicationRecoveryNotice({ compact = false }: { compact?: boolean }) { | CODE |
| LOW | src/renderer/components/Pref/configSync.ts | 7 | export function mergeConfigUpdateIntoDraft( | CODE |
| LOW | src/renderer/components/Pref/languageOptions.ts | 32 | export function normalizeLanguageOptionValue(locale?: LocaleName): LanguageOptionValue | undefined { | CODE |
| LOW | src/renderer/components/Pref/languageOptions.ts | 41 | export function resolveLanguageSelectValue( | CODE |
| LOW | src/renderer/components/Editor/hosts_highlight.ts | 273 | export function toggleCommentBySelections( | 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 | src-tauri/src/commands.rs | 240 | // Step 1: under a short cfg lock, derive the proposed `next` value | COMMENT |
| LOW⚡ | src-tauri/src/refresh.rs | 169 | // Step 0: take this node's refresh mutex for the whole function. | COMMENT |
| LOW⚡ | src-tauri/src/refresh.rs | 177 | // Step 1: take a consistent snapshot, then release the store lock | COMMENT |
| LOW⚡ | src-tauri/src/refresh.rs | 181 | // Step 2: fetch the new content. May take seconds; lockless. | COMMENT |
| LOW⚡ | src-tauri/src/refresh.rs | 206 | // Step 3: re-acquire the manifest under the store lock and stamp | COMMENT |
| LOW⚡ | src-tauri/src/refresh.rs | 211 | // Step 4: tell the UI. Both events match the Electron broadcast | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | src-tauri/src/commands.rs | 240 | // Step 1: under a short cfg lock, derive the proposed `next` value | COMMENT |
| LOW⚡ | src-tauri/src/refresh.rs | 169 | // Step 0: take this node's refresh mutex for the whole function. | COMMENT |
| LOW⚡ | src-tauri/src/refresh.rs | 177 | // Step 1: take a consistent snapshot, then release the store lock | COMMENT |
| LOW⚡ | src-tauri/src/refresh.rs | 181 | // Step 2: fetch the new content. May take seconds; lockless. | COMMENT |
| LOW⚡ | src-tauri/src/refresh.rs | 206 | // Step 3: re-acquire the manifest under the store lock and stamp | COMMENT |
| LOW⚡ | src-tauri/src/refresh.rs | 211 | // Step 4: tell the UI. Both events match the Electron broadcast | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | .github/workflows/release.yml | 40 | # Set APPLE_TEAM_ID to J5J6USUX2F. | COMMENT |