/** * F5 CLI - Requirement Dependency Analyzer * Analyze and visualize requirement dependencies * * @module @f5/cli/core/requirement-quality/dependency-analyzer * @version 1.0.0 */ export type DependencyType = 'depends_on' | 'blocks' | 'related_to' | 'implements' | 'extends' | 'conflicts'; export interface Dependency { from: string; to: string; type: DependencyType; description?: string; } export interface RequirementNode { id: string; description: string; dependencies: string[]; dependents: string[]; depth: number; isOnCriticalPath: boolean; metadata?: { inDegree: number; outDegree: number; }; } export interface CircularDependency { cycle: string[]; description: string; } export interface DependencyAnalysisResult { nodes: RequirementNode[]; edges: Dependency[]; summary: { totalNodes: number; totalEdges: number; roots: string[]; leaves: string[]; circularDependencies: CircularDependency[]; criticalPath: string[]; maxDepth: number; isolatedNodes: string[]; }; mermaidDiagram: string; impactAnalysis: Map; } export declare class DependencyAnalyzer { private nodeMap; /** * Analyze dependencies in requirements */ analyze(requirements: Array<{ id: string; description: string; notes?: string; fullText?: string; }>): DependencyAnalysisResult; /** * Extract dependencies from text using patterns */ private extractDependencies; /** * Find circular dependencies using DFS */ private findCircularDependencies; /** * Calculate depth of each node (longest path from any root) */ private calculateDepths; /** * Find critical path (longest dependency chain) */ private findCriticalPath; /** * Build impact analysis - what gets affected if a requirement changes */ private buildImpactAnalysis; /** * Get all dependents recursively (transitive) */ private getAllDependents; /** * Generate Mermaid diagram */ private generateMermaidDiagram; /** * Add a manual dependency */ addDependency(from: string, to: string, type?: DependencyType): Dependency; /** * Generate text-based report */ generateReport(result: DependencyAnalysisResult): string; }