sicua
Version:
A tool for analyzing project structure and dependencies
27 lines (26 loc) • 1.18 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ComplexityAnalyzer = void 0;
const unifiedComplexityCalculator_1 = require("./metrics/unifiedComplexityCalculator");
class ComplexityAnalyzer {
constructor(components, lookupService, pathResolver, scanResult) {
this.components = components;
this.lookupService = lookupService;
this.pathResolver = pathResolver;
this.scanResult = scanResult;
}
async analyze() {
// Create unified calculator with optimized services
const calculator = new unifiedComplexityCalculator_1.UnifiedComplexityCalculator(this.scanResult);
// Calculate all complexity metrics in single pass
const metrics = calculator.calculateAllMetrics(this.components);
return {
componentComplexity: metrics.componentComplexity,
couplingDegree: metrics.couplingDegree,
cyclomaticComplexity: metrics.cyclomaticComplexity,
maintainabilityIndex: metrics.maintainabilityIndex,
cognitiveComplexity: metrics.cognitiveComplexity,
};
}
}
exports.ComplexityAnalyzer = ComplexityAnalyzer;