/** * Project Analyzer * ADR-025: Enhanced Init with Self-Configuration * * Analyzes a project to detect frameworks, languages, tests, and configuration. */ import type { ProjectAnalysis, DetectedFramework, DetectedLanguage, ExistingTests, CodeComplexity, CoverageMetrics } from './types.js'; export declare class ProjectAnalyzer { private projectRoot; constructor(projectRoot: string); /** * Perform complete project analysis */ analyze(): Promise; /** * Detect test frameworks in the project */ detectFrameworks(): Promise; /** * Detect programming languages used */ detectLanguages(): Promise; /** * Detect existing tests */ detectExistingTests(): Promise; /** * Analyze code complexity using McCabe's cyclomatic complexity * * Cyclomatic complexity = 1 + number of decision points * Decision points: if, else if, for, while, case, catch, &&, ||, ternary * * This implementation: * - Strips comments and strings to avoid false positives * - Identifies function boundaries for per-function analysis * - Counts logical operators as decision points * - Avoids double-counting (e.g., else if) */ analyzeComplexity(): Promise; /** * Calculate complexity for a single file * Returns file-level complexity (per-function requires AST which we don't have) * * Note: For accurate per-function complexity, use a proper AST parser. * This implementation provides file-level aggregate complexity which is * still useful for identifying complex files that need attention. */ private calculateFileComplexity; /** * Strip comments and string literals from code * Prevents false positives from commented-out code or strings containing keywords */ private stripCommentsAndStrings; /** * Calculate cyclomatic complexity for a code block * * McCabe's formula: M = 1 + number of decision points * Decision points: * - if (but not else if, to avoid double counting) * - else if * - for / foreach * - while * - case (in switch) * - catch * - && (logical AND) * - || (logical OR) * - ?: (ternary conditional) */ private calculateComplexity; /** * Measure existing coverage */ measureCoverage(): Promise; /** * Detect project type */ private detectProjectType; /** * Detect package manager */ private detectPackageManager; /** * Detect if CI configuration exists */ private detectCIConfig; /** * Detect CI provider */ private detectCIProvider; } /** * Factory function to create a project analyzer */ export declare function createProjectAnalyzer(projectRoot: string): ProjectAnalyzer; //# sourceMappingURL=project-analyzer.d.ts.map