:trollface: Self-hosted, lightweight server and website monitoring and O&M tool
This report presents the forensic synthetic code analysis of nezhahq/nezha, a Go project with 10,239 GitHub stars. SynthScan v2.0 examined 48,304 lines of code across 298 source files, recording 118 pattern matches distributed across 6 syntactic categories. The overall adjusted score of 2.6 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).
Longitudinal tracking requires multiple scan runs. Once this repository is re-scanned after new commits land, this chart will visualise how the synthetic code signal evolves over time — enabling you to detect whether AI authorship is growing, stabilising, or being actively corrected by human engineers.
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 118 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 | cmd/dashboard/main.go | 81 | COMMENT | |
| LOW | cmd/dashboard/main.go | 101 | // @securityDefinitions.apikey BearerAuth | COMMENT |
| LOW | cmd/dashboard/controller/mcp_origin.go | 41 | } | COMMENT |
| LOW | cmd/dashboard/controller/waf.go | 61 | }, | COMMENT |
| LOW | cmd/dashboard/controller/csrf.go | 81 | c.SetCookie(csrfCookieName, token, 0, "/", "", secure, false) | COMMENT |
| LOW | cmd/dashboard/controller/csrf.go | 101 | // - Bearer-token PAT requests (`Authorization: Bearer nzp_*`): stateless, | COMMENT |
| LOW | cmd/dashboard/controller/server.go | 21 | // List server | COMMENT |
| LOW | cmd/dashboard/controller/server.go | 41 | COMMENT | |
| LOW | cmd/dashboard/controller/server.go | 101 | } | COMMENT |
| LOW | cmd/dashboard/controller/server.go | 161 | // the same serverID and have it wiped by the cleanup. The | COMMENT |
| LOW | cmd/dashboard/controller/server.go | 341 | }(group) | COMMENT |
| LOW | cmd/dashboard/controller/server.go | 401 | continue | COMMENT |
| LOW | cmd/dashboard/controller/service.go | 141 | // Get service history | COMMENT |
| LOW | cmd/dashboard/controller/service.go | 521 | if err := singleton.ServiceSentinelShared.Update(&m); err != nil { | COMMENT |
| LOW | cmd/dashboard/controller/user.go | 41 | }, nil | COMMENT |
| LOW | cmd/dashboard/controller/user.go | 101 | // @Summary List user | COMMENT |
| LOW | cmd/dashboard/controller/user.go | 161 | COMMENT | |
| LOW | cmd/dashboard/controller/user.go | 181 | } | COMMENT |
| LOW | cmd/dashboard/controller/scope_doc.go | 1 | // Package controller — scope reference table for REST + MCP. | COMMENT |
| LOW | cmd/dashboard/controller/scope_doc.go | 21 | // | COMMENT |
| LOW | cmd/dashboard/controller/scope_doc.go | 41 | // GET /api/v1/server nezha:inventory:read | COMMENT |
| LOW | cmd/dashboard/controller/scope_doc.go | 61 | // GET /api/v1/server/{id}/metrics nezha:server:read | COMMENT |
| LOW | cmd/dashboard/controller/scope_doc.go | 81 | // POST /api/v1/cron/{id}/manual nezha:cron:exec | COMMENT |
| LOW | cmd/dashboard/controller/scope_doc.go | 101 | // POST /api/v1/notification-group nezha:notification-group:write | COMMENT |
| LOW | cmd/dashboard/controller/scope_doc.go | 121 | // POST /api/v1/refresh-token | COMMENT |
| LOW | …d/dashboard/controller/mcp_transfer_zero_chunk_test.go | 21 | } | COMMENT |
| LOW | cmd/dashboard/controller/cron_update_owner_uid_test.go | 61 | c.Set(apiTokenCtxKey, tok) | COMMENT |
| LOW | cmd/dashboard/controller/api_token_revoke_registry.go | 21 | // | COMMENT |
| LOW | cmd/dashboard/controller/setting.go | 61 | } | COMMENT |
| LOW | cmd/dashboard/controller/nat.go | 81 | return 0, newGormError("%v", err) | COMMENT |
| LOW | cmd/dashboard/controller/notification.go | 41 | } | COMMENT |
| LOW | cmd/dashboard/controller/notification.go | 161 | return nil, nil | COMMENT |
| LOW | cmd/dashboard/controller/cron.go | 201 | COMMENT | |
| LOW | cmd/dashboard/controller/transfer_retry_authz_test.go | 21 | // retryServerTransfer previously gated on prev.HasPermission(c), which honours | COMMENT |
| LOW | cmd/dashboard/controller/server_group.go | 81 | // New server group | COMMENT |
| LOW | cmd/dashboard/controller/server_group.go | 141 | // Edit server group | COMMENT |
| LOW | cmd/dashboard/controller/server_group.go | 221 | return nil, nil | COMMENT |
| LOW | cmd/dashboard/controller/permissions.go | 201 | // coverMode 抽象「cover 字段在 dispatch 时如何解读 servers 字段」。 | COMMENT |
| LOW | cmd/dashboard/controller/permissions.go | 221 | // coverModeAllowList: dispatch 时只在 servers(allow-list)内 fan-out。 | COMMENT |
| LOW | cmd/dashboard/controller/permissions.go | 361 | // cron write path. cf.Servers is the literal allow/deny list; under | COMMENT |
| LOW | cmd/dashboard/controller/permissions.go | 381 | // does for createCron) is only safe when the caller is the owner-to-be, | COMMENT |
| LOW | cmd/dashboard/controller/mcp.go | 1 | // Package controller — MCP (Model Context Protocol) server. | COMMENT |
| LOW | cmd/dashboard/controller/transfer_list_filter_test.go | 21 | COMMENT | |
| LOW | cmd/dashboard/controller/transfer.go | 21 | // @Description InitiatorID. The same predicate is enforced both at the SQL | COMMENT |
| LOW | cmd/dashboard/controller/transfer.go | 41 | } | COMMENT |
| LOW | cmd/dashboard/controller/transfer.go | 101 | // @Description terminal (Failed/Timeout/Cancelled) transfer. The previous row | COMMENT |
| LOW | cmd/dashboard/controller/transfer.go | 161 | // @Summary Websocket server transfer stream | COMMENT |
| LOW | cmd/dashboard/controller/cron_service_cover_pat_test.go | 1 | package controller | COMMENT |
| LOW | cmd/dashboard/controller/ddns.go | 41 | } | COMMENT |
| LOW | cmd/dashboard/controller/ddns.go | 101 | // @Summary Edit DDNS profile | COMMENT |
| LOW | cmd/dashboard/controller/mcp_transfer.go | 361 | return map[string]any{ | COMMENT |
| LOW | cmd/dashboard/controller/mcp_transfer.go | 681 | // are recognized by their magic; legitimate payload always arrives inside | COMMENT |
| LOW | cmd/dashboard/controller/mcp_transfer.go | 761 | } | COMMENT |
| LOW | cmd/dashboard/controller/scope_doc_consistency_test.go | 1 | package controller | COMMENT |
| LOW | .github/workflows/codeql-analysis.yml | 1 | # For most projects, this workflow file will not need changing; you simply need | COMMENT |
| LOW | model/server.go | 41 | // handler that reassigns the stream on every reconnect — a torn read of the | COMMENT |
| LOW | model/server.go | 181 | } | COMMENT |
| LOW | model/server.go | 201 | // Cron.HasPermission / Service.HasPermission can faithfully replay the | COMMENT |
| LOW | model/service.go | 241 | COMMENT | |
| LOW | model/server_transfer.go | 21 | // ServerTransferStatusVerified means the agent successfully reconnected | COMMENT |
| 48 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | script/install_en.sh | 3 | #======================================================== | COMMENT |
| MEDIUM | script/install_en.sh | 5 | #======================================================== | COMMENT |
| MEDIUM | script/install.sh | 3 | #======================================================== | COMMENT |
| MEDIUM | script/install.sh | 5 | #======================================================== | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | .github/sync.py | 37 | def get_github_latest_release(): | CODE |
| LOW | .github/sync.py | 159 | def get_existing_gitee_release(client, release_api_uri, tag, token): | CODE |
| LOW | .github/sync_atomgit.py | 12 | def get_github_latest_release(): | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | .github/workflows/release.yml | 94 | # Create the Go file to link the library | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | cmd/dashboard/controller/jwt_session_test.go | 355 | refreshResponse(c, 200, "fake-token", newExpire) | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | .github/sync.py | 37 | CODE |