export interface CodeAnalysis {
  file: string;
  language: string;
  metrics: CodeMetrics;
  dependencies: string[];
  exports: string[];
  imports: string[];
  functions: FunctionInfo[];
  classes: ClassInfo[];
  complexity: ComplexityReport;
}

export interface CodeMetrics {
  lines: number;
  loc: number; // Lines of code (excluding blanks and comments)
  comments: number;
  blanks: number;
  complexity: number;
}

export interface FunctionInfo {
  name: string;
  line: number;
  params: string[];
  returnType?: string;
  complexity: number;
  length: number;
}

export interface ClassInfo {
  name: string;
  line: number;
  methods: string[];
  properties: string[];
  extends?: string;
  implements?: string[];
}

export interface ComplexityReport {
  cyclomatic: number;
  cognitive: number;
  maintainabilityIndex: number;
  suggestions: ComplexitySuggestion[];
}

export interface ComplexitySuggestion {
  type: 'refactor' | 'split' | 'simplify' | 'test';
  description: string;
  severity: 'low' | 'medium' | 'high';
  line?: number;
  function?: string;
}

export interface DependencyGraph {
  nodes: DependencyNode[];
  edges: DependencyEdge[];
  cycles: string[][];
  layers: string[][];
}

export interface DependencyNode {
  id: string;
  path: string;
  type: 'file' | 'module' | 'external';
  size: number;
  complexity: number;
}

export interface DependencyEdge {
  from: string;
  to: string;
  type: 'import' | 'require' | 'dynamic';
  count: number;
}