Package io.forgeai.jenkins.analyzers
Class BaseAnalyzer
java.lang.Object
io.forgeai.jenkins.analyzers.BaseAnalyzer
- Direct Known Subclasses:
ArchitectureDriftAnalyzer,CodeReviewAnalyzer,CommitIntelligenceAnalyzer,DependencyRiskAnalyzer,PipelineAdvisorAnalyzer,ReleaseReadinessAnalyzer,TestGapAnalyzer,VulnerabilityAnalyzer
Base class for all ForgeAI analyzers.
Each analyzer focuses on one dimension of code/pipeline intelligence.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final LLMProviderprotected final PrintStreamprotected final int -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBaseAnalyzer(LLMProvider llm, PrintStream logger, int maxTokens) -
Method Summary
Modifier and TypeMethodDescriptionabstract AnalysisResultExecute the analysis on the provided source material.abstract StringShort identifier for JSON keys and filenames.abstract StringHuman-readable name of this analyzer for reports/logs.protected StringsafeComplete(String systemPrompt, String userPrompt) protected StringtruncateSource(String source, int maxChars) Truncate source code to fit within model context limits.
-
Field Details
-
llm
-
logger
-
maxTokens
protected final int maxTokens
-
-
Constructor Details
-
BaseAnalyzer
-
-
Method Details
-
analyze
Execute the analysis on the provided source material.- Parameters:
sourceCode- the code or diff to analyzecontext- additional context (file paths, language, project structure)- Returns:
- structured analysis result
- Throws:
LLMException
-
analyzerName
Human-readable name of this analyzer for reports/logs. -
analyzerId
Short identifier for JSON keys and filenames. -
safeComplete
- Throws:
LLMException
-
truncateSource
Truncate source code to fit within model context limits. Keeps the first and last portions so the model sees both the start and end of files.
-