CATEGORIES
Utilities (118)
stripCodeFences
Remove Markdown-style triple-backtick code fences and surrounding whitespace from a text block.
all-utils.js
isIgnoredDirName
Determine whether a directory name should be skipped based on a built-in ignore list.
all-utils.js
shouldIgnore
Determine whether a full path should be ignored based on configured substring matches.
all-utils.js
isCodeFile
Heuristically decide whether a path represents a source code file based on extension.
all-utils.js
walkDir
Recursively walk a directory tree starting at startPath and return a list of code file paths.
all-utils.js
detectLanguage
Map a file extension from a file path to a short string identifier representing
all-utils.js
chatCompletion
Simple chat completion wrapper that calls the OpenAI Chat Completions endpoint and returns
all-utils.js
chatJSON
Chat completion wrapper that expects the assistant to return STRICT JSON. Calls chatCompletion,
all-utils.js
guessHttpMethod
Heuristically infer an HTTP method (GET/POST/PUT/DELETE) from a URL or endpoint name.
all-utils.js
normalizePath
Normalize Windows backslashes to forward slashes for normalized, portable path strings.
all-utils.js
analyzeRepository
Asynchronously scans a repository path to build a static analysis report describing
analyze-repo.js
classifyFile
Infers the architectural classification of a file based on its path and filename patterns.
analyze-repo.js
checkForViolations
Scans file content line-by-line for known anti-patterns and architecture violations.
analyze-repo.js
extractMethods
Parses content to extract function and method names for JavaScript/TypeScript and Dart files.
analyze-repo.js
extractImports
Extracts module import specifiers from JS/TS or Dart file content using regex patterns.
analyze-repo.js
extractClassName
Attempts to extract the first declared class name from JavaScript/TypeScript content.
analyze-repo.js
extractFlutterDeps
Parses a pubspec.yaml string to collect dependency package names listed under `dependencies:`.
analyze-repo.js
generateSummary
Aggregates analysis results into a concise summary object including counts of files,
analyze-repo.js
getViolationsByType
Aggregates a list of violations by their `type` field and sorts descending by count.
analyze-repo.js
getTopViolators
Identifies the top files by number of violations, returning up to the top 10.
analyze-repo.js
classifyByContent
Inspect a source file's content and path to heuristically classify the file's likely role within a codebase.
classify.js
detectPatterns
Mutates a supplied "patterns" summary object by detecting frameworks and common cross-cutting features
classify.js
buildContext
Build a summarized context object from an analysis result. Aggregates basic stats,
context.js
enhanceViolations
Enhance a list of lint/analysis violations with contextual suggestions based on detected patterns.
context.js
buildApiCatalogAndDocs
Build an API catalog and service documentation from a comprehensive analysis object.
context.js
describeServicePurpose
Infer a human-friendly purpose description for a service based on its name and classification.
context.js
stripCodeFences
Remove surrounding Markdown code fences (```lang ... ```) and trim whitespace.
engine.js
isIgnoredDirName
Check whether a single directory name should be ignored (exact match against IGNORED_DIRS).
engine.js
shouldIgnore
Determine whether a full path should be ignored based on substrings in IGNORE_PATH_PARTS.
engine.js
isCodeFile
Determine if a file path corresponds to a source code file based on extension whitelist.
engine.js
walkDir
Recursively walk a directory tree starting at startPath and collect code file paths.
engine.js
detectLanguage
Map a file extension to a language/runtime identifier used by downstream tooling.
engine.js
chatCompletion
Simple async wrapper around OpenAI chat completions that returns plain text.
engine.js
listFiles
Recursively scan a directory and return a flat list of JavaScript (.js) file paths,
extract-docblocks.js
extractDocblocks
Extract block-style JSDoc comment blocks (/** ... *\/) from a source string.
extract-docblocks.js
detectFunctionName
Heuristically detect the JavaScript function or identifier name that immediately
extract-docblocks.js
processFile
Read a JavaScript file, extract docblocks, parse each docblock with the imported
extract-docblocks.js
printViolationsSummary
Produce a human-readable summary of the violations grouped by severity and print to stdout.
extract-violations.js
extractClasses
Parse source file content and extract top-level class/struct names for supported languages.
extract.js
extractFunctions
Analyze source content and return a list of top-level functions and methods with metadata.
extract.js
extractImports
Extract import/module dependency specifiers from source content for JS/TS/Go/Dart.
extract.js
extractEndpoints
Heuristically extract network endpoints (URLs and route definitions) from source content.
extract.js
extractLanguageSpecific
Extract language-specific artifacts from a file: Go structs, Node models/routes, Flutter/Dart classes and fields.
extract.js
extractGo
Parse Go source content to extract package name, struct type definitions and HTTP handler functions.
extract.js
extractNode
Parse Node/JS/TS content to find Mongoose-like schema blocks, models, express routes and middleware.
extract.js
extractSchemaFields
Parse a snippet that represents a schema object and extract field name/type pairs.
extract.js
isIgnoredDirName
Check whether a directory entry name should be ignored based on the IGNORED_DIRS set.
generate-comments.js
shouldIgnore
Determine whether a full filesystem path should be skipped based on IGNORE_PATH_PARTS.
generate-comments.js
isCodeFile
Quick heuristic to determine whether a given path refers to a source code file
generate-comments.js
stripCodeFences
Remove leading/trailing Markdown code-fences (```...```) from a string and trim whitespace.
generate-comments.js
walkDir
Recursively walk a starting directory and collect all files that are considered code files.
generate-comments.js
detectLanguage
Map file extensions to a short language key used to select prompts and parsing behavior.
generate-comments.js
getDocSystemPrompt
Return a language-specific system prompt for the documentation generation model.
generate-comments.js
getMetaSystemPrompt
Produce the system prompt used to instruct the model to extract structured metadata
generate-comments.js
generateDocForFile
Use the OpenAI Chat Completions API to request insertion of doc-blocks into a source file.
generate-comments.js
extractMetadataForFile
Use the OpenAI Chat Completions API to extract structured metadata (api endpoints and models)
generate-comments.js
escapeHtml
generate-doc-html.js
generateCSS
generate-doc-html.js
generateNav
generate-doc-html.js
generateServers
generate-doc-html.js
generateMounts
generate-doc-html.js
generateRoutes
generate-doc-html.js
generateModels
generate-doc-html.js
generateAPIs
generate-doc-html.js
generateFunctions
generate-doc-html.js
generateMiddleware
generate-doc-html.js
generateDatabases
generate-doc-html.js
generateClusters
generate-doc-html.js
generateSockets
generate-doc-html.js
generateHTML
generate-doc-html.js
diffList
Produce and print lists of added/removed items between two nodeStructure lists keyed by `key` (e.g., routes, models, servers).
generate-report.js
addApiToCatalog
Add a deduplicated API entry to an in-memory catalog keyed by "METHOD url". Tracks which service used the API.
generate-report.js
escapeHtml
Escape characters in a string for safe insertion into HTML content to prevent markup injection.
generate-report.js
anchorId
Generate a safe anchor/id string by combining a prefix and a sanitized name. Removes non-alphanumeric characters from name.
generate-report.js
baseJs
Returns a small JS snippet used across the generated HTML pages for toggling sections and initial UI state.
generate-report.js
pageTemplate
Compose a full HTML page using provided title/header/body and optionally include high-level analysis stats.
generate-report.js
renderServicesSection
Render a collapsible HTML section listing available services with links to their documentation blocks.
generate-report.js
renderApiCatalogSection
Render an API catalog grouped by domain/origin. Each endpoint contains method, url, and list of services that use it.
generate-report.js
renderServiceDocs
Render detailed service and API documentation sections from documentation data. Supports methods, params, returns and endpoints.
generate-report.js
renderModelsStructsBlock
Render a combined Models/Structs/Flutter classes block. Reads model/struct lists from analysis and generates field/index tables.
generate-report.js
renderViolation
Render a single violation object as an HTML block including severity, file path, message, code excerpt and suggestion.
generate-report.js
renderIssuesBySeverity
Render a set of collapsible sections for violations grouped by severity (critical, high, medium, low).
generate-report.js
renderDocumentationSummary
Render a summary section using documentation.json content. Outputs Routes, Servers, Models, Functions, and File Descriptions blocks.
generate-report.js
renderCrossRefsPage
Render cross-reference mappings (route→models, route→collections, model→routes, mount→routes, external APIs) as collapsible sections.
generate-report.js
generateSection
generate-violations-report.js
escapeHtml
generate-violations-report.js
safeList
save-context.js
describeServicePurpose
save-context.js
sanitizeId
Normalize a string to a lowercase dash-separated identifier safe for anchors/ids.
smart-analyze.js
generateId
Generate a stable id string for various entity types used in the documentation structure.
smart-analyze.js
parseParams
Parse an array of parameter doc strings into structured { name, type, description } objects.
smart-analyze.js
parseReturns
Parse return documentation into a structured object with HTTP code, type and description.
smart-analyze.js
parseThrows
Parse thrown errors documentation into structured { code, description } items.
smart-analyze.js
parseSchema
Parse a simple schema definition string into an array of field descriptors.
smart-analyze.js
parseRoute
Parse a route declaration string into method and path. Supports "GET /path" style.
smart-analyze.js
extractServers
Extract server definitions (port, protocol, cluster, workers, database) from docblocks.
smart-analyze.js
extractMounts
Extract Express mount points from docblocks (tag: @mount) and associated router info.
smart-analyze.js
extractRoutes
Extract documented HTTP routes from docblocks (tag: @route) and parse parameters, returns, throws.
smart-analyze.js
extractModels
Extract model/schema declarations from docblocks (tags: @model, @collection, @schema, @indexes).
smart-analyze.js
extractAPIs
Group external API usages (tag: @api) by domain, collect endpoints and usage locations.
smart-analyze.js
extractFunctions
Extract non-route functions from docblocks and infer their type (API Integration, Data Service, etc.).
smart-analyze.js
extractMiddleware
Extract documented middleware entries (tag: @middleware) including purpose and file.
smart-analyze.js
extractDatabases
Group database usage information (tags: @database, @dbname, @host, @authSource, @replicaSet) by dbname.
smart-analyze.js
extractClusters
Aggregate cluster-related docblocks (tag: @cluster) into cluster descriptors with worker counts and files.
smart-analyze.js
extractSockets
Extract socket event documentation (tags: @socket, @emits, @events) into socket descriptors.
smart-analyze.js
extractDomain
Extract the host/domain portion from a URL string. Falls back to the input if not a URL.
smart-analyze.js
inferFunctionType
Heuristically infer a function's role based on docblock tags and file path (API Integration, Data Service, Service Method, Utility).
smart-analyze.js
buildCrossReferences
Enrich the extracted structure with cross-references (anchors) between servers, mounts, routes, models, functions and APIs.
smart-analyze.js
findViolations
violations.js
add
violations.js
PIPELINE
Utilities (118 functions)
stripCodeFences
Remove Markdown-style triple-backtick code fences and surrounding whitespace from a text block.
all-utils.js
isIgnoredDirName
Determine whether a directory name should be skipped based on a built-in ignore list.
all-utils.js
shouldIgnore
Determine whether a full path should be ignored based on configured substring matches.
all-utils.js
isCodeFile
Heuristically decide whether a path represents a source code file based on extension.
all-utils.js
walkDir
Recursively walk a directory tree starting at startPath and return a list of code file paths.
all-utils.js
detectLanguage
Map a file extension from a file path to a short string identifier representing
all-utils.js
chatCompletion
Simple chat completion wrapper that calls the OpenAI Chat Completions endpoint and returns
all-utils.js
chatJSON
Chat completion wrapper that expects the assistant to return STRICT JSON. Calls chatCompletion,
all-utils.js
guessHttpMethod
Heuristically infer an HTTP method (GET/POST/PUT/DELETE) from a URL or endpoint name.
all-utils.js
normalizePath
Normalize Windows backslashes to forward slashes for normalized, portable path strings.
all-utils.js
analyzeRepository
Asynchronously scans a repository path to build a static analysis report describing
analyze-repo.js
classifyFile
Infers the architectural classification of a file based on its path and filename patterns.
analyze-repo.js
checkForViolations
Scans file content line-by-line for known anti-patterns and architecture violations.
analyze-repo.js
extractMethods
Parses content to extract function and method names for JavaScript/TypeScript and Dart files.
analyze-repo.js
extractImports
Extracts module import specifiers from JS/TS or Dart file content using regex patterns.
analyze-repo.js
extractClassName
Attempts to extract the first declared class name from JavaScript/TypeScript content.
analyze-repo.js
extractFlutterDeps
Parses a pubspec.yaml string to collect dependency package names listed under `dependencies:`.
analyze-repo.js
generateSummary
Aggregates analysis results into a concise summary object including counts of files,
analyze-repo.js
getViolationsByType
Aggregates a list of violations by their `type` field and sorts descending by count.
analyze-repo.js
getTopViolators
Identifies the top files by number of violations, returning up to the top 10.
analyze-repo.js
classifyByContent
Inspect a source file's content and path to heuristically classify the file's likely role within a codebase.
classify.js
detectPatterns
Mutates a supplied "patterns" summary object by detecting frameworks and common cross-cutting features
classify.js
buildContext
Build a summarized context object from an analysis result. Aggregates basic stats,
context.js
enhanceViolations
Enhance a list of lint/analysis violations with contextual suggestions based on detected patterns.
context.js
buildApiCatalogAndDocs
Build an API catalog and service documentation from a comprehensive analysis object.
context.js
describeServicePurpose
Infer a human-friendly purpose description for a service based on its name and classification.
context.js
stripCodeFences
Remove surrounding Markdown code fences (```lang ... ```) and trim whitespace.
engine.js
isIgnoredDirName
Check whether a single directory name should be ignored (exact match against IGNORED_DIRS).
engine.js
shouldIgnore
Determine whether a full path should be ignored based on substrings in IGNORE_PATH_PARTS.
engine.js
isCodeFile
Determine if a file path corresponds to a source code file based on extension whitelist.
engine.js
walkDir
Recursively walk a directory tree starting at startPath and collect code file paths.
engine.js
detectLanguage
Map a file extension to a language/runtime identifier used by downstream tooling.
engine.js
chatCompletion
Simple async wrapper around OpenAI chat completions that returns plain text.
engine.js
listFiles
Recursively scan a directory and return a flat list of JavaScript (.js) file paths,
extract-docblocks.js
extractDocblocks
Extract block-style JSDoc comment blocks (/** ... *\/) from a source string.
extract-docblocks.js
detectFunctionName
Heuristically detect the JavaScript function or identifier name that immediately
extract-docblocks.js
processFile
Read a JavaScript file, extract docblocks, parse each docblock with the imported
extract-docblocks.js
printViolationsSummary
Produce a human-readable summary of the violations grouped by severity and print to stdout.
extract-violations.js
extractClasses
Parse source file content and extract top-level class/struct names for supported languages.
extract.js
extractFunctions
Analyze source content and return a list of top-level functions and methods with metadata.
extract.js
extractImports
Extract import/module dependency specifiers from source content for JS/TS/Go/Dart.
extract.js
extractEndpoints
Heuristically extract network endpoints (URLs and route definitions) from source content.
extract.js
extractLanguageSpecific
Extract language-specific artifacts from a file: Go structs, Node models/routes, Flutter/Dart classes and fields.
extract.js
extractGo
Parse Go source content to extract package name, struct type definitions and HTTP handler functions.
extract.js
extractNode
Parse Node/JS/TS content to find Mongoose-like schema blocks, models, express routes and middleware.
extract.js
extractSchemaFields
Parse a snippet that represents a schema object and extract field name/type pairs.
extract.js
isIgnoredDirName
Check whether a directory entry name should be ignored based on the IGNORED_DIRS set.
generate-comments.js
shouldIgnore
Determine whether a full filesystem path should be skipped based on IGNORE_PATH_PARTS.
generate-comments.js
isCodeFile
Quick heuristic to determine whether a given path refers to a source code file
generate-comments.js
stripCodeFences
Remove leading/trailing Markdown code-fences (```...```) from a string and trim whitespace.
generate-comments.js
walkDir
Recursively walk a starting directory and collect all files that are considered code files.
generate-comments.js
detectLanguage
Map file extensions to a short language key used to select prompts and parsing behavior.
generate-comments.js
getDocSystemPrompt
Return a language-specific system prompt for the documentation generation model.
generate-comments.js
getMetaSystemPrompt
Produce the system prompt used to instruct the model to extract structured metadata
generate-comments.js
generateDocForFile
Use the OpenAI Chat Completions API to request insertion of doc-blocks into a source file.
generate-comments.js
extractMetadataForFile
Use the OpenAI Chat Completions API to extract structured metadata (api endpoints and models)
generate-comments.js
escapeHtml
generate-doc-html.js
generateCSS
generate-doc-html.js
generateNav
generate-doc-html.js
generateServers
generate-doc-html.js
generateMounts
generate-doc-html.js
generateRoutes
generate-doc-html.js
generateModels
generate-doc-html.js
generateAPIs
generate-doc-html.js
generateFunctions
generate-doc-html.js
generateMiddleware
generate-doc-html.js
generateDatabases
generate-doc-html.js
generateClusters
generate-doc-html.js
generateSockets
generate-doc-html.js
generateHTML
generate-doc-html.js
diffList
Produce and print lists of added/removed items between two nodeStructure lists keyed by `key` (e.g., routes, models, servers).
generate-report.js
addApiToCatalog
Add a deduplicated API entry to an in-memory catalog keyed by "METHOD url". Tracks which service used the API.
generate-report.js
escapeHtml
Escape characters in a string for safe insertion into HTML content to prevent markup injection.
generate-report.js
anchorId
Generate a safe anchor/id string by combining a prefix and a sanitized name. Removes non-alphanumeric characters from name.
generate-report.js
baseJs
Returns a small JS snippet used across the generated HTML pages for toggling sections and initial UI state.
generate-report.js
pageTemplate
Compose a full HTML page using provided title/header/body and optionally include high-level analysis stats.
generate-report.js
renderServicesSection
Render a collapsible HTML section listing available services with links to their documentation blocks.
generate-report.js
renderApiCatalogSection
Render an API catalog grouped by domain/origin. Each endpoint contains method, url, and list of services that use it.
generate-report.js
renderServiceDocs
Render detailed service and API documentation sections from documentation data. Supports methods, params, returns and endpoints.
generate-report.js
renderModelsStructsBlock
Render a combined Models/Structs/Flutter classes block. Reads model/struct lists from analysis and generates field/index tables.
generate-report.js
renderViolation
Render a single violation object as an HTML block including severity, file path, message, code excerpt and suggestion.
generate-report.js
renderIssuesBySeverity
Render a set of collapsible sections for violations grouped by severity (critical, high, medium, low).
generate-report.js
renderDocumentationSummary
Render a summary section using documentation.json content. Outputs Routes, Servers, Models, Functions, and File Descriptions blocks.
generate-report.js
renderCrossRefsPage
Render cross-reference mappings (route→models, route→collections, model→routes, mount→routes, external APIs) as collapsible sections.
generate-report.js
generateSection
generate-violations-report.js
escapeHtml
generate-violations-report.js
safeList
save-context.js
describeServicePurpose
save-context.js
sanitizeId
Normalize a string to a lowercase dash-separated identifier safe for anchors/ids.
smart-analyze.js
generateId
Generate a stable id string for various entity types used in the documentation structure.
smart-analyze.js
parseParams
Parse an array of parameter doc strings into structured { name, type, description } objects.
smart-analyze.js
parseReturns
Parse return documentation into a structured object with HTTP code, type and description.
smart-analyze.js
parseThrows
Parse thrown errors documentation into structured { code, description } items.
smart-analyze.js
parseSchema
Parse a simple schema definition string into an array of field descriptors.
smart-analyze.js
parseRoute
Parse a route declaration string into method and path. Supports "GET /path" style.
smart-analyze.js
extractServers
Extract server definitions (port, protocol, cluster, workers, database) from docblocks.
smart-analyze.js
extractMounts
Extract Express mount points from docblocks (tag: @mount) and associated router info.
smart-analyze.js
extractRoutes
Extract documented HTTP routes from docblocks (tag: @route) and parse parameters, returns, throws.
smart-analyze.js
extractModels
Extract model/schema declarations from docblocks (tags: @model, @collection, @schema, @indexes).
smart-analyze.js
extractAPIs
Group external API usages (tag: @api) by domain, collect endpoints and usage locations.
smart-analyze.js
extractFunctions
Extract non-route functions from docblocks and infer their type (API Integration, Data Service, etc.).
smart-analyze.js
extractMiddleware
Extract documented middleware entries (tag: @middleware) including purpose and file.
smart-analyze.js
extractDatabases
Group database usage information (tags: @database, @dbname, @host, @authSource, @replicaSet) by dbname.
smart-analyze.js
extractClusters
Aggregate cluster-related docblocks (tag: @cluster) into cluster descriptors with worker counts and files.
smart-analyze.js
extractSockets
Extract socket event documentation (tags: @socket, @emits, @events) into socket descriptors.
smart-analyze.js
extractDomain
Extract the host/domain portion from a URL string. Falls back to the input if not a URL.
smart-analyze.js
inferFunctionType
Heuristically infer a function's role based on docblock tags and file path (API Integration, Data Service, Service Method, Utility).
smart-analyze.js
buildCrossReferences
Enrich the extracted structure with cross-references (anchors) between servers, mounts, routes, models, functions and APIs.
smart-analyze.js
findViolations
violations.js
add
violations.js
FUNCTIONS
stripCodeFences
[Utility]
stripCodeFencesall-utils.jsParameters
| Name | Type | Description |
|---|---|---|
{string} text - Input text which may contain fenced code block(s). |
any |
Returns
Throws
- - Nothing is thrown; falsy input returns an empty string.:
isIgnoredDirName
[Utility]
isIgnoredDirNameall-utils.jsParameters
| Name | Type | Description |
|---|---|---|
{string} name - Single path segment (directory name) to check. |
any |
Returns
Throws
- - None.:
shouldIgnore
[Utility]
shouldIgnoreall-utils.jsParameters
| Name | Type | Description |
|---|---|---|
{string} fullPath - Full file system path to evaluate. |
any |
Returns
Throws
- - None.:
isCodeFile
[Utility]
isCodeFileall-utils.jsParameters
| Name | Type | Description |
|---|---|---|
{string} filePath - File path to inspect. |
any |
Returns
Throws
- - None.:
walkDir
[Utility]
walkDirall-utils.jsParameters
| Name | Type | Description |
|---|---|---|
{string} startPath - Absolute or relative directory path to begin traversal. |
any |
Returns
Throws
- - Does not throw on typical fs errors; unexpected exceptions may propagate.:
detectLanguage
[Utility]
detectLanguageall-utils.jsParameters
| Name | Type | Description |
|---|---|---|
{string} filePath - File path used to infer language from its extension. |
any |
Returns
Throws
- - None.:
chatCompletion
[Utility]
chatCompletionall-utils.jsParameters
| Name | Type | Description |
|---|---|---|
{Object} options |
any | |
{string} options.system - System prompt text (role: system). Will be trimmed. |
any | |
{string} options.user - User prompt text (role: user). Will be trimmed. |
any | |
{number} [options.temperature=1] - Sampling temperature for the completion. |
any | |
{string} [options.model=MODEL_NAME] - Model identifier to use for the request. |
any |
Returns
Throws
- {Error} Throws if the OpenAI client errors or the response is malformed (network/HTTP errors).:
chatJSON
[Utility]
chatJSONall-utils.jsParameters
| Name | Type | Description |
|---|---|---|
{Object} options |
any | |
{string} options.system - System prompt text (role: system) guiding the model to output JSON. |
any | |
{string} options.user - User prompt text (role: user). |
any | |
{number} [options.temperature=1] - Model sampling temperature. |
any | |
{string} [options.model=MODEL_NAME] - Model identifier. |
any |
Returns
Throws
- {Error} Throws if chatCompletion fails (API/network) or JSON.parse fails. Parse errors include the RAW response in the error message.:
guessHttpMethod
[Utility]
guessHttpMethodall-utils.jsParameters
| Name | Type | Description |
|---|---|---|
{string} url - The URL or endpoint identifier to analyze. |
any |
Returns
Throws
- - None.:
ensureDirs
[Utility]
ensureDirsall-utils.jsParameters
| Name | Type | Description |
|---|---|---|
{...string} dirs - One or more directory paths to create (string varargs). |
any |
Returns
Throws
- {Error} If fs.mkdirSync fails due to permission issues or invalid paths, the error will propagate.:
normalizePath
[Utility]
normalizePathall-utils.jsParameters
| Name | Type | Description |
|---|---|---|
{string} p - Input path string to normalize. |
any |
Returns
Throws
- - None.:
analyzeRepository
[Utility]
analyzeRepositoryanalyze-repo.jsParameters
| Name | Type | Description |
|---|---|---|
{string} repoPath - Filesystem path to the repository root to analyze. Defaults to '.' when omitted. |
any |
Returns
Throws
- {Error} May throw filesystem or JSON parsing errors when reading files (e.g., package.json, pubspec.yaml),:
classifyFile
[Utility]
classifyFileanalyze-repo.jsParameters
| Name | Type | Description |
|---|---|---|
{string} filePath - Full filesystem path to the file. |
any | |
{string} content - File content as a string. |
any |
Returns
checkForViolations
[Utility]
checkForViolationsanalyze-repo.jsParameters
| Name | Type | Description |
|---|---|---|
{string} content - File content to scan. |
any | |
{string} filePath - Path of the file being scanned (used in returned violation objects). |
any | |
{string} ext - File extension (e.g., '.js', '.dart') used to adjust scanning logic if needed. |
any |
Returns
extractMethods
[Utility]
extractMethodsanalyze-repo.jsParameters
| Name | Type | Description |
|---|---|---|
{string} content - File content to analyze. |
any | |
{string} ext - File extension ('.js', '.ts', '.dart') to choose parsing heuristics. |
any |
Returns
extractImports
[Utility]
extractImportsanalyze-repo.jsParameters
| Name | Type | Description |
|---|---|---|
{string} content - File content to scan. |
any | |
{string} ext - File extension ('.js', '.ts', '.dart') to select pattern. |
any |
Returns
extractClassName
[Utility]
extractClassNameanalyze-repo.jsParameters
| Name | Type | Description |
|---|---|---|
{string} content - File content to search for "class <Name>". |
any |
Returns
extractFlutterDeps
[Utility]
extractFlutterDepsanalyze-repo.jsParameters
| Name | Type | Description |
|---|---|---|
{string} yaml - Contents of pubspec.yaml as a string. |
any |
Returns
generateSummary
[Utility]
generateSummaryanalyze-repo.jsParameters
| Name | Type | Description |
|---|---|---|
{Object} analysis - The full analysis object produced by analyzeRepository. |
any |
Returns
getViolationsByType
[Utility]
getViolationsByTypeanalyze-repo.jsParameters
| Name | Type | Description |
|---|---|---|
{Array<Object>} violations - Array of violation objects as produced by checkForViolations. |
any |
Returns
getTopViolators
[Utility]
getTopViolatorsanalyze-repo.jsParameters
| Name | Type | Description |
|---|---|---|
{Array<Object>} violations - Array of violation objects. |
any |
Returns
classifyByContent
[Utility]
classifyByContentclassify.jsParameters
| Name | Type | Description |
|---|---|---|
|
any |
Returns
Throws
- None - this function is deterministic and does not throw intentionally; may surface exceptions inherited from callers (e.g. if invalid args cause upstream errors).:
detectPatterns
[Utility]
detectPatternsclassify.jsParameters
| Name | Type | Description |
|---|---|---|
|
any |
Returns
Throws
- None - safe heuristic checks; no errors intentionally thrown.:
buildContext
[Utility]
buildContextcontext.jsParameters
| Name | Type | Description |
|---|---|---|
{Object} analysis - Analysis result object |
any | |
{Object} analysis.stats - Statistics about the codebase (totalFiles, totalLines, byLanguage, entryPoints) |
any | |
{Object} analysis.patterns - Detected architecture patterns (frameworks, hasApiService, hasStorageService, hasRepositories, hasHttpCalls, hasSharedPrefs, hasDbQueries) |
any |
Returns
Throws
- {TypeError} If analysis or required nested fields are not provided the function may throw when accessing properties:
enhanceViolations
[Utility]
enhanceViolationscontext.jsParameters
| Name | Type | Description |
|---|---|---|
{Array<Object>} violations - Array of violation objects detected in the analysis |
any | |
{string} violations[].rule - Violation rule identifier (e.g. "hardcoded-url") |
any | |
{string} [violations[].suggestion] - Existing suggestion text (optional) |
any | |
{Object} context - Context produced by buildContext or equivalent |
any | |
{boolean} context.hasApiService - Whether an ApiService exists in the codebase |
any |
Returns
Throws
- None expected; will propagate errors if invalid inputs are provided:
buildApiCatalogAndDocs
[Utility]
buildApiCatalogAndDocscontext.jsParameters
| Name | Type | Description |
|---|---|---|
{Object} analysis - Full codebase analysis structure |
any | |
{Array<Object>} analysis.files - Array of analyzed file objects { path, content, endpoints[], classes[] } |
any | |
{Object} analysis.classified - Classified file lists by roles (services, controllers, handlers, routes, repositories, database) |
any | |
{Object} [analysis.nodeStructure] - Node-specific structure, may include models: [{ name, file, fields }] |
any | |
{Object} [analysis.goStructure] - Go-specific structure, may include structs: [{ name, file, fields }] |
any | |
{Array<Object>} [analysis.serviceDocumentation] - Optional array to append node/go model docs before final assignment |
any |
Returns
Throws
- {Error} May throw if analysis structure is malformed (e.g. missing arrays expected):
describeServicePurpose
[Utility]
describeServicePurposecontext.jsParameters
| Name | Type | Description |
|---|---|---|
{string} name - Name of the service/class/file identifier |
any | |
{string} type - Classification string (e.g. "handlers", "controllers", "routes") |
any |
Returns
Throws
- None:
parseDocblock
[Utility]
parseDocblockdocblock-parser.js
stripCodeFences
[Utility]
stripCodeFencesengine.jsParameters
| Name | Type | Description |
|---|---|---|
{string} text - Input text that may include Markdown code fences. |
any |
Returns
Throws
- {none}:
isIgnoredDirName
[Utility]
isIgnoredDirNameengine.jsParameters
| Name | Type | Description |
|---|---|---|
{string} name - The directory entry name (not full path). |
any |
Returns
Throws
- {none}:
shouldIgnore
[Utility]
shouldIgnoreengine.jsParameters
| Name | Type | Description |
|---|---|---|
{string} fullPath - Full file or directory path to test. |
any |
Returns
Throws
- {none}:
isCodeFile
[Utility]
isCodeFileengine.jsParameters
| Name | Type | Description |
|---|---|---|
{string} filePath - Full or relative path to a file. |
any |
Returns
Throws
- {none}:
walkDir
[Utility]
walkDirengine.jsParameters
| Name | Type | Description |
|---|---|---|
{string} startPath - Root directory to start walking. |
any |
Returns
Throws
- {none} - Filesystem errors are caught and result in skipping entries; does not throw.:
detectLanguage
[Utility]
detectLanguageengine.jsParameters
| Name | Type | Description |
|---|---|---|
{string} filePath - File path used to extract extension. |
any |
Returns
Throws
- {none}:
chatCompletion
[Utility]
chatCompletionengine.jsParameters
| Name | Type | Description |
|---|---|---|
{Object} options |
any | |
{string} options.system - System prompt content (will be trimmed). |
any | |
{string} options.user - User prompt content (will be trimmed). |
any | |
{number} [options.temperature=1] - Sampling temperature passed to the model. |
any | |
{string} [options.model=MODEL_NAME] - Model identifier to use for the completion. |
any |
Returns
Throws
- {Error} - Propagates errors from OpenAI SDK/network; calling code should handle API errors.:
chatJSON
[Utility]
chatJSONengine.jsParameters
| Name | Type | Description |
|---|---|---|
{Object} options |
any | |
{string} options.system - System prompt passed to chatCompletion. |
any | |
{string} options.user - User prompt passed to chatCompletion. |
any | |
{number} [options.temperature=1] - Sampling temperature forwarded to chatCompletion. |
any | |
{string} [options.model=MODEL_NAME] - Model identifier forwarded to chatCompletion. |
any |
Returns
Throws
- {Error} - Throws an Error with details if JSON.parse fails (includes raw model output).:
listFiles
[Utility]
listFilesextract-docblocks.jsParameters
| Name | Type | Description |
|---|---|---|
{string} dir - The root directory to scan. |
any |
Returns
Throws
- {Error} Throws filesystem errors from fs.readdirSync if the directory cannot be read.:
extractDocblocks
[Utility]
extractDocblocksextract-docblocks.jsParameters
| Name | Type | Description |
|---|---|---|
{string} source - The source file contents to scan. |
any |
Returns
Throws
- {Error} No explicit throws, but will propagate errors if incorrect input types are used.:
detectFunctionName
[Utility]
detectFunctionNameextract-docblocks.jsParameters
| Name | Type | Description |
|---|---|---|
{string} source - The complete source text to scan. |
any | |
{number} pos - The character index in source from which to start scanning (typically the end of a docblock). |
any |
Returns
Throws
- {Error} Will not explicitly throw; may propagate if invalid args are provided.:
processFile
[Utility]
processFileextract-docblocks.jsParameters
| Name | Type | Description |
|---|---|---|
{string} file - File path to read and process. |
any | |
{Array<Object>} allBlocks - Mutable array that will receive parsed docblock summary objects. |
any |
Returns
Throws
- {Error} Propagates errors from fs.readFileSync and parseDocblock.:
printViolationsSummary
[Utility]
printViolationsSummaryextract-violations.jsParameters
| Name | Type | Description |
|---|---|---|
{Array<Object>} violations - Array of violation objects produced by analyzeViolations. |
any |
Returns
extractClasses
[Utility]
extractClassesextract.jsParameters
| Name | Type | Description |
|---|---|---|
{string} content - The full source file content. |
any | |
{string} ext - File extension (e.g. ".js", ".ts", ".go", ".dart"). |
any |
Returns
Throws
- {none}:
extractFunctions
[Utility]
extractFunctionsextract.jsParameters
| Name | Type | Description |
|---|---|---|
{string} content - Full source file content. |
any | |
{string} ext - File extension to guide parsing rules (".go", ".js", ".ts", ".jsx", ".tsx"). |
any |
Returns
Throws
- {none}:
within
[Utility]
withinextract.jsParameters
| Name | Type | Description |
|---|---|---|
{string} content - Full source text. |
any | |
{number} startIndex - Start index within the content. |
any |
Returns
Throws
- {none}:
extractImports
[Utility]
extractImportsextract.jsParameters
| Name | Type | Description |
|---|---|---|
{string} content - Full source file content. |
any | |
{string} ext - File extension (".js", ".ts", ".dart", ".go", etc.) |
any |
Returns
Throws
- {none}:
extractEndpoints
[Utility]
extractEndpointsextract.jsParameters
| Name | Type | Description |
|---|---|---|
{string} content - File contents to scan. |
any | |
{string} ext - File extension to tune Go detection. |
any |
Returns
Throws
- {none}:
extractLanguageSpecific
[Utility]
extractLanguageSpecificextract.jsParameters
| Name | Type | Description |
|---|---|---|
{string} content - File content. |
any | |
{string} filePath - Full or basename of file (used to infer default model names). |
any | |
{string} ext - File extension. |
any |
Returns
Throws
- {none}:
extractGo
[Utility]
extractGoextract.jsParameters
| Name | Type | Description |
|---|---|---|
{string} content - Go source code text. |
any |
Returns
Throws
- {none}:
extractNode
[Utility]
extractNodeextract.jsParameters
| Name | Type | Description |
|---|---|---|
{string} content - Source file content. |
any | |
{string} [filename=""] - Filename used to infer default model names when model declarations are absent. |
any |
Returns
Throws
- {none}:
extractSchemaFields
[Utility]
extractSchemaFieldsextract.jsParameters
| Name | Type | Description |
|---|---|---|
{string} schemaString - Raw schema object source text (may contain comments and whitespace). |
any |
Returns
Throws
- {none}:
isIgnoredDirName
[Utility]
isIgnoredDirNamegenerate-comments.jsParameters
| Name | Type | Description |
|---|---|---|
{string} name - Directory or entry name (not a path) to test (e.g. "node_modules"). |
any |
Returns
Throws
- None:
shouldIgnore
[Utility]
shouldIgnoregenerate-comments.jsParameters
| Name | Type | Description |
|---|---|---|
{string} fullPath - Absolute or relative filesystem path to evaluate. |
any |
Returns
Throws
- None:
isCodeFile
[Utility]
isCodeFilegenerate-comments.jsParameters
| Name | Type | Description |
|---|---|---|
{string} filePath - File path to inspect. |
any |
Returns
Throws
- None:
stripCodeFences
[Utility]
stripCodeFencesgenerate-comments.jsParameters
| Name | Type | Description |
|---|---|---|
{string} text - Potentially fenced text returned by an LLM or other source. |
any |
Returns
Throws
- None:
walkDir
[Utility]
walkDirgenerate-comments.jsParameters
| Name | Type | Description |
|---|---|---|
{string} startPath - Path to begin recursion from. Can be relative or absolute. |
any |
Returns
Throws
- Will not throw on typical filesystem access errors — errors are caught and directories/files skipped.:
detectLanguage
[Utility]
detectLanguagegenerate-comments.jsParameters
| Name | Type | Description |
|---|---|---|
{string} filePath - Path or filename whose extension will be inspected. |
any |
Returns
Throws
- None:
getDocSystemPrompt
[Utility]
getDocSystemPromptgenerate-comments.jsParameters
| Name | Type | Description |
|---|---|---|
{string} lang - Language key returned by detectLanguage (e.g. "js", "go", "dart"). |
any |
Returns
Throws
- None:
getMetaSystemPrompt
[Utility]
getMetaSystemPromptgenerate-comments.jsParameters
| Name | Type | Description |
|---|---|---|
{string} lang - Language key used to contextualize prompts (informational). |
any |
Returns
Throws
- None:
generateDocForFile
[Utility]
generateDocForFilegenerate-comments.jsParameters
| Name | Type | Description |
|---|---|---|
{string} filePath - The file path being documented (used for logging/context only). |
any | |
{string} source - The original source content of the file. |
any | |
{string} lang - Language key used to select the system prompt. |
any |
Returns
Throws
- Will propagate errors from the OpenAI client (network, auth, or API errors).:
extractMetadataForFile
[Utility]
extractMetadataForFilegenerate-comments.jsParameters
| Name | Type | Description |
|---|---|---|
{string} filePath - Path to the file being analyzed (used for logging/context). |
any | |
{string} source - The file contents (preferably updated with doc-blocks). |
any | |
{string} lang - Language key used to contextualize the prompt. |
any |
Returns
Throws
- Will propagate OpenAI API errors. JSON.parse errors are caught and logged; the function returns an empty metadata structure on parse failure.:
escapeHtml
[Utility]
escapeHtmlgenerate-doc-html.jsParameters
| Name | Type | Description |
|---|---|---|
{string} text - The input text that may contain HTML-sensitive characters |
any |
Returns
Throws
- None:
generateCSS
[Utility]
generateCSSgenerate-doc-html.jsParameters
| Name | Type | Description |
|---|---|---|
None (reads global `data` but does not mutate it) |
any |
Returns
Throws
- None:
generateServers
[Utility]
generateServersgenerate-doc-html.jsParameters
| Name | Type | Description |
|---|---|---|
None (reads global `data.servers` array) |
any |
Returns
Throws
- None:
generateMounts
[Utility]
generateMountsgenerate-doc-html.jsParameters
| Name | Type | Description |
|---|---|---|
None (reads global `data.mounts`) |
any |
Returns
Throws
- None:
generateRoutes
[Utility]
generateRoutesgenerate-doc-html.jsParameters
| Name | Type | Description |
|---|---|---|
None (reads global `data.routes`) |
any |
Returns
Throws
- None:
generateModels
[Utility]
generateModelsgenerate-doc-html.jsParameters
| Name | Type | Description |
|---|---|---|
None (reads global `data.models`) |
any |
Returns
Throws
- None:
generateAPIs
[Utility]
generateAPIsgenerate-doc-html.jsParameters
| Name | Type | Description |
|---|---|---|
None (reads global `data.apis`) |
any |
Returns
Throws
- None:
generateFunctions
[Utility]
generateFunctionsgenerate-doc-html.jsParameters
| Name | Type | Description |
|---|---|---|
None (reads global `data.functions`) |
any |
Returns
Throws
- None:
generateMiddleware
[Utility]
generateMiddlewaregenerate-doc-html.jsParameters
| Name | Type | Description |
|---|---|---|
None (reads global `data.middleware`) |
any |
Returns
Throws
- None:
generateDatabases
[Utility]
generateDatabasesgenerate-doc-html.jsParameters
| Name | Type | Description |
|---|---|---|
None (reads global `data.databases`) |
any |
Returns
Throws
- None:
generateClusters
[Utility]
generateClustersgenerate-doc-html.jsParameters
| Name | Type | Description |
|---|---|---|
None (reads global `data.clusters`) |
any |
Returns
Throws
- None:
generateSockets
[Utility]
generateSocketsgenerate-doc-html.jsParameters
| Name | Type | Description |
|---|---|---|
None (reads global `data.sockets`) |
any |
Returns
Throws
- None:
generateHTML
[Utility]
generateHTMLgenerate-doc-html.jsParameters
| Name | Type | Description |
|---|---|---|
None (reads global `data` and uses helper functions: generateCSS, generateNav, generateServers, etc.) |
any |
Returns
Throws
- None:
hasDocumentation
[Utility]
hasDocumentationgenerate-docs.jsParameters
| Name | Type | Description |
|---|---|---|
{string} source - Full file source code to inspect. |
any |
Returns
Throws
- {none} This function performs pure string analysis and does not throw.:
count
[Utility]
countgenerate-report.jsParameters
| Name | Type | Description |
|---|---|---|
{any} arr - Value expected to be an array; if not an array returns 0. |
any |
Returns
diffList
[Utility]
diffListgenerate-report.jsParameters
| Name | Type | Description |
|---|---|---|
{string} key - Name of the nodeStructure array to diff (e.g., "routes" or "models"). |
any |
Returns
Throws
- none:
addApiToCatalog
[Utility]
addApiToCataloggenerate-report.jsParameters
| Name | Type | Description |
|---|---|---|
{Object} param0 - Input object |
any | |
{string} [param0.method="GET"] - HTTP method for the API endpoint. |
any | |
{string} [param0.url=""] - URL or path of the API endpoint. |
any | |
{string|null} [param0.sourceService=null] - Optional service name that uses this API. |
any |
Returns
Throws
- none - Silently ignores invalid or empty URLs.:
escapeHtml
[Utility]
escapeHtmlgenerate-report.jsParameters
| Name | Type | Description |
|---|---|---|
{string} [text=""] - Input string to escape. |
any |
Returns
Throws
- none:
anchorId
[Utility]
anchorIdgenerate-report.jsParameters
| Name | Type | Description |
|---|---|---|
{string} prefix - Identifier prefix (e.g., "service", "api"). |
any | |
{string} [name=""] - Name or path component to include in the id. |
any |
Returns
baseCss
[Utility]
baseCssgenerate-report.jsParameters
| Name | Type | Description |
|---|---|---|
none |
any |
Returns
baseJs
[Utility]
baseJsgenerate-report.jsParameters
| Name | Type | Description |
|---|---|---|
none |
any |
Returns
pageTemplate
[Utility]
pageTemplategenerate-report.jsParameters
| Name | Type | Description |
|---|---|---|
{string} title - Page title used in <title>. |
any | |
{string} headerBlock - Heading displayed at top of the page. |
any | |
{string} body - Main body HTML fragment. |
any | |
{boolean} [includeStats=false] - Whether to include a stats block derived from analysis. |
any |
Returns
renderServicesSection
[Utility]
renderServicesSectiongenerate-report.jsParameters
| Name | Type | Description |
|---|---|---|
{string} title - Section title text. |
any | |
{Array<Object>} items - Array of service objects: { name, purpose, path }. |
any |
Returns
renderApiCatalogSection
[Utility]
renderApiCatalogSectiongenerate-report.jsParameters
| Name | Type | Description |
|---|---|---|
{string} title - Section title. |
any | |
{Array<Object>} endpoints - Array of { method, url, usedBy } entries. |
any |
Returns
renderServiceDocs
[Utility]
renderServiceDocsgenerate-report.jsParameters
| Name | Type | Description |
|---|---|---|
{Array<Object>} docs - Array of service documentation objects. Each may contain { name, path, purpose, endpoints[], methods[] }. |
any |
Returns
renderModelsStructsBlock
[Utility]
renderModelsStructsBlockgenerate-report.jsParameters
| Name | Type | Description |
|---|---|---|
none - Reads analysis.* structures from outer scope. |
any |
Returns
renderViolation
[Utility]
renderViolationgenerate-report.jsParameters
| Name | Type | Description |
|---|---|---|
{Object} v - Violation object: { severity, file, line, message, code, suggestion, shouldUse }. |
any |
Returns
renderIssuesBySeverity
[Utility]
renderIssuesBySeveritygenerate-report.jsParameters
| Name | Type | Description |
|---|---|---|
none - Uses top-level violationsBySeverity variable. |
any |
Returns
renderDocumentationSummary
[Utility]
renderDocumentationSummarygenerate-report.jsParameters
| Name | Type | Description |
|---|---|---|
none - Uses docsJson variable from outer scope. |
any |
Returns
renderCrossRefsPage
[Utility]
renderCrossRefsPagegenerate-report.jsParameters
| Name | Type | Description |
|---|---|---|
none - Uses xrefs variable from outer scope which may contain various mapping objects. |
any |
Returns
generateSection
[Utility]
generateSectiongenerate-violations-report.jsParameters
| Name | Type | Description |
|---|---|---|
{string} severity - Severity key used for CSS classes and badges ('critical'|'high'|'medium'|'low'). |
any | |
{string} title - Display title for the section header (human readable). |
any | |
{Array<Object>} items - Array of violation objects to render. Expected fields on each violation: |
any |
Returns
Throws
- {TypeError} If items is not iterable (e.g. null/undefined) the internal map() will throw.:
escapeHtml
[Utility]
escapeHtmlgenerate-violations-report.jsParameters
| Name | Type | Description |
|---|---|---|
{string} text - Input string containing arbitrary characters that will be rendered in HTML context. |
any |
Returns
Throws
- {TypeError} If text is not a string and does not implement replace, this will throw when calling replace.:
safeList
[Utility]
safeListsave-context.jsParameters
| Name | Type | Description |
|---|---|---|
{Object} obj - Source object to read property from |
any | |
{string} key - Property key expected to contain an array |
any |
Returns
Throws
- - None:
describeServicePurpose
[Utility]
describeServicePurposesave-context.jsParameters
| Name | Type | Description |
|---|---|---|
{Object} service - Service descriptor object (expects at least a 'name' field) |
any | |
{string} service.name - The service/class name used to infer purpose |
any |
Returns
Throws
- - None:
sanitizeId
[Utility]
sanitizeIdsmart-analyze.jsParameters
| Name | Type | Description |
|---|---|---|
{string} str - Input string to normalize (file name, route, etc.). |
any |
Returns
Throws
- Will not throw; defensive trimming applied.:
generateId
[Utility]
generateIdsmart-analyze.jsParameters
| Name | Type | Description |
|---|---|---|
{string} type - One of: server, mount, route, model, api, function, middleware, database, cluster, socket. |
any | |
{Object} data - Context object containing identifying fields (e.g., port, path, method, name, url, file). |
any |
Returns
Throws
- Will not throw; unknown types fall back to sanitized type string.:
parseParams
[Utility]
parseParamssmart-analyze.jsParameters
| Name | Type | Description |
|---|---|---|
{string[]|undefined} paramArray - Array of param doc strings, e.g. "id |
number | resource id". |
Returns
Throws
- Will not throw; unknown formats return name only with type "any".:
parseReturns
[Utility]
parseReturnssmart-analyze.jsParameters
| Name | Type | Description |
|---|---|---|
{string[]|undefined} returnArray - Array containing return doc string, e.g. "200 {object} Success payload". |
any |
Returns
Throws
- Will not throw; fallback to code "200" and type "unknown" for unparseable input.:
parseThrows
[Utility]
parseThrowssmart-analyze.jsParameters
| Name | Type | Description |
|---|---|---|
{string[]|undefined} throwsArray - Array of throw doc strings, e.g. "404 - Not Found". |
any |
Returns
Throws
- Will not throw; unparseable lines are returned with code equal to the raw string.:
parseSchema
[Utility]
parseSchemasmart-analyze.jsParameters
| Name | Type | Description |
|---|---|---|
{string|undefined} schemaString - Comma-separated fields like "name |
String, | age:Number". |
Returns
Throws
- Will not throw; missing type defaults to "String".:
parseRoute
[Utility]
parseRoutesmart-analyze.jsParameters
| Name | Type | Description |
|---|---|---|
{string} routeString - Route string, e.g. "GET /users/ |
id" | or just "/users". |
Returns
Throws
- Will not throw; unknown formats default to GET and the full string as path.:
extractServers
[Utility]
extractServerssmart-analyze.jsParameters
| Name | Type | Description |
|---|---|---|
{Array<Object>} docblocks - Array of parsed docblock objects with tags and file metadata. |
any |
Returns
Throws
- Will not throw; entries without port are filtered out.:
extractMounts
[Utility]
extractMountssmart-analyze.jsParameters
| Name | Type | Description |
|---|---|---|
{Array<Object>} docblocks - Array of docblock entries. |
any |
Returns
Throws
- Will not throw.:
extractModels
[Utility]
extractModelssmart-analyze.jsParameters
| Name | Type | Description |
|---|---|---|
{Array<Object>} docblocks - Array of docblocks. |
any |
Returns
Throws
- Will not throw; entries lacking name/collection are ignored.:
extractAPIs
[Utility]
extractAPIssmart-analyze.jsParameters
| Name | Type | Description |
|---|---|---|
{Array<Object>} docblocks - Array of docblocks; uses description and tags.purpose where available. |
any |
Returns
Throws
- Will not throw; malformed URLs are treated as single-domain entries.:
extractFunctions
[Utility]
extractFunctionssmart-analyze.jsParameters
| Name | Type | Description |
|---|---|---|
{Array<Object>} docblocks - Array of docblocks (function != "file-level"). |
any |
Returns
Throws
- Will not throw.:
extractMiddleware
[Utility]
extractMiddlewaresmart-analyze.jsParameters
| Name | Type | Description |
|---|---|---|
{Array<Object>} docblocks - Array of parsed docblocks. |
any |
Returns
Throws
- Will not throw.:
extractDatabases
[Utility]
extractDatabasessmart-analyze.jsParameters
| Name | Type | Description |
|---|---|---|
{Array<Object>} docblocks - Array of docblocks referencing DBs. |
any |
Returns
Throws
- Will not throw.:
extractClusters
[Utility]
extractClusterssmart-analyze.jsParameters
| Name | Type | Description |
|---|---|---|
{Array<Object>} docblocks - Array of docblocks. |
any |
Returns
Throws
- Will not throw.:
extractSockets
[Utility]
extractSocketssmart-analyze.jsParameters
| Name | Type | Description |
|---|---|---|
{Array<Object>} docblocks - Array of docblocks. |
any |
Returns
Throws
- Will not throw.:
extractDomain
[Utility]
extractDomainsmart-analyze.jsParameters
| Name | Type | Description |
|---|---|---|
{string} url - Full URL or identifier. |
any |
Returns
Throws
- Will not throw; exceptions caught and original URL returned.:
inferFunctionType
[Utility]
inferFunctionTypesmart-analyze.jsParameters
| Name | Type | Description |
|---|---|---|
{Object} block - Docblock object with tags and file metadata. |
any |
Returns
Throws
- Will not throw.:
buildCrossReferences
[Utility]
buildCrossReferencessmart-analyze.jsParameters
| Name | Type | Description |
|---|---|---|
{Object} structure - Object containing arrays: routes, models, apis, functions, mounts, servers. |
any |
Returns
Throws
- Will not throw; best-effort augmentation when link targets are missing.:
findViolations
[Utility]
findViolationsviolations.jsParameters
| Name | Type | Description |
|---|---|---|
|
any |
Returns
Throws
- None - function performs only in-memory analysis and does not throw intentionally.:
add
[Utility]
addviolations.jsParameters
| Name | Type | Description |
|---|---|---|
|
any |
Returns
Throws
- None:
ROUTES
GET See each returned route.method + route.path for actual endpoints.
See each returned route.method + route.path for actual endpoints.smart-analyze.jsextractRoutesParameters
| Name | Type | Description |
|---|---|---|
{Array<Object>} docblocks - Array of docblocks with tags like @route, @params, @returns, @models. |
any |
Returns
Errors
| Code | Description |
|---|---|
| Will not throw; returns empty array if none. |
MODELS
Schema extraction attempts to map field name -> type and common options (required, default, lowercase) (Mongoose models (inferred) - model.name corresponds to mongoose.model('<name>', Schema))
Schema extraction attempts to map field name -> type and common options (required, default, lowercase)Mongoose models (inferred) - model.name corresponds to mongoose.model('<name>', Schema)extract.jsSchema and field information rendered as table rows (When model.collection is present, shown in UI but not modified)
Schema and field information rendered as table rowsWhen model.collection is present, shown in UI but not modifiedgenerate-doc-html.jsSchema/model descriptor representing fields and indexes. (When present, collection property maps to the Mongo collection name.)
Schema/model descriptor representing fields and indexes.When present, collection property maps to the Mongo collection name.smart-analyze.jsWhen present, files list the source files interacting with the DB. (When present, files list the source files interacting with the DB.)
When present, files list the source files interacting with the DB.smart-analyze.js