Repository Analysis

nezhahq/nezha

:trollface: Self-hosted, lightweight server and website monitoring and O&M tool

2.6 Likely human-written View on GitHub

Analysis Overview

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).

2.6
Adjusted Score
2.6
Raw Score
100%
Time Factor
2026-07-14
Last Push
10.2K
Stars
Go
Language
48.3K
Lines of Code
298
Files
118
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

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.

No multi-scan history yet — run the scanner again to build trend data.

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 5LOW 113

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 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.

Over-Commented Block108 hits · 108 pts
SeverityFileLineSnippetContext
LOWcmd/dashboard/main.go81COMMENT
LOWcmd/dashboard/main.go101// @securityDefinitions.apikey BearerAuthCOMMENT
LOWcmd/dashboard/controller/mcp_origin.go41 }COMMENT
LOWcmd/dashboard/controller/waf.go61 },COMMENT
LOWcmd/dashboard/controller/csrf.go81 c.SetCookie(csrfCookieName, token, 0, "/", "", secure, false)COMMENT
LOWcmd/dashboard/controller/csrf.go101// - Bearer-token PAT requests (`Authorization: Bearer nzp_*`): stateless,COMMENT
LOWcmd/dashboard/controller/server.go21// List serverCOMMENT
LOWcmd/dashboard/controller/server.go41COMMENT
LOWcmd/dashboard/controller/server.go101 }COMMENT
LOWcmd/dashboard/controller/server.go161 // the same serverID and have it wiped by the cleanup. TheCOMMENT
LOWcmd/dashboard/controller/server.go341 }(group)COMMENT
LOWcmd/dashboard/controller/server.go401 continueCOMMENT
LOWcmd/dashboard/controller/service.go141// Get service historyCOMMENT
LOWcmd/dashboard/controller/service.go521 if err := singleton.ServiceSentinelShared.Update(&m); err != nil {COMMENT
LOWcmd/dashboard/controller/user.go41 }, nilCOMMENT
LOWcmd/dashboard/controller/user.go101// @Summary List userCOMMENT
LOWcmd/dashboard/controller/user.go161COMMENT
LOWcmd/dashboard/controller/user.go181 }COMMENT
LOWcmd/dashboard/controller/scope_doc.go1// Package controller — scope reference table for REST + MCP.COMMENT
LOWcmd/dashboard/controller/scope_doc.go21//COMMENT
LOWcmd/dashboard/controller/scope_doc.go41// GET /api/v1/server nezha:inventory:readCOMMENT
LOWcmd/dashboard/controller/scope_doc.go61// GET /api/v1/server/{id}/metrics nezha:server:readCOMMENT
LOWcmd/dashboard/controller/scope_doc.go81// POST /api/v1/cron/{id}/manual nezha:cron:execCOMMENT
LOWcmd/dashboard/controller/scope_doc.go101// POST /api/v1/notification-group nezha:notification-group:writeCOMMENT
LOWcmd/dashboard/controller/scope_doc.go121// POST /api/v1/refresh-tokenCOMMENT
LOW…d/dashboard/controller/mcp_transfer_zero_chunk_test.go21}COMMENT
LOWcmd/dashboard/controller/cron_update_owner_uid_test.go61 c.Set(apiTokenCtxKey, tok)COMMENT
LOWcmd/dashboard/controller/api_token_revoke_registry.go21//COMMENT
LOWcmd/dashboard/controller/setting.go61 }COMMENT
LOWcmd/dashboard/controller/nat.go81 return 0, newGormError("%v", err)COMMENT
LOWcmd/dashboard/controller/notification.go41}COMMENT
LOWcmd/dashboard/controller/notification.go161 return nil, nilCOMMENT
LOWcmd/dashboard/controller/cron.go201COMMENT
LOWcmd/dashboard/controller/transfer_retry_authz_test.go21// retryServerTransfer previously gated on prev.HasPermission(c), which honoursCOMMENT
LOWcmd/dashboard/controller/server_group.go81// New server groupCOMMENT
LOWcmd/dashboard/controller/server_group.go141// Edit server groupCOMMENT
LOWcmd/dashboard/controller/server_group.go221 return nil, nilCOMMENT
LOWcmd/dashboard/controller/permissions.go201// coverMode 抽象「cover 字段在 dispatch 时如何解读 servers 字段」。COMMENT
LOWcmd/dashboard/controller/permissions.go221 // coverModeAllowList: dispatch 时只在 servers(allow-list)内 fan-out。COMMENT
LOWcmd/dashboard/controller/permissions.go361// cron write path. cf.Servers is the literal allow/deny list; underCOMMENT
LOWcmd/dashboard/controller/permissions.go381// does for createCron) is only safe when the caller is the owner-to-be,COMMENT
LOWcmd/dashboard/controller/mcp.go1// Package controller — MCP (Model Context Protocol) server.COMMENT
LOWcmd/dashboard/controller/transfer_list_filter_test.go21COMMENT
LOWcmd/dashboard/controller/transfer.go21// @Description InitiatorID. The same predicate is enforced both at the SQLCOMMENT
LOWcmd/dashboard/controller/transfer.go41 }COMMENT
LOWcmd/dashboard/controller/transfer.go101// @Description terminal (Failed/Timeout/Cancelled) transfer. The previous rowCOMMENT
LOWcmd/dashboard/controller/transfer.go161// @Summary Websocket server transfer streamCOMMENT
LOWcmd/dashboard/controller/cron_service_cover_pat_test.go1package controllerCOMMENT
LOWcmd/dashboard/controller/ddns.go41}COMMENT
LOWcmd/dashboard/controller/ddns.go101// @Summary Edit DDNS profileCOMMENT
LOWcmd/dashboard/controller/mcp_transfer.go361 return map[string]any{COMMENT
LOWcmd/dashboard/controller/mcp_transfer.go681// are recognized by their magic; legitimate payload always arrives insideCOMMENT
LOWcmd/dashboard/controller/mcp_transfer.go761 }COMMENT
LOWcmd/dashboard/controller/scope_doc_consistency_test.go1package controllerCOMMENT
LOW.github/workflows/codeql-analysis.yml1# For most projects, this workflow file will not need changing; you simply needCOMMENT
LOWmodel/server.go41 // handler that reassigns the stream on every reconnect — a torn read of theCOMMENT
LOWmodel/server.go181}COMMENT
LOWmodel/server.go201// Cron.HasPermission / Service.HasPermission can faithfully replay theCOMMENT
LOWmodel/service.go241COMMENT
LOWmodel/server_transfer.go21 // ServerTransferStatusVerified means the agent successfully reconnectedCOMMENT
48 more matches not shown…
Decorative Section Separators4 hits · 12 pts
SeverityFileLineSnippetContext
MEDIUMscript/install_en.sh3#========================================================COMMENT
MEDIUMscript/install_en.sh5#========================================================COMMENT
MEDIUMscript/install.sh3#========================================================COMMENT
MEDIUMscript/install.sh5#========================================================COMMENT
Hyper-Verbose Identifiers3 hits · 3 pts
SeverityFileLineSnippetContext
LOW.github/sync.py37def get_github_latest_release():CODE
LOW.github/sync.py159def get_existing_gitee_release(client, release_api_uri, tag, token):CODE
LOW.github/sync_atomgit.py12def get_github_latest_release():CODE
Self-Referential Comments1 hit · 3 pts
SeverityFileLineSnippetContext
MEDIUM.github/workflows/release.yml94 # Create the Go file to link the libraryCOMMENT
Fake / Example Data1 hit · 1 pts
SeverityFileLineSnippetContext
LOWcmd/dashboard/controller/jwt_session_test.go355 refreshResponse(c, 200, "fake-token", newExpire)CODE
Deep Nesting1 hit · 1 pts
SeverityFileLineSnippetContext
LOW.github/sync.py37CODE