woaru
Version:
Universal Project Setup Autopilot - Analyze and automatically configure development tools for ANY programming language
224 lines • 7.03 kB
TypeScript
import { NotificationManager } from '../supervisor/NotificationManager';
import { SecurityScanResult, SecurityCheckOptions } from '../types/security';
import { SOLIDCheckResult } from '../solid/types/solid-types';
import { CodeSmellFinding } from '../types/code-smell';
export interface QualityCheckResult {
filePath: string;
tool: string;
severity: 'error' | 'warning' | 'info';
issues: string[];
raw_output?: string;
fixes?: string[];
explanation?: string;
solidResult?: SOLIDCheckResult;
codeSmellFindings?: CodeSmellFinding[];
}
export interface SnykVulnerability {
id: string;
title: string;
severity: 'low' | 'medium' | 'high' | 'critical';
packageName: string;
version: string;
from: string[];
upgradePath?: string[];
isUpgradable: boolean;
isPatchable: boolean;
description?: string;
fixedIn?: string[];
exploit?: string;
CVSSv3?: string;
semver?: {
vulnerable: string[];
};
}
export interface SnykCodeIssue {
filePath: string;
line: number;
column: number;
severity: 'low' | 'medium' | 'high' | 'critical';
title: string;
message: string;
ruleId: string;
categories: string[];
}
export interface SnykResult {
type: 'dependencies' | 'code';
vulnerabilities?: SnykVulnerability[];
codeIssues?: SnykCodeIssue[];
summary?: {
total: number;
critical: number;
high: number;
medium: number;
low: number;
};
error?: string;
}
export declare class QualityRunner {
private notificationManager;
private databaseManager;
private corePlugins;
private solidChecker;
private codeSmellAnalyzer;
constructor(notificationManager: NotificationManager);
/**
* Initialize secure core plugins
*/
private initializeCorePlugins;
/**
* 🗂️ Hilfsmethode: Sprache aus Dateierweiterung ableiten
*/
private getLanguageFromExtension;
/**
* HYBRID ARCHITECTURE: Run quality checks using both core plugins and experimental tools
* 🪝 KI-freundliche Regelwelt: Integriert Hooks für Erweiterbarkeit
*/
runChecksOnFileChange(filePath: string): Promise<void>;
/**
* Phase 1: Run checks using secure core plugins
* 🪝 KI-freundliche Regelwelt: Integriert Tool-Execution Hooks
*/
private runCorePluginCheck;
/**
* Phase 2: Run checks using experimental tools (dynamic command templates)
* 🪝 KI-freundliche Regelwelt: Integriert Tool-Execution Hooks
*/
private runExperimentalToolCheck;
/**
* Phase 3: Fallback to legacy hardcoded checks
*/
private runLegacyChecks;
/**
* Check if an experimental tool can be run (is installed)
*/
private canRunExperimentalTool;
/**
* Execute an experimental tool using its command template
*/
private executeExperimentalTool;
/**
* Validate experimental command for security
*/
private isValidExperimentalCommand;
runChecksOnFileList(filePaths: string[]): Promise<QualityCheckResult[]>;
private runESLintCheck;
private runRuffCheck;
private runGoCheck;
private runRustCheck;
private runCSharpCheck;
private runJavaCheck;
private runPHPCheck;
private runRubyCheck;
private runESLintCheckForReview;
private runRuffCheckForReview;
private runGoCheckForReview;
private runRustCheckForReview;
private runCSharpCheckForReview;
private runJavaCheckForReview;
private runPHPCheckForReview;
private runRubyCheckForReview;
private parseESLintOutput;
private parseRuffOutput;
/**
* Runs Snyk security checks on the provided files and their dependencies
* @param filePaths Array of file paths to check
* @returns Array of Snyk results containing vulnerabilities and code issues
*/
runSnykChecks(filePaths: string[]): Promise<SnykResult[]>;
/**
* Runs Snyk test for dependency vulnerabilities
*/
private runSnykDependencyCheck;
/**
* Runs Snyk Code for static application security testing
*/
private runSnykCodeCheck;
/**
* Helper to parse Snyk error output that contains vulnerability data
*/
private parseSnykErrorOutput;
/**
* Maps Snyk Code severity levels to our standard severity
*/
private mapSnykCodeSeverity;
/**
* Run comprehensive security checks for code review
* Includes Snyk, Gitleaks, and other security tools
*/
runSecurityChecksForReview(filePaths: string[], options?: SecurityCheckOptions): Promise<SecurityScanResult[]>;
/**
* Run Gitleaks to detect secrets in code
*/
private runGitleaksCheck;
/**
* Convert Snyk results to unified SecurityScanResult format
*/
private convertSnykToSecurityResults;
/**
* Determine severity level for different secret types
*/
private getSecretSeverity;
/**
* Generate human-readable explanation for ESLint issues
*/
private generateESLintExplanation;
/**
* Generate specific fix suggestions for ESLint issues
*/
private generateESLintFixes;
/**
* Run SOLID principles check for review
*/
private runSOLIDCheckForReview;
/**
* Run comprehensive SOLID analysis for all files (used by ProductionReadinessAuditor)
*/
runSOLIDChecksForProject(filePaths: string[], language: string): Promise<SOLIDCheckResult[]>;
/**
* Get available SOLID principles for a language
*/
getAvailableSOLIDPrinciples(language: string): string[];
/**
* Check if SOLID analysis is supported for a language
*/
supportsSOLIDAnalysis(language: string): boolean;
/**
* Phase 0: Run internal code smell analysis (no external dependencies)
*/
private runInternalCodeSmellAnalysis;
/**
* Get available code smell types for a language
*/
getAvailableCodeSmellChecks(language: string): string[];
/**
* Check if code smell analysis is supported for a language
*/
supportsCodeSmellAnalysis(language: string): boolean;
/**
* Get context-sensitive ESLint command based on file extension
* Implements Bug Fix 2: Context-sensitive linting for JS/TS files
*/
private getContextSensitiveESLintCommand;
/**
* Run basic security analysis for XSS and other vulnerabilities
* Implements Bug Fix 3: Basic security analysis with pattern matching
*/
private runBasicSecurityAnalysis;
/**
* Try to run Semgrep analysis if available
*/
private runSemgrepAnalysis;
/**
* Detect XSS vulnerabilities using pattern matching
*/
private detectXSSVulnerabilities;
/**
* Detect other security issues using pattern matching
*/
private detectOtherSecurityIssues;
/**
* Map Semgrep severity to our standard severity levels
*/
private mapSemgrepSeverity;
}
//# sourceMappingURL=QualityRunner.d.ts.map