@oxog/codeguardian 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +242 -0
- package/dist/cli.cjs +3498 -0
- package/dist/cli.cjs.map +1 -0
- package/dist/cli.d.cts +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +3472 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.cjs +3158 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +169 -0
- package/dist/index.d.ts +169 -0
- package/dist/index.js +3130 -0
- package/dist/index.js.map +1 -0
- package/dist/plugins/index.cjs +1329 -0
- package/dist/plugins/index.cjs.map +1 -0
- package/dist/plugins/index.d.cts +138 -0
- package/dist/plugins/index.d.ts +138 -0
- package/dist/plugins/index.js +1316 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/types-CQZEdzEa.d.cts +487 -0
- package/dist/types-CQZEdzEa.d.ts +487 -0
- package/package.json +88 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/graph/query.ts","../../src/plugins/core/architecture.ts","../../src/plugins/core/security.ts","../../src/plugins/core/performance.ts","../../src/plugins/core/quality.ts","../../src/plugins/optional/naming.ts","../../src/plugins/optional/api.ts","../../src/plugins/optional/test-guard.ts","../../src/plugins/optional/dep-audit.ts"],"names":["ts"],"mappings":";;;;;;;;;AA8EO,SAAS,iBAAiB,KAAA,EAAkC;AACjE,EAAA,MAAM,SAAqB,EAAC;AAC5B,EAAA,MAAM,OAAA,uBAAc,GAAA,EAAY;AAChC,EAAA,MAAM,OAAA,uBAAc,GAAA,EAAY;AAChC,EAAA,MAAM,QAAkB,EAAC;AAEzB,EAAA,MAAM,GAAA,GAAM,CAAC,IAAA,KAAuB;AAClC,IAAA,IAAI,OAAA,CAAQ,GAAA,CAAI,IAAI,CAAA,EAAG;AAErB,MAAA,MAAM,UAAA,GAAa,KAAA,CAAM,OAAA,C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'../types.js';\n\n/**\n * Get a file node from the graph.\n *\n * @example\n * ```typescript\n * const file = getFile(graph, 'src/services/user.service.ts');\n * ```\n */\nexport function getFile(graph: CodebaseGraph, filePath: string): FileNode | undefined {\n return graph.files.get(filePath);\n}\n\n/**\n * Get a symbol node from the graph.\n *\n * @example\n * ```typescript\n * const symbol = getSymbol(graph, 'UserService');\n * ```\n */\nexport function getSymbol(graph: CodebaseGraph, name: string): SymbolNode | undefined {\n // Try direct lookup first\n for (const [, symbol] of graph.symbols) {\n if (symbol.name === name) {\n return symbol;\n }\n }\n return undefined;\n}\n\n/**\n * Get all files that the given file depends on (imports from).\n *\n * @example\n * ```typescript\n * const deps = getDependencies(graph, 'src/controllers/user.controller.ts');\n * // ['src/services/user.service.ts', 'src/types.ts']\n * ```\n */\nexport function getDependencies(graph: CodebaseGraph, filePath: string): string[] {\n const deps = graph.dependencies.adjacency.get(filePath);\n return deps ? Array.from(deps) : [];\n}\n\n/**\n * Get all files that depend on (import from) the given file.\n *\n * @example\n * ```typescript\n * const dependents = getDependents(graph, 'src/services/user.service.ts');\n * // ['src/controllers/user.controller.ts']\n * ```\n */\nexport function getDependents(graph: CodebaseGraph, filePath: string): string[] {\n const dependents: string[] = [];\n for (const [file, deps] of graph.dependencies.adjacency) {\n if (deps.has(filePath)) {\n dependents.push(file);\n }\n }\n return dependents;\n}\n\n/**\n * Find all circular dependency chains in the graph.\n *\n * Uses DFS cycle detection on the dependency adjacency list.\n *\n * @returns Array of circular dependency chains (each chain is a string array of file paths)\n *\n * @example\n * ```typescript\n * const cycles = findCircularDeps(graph);\n * // [['a.ts', 'b.ts', 'c.ts', 'a.ts']]\n * ```\n */\nexport function findCircularDeps(graph: CodebaseGraph): string[][] {\n const cycles: string[][] = [];\n const visited = new Set<string>();\n const inStack = new Set<string>();\n const stack: string[] = [];\n\n const dfs = (node: string): void => {\n if (inStack.has(node)) {\n // Found a cycle\n const cycleStart = stack.indexOf(node);\n if (cycleStart !== -1) {\n const cycle = [...stack.slice(cycleStart), node];\n cycles.push(cycle);\n }\n return;\n }\n\n if (visited.has(node)) return;\n\n visited.add(node);\n inStack.add(node);\n stack.push(node);\n\n const deps = graph.dependencies.adjacency.get(node);\n if (deps) {\n for (const dep of deps) {\n dfs(dep);\n }\n }\n\n stack.pop();\n inStack.delete(node);\n };\n\n for (const node of graph.dependencies.adjacency.keys()) {\n dfs(node);\n }\n\n return cycles;\n}\n\n/**\n * Get graph statistics.\n *\n * @example\n * ```typescript\n * const stats = getGraphStats(graph);\n * console.log(`${stats.totalFiles} files, ${stats.totalSymbols} symbols`);\n * ```\n */\nexport function getGraphStats(graph: CodebaseGraph): {\n totalFiles: number;\n totalSymbols: number;\n totalEdges: number;\n totalFunctions: number;\n totalLOC: number;\n avgComplexity: number;\n filesByRole: Record<string, number>;\n filesByLayer: Record<string, number>;\n} {\n let totalFunctions = 0;\n let totalLOC = 0;\n let totalComplexity = 0;\n const filesByRole: Record<string, number> = {};\n const filesByLayer: Record<string, number> = {};\n\n for (const file of graph.files.values()) {\n totalFunctions += file.functions.length;\n totalLOC += file.loc;\n totalComplexity += file.complexity;\n\n filesByRole[file.role] = (filesByRole[file.role] ?? 0) + 1;\n filesByLayer[file.layer] = (filesByLayer[file.layer] ?? 0) + 1;\n }\n\n const fileCount = graph.files.size;\n\n return {\n totalFiles: fileCount,\n totalSymbols: graph.symbols.size,\n totalEdges: graph.edges.length,\n totalFunctions,\n totalLOC,\n avgComplexity: fileCount > 0 ? totalComplexity / fileCount : 0,\n filesByRole,\n filesByLayer,\n };\n}\n","import type { Finding, GuardianPlugin, ArchitecturePluginConfig, RuleContext } from '../../types.js';\nimport { findCircularDeps } from '../../graph/query.js';\n\n/**\n * Architecture plugin — enforces layer boundaries, detects circular deps,\n * validates file structure conventions.\n *\n * Rules:\n * - architecture/layer-violation\n * - architecture/circular-dependency\n * - architecture/file-role-mismatch\n * - architecture/god-file\n * - architecture/god-function\n * - architecture/barrel-explosion\n *\n * @param config - Architecture plugin configuration\n * @returns GuardianPlugin instance\n *\n * @example\n * ```typescript\n * guardian.use(architecturePlugin({\n * enabled: true,\n * layers: ['controller', 'service', 'repository'],\n * enforceDirection: true,\n * }));\n * ```\n */\nexport function architecturePlugin(\n config: Partial<ArchitecturePluginConfig> = {},\n): GuardianPlugin<ArchitecturePluginConfig> {\n const fullConfig: ArchitecturePluginConfig = {\n enabled: true,\n layers: ['controller', 'service', 'repository', 'util'],\n enforceDirection: true,\n maxFileLines: 300,\n maxFunctionLines: 50,\n maxFunctionComplexity: 15,\n ...config,\n };\n\n return {\n name: 'architecture',\n version: '1.0.0',\n install(kernel) {\n // architecture/layer-violation\n kernel.registerRule({\n name: 'architecture/layer-violation',\n severity: 'error',\n description: 'Detects when a lower layer imports from a higher layer',\n category: 'architecture',\n check(context: RuleContext): Finding[] {\n const findings: Finding[] = [];\n const layers = fullConfig.layers!;\n if (!fullConfig.enforceDirection || layers.length === 0) return findings;\n\n const fileLayer = context.file.layer;\n const fileLayerIndex = layers.indexOf(fileLayer);\n if (fileLayerIndex === -1) return findings;\n\n for (const imp of context.file.imports) {\n const targetFile = context.graph.files.get(resolveImport(context.file.path, imp.source));\n if (!targetFile) continue;\n\n const targetLayerIndex = layers.indexOf(targetFile.layer);\n if (targetLayerIndex === -1) continue;\n\n // Layers: lower index = higher layer (e.g., controller=0, service=1, repo=2)\n // Fine: higher layer (lower index) importing from lower layer (higher index)\n if (fileLayerIndex <= targetLayerIndex) {\n // Normal dependency direction — ok\n } else {\n // Violation: lower layer importing from higher layer\n findings.push({\n message: `${fileLayer} layer importing from ${targetFile.layer} layer (violates layer direction)`,\n file: context.file.path,\n line: 1,\n column: 1,\n fix: {\n suggestion: `${capitalize(fileLayer)}s should not depend on ${targetFile.layer}s. Invert the dependency.`,\n },\n });\n }\n }\n\n return findings;\n },\n });\n\n // architecture/circular-dependency\n kernel.registerRule({\n name: 'architecture/circular-dependency',\n severity: 'error',\n description: 'Detects circular import chains',\n category: 'architecture',\n check(context: RuleContext): Finding[] {\n const findings: Finding[] = [];\n const cycles = findCircularDeps(context.graph);\n\n for (const cycle of cycles) {\n if (cycle.includes(context.file.path)) {\n findings.push({\n message: `Circular dependency detected: ${cycle.join(' → ')}`,\n file: context.file.path,\n line: 1,\n column: 1,\n fix: {\n suggestion: 'Break the cycle by extracting shared types or using dependency injection.',\n },\n });\n }\n }\n\n return findings;\n },\n });\n\n // architecture/file-role-mismatch\n kernel.registerRule({\n name: 'architecture/file-role-mismatch',\n severity: 'warning',\n description: 'Detects when file content does not match directory role',\n category: 'architecture',\n check(context: RuleContext): Finding[] {\n const findings: Finding[] = [];\n const path = context.file.path.toLowerCase();\n const role = context.file.role;\n\n // Check if path suggests a role but content doesn't match\n if (path.includes('/service') && role !== 'service' && role !== 'unknown') {\n findings.push({\n message: `File is in services directory but detected role is \"${role}\"`,\n file: context.file.path,\n line: 1,\n column: 1,\n fix: {\n suggestion: 'Move this file to the appropriate directory or rename it.',\n },\n });\n }\n\n if (path.includes('/controller') && role !== 'controller' && role !== 'unknown') {\n findings.push({\n message: `File is in controllers directory but detected role is \"${role}\"`,\n file: context.file.path,\n line: 1,\n column: 1,\n fix: {\n suggestion: 'Move this file to the appropriate directory or rename it.',\n },\n });\n }\n\n return findings;\n },\n });\n\n // architecture/god-file\n kernel.registerRule({\n name: 'architecture/god-file',\n severity: 'warning',\n description: 'Detects files exceeding maximum line count',\n category: 'architecture',\n check(context: RuleContext): Finding[] {\n const maxLines = fullConfig.maxFileLines ?? 300;\n if (context.file.loc > maxLines) {\n return [\n {\n message: `File has ${context.file.loc} lines (max: ${maxLines})`,\n file: context.file.path,\n line: 1,\n column: 1,\n fix: {\n suggestion: 'Split this file into smaller, focused modules.',\n },\n },\n ];\n }\n return [];\n },\n });\n\n // architecture/god-function\n kernel.registerRule({\n name: 'architecture/god-function',\n severity: 'warning',\n description: 'Detects functions exceeding maximum line count',\n category: 'architecture',\n check(context: RuleContext): Finding[] {\n const findings: Finding[] = [];\n const maxLines = fullConfig.maxFunctionLines ?? 50;\n\n for (const fn of context.file.functions) {\n const fnLines = fn.endLine - fn.startLine + 1;\n if (fnLines > maxLines) {\n findings.push({\n message: `Function \"${fn.name}\" has ${fnLines} lines (max: ${maxLines})`,\n file: context.file.path,\n line: fn.startLine,\n column: 1,\n fix: {\n suggestion: 'Extract logic into smaller helper functions.',\n },\n });\n }\n }\n\n return findings;\n },\n });\n\n // architecture/barrel-explosion\n kernel.registerRule({\n name: 'architecture/barrel-explosion',\n severity: 'info',\n description: 'Detects barrel files (index.ts) that re-export everything',\n category: 'architecture',\n check(context: RuleContext): Finding[] {\n const findings: Finding[] = [];\n /* v8 ignore next */\n const fileName = context.file.path.split('/').pop() ?? '';\n\n if (fileName === 'index.ts' || fileName === 'index.tsx') {\n const exportCount = context.file.exports.length;\n if (exportCount > 10) {\n findings.push({\n message: `Barrel file re-exports ${exportCount} symbols (may cause bundle size issues)`,\n file: context.file.path,\n line: 1,\n column: 1,\n fix: {\n suggestion: 'Consider using direct imports instead of barrel files for tree-shaking.',\n },\n });\n }\n }\n\n return findings;\n },\n });\n },\n };\n}\n\nfunction resolveImport(fromFile: string, source: string): string {\n if (!source.startsWith('.')) return source;\n const fromDir = fromFile.split('/').slice(0, -1).join('/');\n const parts = [...fromDir.split('/'), ...source.split('/')];\n const resolved: string[] = [];\n for (const part of parts) {\n if (part === '..') resolved.pop();\n else if (part !== '.') resolved.push(part);\n }\n let result = resolved.join('/');\n if (!result.endsWith('.ts') && !result.endsWith('.tsx')) {\n result += '.ts';\n }\n return result;\n}\n\nfunction capitalize(str: string): string {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\n","import ts from 'typescript';\nimport type { Finding, GuardianPlugin, SecurityPluginConfig, RuleContext } from '../../types.js';\n\nconst DB_METHODS = ['query', 'execute', 'raw', 'prepare', 'exec'];\nconst SECRET_PATTERNS = [\n /^(sk_|pk_|api_|token_|secret_|password|auth_)/i,\n /^(AKIA[0-9A-Z]{16})/, // AWS access key\n /^eyJ[A-Za-z0-9-_]+\\.eyJ/, // JWT token\n /^(ghp_|gho_|ghu_|ghs_|ghr_)/, // GitHub tokens\n /(mongodb(\\+srv)?:\\/\\/|postgres(ql)?:\\/\\/|mysql:\\/\\/|redis:\\/\\/)/i, // Connection strings\n];\n\n/**\n * Security plugin — detects security anti-patterns and vulnerabilities.\n *\n * Rules:\n * - security/sql-injection\n * - security/hardcoded-secret\n * - security/eval-usage\n * - security/prototype-pollution\n * - security/xss-risk\n * - security/missing-auth-check\n * - security/insecure-random\n * - security/path-traversal\n *\n * @param config - Security plugin configuration\n * @returns GuardianPlugin instance\n *\n * @example\n * ```typescript\n * guardian.use(securityPlugin({ checkInjection: true, checkSecrets: true }));\n * ```\n */\nexport function securityPlugin(\n config: Partial<SecurityPluginConfig> = {},\n): GuardianPlugin<SecurityPluginConfig> {\n const fullConfig: SecurityPluginConfig = {\n enabled: true,\n checkInjection: true,\n checkAuth: true,\n checkSecrets: true,\n checkXSS: true,\n checkCSRF: true,\n ...config,\n };\n\n return {\n name: 'security',\n version: '1.0.0',\n install(kernel) {\n // security/sql-injection\n kernel.registerRule({\n name: 'security/sql-injection',\n severity: 'critical',\n description: 'Detects string concatenation in SQL queries',\n category: 'security',\n check(context: RuleContext): Finding[] {\n if (!fullConfig.checkInjection) return [];\n const findings: Finding[] = [];\n\n context.walk(context.ast, {\n CallExpression(node: ts.Node) {\n const call = node as ts.CallExpression;\n\n const expr = call.expression;\n let methodName = '';\n\n if (ts.isPropertyAccessExpression(expr)) {\n methodName = expr.name.text;\n } else if (ts.isIdentifier(expr)) {\n methodName = expr.text;\n }\n\n if (DB_METHODS.includes(methodName)) {\n for (const arg of call.arguments) {\n if (ts.isTemplateExpression(arg) || context.hasStringConcat(arg)) {\n const pos = context.ast.getLineAndCharacterOfPosition(call.getStart(context.ast));\n findings.push({\n message: 'Raw string concatenation in SQL query — potential SQL injection',\n file: context.file.path,\n line: pos.line + 1,\n column: pos.character + 1,\n fix: {\n suggestion: 'Use parameterized queries instead of string templates.',\n },\n });\n }\n }\n }\n },\n });\n\n return findings;\n },\n });\n\n // security/hardcoded-secret\n kernel.registerRule({\n name: 'security/hardcoded-secret',\n severity: 'critical',\n description: 'Detects hardcoded API keys, tokens, and passwords',\n category: 'security',\n check(context: RuleContext): Finding[] {\n if (!fullConfig.checkSecrets) return [];\n if (context.file.role === 'test') return [];\n const findings: Finding[] = [];\n\n context.walk(context.ast, {\n StringLiteral(node: ts.Node) {\n const str = node as ts.StringLiteral;\n const value = str.text;\n\n if (value.length < 8) return;\n\n for (const pattern of SECRET_PATTERNS) {\n if (pattern.test(value)) {\n const pos = context.ast.getLineAndCharacterOfPosition(str.getStart(context.ast));\n findings.push({\n message: 'Possible hardcoded secret detected',\n file: context.file.path,\n line: pos.line + 1,\n column: pos.character + 1,\n fix: {\n suggestion: 'Move secrets to environment variables or a secure vault.',\n },\n });\n break;\n }\n }\n },\n NoSubstitutionTemplateLiteral(node: ts.Node) {\n const tmpl = node as ts.NoSubstitutionTemplateLiteral;\n const value = tmpl.text;\n if (value.length < 8) return;\n\n for (const pattern of SECRET_PATTERNS) {\n if (pattern.test(value)) {\n const pos = context.ast.getLineAndCharacterOfPosition(tmpl.getStart(context.ast));\n findings.push({\n message: 'Possible hardcoded secret detected',\n file: context.file.path,\n line: pos.line + 1,\n column: pos.character + 1,\n fix: {\n suggestion: 'Move secrets to environment variables or a secure vault.',\n },\n });\n break;\n }\n }\n },\n });\n\n return findings;\n },\n });\n\n // security/eval-usage\n kernel.registerRule({\n name: 'security/eval-usage',\n severity: 'critical',\n description: 'Detects eval(), Function(), and similar unsafe patterns',\n category: 'security',\n check(context: RuleContext): Finding[] {\n const findings: Finding[] = [];\n\n context.walk(context.ast, {\n CallExpression(node: ts.Node) {\n const call = node as ts.CallExpression;\n\n let name = '';\n if (ts.isIdentifier(call.expression)) {\n name = call.expression.text;\n }\n\n if (name === 'eval' || name === 'Function') {\n const pos = context.ast.getLineAndCharacterOfPosition(call.getStart(context.ast));\n findings.push({\n message: `Unsafe ${name}() call — potential code injection`,\n file: context.file.path,\n line: pos.line + 1,\n column: pos.character + 1,\n fix: {\n suggestion: `Avoid ${name}(). Use safe alternatives like JSON.parse() or structured data.`,\n },\n });\n }\n\n // setTimeout/setInterval with string argument\n if ((name === 'setTimeout' || name === 'setInterval') && call.arguments.length > 0) {\n const firstArg = call.arguments[0]!;\n if (ts.isStringLiteral(firstArg)) {\n const pos = context.ast.getLineAndCharacterOfPosition(call.getStart(context.ast));\n findings.push({\n message: `${name}() with string argument is equivalent to eval()`,\n file: context.file.path,\n line: pos.line + 1,\n column: pos.character + 1,\n fix: {\n suggestion: 'Pass a function reference instead of a string.',\n },\n });\n }\n }\n },\n NewExpression(node: ts.Node) {\n const newExpr = node as ts.NewExpression;\n if (ts.isIdentifier(newExpr.expression) && newExpr.expression.text === 'Function') {\n const pos = context.ast.getLineAndCharacterOfPosition(newExpr.getStart(context.ast));\n findings.push({\n message: 'new Function() is equivalent to eval() — potential code injection',\n file: context.file.path,\n line: pos.line + 1,\n column: pos.character + 1,\n fix: {\n suggestion: 'Avoid new Function(). Use safe alternatives.',\n },\n });\n }\n },\n });\n\n return findings;\n },\n });\n\n // security/prototype-pollution\n kernel.registerRule({\n name: 'security/prototype-pollution',\n severity: 'error',\n description: 'Detects potential prototype pollution',\n category: 'security',\n check(context: RuleContext): Finding[] {\n const findings: Finding[] = [];\n\n context.walk(context.ast, {\n PropertyAccessExpression(node: ts.Node) {\n const propAccess = node as ts.PropertyAccessExpression;\n\n if (propAccess.name.text === '__proto__' || propAccess.name.text === 'prototype') {\n // Check if it's Object.prototype assignment\n const parent = propAccess.parent;\n if (ts.isBinaryExpression(parent) && parent.operatorToken.kind === ts.SyntaxKind.EqualsToken) {\n const pos = context.ast.getLineAndCharacterOfPosition(propAccess.getStart(context.ast));\n findings.push({\n message: 'Direct prototype assignment — potential prototype pollution',\n file: context.file.path,\n line: pos.line + 1,\n column: pos.character + 1,\n fix: {\n suggestion: 'Use Object.create(null) or Map for dynamic key-value stores.',\n },\n });\n }\n }\n },\n });\n\n return findings;\n },\n });\n\n // security/xss-risk\n kernel.registerRule({\n name: 'security/xss-risk',\n severity: 'error',\n description: 'Detects innerHTML and similar XSS-prone patterns',\n category: 'security',\n check(context: RuleContext): Finding[] {\n if (!fullConfig.checkXSS) return [];\n const findings: Finding[] = [];\n const xssProps = ['innerHTML', 'outerHTML', 'dangerouslySetInnerHTML'];\n\n context.walk(context.ast, {\n PropertyAccessExpression(node: ts.Node) {\n const propAccess = node as ts.PropertyAccessExpression;\n\n if (xssProps.includes(propAccess.name.text)) {\n const pos = context.ast.getLineAndCharacterOfPosition(propAccess.getStart(context.ast));\n findings.push({\n message: `Use of ${propAccess.name.text} — potential XSS vulnerability`,\n file: context.file.path,\n line: pos.line + 1,\n column: pos.character + 1,\n fix: {\n suggestion: 'Sanitize HTML content before insertion or use safe alternatives.',\n },\n });\n }\n },\n CallExpression(node: ts.Node) {\n const call = node as ts.CallExpression;\n\n if (ts.isPropertyAccessExpression(call.expression)) {\n const name = call.expression.name.text;\n if (name === 'write' || name === 'writeln') {\n if (ts.isIdentifier(call.expression.expression) && call.expression.expression.text === 'document') {\n const pos = context.ast.getLineAndCharacterOfPosition(call.getStart(context.ast));\n findings.push({\n message: 'document.write() is an XSS risk',\n file: context.file.path,\n line: pos.line + 1,\n column: pos.character + 1,\n fix: {\n suggestion: 'Use DOM manipulation methods instead of document.write().',\n },\n });\n }\n }\n }\n },\n });\n\n return findings;\n },\n });\n\n // security/missing-auth-check\n kernel.registerRule({\n name: 'security/missing-auth-check',\n severity: 'warning',\n description: 'Detects route handlers without auth checks',\n category: 'security',\n check(context: RuleContext): Finding[] {\n if (!fullConfig.checkAuth) return [];\n if (context.file.role !== 'controller') return [];\n const findings: Finding[] = [];\n\n const fileText = context.ast.getFullText();\n const hasAuthReference =\n fileText.includes('auth') ||\n fileText.includes('Auth') ||\n fileText.includes('authenticate') ||\n fileText.includes('authorize') ||\n fileText.includes('guard') ||\n fileText.includes('middleware') ||\n fileText.includes('jwt') ||\n fileText.includes('token');\n\n if (!hasAuthReference && context.file.functions.length > 0) {\n findings.push({\n message: 'Controller has no authentication/authorization references',\n file: context.file.path,\n line: 1,\n column: 1,\n fix: {\n suggestion: 'Add authentication middleware or auth checks to route handlers.',\n },\n });\n }\n\n return findings;\n },\n });\n\n // security/insecure-random\n kernel.registerRule({\n name: 'security/insecure-random',\n severity: 'warning',\n description: 'Detects Math.random() in security-sensitive contexts',\n category: 'security',\n check(context: RuleContext): Finding[] {\n const findings: Finding[] = [];\n\n context.walk(context.ast, {\n CallExpression(node: ts.Node) {\n const call = node as ts.CallExpression;\n\n if (ts.isPropertyAccessExpression(call.expression)) {\n if (\n ts.isIdentifier(call.expression.expression) &&\n call.expression.expression.text === 'Math' &&\n call.expression.name.text === 'random'\n ) {\n // Check if used in security context\n const fileText = context.ast.getFullText();\n const isSecurityContext =\n fileText.includes('token') ||\n fileText.includes('secret') ||\n fileText.includes('password') ||\n fileText.includes('hash') ||\n fileText.includes('crypto') ||\n fileText.includes('session');\n\n if (isSecurityContext) {\n const pos = context.ast.getLineAndCharacterOfPosition(call.getStart(context.ast));\n findings.push({\n message: 'Math.random() is not cryptographically secure',\n file: context.file.path,\n line: pos.line + 1,\n column: pos.character + 1,\n fix: {\n suggestion: 'Use crypto.randomBytes() or crypto.randomUUID() for security-sensitive values.',\n },\n });\n }\n }\n }\n },\n });\n\n return findings;\n },\n });\n\n // security/path-traversal\n kernel.registerRule({\n name: 'security/path-traversal',\n severity: 'error',\n description: 'Detects file operations with potential path traversal',\n category: 'security',\n check(context: RuleContext): Finding[] {\n const findings: Finding[] = [];\n const fsOps = ['readFile', 'readFileSync', 'writeFile', 'writeFileSync', 'createReadStream', 'createWriteStream', 'access', 'open'];\n\n context.walk(context.ast, {\n CallExpression(node: ts.Node) {\n const call = node as ts.CallExpression;\n\n let methodName = '';\n if (ts.isPropertyAccessExpression(call.expression)) {\n methodName = call.expression.name.text;\n } else if (ts.isIdentifier(call.expression)) {\n methodName = call.expression.text;\n }\n\n if (fsOps.includes(methodName) && call.arguments.length > 0) {\n const firstArg = call.arguments[0]!;\n if (ts.isTemplateExpression(firstArg) || context.hasStringConcat(firstArg)) {\n const pos = context.ast.getLineAndCharacterOfPosition(call.getStart(context.ast));\n findings.push({\n message: `File operation \"${methodName}\" with dynamic path — potential path traversal`,\n file: context.file.path,\n line: pos.line + 1,\n column: pos.character + 1,\n fix: {\n suggestion: 'Validate and sanitize file paths. Use path.resolve() and check against a whitelist.',\n },\n });\n }\n }\n },\n });\n\n return findings;\n },\n });\n },\n };\n}\n","import ts from 'typescript';\nimport type { Finding, GuardianPlugin, PerformancePluginConfig, RuleContext } from '../../types.js';\n\nconst DB_CALL_PATTERNS = ['find', 'findOne', 'findAll', 'findById', 'query', 'execute', 'fetch', 'get', 'select'];\nconst SYNC_FS_METHODS = ['readFileSync', 'writeFileSync', 'appendFileSync', 'mkdirSync', 'readdirSync', 'statSync', 'existsSync', 'unlinkSync', 'copyFileSync'];\n\n/**\n * Performance plugin — catches N+1 queries, memory leaks, sync operations.\n *\n * Rules:\n * - performance/n1-query\n * - performance/sync-in-async\n * - performance/memory-leak-risk\n * - performance/unbounded-query\n * - performance/missing-index-hint\n * - performance/heavy-import\n * - performance/blocking-operation\n *\n * @param config - Performance plugin configuration\n * @returns GuardianPlugin instance\n *\n * @example\n * ```typescript\n * guardian.use(performancePlugin({ checkN1Queries: true }));\n * ```\n */\nexport function performancePlugin(\n config: Partial<PerformancePluginConfig> = {},\n): GuardianPlugin<PerformancePluginConfig> {\n const fullConfig: PerformancePluginConfig = {\n enabled: true,\n checkN1Queries: true,\n checkMemoryLeaks: true,\n checkAsyncPatterns: true,\n checkBundleSize: false,\n ...config,\n };\n\n return {\n name: 'performance',\n version: '1.0.0',\n install(kernel) {\n // performance/n1-query\n kernel.registerRule({\n name: 'performance/n1-query',\n severity: 'warning',\n description: 'Detects database calls inside loops (potential N+1 query)',\n category: 'performance',\n check(context: RuleContext): Finding[] {\n if (!fullConfig.checkN1Queries) return [];\n const findings: Finding[] = [];\n\n const checkForDbCallsInLoop = (loopNode: ts.Node): void => {\n ts.forEachChild(loopNode, function visitChild(child) {\n if (ts.isCallExpression(child)) {\n let methodName = '';\n if (ts.isPropertyAccessExpression(child.expression)) {\n methodName = child.expression.name.text;\n }\n if (DB_CALL_PATTERNS.includes(methodName)) {\n const pos = context.ast.getLineAndCharacterOfPosition(child.getStart(context.ast));\n findings.push({\n message: `Potential N+1 query: \"${methodName}\" called inside a loop`,\n file: context.file.path,\n line: pos.line + 1,\n column: pos.character + 1,\n fix: {\n suggestion: 'Batch queries using Promise.all() or a single query with IN clause.',\n },\n });\n }\n }\n ts.forEachChild(child, visitChild);\n });\n };\n\n context.walk(context.ast, {\n ForStatement(node: ts.Node) { checkForDbCallsInLoop(node); },\n ForInStatement(node: ts.Node) { checkForDbCallsInLoop(node); },\n ForOfStatement(node: ts.Node) { checkForDbCallsInLoop(node); },\n WhileStatement(node: ts.Node) { checkForDbCallsInLoop(node); },\n DoStatement(node: ts.Node) { checkForDbCallsInLoop(node); },\n });\n\n // Also check .forEach() and .map()\n context.walk(context.ast, {\n CallExpression(node: ts.Node) {\n const call = node as ts.CallExpression;\n\n if (ts.isPropertyAccessExpression(call.expression)) {\n const name = call.expression.name.text;\n if (name === 'forEach' || name === 'map') {\n if (call.arguments.length > 0) {\n checkForDbCallsInLoop(call.arguments[0]!);\n }\n }\n }\n },\n });\n\n return findings;\n },\n });\n\n // performance/sync-in-async\n kernel.registerRule({\n name: 'performance/sync-in-async',\n severity: 'warning',\n description: 'Detects synchronous file operations in async functions',\n category: 'performance',\n check(context: RuleContext): Finding[] {\n if (!fullConfig.checkAsyncPatterns) return [];\n const findings: Finding[] = [];\n\n for (const fn of context.file.functions) {\n if (!fn.isAsync) continue;\n\n // Walk the function's AST to find sync calls\n context.walk(context.ast, {\n CallExpression(node: ts.Node) {\n const call = node as ts.CallExpression;\n\n const pos = context.ast.getLineAndCharacterOfPosition(call.getStart(context.ast));\n const callLine = pos.line + 1;\n\n // Check if this call is within the async function's range\n if (callLine < fn.startLine || callLine > fn.endLine) return;\n\n let methodName = '';\n if (ts.isPropertyAccessExpression(call.expression)) {\n methodName = call.expression.name.text;\n } else if (ts.isIdentifier(call.expression)) {\n methodName = call.expression.text;\n }\n\n if (SYNC_FS_METHODS.includes(methodName)) {\n findings.push({\n message: `Synchronous \"${methodName}\" in async function \"${fn.name}\"`,\n file: context.file.path,\n line: callLine,\n column: pos.character + 1,\n fix: {\n suggestion: `Use the async version instead (e.g., fs.promises.${methodName.replace('Sync', '')}).`,\n },\n });\n }\n },\n });\n }\n\n return findings;\n },\n });\n\n // performance/memory-leak-risk\n kernel.registerRule({\n name: 'performance/memory-leak-risk',\n severity: 'warning',\n description: 'Detects addEventListener without removeEventListener, setInterval without clearInterval',\n category: 'performance',\n check(context: RuleContext): Finding[] {\n if (!fullConfig.checkMemoryLeaks) return [];\n const findings: Finding[] = [];\n const fileText = context.ast.getFullText();\n\n // Check for addEventListener without removeEventListener\n if (fileText.includes('addEventListener') && !fileText.includes('removeEventListener')) {\n context.walk(context.ast, {\n CallExpression(node: ts.Node) {\n const call = node as ts.CallExpression;\n\n if (ts.isPropertyAccessExpression(call.expression) &&\n call.expression.name.text === 'addEventListener') {\n const pos = context.ast.getLineAndCharacterOfPosition(call.getStart(context.ast));\n findings.push({\n message: 'addEventListener without corresponding removeEventListener — potential memory leak',\n file: context.file.path,\n line: pos.line + 1,\n column: pos.character + 1,\n fix: {\n suggestion: 'Add a cleanup function that calls removeEventListener.',\n },\n });\n }\n },\n });\n }\n\n // Check for setInterval without clearInterval\n if (fileText.includes('setInterval') && !fileText.includes('clearInterval')) {\n context.walk(context.ast, {\n CallExpression(node: ts.Node) {\n const call = node as ts.CallExpression;\n\n if (ts.isIdentifier(call.expression) && call.expression.text === 'setInterval') {\n const pos = context.ast.getLineAndCharacterOfPosition(call.getStart(context.ast));\n findings.push({\n message: 'setInterval without clearInterval — potential memory leak',\n file: context.file.path,\n line: pos.line + 1,\n column: pos.character + 1,\n fix: {\n suggestion: 'Store the interval ID and clear it when no longer needed.',\n },\n });\n }\n },\n });\n }\n\n return findings;\n },\n });\n\n // performance/unbounded-query\n kernel.registerRule({\n name: 'performance/unbounded-query',\n severity: 'warning',\n description: 'Detects database queries without LIMIT or pagination',\n category: 'performance',\n check(context: RuleContext): Finding[] {\n const findings: Finding[] = [];\n\n context.walk(context.ast, {\n CallExpression(node: ts.Node) {\n const call = node as ts.CallExpression;\n\n let methodName = '';\n if (ts.isPropertyAccessExpression(call.expression)) {\n methodName = call.expression.name.text;\n }\n\n if (methodName === 'findAll' || methodName === 'find') {\n // Check if there's a limit/take in the arguments\n const argText = call.arguments.map((a) => a.getText(context.ast)).join(' ');\n if (!argText.includes('limit') && !argText.includes('take') && !argText.includes('LIMIT')) {\n const pos = context.ast.getLineAndCharacterOfPosition(call.getStart(context.ast));\n findings.push({\n message: `\"${methodName}\" without limit — could return unbounded results`,\n file: context.file.path,\n line: pos.line + 1,\n column: pos.character + 1,\n fix: {\n suggestion: 'Add a LIMIT clause or pagination to prevent loading too many records.',\n },\n });\n }\n }\n },\n });\n\n return findings;\n },\n });\n\n // performance/missing-index-hint\n kernel.registerRule({\n name: 'performance/missing-index-hint',\n severity: 'info',\n description: 'Detects queries that may need database indexes',\n category: 'performance',\n check(_context: RuleContext): Finding[] {\n // This rule requires schema knowledge which we don't have\n // Return empty for now — can be extended with schema plugin\n return [];\n },\n });\n\n // performance/heavy-import\n kernel.registerRule({\n name: 'performance/heavy-import',\n severity: 'info',\n description: 'Detects importing entire libraries when a smaller import is available',\n category: 'performance',\n check(context: RuleContext): Finding[] {\n if (!fullConfig.checkBundleSize) return [];\n const findings: Finding[] = [];\n const heavyLibs = ['lodash', 'moment', 'rxjs'];\n\n for (const imp of context.file.imports) {\n for (const lib of heavyLibs) {\n if (imp.source === lib && imp.specifiers.length <= 2) {\n findings.push({\n /* v8 ignore next */\n message: `Importing from \"${lib}\" — consider using \"${lib}/${imp.specifiers[0] ?? ''}\" for smaller bundle`,\n file: context.file.path,\n line: 1,\n column: 1,\n fix: {\n suggestion: `Use deep imports (e.g., \"${lib}/functionName\") for tree-shaking.`,\n },\n });\n }\n }\n }\n\n return findings;\n },\n });\n\n // performance/blocking-operation\n kernel.registerRule({\n name: 'performance/blocking-operation',\n severity: 'warning',\n description: 'Detects CPU-intensive operations in request handlers',\n category: 'performance',\n check(context: RuleContext): Finding[] {\n if (context.file.role !== 'controller') return [];\n const findings: Finding[] = [];\n\n context.walk(context.ast, {\n CallExpression(node: ts.Node) {\n const call = node as ts.CallExpression;\n\n let methodName = '';\n if (ts.isPropertyAccessExpression(call.expression)) {\n methodName = call.expression.name.text;\n } else if (ts.isIdentifier(call.expression)) {\n methodName = call.expression.text;\n }\n\n // Large JSON.parse\n if (methodName === 'parse' && ts.isPropertyAccessExpression(call.expression)) {\n if (ts.isIdentifier(call.expression.expression) && call.expression.expression.text === 'JSON') {\n const pos = context.ast.getLineAndCharacterOfPosition(call.getStart(context.ast));\n findings.push({\n message: 'JSON.parse() in request handler may block event loop for large payloads',\n file: context.file.path,\n line: pos.line + 1,\n column: pos.character + 1,\n fix: {\n suggestion: 'Consider streaming JSON parsing or limiting request body size.',\n },\n });\n }\n }\n },\n });\n\n return findings;\n },\n });\n },\n };\n}\n","import ts from 'typescript';\nimport type { Finding, GuardianPlugin, QualityPluginConfig, RuleContext } from '../../types.js';\n\n/**\n * Quality plugin — checks complexity, dead code, naming, and patterns.\n *\n * Rules:\n * - quality/cyclomatic-complexity\n * - quality/dead-code\n * - quality/any-type\n * - quality/no-error-handling\n * - quality/inconsistent-naming\n * - quality/magic-number\n * - quality/empty-catch\n * - quality/nested-callbacks\n *\n * @param config - Quality plugin configuration\n * @returns GuardianPlugin instance\n *\n * @example\n * ```typescript\n * guardian.use(qualityPlugin({ maxCyclomaticComplexity: 10 }));\n * ```\n */\nexport function qualityPlugin(\n config: Partial<QualityPluginConfig> = {},\n): GuardianPlugin<QualityPluginConfig> {\n const fullConfig: QualityPluginConfig = {\n enabled: true,\n checkDeadCode: true,\n checkNaming: true,\n checkComplexity: true,\n maxCyclomaticComplexity: 15,\n ...config,\n };\n\n return {\n name: 'quality',\n version: '1.0.0',\n install(kernel) {\n // quality/cyclomatic-complexity\n kernel.registerRule({\n name: 'quality/cyclomatic-complexity',\n severity: 'warning',\n description: 'Detects functions with high cyclomatic complexity',\n category: 'quality',\n check(context: RuleContext): Finding[] {\n if (!fullConfig.checkComplexity) return [];\n const findings: Finding[] = [];\n const maxComplexity = fullConfig.maxCyclomaticComplexity ?? 15;\n\n for (const fn of context.file.functions) {\n if (fn.complexity > maxComplexity) {\n findings.push({\n message: `Function \"${fn.name}\" has cyclomatic complexity ${fn.complexity} (max: ${maxComplexity})`,\n file: context.file.path,\n line: fn.startLine,\n column: 1,\n fix: {\n suggestion: 'Simplify by extracting conditions into named functions or using early returns.',\n },\n });\n }\n }\n\n return findings;\n },\n });\n\n // quality/dead-code\n kernel.registerRule({\n name: 'quality/dead-code',\n severity: 'warning',\n description: 'Detects exported symbols never imported by other files',\n category: 'quality',\n check(context: RuleContext): Finding[] {\n if (!fullConfig.checkDeadCode) return [];\n if (context.file.role === 'test') return [];\n const findings: Finding[] = [];\n\n for (const exportName of context.file.exports) {\n // Skip default exports and index files\n if (exportName === 'default') continue;\n /* v8 ignore next */\n const fileName = context.file.path.split('/').pop() ?? '';\n if (fileName === 'index.ts' || fileName === 'index.tsx') continue;\n\n const isUsed = context.isExternallyUsed(exportName);\n if (!isUsed) {\n findings.push({\n message: `Exported symbol \"${exportName}\" is never imported by other files`,\n file: context.file.path,\n line: 1,\n column: 1,\n fix: {\n suggestion: 'Remove unused export or add an import if intentional.',\n },\n });\n }\n }\n\n return findings;\n },\n });\n\n // quality/any-type\n kernel.registerRule({\n name: 'quality/any-type',\n severity: 'warning',\n description: 'Detects usage of `any` type annotation',\n category: 'quality',\n check(context: RuleContext): Finding[] {\n const findings: Finding[] = [];\n\n context.walk(context.ast, {\n // TypeReference for explicit 'any' annotations\n AnyKeyword(node: ts.Node) {\n const pos = context.ast.getLineAndCharacterOfPosition(node.getStart(context.ast));\n findings.push({\n message: 'Usage of `any` type — use a specific type instead',\n file: context.file.path,\n line: pos.line + 1,\n column: pos.character + 1,\n fix: {\n suggestion: 'Replace `any` with a specific type or `unknown`.',\n },\n });\n },\n });\n\n return findings;\n },\n });\n\n // quality/no-error-handling\n kernel.registerRule({\n name: 'quality/no-error-handling',\n severity: 'warning',\n description: 'Detects async functions without error handling',\n category: 'quality',\n check(context: RuleContext): Finding[] {\n const findings: Finding[] = [];\n\n for (const fn of context.file.functions) {\n if (!fn.isAsync) continue;\n\n // Check if the function body has a try-catch or .catch()\n const fileText = context.ast.getFullText();\n const fnText = fileText.slice(\n getLineOffset(fileText, fn.startLine),\n getLineOffset(fileText, fn.endLine + 1),\n );\n\n const hasTryCatch = fnText.includes('try') && fnText.includes('catch');\n const hasDotCatch = fnText.includes('.catch(');\n const hasThrow = fnText.includes('throw ');\n\n if (!hasTryCatch && !hasDotCatch && !hasThrow) {\n findings.push({\n message: `Async function \"${fn.name}\" has no error handling (try-catch or .catch())`,\n file: context.file.path,\n line: fn.startLine,\n column: 1,\n fix: {\n suggestion: 'Add try-catch around async operations or use .catch() on promises.',\n },\n });\n }\n }\n\n return findings;\n },\n });\n\n // quality/inconsistent-naming\n kernel.registerRule({\n name: 'quality/inconsistent-naming',\n severity: 'info',\n description: 'Detects naming that does not follow project conventions',\n category: 'quality',\n check(context: RuleContext): Finding[] {\n if (!fullConfig.checkNaming) return [];\n const findings: Finding[] = [];\n\n for (const fn of context.file.functions) {\n // Functions should be camelCase\n if (fn.name && !/^[a-z_$]/.test(fn.name) && !/^[A-Z][A-Z_]+$/.test(fn.name)) {\n // Allow PascalCase for component functions\n if (context.file.role !== 'unknown') {\n findings.push({\n message: `Function \"${fn.name}\" does not follow camelCase naming convention`,\n file: context.file.path,\n line: fn.startLine,\n column: 1,\n fix: {\n suggestion: 'Use camelCase for function names (e.g., getUser, handleRequest).',\n },\n });\n }\n }\n }\n\n return findings;\n },\n });\n\n // quality/magic-number\n kernel.registerRule({\n name: 'quality/magic-number',\n severity: 'info',\n description: 'Detects numeric literals used directly in logic',\n category: 'quality',\n check(context: RuleContext): Finding[] {\n const findings: Finding[] = [];\n const allowedNumbers = new Set([0, 1, -1, 2, 100, 200, 201, 204, 301, 302, 400, 401, 403, 404, 500]);\n\n context.walk(context.ast, {\n NumericLiteral(node: ts.Node) {\n const num = node as ts.NumericLiteral;\n\n const value = parseFloat(num.text);\n if (allowedNumbers.has(value)) return;\n\n // Skip if it's in a const declaration or enum\n let parent: ts.Node = num.parent;\n while (parent) {\n if (ts.isVariableDeclaration(parent) || ts.isEnumMember(parent) || ts.isPropertyAssignment(parent)) {\n return;\n }\n parent = parent.parent;\n }\n\n const pos = context.ast.getLineAndCharacterOfPosition(num.getStart(context.ast));\n findings.push({\n message: `Magic number ${num.text} — extract to a named constant`,\n file: context.file.path,\n line: pos.line + 1,\n column: pos.character + 1,\n fix: {\n suggestion: 'Extract numeric literal to a named constant for clarity.',\n },\n });\n },\n });\n\n return findings;\n },\n });\n\n // quality/empty-catch\n kernel.registerRule({\n name: 'quality/empty-catch',\n severity: 'warning',\n description: 'Detects empty catch blocks',\n category: 'quality',\n check(context: RuleContext): Finding[] {\n const findings: Finding[] = [];\n\n context.walk(context.ast, {\n CatchClause(node: ts.Node) {\n const catchClause = node as ts.CatchClause;\n\n const block = catchClause.block;\n if (block.statements.length === 0) {\n const pos = context.ast.getLineAndCharacterOfPosition(catchClause.getStart(context.ast));\n findings.push({\n message: 'Empty catch block — errors are silently swallowed',\n file: context.file.path,\n line: pos.line + 1,\n column: pos.character + 1,\n fix: {\n suggestion: 'Handle the error, log it, or re-throw if appropriate.',\n },\n });\n }\n },\n });\n\n return findings;\n },\n });\n\n // quality/nested-callbacks\n kernel.registerRule({\n name: 'quality/nested-callbacks',\n severity: 'warning',\n description: 'Detects deeply nested callbacks (> 3 levels)',\n category: 'quality',\n check(context: RuleContext): Finding[] {\n const findings: Finding[] = [];\n const maxNesting = 3;\n\n const checkNesting = (node: ts.Node, depth: number): void => {\n if (ts.isArrowFunction(node) || ts.isFunctionExpression(node)) {\n if (depth > maxNesting) {\n const pos = context.ast.getLineAndCharacterOfPosition(node.getStart(context.ast));\n findings.push({\n message: `Callback nested ${depth} levels deep (max: ${maxNesting})`,\n file: context.file.path,\n line: pos.line + 1,\n column: pos.character + 1,\n fix: {\n suggestion: 'Use async/await or extract nested callbacks into named functions.',\n },\n });\n return; // Don't recurse further\n }\n ts.forEachChild(node, (child) => checkNesting(child, depth + 1));\n } else {\n ts.forEachChild(node, (child) => checkNesting(child, depth));\n }\n };\n\n ts.forEachChild(context.ast, (child) => checkNesting(child, 0));\n\n return findings;\n },\n });\n },\n };\n}\n\nfunction getLineOffset(text: string, line: number): number {\n let offset = 0;\n let currentLine = 1;\n for (let i = 0; i < text.length; i++) {\n if (currentLine === line) return offset;\n if (text[i] === '\\n') {\n currentLine++;\n }\n offset++;\n }\n return offset;\n}\n","import type { Finding, GuardianPlugin, NamingPluginConfig, RuleContext } from '../../types.js';\n\n/**\n * Naming convention plugin — enforces strict file naming patterns.\n *\n * @example\n * ```typescript\n * guardian.use(namingPlugin({ enabled: true }));\n * ```\n */\nexport function namingPlugin(\n _config: Partial<NamingPluginConfig> = {},\n): GuardianPlugin<NamingPluginConfig> {\n return {\n name: 'naming-convention',\n version: '1.0.0',\n install(kernel) {\n kernel.registerRule({\n name: 'naming-convention/file-naming',\n severity: 'warning',\n description: 'Enforces consistent file naming patterns based on directory',\n category: 'quality',\n check(context: RuleContext): Finding[] {\n const findings: Finding[] = [];\n const path = context.file.path;\n /* v8 ignore next */\n const fileName = path.split('/').pop() ?? '';\n\n // Check service files\n if (path.includes('/services/') && !fileName.endsWith('.service.ts') && !fileName.endsWith('.test.ts')) {\n findings.push({\n message: `File in services/ should follow *.service.ts naming: \"${fileName}\"`,\n file: context.file.path,\n line: 1,\n column: 1,\n fix: { suggestion: 'Rename file to follow *.service.ts convention.' },\n });\n }\n\n // Check controller files\n if (path.includes('/controllers/') && !fileName.endsWith('.controller.ts') && !fileName.endsWith('.test.ts')) {\n findings.push({\n message: `File in controllers/ should follow *.controller.ts naming: \"${fileName}\"`,\n file: context.file.path,\n line: 1,\n column: 1,\n fix: { suggestion: 'Rename file to follow *.controller.ts convention.' },\n });\n }\n\n // Check repository files\n if (path.includes('/repositories/') && !fileName.endsWith('.repository.ts') && !fileName.endsWith('.test.ts')) {\n findings.push({\n message: `File in repositories/ should follow *.repository.ts naming: \"${fileName}\"`,\n file: context.file.path,\n line: 1,\n column: 1,\n fix: { suggestion: 'Rename file to follow *.repository.ts convention.' },\n });\n }\n\n return findings;\n },\n });\n },\n };\n}\n","import ts from 'typescript';\nimport type { Finding, GuardianPlugin, ApiPluginConfig, RuleContext } from '../../types.js';\n\n/**\n * API consistency plugin — checks REST endpoint naming and response format consistency.\n *\n * @example\n * ```typescript\n * guardian.use(apiPlugin({ enabled: true }));\n * ```\n */\nexport function apiPlugin(\n _config: Partial<ApiPluginConfig> = {},\n): GuardianPlugin<ApiPluginConfig> {\n return {\n name: 'api-consistency',\n version: '1.0.0',\n install(kernel) {\n kernel.registerRule({\n name: 'api-consistency/endpoint-naming',\n severity: 'info',\n description: 'Checks REST API endpoint naming conventions',\n category: 'quality',\n check(context: RuleContext): Finding[] {\n if (context.file.role !== 'controller') return [];\n const findings: Finding[] = [];\n\n context.walk(context.ast, {\n StringLiteral(node: ts.Node) {\n const str = node as ts.StringLiteral;\n const value = str.text;\n\n // Check for route-like strings\n if (value.startsWith('/') && value.length > 1) {\n // Check for camelCase in paths (should be kebab-case)\n if (/\\/[a-z]+[A-Z]/.test(value)) {\n const pos = context.ast.getLineAndCharacterOfPosition(str.getStart(context.ast));\n findings.push({\n message: `API endpoint \"${value}\" uses camelCase — prefer kebab-case`,\n file: context.file.path,\n line: pos.line + 1,\n column: pos.character + 1,\n fix: { suggestion: 'Use kebab-case for URL paths (e.g., /user-profiles instead of /userProfiles).' },\n });\n }\n }\n },\n });\n\n return findings;\n },\n });\n },\n };\n}\n","import type { Finding, GuardianPlugin, TestGuardPluginConfig, RuleContext } from '../../types.js';\n\n/**\n * Test coverage guard plugin — ensures changed files have corresponding test files.\n *\n * @example\n * ```typescript\n * guardian.use(testGuardPlugin({ enabled: true }));\n * ```\n */\nexport function testGuardPlugin(\n _config: Partial<TestGuardPluginConfig> = {},\n): GuardianPlugin<TestGuardPluginConfig> {\n return {\n name: 'test-coverage-guard',\n version: '1.0.0',\n install(kernel) {\n kernel.registerRule({\n name: 'test-coverage-guard/missing-tests',\n severity: 'warning',\n description: 'Ensures source files have corresponding test files',\n category: 'quality',\n check(context: RuleContext): Finding[] {\n if (context.file.role === 'test' || context.file.role === 'type' || context.file.role === 'config') {\n return [];\n }\n\n const findings: Finding[] = [];\n const filePath = context.file.path;\n\n // Generate expected test file paths\n const testPaths = getExpectedTestPaths(filePath);\n\n // Check if any test file exists in the graph\n const hasTest = testPaths.some((tp) => context.graph.files.has(tp));\n\n if (!hasTest) {\n findings.push({\n message: `No test file found for \"${filePath}\"`,\n file: context.file.path,\n line: 1,\n column: 1,\n fix: {\n /* v8 ignore next */\n suggestion: `Create a test file (e.g., ${testPaths[0] ?? filePath.replace('.ts', '.test.ts')}).`,\n },\n });\n }\n\n return findings;\n },\n });\n },\n };\n}\n\nfunction getExpectedTestPaths(filePath: string): string[] {\n const base = filePath.replace(/\\.ts$/, '');\n return [\n `${base}.test.ts`,\n `${base}.spec.ts`,\n filePath.replace('src/', 'tests/').replace('.ts', '.test.ts'),\n filePath.replace('src/', 'tests/unit/').replace('.ts', '.test.ts'),\n ];\n}\n","import type { Finding, GuardianPlugin, DepAuditPluginConfig, RuleContext } from '../../types.js';\n\n/**\n * Dependency audit plugin — checks import depth and heavy transitive dependencies.\n *\n * @example\n * ```typescript\n * guardian.use(depAuditPlugin({ enabled: true, maxDepth: 5 }));\n * ```\n */\nexport function depAuditPlugin(\n config: Partial<DepAuditPluginConfig> = {},\n): GuardianPlugin<DepAuditPluginConfig> {\n const fullConfig: DepAuditPluginConfig = {\n enabled: true,\n maxDepth: 5,\n ...config,\n };\n\n return {\n name: 'dependency-audit',\n version: '1.0.0',\n install(kernel) {\n kernel.registerRule({\n name: 'dependency-audit/deep-imports',\n severity: 'info',\n description: 'Detects deeply nested import chains',\n category: 'architecture',\n check(context: RuleContext): Finding[] {\n const findings: Finding[] = [];\n const maxDepth = fullConfig.maxDepth ?? 5;\n\n // Calculate import depth for this file\n const depth = calculateImportDepth(\n context.file.path,\n context.graph.dependencies.adjacency,\n new Set(),\n );\n\n if (depth > maxDepth) {\n findings.push({\n message: `File has import depth of ${depth} (max: ${maxDepth})`,\n file: context.file.path,\n line: 1,\n column: 1,\n fix: {\n suggestion: 'Consider restructuring imports to reduce dependency depth.',\n },\n });\n }\n\n return findings;\n },\n });\n },\n };\n}\n\nfunction calculateImportDepth(\n file: string,\n adjacency: Map<string, Set<string>>,\n visited: Set<string>,\n): number {\n if (visited.has(file)) return 0;\n visited.add(file);\n\n const deps = adjacency.get(file);\n if (!deps || deps.size === 0) return 0;\n\n let maxDepth = 0;\n for (const dep of deps) {\n const depth = calculateImportDepth(dep, adjacency, visited);\n maxDepth = Math.max(maxDepth, depth);\n }\n\n return maxDepth + 1;\n}\n"]}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { n as ArchitecturePluginConfig, b as GuardianPlugin, o as SecurityPluginConfig, p as PerformancePluginConfig, Q as QualityPluginConfig, N as NamingPluginConfig, q as ApiPluginConfig, T as TestGuardPluginConfig, r as DepAuditPluginConfig } from '../types-CQZEdzEa.cjs';
|
|
2
|
+
import 'typescript';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Architecture plugin — enforces layer boundaries, detects circular deps,
|
|
6
|
+
* validates file structure conventions.
|
|
7
|
+
*
|
|
8
|
+
* Rules:
|
|
9
|
+
* - architecture/layer-violation
|
|
10
|
+
* - architecture/circular-dependency
|
|
11
|
+
* - architecture/file-role-mismatch
|
|
12
|
+
* - architecture/god-file
|
|
13
|
+
* - architecture/god-function
|
|
14
|
+
* - architecture/barrel-explosion
|
|
15
|
+
*
|
|
16
|
+
* @param config - Architecture plugin configuration
|
|
17
|
+
* @returns GuardianPlugin instance
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* guardian.use(architecturePlugin({
|
|
22
|
+
* enabled: true,
|
|
23
|
+
* layers: ['controller', 'service', 'repository'],
|
|
24
|
+
* enforceDirection: true,
|
|
25
|
+
* }));
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
declare function architecturePlugin(config?: Partial<ArchitecturePluginConfig>): GuardianPlugin<ArchitecturePluginConfig>;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Security plugin — detects security anti-patterns and vulnerabilities.
|
|
32
|
+
*
|
|
33
|
+
* Rules:
|
|
34
|
+
* - security/sql-injection
|
|
35
|
+
* - security/hardcoded-secret
|
|
36
|
+
* - security/eval-usage
|
|
37
|
+
* - security/prototype-pollution
|
|
38
|
+
* - security/xss-risk
|
|
39
|
+
* - security/missing-auth-check
|
|
40
|
+
* - security/insecure-random
|
|
41
|
+
* - security/path-traversal
|
|
42
|
+
*
|
|
43
|
+
* @param config - Security plugin configuration
|
|
44
|
+
* @returns GuardianPlugin instance
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```typescript
|
|
48
|
+
* guardian.use(securityPlugin({ checkInjection: true, checkSecrets: true }));
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
declare function securityPlugin(config?: Partial<SecurityPluginConfig>): GuardianPlugin<SecurityPluginConfig>;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Performance plugin — catches N+1 queries, memory leaks, sync operations.
|
|
55
|
+
*
|
|
56
|
+
* Rules:
|
|
57
|
+
* - performance/n1-query
|
|
58
|
+
* - performance/sync-in-async
|
|
59
|
+
* - performance/memory-leak-risk
|
|
60
|
+
* - performance/unbounded-query
|
|
61
|
+
* - performance/missing-index-hint
|
|
62
|
+
* - performance/heavy-import
|
|
63
|
+
* - performance/blocking-operation
|
|
64
|
+
*
|
|
65
|
+
* @param config - Performance plugin configuration
|
|
66
|
+
* @returns GuardianPlugin instance
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```typescript
|
|
70
|
+
* guardian.use(performancePlugin({ checkN1Queries: true }));
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
declare function performancePlugin(config?: Partial<PerformancePluginConfig>): GuardianPlugin<PerformancePluginConfig>;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Quality plugin — checks complexity, dead code, naming, and patterns.
|
|
77
|
+
*
|
|
78
|
+
* Rules:
|
|
79
|
+
* - quality/cyclomatic-complexity
|
|
80
|
+
* - quality/dead-code
|
|
81
|
+
* - quality/any-type
|
|
82
|
+
* - quality/no-error-handling
|
|
83
|
+
* - quality/inconsistent-naming
|
|
84
|
+
* - quality/magic-number
|
|
85
|
+
* - quality/empty-catch
|
|
86
|
+
* - quality/nested-callbacks
|
|
87
|
+
*
|
|
88
|
+
* @param config - Quality plugin configuration
|
|
89
|
+
* @returns GuardianPlugin instance
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```typescript
|
|
93
|
+
* guardian.use(qualityPlugin({ maxCyclomaticComplexity: 10 }));
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
declare function qualityPlugin(config?: Partial<QualityPluginConfig>): GuardianPlugin<QualityPluginConfig>;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Naming convention plugin — enforces strict file naming patterns.
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```typescript
|
|
103
|
+
* guardian.use(namingPlugin({ enabled: true }));
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
declare function namingPlugin(_config?: Partial<NamingPluginConfig>): GuardianPlugin<NamingPluginConfig>;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* API consistency plugin — checks REST endpoint naming and response format consistency.
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* ```typescript
|
|
113
|
+
* guardian.use(apiPlugin({ enabled: true }));
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
declare function apiPlugin(_config?: Partial<ApiPluginConfig>): GuardianPlugin<ApiPluginConfig>;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Test coverage guard plugin — ensures changed files have corresponding test files.
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```typescript
|
|
123
|
+
* guardian.use(testGuardPlugin({ enabled: true }));
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
declare function testGuardPlugin(_config?: Partial<TestGuardPluginConfig>): GuardianPlugin<TestGuardPluginConfig>;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Dependency audit plugin — checks import depth and heavy transitive dependencies.
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* ```typescript
|
|
133
|
+
* guardian.use(depAuditPlugin({ enabled: true, maxDepth: 5 }));
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
declare function depAuditPlugin(config?: Partial<DepAuditPluginConfig>): GuardianPlugin<DepAuditPluginConfig>;
|
|
137
|
+
|
|
138
|
+
export { apiPlugin, architecturePlugin, depAuditPlugin, namingPlugin, performancePlugin, qualityPlugin, securityPlugin, testGuardPlugin };
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { n as ArchitecturePluginConfig, b as GuardianPlugin, o as SecurityPluginConfig, p as PerformancePluginConfig, Q as QualityPluginConfig, N as NamingPluginConfig, q as ApiPluginConfig, T as TestGuardPluginConfig, r as DepAuditPluginConfig } from '../types-CQZEdzEa.js';
|
|
2
|
+
import 'typescript';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Architecture plugin — enforces layer boundaries, detects circular deps,
|
|
6
|
+
* validates file structure conventions.
|
|
7
|
+
*
|
|
8
|
+
* Rules:
|
|
9
|
+
* - architecture/layer-violation
|
|
10
|
+
* - architecture/circular-dependency
|
|
11
|
+
* - architecture/file-role-mismatch
|
|
12
|
+
* - architecture/god-file
|
|
13
|
+
* - architecture/god-function
|
|
14
|
+
* - architecture/barrel-explosion
|
|
15
|
+
*
|
|
16
|
+
* @param config - Architecture plugin configuration
|
|
17
|
+
* @returns GuardianPlugin instance
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* guardian.use(architecturePlugin({
|
|
22
|
+
* enabled: true,
|
|
23
|
+
* layers: ['controller', 'service', 'repository'],
|
|
24
|
+
* enforceDirection: true,
|
|
25
|
+
* }));
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
declare function architecturePlugin(config?: Partial<ArchitecturePluginConfig>): GuardianPlugin<ArchitecturePluginConfig>;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Security plugin — detects security anti-patterns and vulnerabilities.
|
|
32
|
+
*
|
|
33
|
+
* Rules:
|
|
34
|
+
* - security/sql-injection
|
|
35
|
+
* - security/hardcoded-secret
|
|
36
|
+
* - security/eval-usage
|
|
37
|
+
* - security/prototype-pollution
|
|
38
|
+
* - security/xss-risk
|
|
39
|
+
* - security/missing-auth-check
|
|
40
|
+
* - security/insecure-random
|
|
41
|
+
* - security/path-traversal
|
|
42
|
+
*
|
|
43
|
+
* @param config - Security plugin configuration
|
|
44
|
+
* @returns GuardianPlugin instance
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```typescript
|
|
48
|
+
* guardian.use(securityPlugin({ checkInjection: true, checkSecrets: true }));
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
declare function securityPlugin(config?: Partial<SecurityPluginConfig>): GuardianPlugin<SecurityPluginConfig>;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Performance plugin — catches N+1 queries, memory leaks, sync operations.
|
|
55
|
+
*
|
|
56
|
+
* Rules:
|
|
57
|
+
* - performance/n1-query
|
|
58
|
+
* - performance/sync-in-async
|
|
59
|
+
* - performance/memory-leak-risk
|
|
60
|
+
* - performance/unbounded-query
|
|
61
|
+
* - performance/missing-index-hint
|
|
62
|
+
* - performance/heavy-import
|
|
63
|
+
* - performance/blocking-operation
|
|
64
|
+
*
|
|
65
|
+
* @param config - Performance plugin configuration
|
|
66
|
+
* @returns GuardianPlugin instance
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```typescript
|
|
70
|
+
* guardian.use(performancePlugin({ checkN1Queries: true }));
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
declare function performancePlugin(config?: Partial<PerformancePluginConfig>): GuardianPlugin<PerformancePluginConfig>;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Quality plugin — checks complexity, dead code, naming, and patterns.
|
|
77
|
+
*
|
|
78
|
+
* Rules:
|
|
79
|
+
* - quality/cyclomatic-complexity
|
|
80
|
+
* - quality/dead-code
|
|
81
|
+
* - quality/any-type
|
|
82
|
+
* - quality/no-error-handling
|
|
83
|
+
* - quality/inconsistent-naming
|
|
84
|
+
* - quality/magic-number
|
|
85
|
+
* - quality/empty-catch
|
|
86
|
+
* - quality/nested-callbacks
|
|
87
|
+
*
|
|
88
|
+
* @param config - Quality plugin configuration
|
|
89
|
+
* @returns GuardianPlugin instance
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```typescript
|
|
93
|
+
* guardian.use(qualityPlugin({ maxCyclomaticComplexity: 10 }));
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
declare function qualityPlugin(config?: Partial<QualityPluginConfig>): GuardianPlugin<QualityPluginConfig>;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Naming convention plugin — enforces strict file naming patterns.
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```typescript
|
|
103
|
+
* guardian.use(namingPlugin({ enabled: true }));
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
declare function namingPlugin(_config?: Partial<NamingPluginConfig>): GuardianPlugin<NamingPluginConfig>;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* API consistency plugin — checks REST endpoint naming and response format consistency.
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* ```typescript
|
|
113
|
+
* guardian.use(apiPlugin({ enabled: true }));
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
declare function apiPlugin(_config?: Partial<ApiPluginConfig>): GuardianPlugin<ApiPluginConfig>;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Test coverage guard plugin — ensures changed files have corresponding test files.
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```typescript
|
|
123
|
+
* guardian.use(testGuardPlugin({ enabled: true }));
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
declare function testGuardPlugin(_config?: Partial<TestGuardPluginConfig>): GuardianPlugin<TestGuardPluginConfig>;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Dependency audit plugin — checks import depth and heavy transitive dependencies.
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* ```typescript
|
|
133
|
+
* guardian.use(depAuditPlugin({ enabled: true, maxDepth: 5 }));
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
declare function depAuditPlugin(config?: Partial<DepAuditPluginConfig>): GuardianPlugin<DepAuditPluginConfig>;
|
|
137
|
+
|
|
138
|
+
export { apiPlugin, architecturePlugin, depAuditPlugin, namingPlugin, performancePlugin, qualityPlugin, securityPlugin, testGuardPlugin };
|