Overview
TheAnalysisEngine class orchestrates the privacy scanning process by combining pattern-based detection with AI-powered analysis.
Constructor
verbose(boolean, optional): Enable verbose logging. Default:false
Properties
verbose
boolean
patternScanner
PatternScanner
llmAnalyzer
LLMAnalyzer
Methods
analyzeFile(filePath)
Analyzes a single file for privacy issues.filePath(string): Absolute path to the file
- Reads file content
- Runs PatternScanner for regex detection
- Runs LLMAnalyzer for contextual analysis
- Combines and returns all findings
analyzeFiles(filePaths)
Analyzes multiple files for privacy issues.filePaths(string[]): Array of absolute file paths
- Iterates through each file
- Calls
analyzeFile()for each - Aggregates all findings
- Returns combined results
Usage Examples
Basic Analysis
Verbose Analysis
Batch Analysis
Filter by Severity
Group by File
Error Handling
Custom Analysis Pipeline
Integration Examples
Complete Scan Pipeline
Build Integration
Continuous Monitoring
Performance Optimization
Parallel Processing
Parallel Processing
For better performance on large codebases:
Memory Management
Memory Management
For very large files:
Selective Analysis
Selective Analysis
Analyze only changed files in git:
API Summary
| Method | Parameters | Returns | Description |
|---|---|---|---|
constructor(verbose) | verbose?: boolean | AnalysisEngine | Create new instance |
analyzeFile(filePath) | filePath: string | Promise<Finding[]> | Analyze single file |
analyzeFiles(filePaths) | filePaths: string[] | Promise<Finding[]> | Analyze multiple files |

