Class SarifCommand

java.lang.Object
org.egothor.methodatlas.command.SarifCommand
All Implemented Interfaces:
Command

public final class SarifCommand extends Object implements Command
CLI command handler for the -sarif output mode.

Scans one or more source roots, buffers all discovered test-method records, and serializes the result as a single SARIF 2.1.0 JSON document once the scan completes.

See Also:
  • Constructor Details

    • SarifCommand

      public SarifCommand(CliConfig cliConfig, org.egothor.methodatlas.api.TestDiscoveryConfig discoveryConfig, AiSuggestionEngine aiEngine, ClassificationOverride override, AiResultCache aiCache)
      Creates a new SARIF command.
      Parameters:
      cliConfig - full parsed CLI configuration
      discoveryConfig - discovery configuration forwarded to providers
      aiEngine - AI engine providing suggestions; null when AI is disabled
      override - human classification overrides
      aiCache - AI result cache
  • Method Details

    • execute

      public int execute(PrintWriter out) throws IOException
      Scans all roots and emits the buffered result as SARIF JSON.
      Specified by:
      execute in interface Command
      Parameters:
      out - writer that receives the serialized SARIF document
      Returns:
      0 if all files were processed successfully, 1 if any file produced a parse or processing error
      Throws:
      IOException - if traversing a file tree fails