The open source frontend for GitBook doc sites
This report summarizes scanner evidence for GitbookIO/gitbook, a TypeScript project with 29,081 GitHub stars. SynthScan examined 130,967 lines of code across 1137 source files, recording 255 pattern matches distributed across 6 syntactic categories. The legacy adjusted pattern signal is 2.1 (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? 245 finding(s).
Are imports declared and package/API names verified? 10 finding(s).
Are wrappers, guards, and repeated structures necessary? 238 finding(s).
Which changes need focused human review? 255 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 255 distinct pattern matches across 6 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 | packages/react-openapi/src/OpenAPIOperationContext.tsx | 22 | export function OpenAPIOperationContextProvider( | CODE |
| LOW | packages/react-openapi/src/OpenAPIOperationContext.tsx | 43 | export function useOpenAPIOperationContext() { | CODE |
| LOW | …ckages/react-openapi/src/OpenAPIOperationStability.tsx | 9 | export function OpenAPIOperationStability(props: { | CODE |
| LOW | packages/react-openapi/src/OpenAPISchema.tsx | 189 | export function OpenAPISchemaPropertiesFromServer(props: { | CODE |
| LOW | packages/react-openapi/src/OpenAPISchema.tsx | 279 | export function OpenAPIRootSchemaFromServer(props: { | CODE |
| LOW | packages/react-openapi/src/OpenAPISchema.tsx | 344 | function OpenAPISchemaAlternatives(props: { | CODE |
| LOW | packages/react-openapi/src/OpenAPISchema.tsx | 442 | function OpenAPISchemaAlternativeSeparator(props: { | CODE |
| LOW | packages/react-openapi/src/OpenAPISchema.tsx | 541 | export function OpenAPISchemaPresentation(props: { | CODE |
| LOW | …ages/react-openapi/src/OpenAPIOperationDescription.tsx | 10 | export function OpenAPIOperationDescription(props: { | CODE |
| LOW | packages/react-openapi/src/utils.ts | 206 | export function getStatusCodeDefaultLabel( | CODE |
| LOW | packages/react-openapi/src/utils.ts | 318 | function normalizeNullableUnionUncached(typed: OpenAPIV3.SchemaObject): OpenAPIV3.SchemaObject { | CODE |
| LOW | packages/react-openapi/src/utils.ts | 428 | export function extractOperationSecurityInfo(args: { | CODE |
| LOW | packages/react-openapi/src/utils.ts | 479 | function resolveRequiredScopesForScheme( | CODE |
| LOW | …ges/react-openapi/src/OpenAPIRequestBodyHeaderType.tsx | 11 | export function OpenAPIRequestBodyHeaderType(props: { | CODE |
| LOW | packages/react-openapi/src/generateSchemaExample.ts | 30 | export function generateMediaTypeExamples( | CODE |
| LOW | packages/react-openapi/src/resolveOpenAPIWebhook.ts | 98 | function getWebhookByNameAndMethod( | CODE |
| LOW | packages/react-openapi/src/resolveOpenAPIOperation.ts | 171 | function getOperationByPathAndMethod( | CODE |
| LOW | …es/react-openapi/src/OpenAPIPrefillContextProvider.tsx | 22 | export function OpenAPIPrefillContextProvider( | CODE |
| LOW | packages/react-openapi/src/OpenAPIMediaType.tsx | 21 | function useMediaTypeExamplesState(stateKey: string | undefined, initialKey: Key = 'default') { | CODE |
| LOW | packages/react-openapi/src/dereference.ts | 26 | async function baseDereferenceFilesystem(filesystem: Filesystem): Promise<OpenAPIV3xDocument> { | CODE |
| LOW | packages/react-openapi/src/OpenAPICodeSample.tsx | 262 | function resolveScalarClientContext( | CODE |
| LOW | …es/react-openapi/src/OpenAPIResponseExampleContent.tsx | 22 | export function OpenAPIResponseExampleContent(props: { | CODE |
| LOW | …es/react-openapi/src/OpenAPIResponseExampleContent.tsx | 38 | function OpenAPIResponseExampleHeader(props: { | CODE |
| LOW | …es/react-openapi/src/OpenAPIResponseExampleContent.tsx | 70 | function OpenAPIResponseExampleItem(props: { item: OpenAPIResponseExampleItem }) { | CODE |
| LOW | …es/react-openapi/src/OpenAPIResponseExampleContent.tsx | 88 | function OpenAPIResponseExampleBody(props: { items: OpenAPIResponseExampleItem[] }) { | CODE |
| LOW | …es/react-openapi/src/OpenAPIResponseExampleContent.tsx | 105 | function getResponseExampleStateKey() { | CODE |
| LOW | …kages/react-openapi/src/OpenAPIPathMultipleServers.tsx | 16 | export function OpenAPIPathMultipleServers( | CODE |
| LOW | …ges/react-openapi/src/OpenAPICodeSampleInteractive.tsx | 6 | export function OpenAPIMediaTypeExamplesSelector(props: { | CODE |
| LOW | …ges/react-openapi/src/OpenAPICodeSampleInteractive.tsx | 93 | export function OpenAPIMediaTypeExamplesBody(props: { | CODE |
| LOW | packages/react-openapi/src/util/example.tsx | 25 | export function getExamplesFromMediaTypeObject(args: { | CODE |
| LOW | packages/react-openapi/src/util/tryit-prefill.ts | 23 | export function resolveTryItPrefillForOperation(args: { | CODE |
| LOW | packages/react-openapi/src/util/tryit-prefill.ts | 74 | function resolveTryItPrefillAuthForOperationSecurities(args: { | CODE |
| LOW | packages/react-openapi/src/util/tryit-prefill.ts | 128 | function resolveTryItPrefillServersForOperationServers(args: { | CODE |
| LOW | packages/react-openapi/src/util/tryit-prefill.ts | 180 | export function resolvePrefillCodePlaceholderFromSecurityScheme(args: { | CODE |
| LOW | packages/react-openapi/src/util/tryit-prefill.ts | 199 | function extractPrefillExpressionPartsFromSecurityScheme( | CODE |
| LOW | packages/react-openapi/src/util/tryit-prefill.ts | 214 | export function resolveURLWithPrefillCodePlaceholdersFromServer( | CODE |
| LOW | packages/react-openapi/src/util/tryit-prefill.ts | 261 | function templatePartsToExpression(parts: ReturnType<typeof parseTemplate>) { | CODE |
| LOW | …act-openapi/src/common/OpenAPIOperationDescription.tsx | 7 | export function OpenAPIOperationDescription(props: { | CODE |
| LOW | packages/expr/src/autocomplete.ts | 557 | function isSupportedMemberProperty(node: Expression | PrivateIdentifier | Super) { | CODE |
| LOW | packages/expr/src/runtime.ts | 256 | function createExpressionErrorFromSyntaxError( | CODE |
| LOW | packages/expr/src/runtime.ts | 279 | function validateRestrictedExpression(code: string, expression: Expression): void { | CODE |
| LOW | packages/expr/src/runtime.ts | 322 | function isParsedExpressionStatement( | CODE |
| LOW | packages/expr/src/runtime.ts | 328 | export function filterOutModuleDeclarationStatement( | CODE |
| LOW | packages/expr/src/input-values.ts | 16 | export function inferDefaultInputValuesFromObjectJSONSchema( | CODE |
| LOW | packages/expr/src/input-values.ts | 36 | function inferDefaultInputValueFromJSONSchema(schema: JSONSchema7): InputValuesType { | CODE |
| LOW | packages/expr/src/input-values.ts | 62 | function inferDefaultInputValueFromPrimitive(schema: JSONSchema7): InputValuesType { | CODE |
| LOW | packages/openapi-parser/src/schemas.ts | 22 | export function filterSelectedOpenAPISchemas( | CODE |
| LOW | packages/cache-tags/src/index.ts | 128 | export function getComputedContentSourceCacheTags( | CODE |
| LOW | packages/react-contentkit/src/context.ts | 96 | export function useContentKitClientContext(): ContentKitClientContextType { | CODE |
| LOW | packages/gitbook/tests/mcp-utils.ts | 183 | export async function fetchProtectedResourceMetadata(siteURL: string, endpoint: string) { | CODE |
| LOW | packages/gitbook/e2e/style-perf.spec.ts | 118 | async function waitForStableElementCount(page: Page): Promise<number> { | CODE |
| LOW | packages/gitbook/src/middleware.ts | 102 | async function validateServerActionRequest(request: NextRequest) { | CODE |
| LOW | packages/gitbook/src/middleware.ts | 140 | function shouldFilterMaliciousRequests(requestURL: URL): boolean { | CODE |
| LOW | …ode]/[siteURL]/[siteData]/~gitbook/site-index/route.ts | 50 | function getIndexablePagesWithAncestors( | CODE |
| LOW | packages/gitbook/src/components/Insights/cookies.ts | 22 | export function isCookiesTrackingDisabled() { | CODE |
| LOW | packages/gitbook/src/components/Insights/cookies.ts | 42 | export function isGlobalPrivacyControlEnabled(): boolean { | CODE |
| LOW | …book/src/components/SpaceLayout/SpaceLayoutContext.tsx | 15 | export function SpaceLayoutContextProvider( | CODE |
| LOW | …book/src/components/SpaceLayout/SpaceLayoutContext.tsx | 53 | export function useSiteAdaptiveAuthLoginHref() { | CODE |
| LOW | …rc/components/SiteSections/encodeClientSiteSections.ts | 223 | function areSiteSpacesSameLanguage(siteSpace1: SiteSpace, siteSpace2: SiteSpace) { | CODE |
| LOW | …ents/SiteSections/shouldRenderSiteSectionNavigation.ts | 4 | export function shouldRenderSiteSectionNavigation(sections: SiteSections | null): boolean { | CODE |
| 178 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | packages/react-openapi/src/OpenAPICodeSample.test.ts | 26 | Authorization: 'CustomScheme YOUR_API_KEY', | CODE |
| HIGH | packages/react-openapi/src/OpenAPICodeSample.tsx | 377 | defaultPlaceholderValue: 'YOUR_API_KEY', | CODE |
| HIGH | …ok/src/components/DocumentView/CodeBlock/utils.test.ts | 37 | code: 'const config = { API_KEY: "$$__X-GITBOOK-PREFILL[visitor.claims.apiKey ?? "YOUR_API_KEY"]__$$" }', | CODE |
| HIGH | …ok/src/components/DocumentView/CodeBlock/utils.test.ts | 61 | data: { expression: 'visitor.claims.apiKey ?? "YOUR_API_KEY"' }, | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | packages/gitbook/e2e/internal.spec.ts | 51 | '2. Perform a single search for exactly "Lorem ipsum".', | CODE |
| LOW | packages/gitbook/src/components/Ads/Ad.tsx | 77 | previewParam === 'placeholder' || | CODE |
| LOW | packages/gitbook/src/components/Ads/Ad.tsx | 88 | ? await renderAd({ source: 'placeholder' }) | CODE |
| LOW | packages/gitbook/src/components/Ads/renderAd.tsx | 36 | source: 'placeholder'; | CODE |
| LOW | packages/gitbook/src/lib/visitors.test.ts | 569 | const url = new URL('https://docs.example.com/?jwt_token=fake-token'); | CODE |
| LOW | packages/gitbook/src/lib/visitors.test.ts | 582 | 'https://docs.example.com/?jwt_token=fake-token&visitor.isBetaUser=true&visitor.language=fr' | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | packages/gitbook/types/global.d.ts | 1 | // Needed because of https://github.com/oven-sh/bun/issues/358 | COMMENT |
| LOW | packages/gitbook/e2e/internal.spec.ts | 2181 | // const invalidToken = jwt.sign( | COMMENT |
| LOW | .github/workflows/deploy-preview.yaml | 281 | BASE_URL: ${{needs.deploy-v2-vercel.outputs.deployment-url}} | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | packages/gitbook/src/components/WebMCP/WebMCP.tsx | 36 | // The MCP SDK is imported lazily: only agentic browsers pay for it. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | packages/gitbook/src/components/AI/references.test.ts | 56 | expect(result).toContain('The user is referring to the following code block'); | CODE |
| LOW | packages/gitbook/src/components/AI/references.test.ts | 75 | const codeIndex = result.indexOf('referring to the following code block'); | CODE |
| LOW | packages/gitbook/src/components/AI/references.ts | 77 | return `The user is referring to the following code block${plural ? 's' : ''} from the page they are reading. Answer | CODE |