AI Slop Code Risk Monitor

oldj/SwitchHosts

SlopCodeMonitor badge for oldj/SwitchHosts Adjusted legacy signal; badge bands: 25 / 50 / 75 (different from dashboard bands).

Switch hosts quickly!

3.2 Low pattern signal View on GitHub

Open-Source Code Quality, Security and Technical Debt Review

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.

3.2
Adjusted Signal
3.2
Raw Pattern Score
100%
Time Factor
2026-10-30
Last Push
27.3K
Stars
TypeScript
Language
64.4K
Lines of Code
280
Files
139
Pattern Hits
2026-10-31
Scan Date
0.01
HC Hit Rate

Risk Review · Payload v1

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.

Cognitive Ownership Risk 10.5/100 · LOW

Can maintainers explain intent, assumptions, and trade-offs? 127 finding(s).

Hallucinated Dependency & Supply Chain Risk 3.1/100 · LOW

Are imports declared and package/API names verified? 4 finding(s).

Agent Over-Engineering Ratio 3.2/100 · LOW

Are wrappers, guards, and repeated structures necessary? 24 finding(s).

PR Review Velocity Impact 13.8/100 · LOW

Which changes need focused human review? 139 finding(s).

What These Metrics Mean

Adjusted Signal
Legacy pattern score normalized per 1,000 scanned lines and multiplied by the repository-level time factor. It is not an estimate of AI authorship.
Raw Pattern Score
Sum of severity- and context-weighted pattern findings before applying the time factor.
Time Factor
A coarse multiplier based on repository last-push metadata. It does not identify when individual code was written.
Pattern Hits
Count of configured pattern findings. Review each location and surrounding code before acting.
HC Hit Rate
High- and critical-severity findings per scanned file. Severity is a configured detector weight, not proof of a vulnerability or authorship.
Lines / Files
Scan coverage denominators used by the legacy normalized score.

Pattern-Signal History

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.

Severity Breakdown

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.

CRITICAL 4HIGH 0MEDIUM 8LOW 127

Directory Score Breakdown

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.

Pattern Findings

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.

Over-Commented Block98 hits · 98 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//! When the toggle is applied in the backend (no renderer, see below)COMMENT
LOWsrc-tauri/src/http_api.rs41//! nobody while the endpoint still answers `ok`. The v5 storage planCOMMENT
LOWsrc-tauri/src/lib.rs161 .on_menu_event(|app, event| {COMMENT
LOWsrc-tauri/src/lib.rs241 // We build the main window programmatically (rather thanCOMMENT
LOWsrc-tauri/src/lib.rs261 // Only `pages/index.tsx` (the main window's React root) broadcastsCOMMENT
LOWsrc-tauri/src/lib.rs301 .unwrap_or(false);COMMENT
LOWsrc-tauri/src/lib.rs401 // clears the login-launch grace window.COMMENT
LOWsrc-tauri/src/lib.rs561 // data dirCOMMENT
LOWsrc-tauri/src/lib.rs581 // and `prevent_exit` only when the guard above was armed by aCOMMENT
LOWsrc-tauri/src/tray.rs1//! System tray for the v5 main app.COMMENT
LOWsrc-tauri/src/tray.rs61/// click-outside monitor after the tray click handler has alreadyCOMMENT
LOWsrc-tauri/src/tray.rs81COMMENT
LOWsrc-tauri/src/tray.rs181 // paths can interleave differently across platforms, so handleCOMMENT
LOWsrc-tauri/src/tray.rs541 Ok(window)COMMENT
LOWsrc-tauri/src/tray.rs561/// lookup misses every display and falls back to the primaryCOMMENT
LOWsrc-tauri/src/tray.rs681// Tauri's `Focused(false)` event is unreliable as a click-outside signalCOMMENT
LOWsrc-tauri/src/commands.rs1//! Tauri commands.COMMENT
LOWsrc-tauri/src/commands.rs241 // and remember whether launch_at_login is changing. We deliberatelyCOMMENT
LOWsrc-tauri/src/commands.rs301 key: "launch_at_login".into(),COMMENT
LOWsrc-tauri/src/commands.rs1821 let proxy = proxy_urlCOMMENT
LOWsrc-tauri/src/commands.rs1901COMMENT
LOWsrc-tauri/src/commands.rs2081 data_dir_pointer::clear()?;COMMENT
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.rs1041 if window.is_minimized().unwrap_or(false) {COMMENT
LOWsrc-tauri/src/lifecycle.rs1081/// apart. The login-launch grace window armed at setup is that signal:COMMENT
LOWsrc-tauri/src/lifecycle.rs1221COMMENT
LOWsrc-tauri/src/find.rs1//! Find / replace window plumbing.COMMENT
LOWsrc-tauri/src/find.rs181 } else {COMMENT
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.rs61// ---- privileged-write strategy ---------------------------------------------COMMENT
LOWsrc-tauri/src/hosts_apply/elevation.rs221 &super::write::windows_system_hosts_path()?,COMMENT
LOWsrc-tauri/src/hosts_apply/elevation.rs541// ---- Linux: pkexec ---------------------------------------------------------COMMENT
LOWsrc-tauri/src/hosts_apply/elevation.rs601COMMENT
LOWsrc-tauri/src/hosts_apply/elevation.rs681 let verb = to_wide(OsStr::new("runas"));COMMENT
LOWsrc-tauri/src/hosts_apply/elevation.rs701 // CoInitializeEx returns:COMMENT
LOWsrc-tauri/src/hosts_apply/error.rs1//! Apply-time error type.COMMENT
LOWsrc-tauri/src/hosts_apply/write.rs1//! System hosts write orchestration.COMMENT
LOWsrc-tauri/src/hosts_apply/write.rs341/// Rebuild the hosts file around the SwitchHosts-managed section.COMMENT
LOWsrc-tauri/src/hosts_apply/write.rs381 resultCOMMENT
38 more matches not shown…
Hallucination Indicators4 hits · 40 pts
SeverityFileLineSnippetContext
CRITICALsrc/renderer/models/useHostsData.test.tsx418 expect(main.result.current.first.hostsData.list.map((node) => node.id)).toEqual(['b', 'a'])CODE
CRITICALsrc/renderer/models/useHostsData.test.tsx435 expect(tray.result.current.first.hostsData.list.map((node) => node.id)).toEqual(['b', 'a'])CODE
CRITICALsrc/renderer/models/useHostsData.test.tsx441 expect(reopenedTray.result.current.first.hostsData.list.map((node) => node.id)).toEqual([CODE
CRITICALsrc/renderer/models/useHostsData.test.tsx453 expect(reopenedTray.result.current.first.hostsData.list.map((node) => node.id)).toEqual([CODE
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.yml881 # ── Generate latest.json after release assets are finalized ───────COMMENT
Hyper-Verbose Identifiers16 hits · 18 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/ApplicationRecoveryNotice.tsx8export default function ApplicationRecoveryNotice({ compact = false }: { compact?: boolean }) {CODE
LOWsrc/renderer/components/Pref/configSync.ts7export function mergeConfigUpdateIntoDraft(CODE
LOWsrc/renderer/components/Pref/languageOptions.ts32export function normalizeLanguageOptionValue(locale?: LocaleName): LanguageOptionValue | undefined {CODE
LOWsrc/renderer/components/Pref/languageOptions.ts41export function resolveLanguageSelectValue(CODE
LOWsrc/renderer/components/Editor/hosts_highlight.ts273export function toggleCommentBySelections(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
LOW⚡src/renderer/pages/find.tsx162function normalizeFindResultColumnMaxWidth(maxColumnWidth?: number) {CODE
LOW⚡src/renderer/pages/find.tsx168function normalizeFindResultColumnWidth(width: number) {CODE
LOW⚡src/renderer/pages/find.tsx172function getFindResultDragColumnMaxWidth(currentWidth: number, maxColumnWidth: number) {CODE
LOW⚡src/renderer/pages/find.tsx176function clampFindResultColumnWidthForDrag(CODE
LOWsrc/renderer/pages/find.tsx187export function resizeFindResultFixedColumnWidths(CODE
Verbosity Indicators6 hits · 13 pts
SeverityFileLineSnippetContext
LOWsrc-tauri/src/commands.rs240 // Step 1: under a short cfg lock, derive the proposed `next` valueCOMMENT
LOW⚡src-tauri/src/refresh.rs169 // Step 0: take this node's refresh mutex for the whole function.COMMENT
LOW⚡src-tauri/src/refresh.rs177 // Step 1: take a consistent snapshot, then release the store lockCOMMENT
LOW⚡src-tauri/src/refresh.rs181 // Step 2: fetch the new content. May take seconds; lockless.COMMENT
LOW⚡src-tauri/src/refresh.rs206 // Step 3: re-acquire the manifest under the store lock and stampCOMMENT
LOW⚡src-tauri/src/refresh.rs211 // Step 4: tell the UI. Both events match the Electron broadcastCOMMENT
Structural Annotation Overuse6 hits · 13 pts
SeverityFileLineSnippetContext
LOWsrc-tauri/src/commands.rs240 // Step 1: under a short cfg lock, derive the proposed `next` valueCOMMENT
LOW⚡src-tauri/src/refresh.rs169 // Step 0: take this node's refresh mutex for the whole function.COMMENT
LOW⚡src-tauri/src/refresh.rs177 // Step 1: take a consistent snapshot, then release the store lockCOMMENT
LOW⚡src-tauri/src/refresh.rs181 // Step 2: fetch the new content. May take seconds; lockless.COMMENT
LOW⚡src-tauri/src/refresh.rs206 // Step 3: re-acquire the manifest under the store lock and stampCOMMENT
LOW⚡src-tauri/src/refresh.rs211 // Step 4: tell the UI. Both events match the Electron broadcastCOMMENT
Redundant / Tautological Comments1 hit · 2 pts
SeverityFileLineSnippetContext
LOW.github/workflows/release.yml40# Set APPLE_TEAM_ID to J5J6USUX2F.COMMENT