🥚🥚🥚🥚 Born to build better enterprise frameworks and apps with Node.js & Koa. https://codewiki.google/github.com/eggjs/egg
This report summarizes scanner evidence for eggjs/egg, a TypeScript project with 18,984 GitHub stars. SynthScan examined 271,159 lines of code across 2579 source files, recording 153 pattern matches distributed across 11 syntactic categories. The legacy adjusted pattern signal is 0.8 (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? 144 finding(s).
Are imports declared and package/API names verified? 5 finding(s).
Are wrappers, guards, and repeated structures necessary? 54 finding(s).
Which changes need focused human review? 153 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 153 distinct pattern matches across 11 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 | vitest.config.ts | 41 | // { | COMMENT |
| LOW | vitest.config.ts | 61 | // decorators correctly. Requires @oxc-node/core >= 0.1.0, which fixes the | COMMENT |
| LOW | tools/egg-bin/src/baseCommand.ts | 241 | // and an ESM `module.register()` hook from a single `--import`, so when it is | COMMENT |
| LOW | tools/egg-bundler/test/no-filesystem-scan.test.ts | 1 | import fs from 'node:fs/promises'; | COMMENT |
| LOW | tools/egg-bundler/test/deterministic.test.ts | 21 | // | COMMENT |
| LOW | tools/egg-bundler/src/lib/prelude.ts | 241 | // Call args captured at build can themselves be member-proxies — e.g. a model column | COMMENT |
| LOW | tools/egg-bundler/src/lib/EntryGenerator.ts | 381 | } | COMMENT |
| LOW | tools/egg-bundler/src/lib/EntryGenerator.ts | 481 | // no servers/timers/connections), run the snapshotWillSerialize hooks to release | COMMENT |
| LOW | tools/egg-bundler/src/lib/EntryGenerator.ts | 541 | // eslint-disable-next-line no-console | COMMENT |
| LOW | plugins/watcher/src/lib/event-sources/development.ts | 81 | // path: '/Users/mk2/git/changing/test/fixtures/foo.js', | COMMENT |
| LOW | plugins/security/test/benchmark/set_header.js | 61 | console.log('\n setHeader() Benchmark\n node version: %s, date: %s\n Starting...', process.version, Date()); | COMMENT |
| LOW | plugins/security/test/benchmark/cidr_subnet.js | 41 | benchmarks.log(); | COMMENT |
| LOW | plugins/redis/src/config/config.default.ts | 81 | export default { | COMMENT |
| LOW | plugins/redis/src/config/config.default.ts | 101 | // port: 'port', | COMMENT |
| LOW | plugins/redis/src/config/config.default.ts | 121 | // db: 'db', | COMMENT |
| LOW | plugins/development/test/development-ts.test.ts | 21 | // for debounce | COMMENT |
| LOW | plugins/mock/test/inject_ctx.test.ts | 81 | .expect('stdout', /"before each" hook for "should not print"/) | COMMENT |
| LOW | plugins/mock/test/index.test-skip.ts | 1 | // import mm from '../index'; | COMMENT |
| LOW | plugins/mock/test/index.test-skip.ts | 21 | COMMENT | |
| LOW | plugins/mock/test/index.test-skip.ts | 41 | COMMENT | |
| LOW | plugins/mock/test/index.test-skip.ts | 61 | // process.exit(1); | COMMENT |
| LOW | plugins/mock/test/mock_agent_httpclient.test.ts | 21 | agent = (app as any).agent; | COMMENT |
| LOW | plugins/mock/test/mock_agent_httpclient.test.ts | 41 | // agent.httpclient.once('response', function (result: any) { | COMMENT |
| LOW | plugins/mock/test/mock_agent_httpclient.test.ts | 61 | // // assert.deepEqual(result.req.options, { | COMMENT |
| LOW | plugins/mock/test/mock_agent_httpclient.test.ts | 81 | COMMENT | |
| LOW | plugins/mock/test/mock_agent_httpclient.test.ts | 101 | // done(); | COMMENT |
| LOW | plugins/mock/test/mock_agent_httpclient.test.ts | 121 | // agent.httpclient.once('response', function (result: any) { | COMMENT |
| LOW | plugins/mock/src/typings/index.d.ts | 1 | // make sure to import egg typings and let typescript know about it | COMMENT |
| LOW | plugins/mock/src/lib/utils.ts | 41 | return options; | COMMENT |
| LOW | plugins/mock/src/lib/utils.ts | 61 | // if (!src) { | COMMENT |
| LOW | plugins/mock/src/lib/utils.ts | 81 | // return dest; | COMMENT |
| LOW | plugins/mock/src/lib/prerequire.ts | 1 | // const debug = require('util').debuglog('egg-mock/prerequire'); | COMMENT |
| LOW | plugins/mock/src/lib/prerequire.ts | 21 | // require(filepath); | COMMENT |
| LOW | tegg/README.md | 461 | COMMENT | |
| LOW | tegg/standalone/standalone/src/ModuleConfig.ts | 1 | // import 'egg'; | COMMENT |
| LOW | tegg/plugin/controller/src/lib/impl/mcp/EggMcpRouter.ts | 561 | COMMENT | |
| LOW | tegg/plugin/tegg/test/BundledAppBoot.test.ts | 101 | // The injected manifest VFS is the loader's fs, exactly like a bundled app. | COMMENT |
| LOW | tegg/plugin/tegg/test/app/extend/context.test.ts | 101 | }); | COMMENT |
| LOW | tegg/plugin/mcp-proxy/test/client-field-shadow.test.ts | 1 | import assert from 'node:assert'; | COMMENT |
| LOW | tegg/plugin/orm/src/lib/DataSourceManager.ts | 1 | // exports.orm = { | COMMENT |
| LOW | packages/cluster/test/options.test.ts | 321 | COMMENT | |
| LOW | packages/cluster/test/master/messenger.test.ts | 61 | await app.ready(); | COMMENT |
| LOW | packages/cluster/test/master/messenger.test.ts | 81 | // 'ignore', | COMMENT |
| LOW | packages/egg/test/typescript.test.ts | 21 | // .expect('code', 0) | COMMENT |
| LOW | packages/egg/test/typescript.test.ts | 61 | describe('type check', () => { | COMMENT |
| LOW | packages/egg/test/typescript.test.ts | 81 | // await coffee.fork( | COMMENT |
| LOW | packages/egg/test/app/extend/application.test.ts | 181 | }); | COMMENT |
| LOW | packages/egg/test/app/extend/context.test.ts | 301 | // await scheduler.wait(1200); | COMMENT |
| LOW | packages/egg/test/app/extend/context.test.ts | 321 | it('should use custom task name first', async () => { | COMMENT |
| LOW | packages/egg/src/lib/application.ts | 121 | // | COMMENT |
| LOW | packages/egg/src/lib/egg.ts | 701 | } | COMMENT |
| LOW | packages/egg/src/lib/egg.ts | 721 | // `npm ci` into the output dir), OR | COMMENT |
| LOW | packages/core/test/egg.test.ts | 241 | // app.once('ready_timeout', id => { | COMMENT |
| LOW | packages/core/test/egg.test.ts | 281 | // done = pending(2, done); | COMMENT |
| LOW | packages/core/test/egg.test.ts | 301 | // done, | COMMENT |
| LOW | packages/core/test/egg.test.ts | 321 | await promise; | COMMENT |
| LOW | packages/core/test/egg.test.ts | 341 | // }); | COMMENT |
| LOW | packages/core/test/egg.test.ts | 441 | COMMENT | |
| LOW | packages/core/test/egg.test.ts | 461 | // return wrapped(true).then(res => assert(res === true)); | COMMENT |
| LOW | packages/core/test/egg.test.ts | 481 | // const arr = [ fn(1), fn(2) ]; | COMMENT |
| 13 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tools/egg-bin/src/bundleOptions.ts | 35 | export async function getBundleFrameworkSpecifier(baseDir: string, framework?: string): Promise<string> { | CODE |
| LOW | tools/egg-bundler/test/ManifestLoader.test.ts | 129 | async function createInstalledFrameworkFixture( | CODE |
| LOW | tools/egg-bundler/test/deterministic.test.ts | 94 | function makeDeterministicMockBuild(outputDir: string): BuildFunc { | CODE |
| LOW | tools/egg-bundler/test/deterministic.test.ts | 128 | function normalizeWorkerAppBaseDir(source: string, baseDir: string): string { | CODE |
| LOW | tools/egg-bundler/src/compat/leoric/index.ts | 33 | export function resolveLeoricSnapshotCompatibility( | CODE |
| LOW | tools/egg-bundler/src/lib/prelude.ts | 125 | export async function resolveSnapshotLazyModules(baseDir: string): Promise<string[]> { | CODE |
| LOW | tools/egg-bundler/src/lib/prelude.ts | 178 | (function eggBundlerSnapshotPrelude() { | CODE |
| LOW | tools/egg-bundler/src/lib/prelude.ts | 542 | export function injectExternalRequireLazyHook(content: string): ExternalRequireInjectionResult { | CODE |
| LOW | tools/egg-bundler/src/lib/frameworkSpecifier.ts | 6 | function isPathLikeFrameworkSpecifier(framework: string): boolean { | CODE |
| LOW | tools/egg-bundler/src/lib/frameworkSpecifier.ts | 23 | export function assertFrameworkPackageSpecifier(framework: string): void { | CODE |
| LOW | tools/egg-bundler/src/lib/Bundler.ts | 97 | function validateModulePackAliasSpecifier(filepath: string, specifier: string): void { | CODE |
| LOW⚡ | tools/egg-bundler/src/lib/Bundler.ts | 122 | function normalizeRuntimeAssetRoot(filepath: string, root: string): string { | CODE |
| LOW⚡ | tools/egg-bundler/src/lib/Bundler.ts | 126 | function normalizeRuntimeAssetRoots(filepath: string, roots: readonly string[]): readonly string[] { | CODE |
| LOW⚡ | tools/egg-bundler/src/lib/Bundler.ts | 130 | function normalizeRuntimeAssetForceCopyDir(filepath: string, dir: string): string { | CODE |
| LOW⚡ | tools/egg-bundler/src/lib/Bundler.ts | 134 | function normalizeRuntimeAssetForceCopyDirs(filepath: string, dirs: readonly string[]): readonly string[] { | CODE |
| LOW | tools/egg-bundler/src/lib/Bundler.ts | 160 | function parseModuleBundlePackConfig( | CODE |
| LOW | tools/egg-bundler/src/lib/Bundler.ts | 197 | function parseModuleBundleRuntimeAssetsConfig( | CODE |
| LOW | tools/egg-bundler/src/lib/Bundler.ts | 304 | export function sanitizeBundleOutputRelativePath(relativeName: string): string { | CODE |
| LOW | …ins/development/src/app/middleware/egg_loader_trace.ts | 10 | export default function createEggLoaderTraceMiddleware(_options: unknown, app: Application): MiddlewareFunc { | CODE |
| LOW | tegg/core/runtime/src/model/EggObject.ts | 12 | export function eggObjectLifecycleUtilFromBag(bag: TeggScopeBag): LifecycleUtil<EggObjectLifeCycleContext, EggObject> { | CODE |
| LOW | tegg/core/runtime/src/model/LoadUnitInstance.ts | 13 | export function loadUnitInstanceLifecycleUtilFromBag( | CODE |
| LOW | tegg/core/runtime/src/model/EggContext.ts | 13 | export function eggContextLifecycleUtilFromBag( | CODE |
| LOW | …/core/controller-decorator/src/decorator/Middleware.ts | 18 | function isAopTypeOrMiddlewareType( | CODE |
| LOW | …/core/controller-decorator/src/decorator/Middleware.ts | 32 | function functionTypeClassMiddleware(constructor: EggProtoImplClass) { | CODE |
| LOW | …/core/controller-decorator/src/decorator/Middleware.ts | 44 | function functionTypeMethodMiddleware(target: any, propertyKey: PropertyKey) { | CODE |
| LOW | tegg/core/loader/src/TeggManifestLoaderFS.ts | 41 | export function createTeggManifestLoaderFS( | CODE |
| LOW | …ecorator/src/qualifier/ChatCheckpointSaverQualifier.ts | 6 | export function ChatCheckpointSaverQualifier( | CODE |
| LOW | tegg/core/metadata/src/model/LoadUnit.ts | 12 | export function loadUnitLifecycleUtilFromBag(bag: TeggScopeBag): LifecycleUtil<LoadUnitLifecycleContext, LoadUnit> { | CODE |
| LOW | tegg/core/metadata/src/model/EggPrototype.ts | 17 | export function eggPrototypeLifecycleUtilFromBag( | CODE |
| LOW | tegg/plugin/schedule/src/lib/EggScheduleAdapter.ts | 9 | export function eggScheduleAdapterFactory( | CODE |
| LOW | scripts/utils.js | 54 | export function assertValidNpmPackageName(name) { | CODE |
| LOW | scripts/utils.js | 169 | export function resolveWorkspaceProtocols(manifest, { versionMap, catalogs }) { | CODE |
| LOW | scripts/utils.js | 205 | export function applyPublishConfigOverrides(manifest) { | CODE |
| LOW | scripts/ci-test-benchmark/cli.js | 111 | function normalizePackageManagerArgv(argv) { | CODE |
| LOW | packages/core/src/loader/egg_loader.ts | 2046 | function controllerMethodToMiddleware(Controller: typeof BaseContextClass, key: string) { | CODE |
| LOW | packages/core/src/loader/egg_loader.ts | 2047 | return function classControllerMiddleware(this: Context, ...args: unknown[]) { | CODE |
| LOW | packages/core/src/loader/egg_loader.ts | 2085 | function objectFunctionToMiddleware(func: Fun) { | CODE |
| LOW | packages/core/src/loader/egg_loader.ts | 2086 | async function objectControllerMiddleware(this: Context, ...args: unknown[]) { | CODE |
| LOW | packages/core/src/loader/file_loader.ts | 66 | function getDefaultFileLoaderMatch(): string[] { | CODE |
| LOW | packages/loader-fs/src/manifest_loader_fs.ts | 312 | function normalizeAlternationGroups(pattern: string): string { | CODE |
| LOW | packages/loader-fs/src/index.ts | 30 | function isEnvironmentTeardownError(e: unknown): boolean { | CODE |
| LOW | packages/logger/src/utils.ts | 97 | export function defaultContextPaddingMessage(ctx: Record<string, unknown>): string { | CODE |
| LOW | packages/supertest/test/supertest.test.ts | 20 | function shouldIncludeStackWithThisFile(err: Error) { | CODE |
| LOW | packages/utils/src/import.ts | 164 | function tryToResolveByDirnameFromPackage(dirname: string, pkg: any): string | undefined { | CODE |
| LOW | packages/utils/src/import.ts | 289 | function tryToResolveFromAbsoluteFile(filepath: string): string | undefined { | CODE |
| LOW | packages/utils/src/import.ts | 459 | function normalizeBundleModulePath(filepath: string): string { | CODE |
| LOW | packages/skills/egg-core/references/proto.md | 85 | export class RequestHandler { | CODE |
| LOW | packages/cookies/src/cookies.ts | 287 | function parseChromiumAndMajorVersion(userAgent: string): ParseChromiumResult { | CODE |
| LOW | packages/cookies/src/cookies.ts | 327 | function ignoreCookiesByNameAndPath(cookies: string[], name: string, path: string | null | undefined) { | CODE |
| LOW | packages/koa/src/request.ts | 644 | function splitCommaSeparatedValues(value: string, limit?: number): string[] { | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| CRITICAL | packages/egg/test/lib/core/logger.test.ts | 120 | // app.config.logger.buffer.should.equal(false); | COMMENT |
| CRITICAL | packages/egg/test/lib/core/logger.test.ts | 144 | // app.config.logger.buffer.should.equal(true); | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | …evelopment/src/app/middleware/loader_trace_template.ts | 20 | // Step 2: 载入数据源 | COMMENT |
| LOW | packages/skills/PLAN.md | 213 | // Step 1: 加载 skill 内容作为 system prompt,向被测 LLM 提问 | COMMENT |
| LOW | packages/skills/PLAN.md | 231 | // Step 2: 用 Judge LLM 对回答逐项评分 | COMMENT |
| LOW | packages/skills/egg-controller/references/schedule.md | 9 | ## Step 1: 创建定时任务 | COMMENT |
| LOW | packages/skills/egg-controller/references/schedule.md | 74 | ## Step 2: 选择工作模式 | COMMENT |
| LOW | packages/skills/egg-controller/references/schedule.md | 81 | ## Step 3: 配置运行参数 | COMMENT |
| LOW | packages/skills/egg-core/SKILL.md | 11 | ### Step 1: 代码写在 module 中 | COMMENT |
| LOW | packages/skills/egg-core/SKILL.md | 102 | ### Step 2: 用 Proto 实现 Service | COMMENT |
| LOW | packages/skills/egg-core/SKILL.md | 148 | ### Step 3: 通过 Inject 使用 Service | COMMENT |
| LOW | packages/skills/egg-core/references/dynamic-inject.md | 8 | ## Step 1: 定义抽象类和类型枚举 | COMMENT |
| LOW | packages/skills/egg-core/references/dynamic-inject.md | 29 | ## Step 2: 创建自定义装饰器 | COMMENT |
| LOW | packages/skills/egg-core/references/dynamic-inject.md | 50 | ## Step 3: 实现抽象类 | COMMENT |
| LOW | packages/skills/egg-core/references/dynamic-inject.md | 70 | ## Step 4: 动态获取实现 | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tools/egg-bundler/src/lib/EntryGenerator.ts | 383 | // ── decorator file-path correction ────────────────────────────────────────── | COMMENT |
| MEDIUM | tools/egg-bundler/src/lib/EntryGenerator.ts | 478 | // ── snapshot build mode ───────────────────────────────────────────────── | COMMENT |
| MEDIUM | tools/egg-bundler/src/lib/EntryGenerator.ts | 529 | // ── snapshot restore main ────────────────────────────────────────── | COMMENT |
| MEDIUM | tools/egg-bundler/src/lib/EntryGenerator.ts | 609 | // ── normal mode ───────────────────────────────────────────────────────── | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tools/egg-bundler/src/lib/Bundler.ts | 540 | // loop stays robust if it ever moves) and, in the same read/write, prepend the | COMMENT |
| MEDIUM | tools/scripts/src/commands/start.ts | 239 | // it makes env big but more robust | COMMENT |
| MEDIUM | packages/supertest/test/supertest.test.ts | 442 | // "socket hang up". Assert the family so the test is robust regardless of what | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tools/create-egg/README.md | 61 | Check out Awesome Egg.js for [community maintained templates](https://github.com/eggjs/awesome-egg#boilerplates) that in | CODE |
| MEDIUM | tools/create-egg/README.md | 61 | Check out Awesome Egg.js for [community maintained templates](https://github.com/eggjs/awesome-egg#boilerplates) that in | CODE |
| MEDIUM | site/docs/advanced/framework.md | 49 | Just use [egg-boilerplate-framework](https://github.com/eggjs/egg-boilerplate-framework) to generates a scaffold for you | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | site/docs/zh-CN/core/deployment.md | 170 | secret: '<YOUR_SECRET>', | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | .github/workflows/release.yml | 135 | # Create the tag locally if it doesn't exist | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | packages/supertest/README.md | 158 | expect(response.body.email).toEqual('foo@bar.com'); | CODE |
| LOW | packages/supertest/README.md | 172 | expect(response.body.email).toEqual('foo@bar.com'); | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | …evelopment/src/app/middleware/loader_trace_template.ts | 20 | // Step 2: 载入数据源 | COMMENT |