UNPKG

ds-sfcoe-ailabs

Version:

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

41 lines (40 loc) 1.5 kB
import { SCATProviderType, SCATProvider } from './index.js'; /** * Factory class for creating Static Code Analysis Tool (SCAT) provider instances * * Provides a centralized way to create appropriate SCAT provider implementations * based on the specified provider type. Supports SFCodeAnalyzer and PMDCodeAnalyzer. * * @example * ```typescript * const provider = SCATProviderFactory.getInstance( * SCATProviderType.SFCodeAnalyzer, * '/path/to/scan', * '/path/to/config' * ); * const results = await provider.run(); * ``` */ 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 or required parameters are missing * @example * ```typescript * const provider = SCATProviderFactory.getInstance( * SCATProviderType.PMDCodeAnalyzer, * '/src', * 'pmd-ruleset.xml', * ['Class1.cls', 'Class2.cls'] * ); * const results = await provider.run(); * ``` */ static getInstance(type: SCATProviderType, scanDirectory: string, configFile?: string, fileList?: string[]): SCATProvider; }