UNPKG

sfcoe-ailabs

Version:

AI-powered code review tool with static analysis integration for comprehensive code quality assessment.

27 lines (26 loc) 1.22 kB
import { SCATProviderType, SFCodeAnalyzer, PMDCodeAnalyzer, } from './index.js'; export default class SCATProviderFactory { /** * Gets a SCAT provider instance * * @param type - The type of SCAT provider to create * @param scanDirectory - The directory to scan for code analysis * @param configFile - Optional configuration file path for the analyzer * @param fileList - Optional array of specific files to analyze (for PMD) * @returns An instance of the specified SCAT provider * @throws Error when the provider type is unsupported */ static getInstance(type, scanDirectory, configFile, fileList) { switch (type) { case SCATProviderType.SFCodeAnalyzer: return new SFCodeAnalyzer(scanDirectory, configFile); case SCATProviderType.PMDCodeAnalyzer: if (!configFile || !fileList) { throw new Error('PMDCodeAnalyzer requires both configFile and fileList parameters'); } return new PMDCodeAnalyzer(scanDirectory, configFile, fileList); default: throw new Error(`Unsupported SCAT provider type: ${type}`); } } }