Class BaseAnalyzer

java.lang.Object
io.forgeai.jenkins.analyzers.BaseAnalyzer
Direct Known Subclasses:
ArchitectureDriftAnalyzer, CodeReviewAnalyzer, CommitIntelligenceAnalyzer, DependencyRiskAnalyzer, PipelineAdvisorAnalyzer, ReleaseReadinessAnalyzer, TestGapAnalyzer, VulnerabilityAnalyzer

public abstract class BaseAnalyzer extends Object
Base class for all ForgeAI analyzers. Each analyzer focuses on one dimension of code/pipeline intelligence.
  • Field Details

    • llm

      protected final LLMProvider llm
    • logger

      protected final PrintStream logger
    • maxTokens

      protected final int maxTokens
  • Constructor Details

  • Method Details

    • analyze

      public abstract AnalysisResult analyze(String sourceCode, String context) throws LLMException
      Execute the analysis on the provided source material.
      Parameters:
      sourceCode - the code or diff to analyze
      context - additional context (file paths, language, project structure)
      Returns:
      structured analysis result
      Throws:
      LLMException
    • analyzerName

      public abstract String analyzerName()
      Human-readable name of this analyzer for reports/logs.
    • analyzerId

      public abstract String analyzerId()
      Short identifier for JSON keys and filenames.
    • safeComplete

      protected String safeComplete(String systemPrompt, String userPrompt) throws LLMException
      Throws:
      LLMException
    • truncateSource

      protected String truncateSource(String source, int maxChars)
      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.