code-auditor-mcp
Version:
Multi-language code quality auditor with MCP server - Analyze TypeScript, JavaScript, and Go code for SOLID principles, DRY violations, security patterns, and more
120 lines • 3.4 kB
TypeScript
/**
* Code Map Generator
* Processes indexed code data into human-readable terminal-friendly maps
*/
import { DocumentationMetrics } from '../analyzers/documentationAnalyzer.js';
export interface CodeMapOptions {
includeComplexity?: boolean;
includeDocumentation?: boolean;
includeDependencies?: boolean;
includeUsage?: boolean;
maxDepth?: number;
groupByDirectory?: boolean;
showUnusedImports?: boolean;
minComplexity?: number;
}
export interface CodeMapStats {
totalFiles: number;
totalFunctions: number;
totalComponents: number;
averageComplexity: number;
highComplexityCount: number;
unusedImports: number;
documentationCoverage?: number;
lastIndexed: Date | null;
}
export interface FileGroup {
directory: string;
files: FileMapInfo[];
stats: {
functionCount: number;
componentCount: number;
averageComplexity: number;
documentationScore: number;
};
}
export interface FileMapInfo {
path: string;
relativePath: string;
functions: FunctionMapInfo[];
components: FunctionMapInfo[];
lineCount: number;
complexity: number;
unusedImports: string[];
documentationScore: number;
}
export interface FunctionMapInfo {
name: string;
line: number;
complexity?: number;
purpose?: string;
parameters?: string[];
hooks?: string[];
dependencies?: string[];
usedBy?: string[];
calls?: string[];
isExported?: boolean;
componentType?: string;
hasDocumentation?: boolean;
}
export interface DependencyInfo {
name: string;
version?: string;
usageCount: number;
usedBy: string[];
unusedInFiles: string[];
}
export declare class CodeMapGenerator {
/**
* Generates a complete code map for the project
*/
generateCodeMap(projectPath: string, options?: CodeMapOptions): Promise<{
stats: CodeMapStats;
fileGroups: FileGroup[];
dependencies: DependencyInfo[];
documentation?: DocumentationMetrics;
}>;
/**
* Generates a paginated code map and stores sections in database
* Returns summary with section references
*/
generatePaginatedCodeMap(projectPath: string, options?: CodeMapOptions): Promise<{
mapId: string;
summary: {
stats: CodeMapStats;
sectionsAvailable: Array<{
type: string;
description: string;
size: number;
}>;
totalSections: number;
};
quickPreview: string;
}>;
/**
* Formats the code map as terminal-friendly text
*/
formatAsText(codeMap: Awaited<ReturnType<CodeMapGenerator['generateCodeMap']>>, options?: CodeMapOptions): string;
private calculateProjectStats;
private groupFunctionsByFile;
private groupFilesByDirectory;
private calculateGroupStats;
private analyzeDependencies;
private formatTimeAgo;
/**
* Break code map into sections for storage
*/
private createCodeMapSections;
/**
* Create a quick preview of the code map
*/
private createQuickPreview;
/**
* Format individual sections
*/
private formatOverviewSection;
private formatFilesSection;
private formatDependenciesSection;
private formatDocumentationSection;
}
//# sourceMappingURL=CodeMapGenerator.d.ts.map