Skip to content

Commit

Permalink
fix(spoon): Add logging to spoon analyzer (#808)
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinWitt authored Jul 9, 2023
1 parent 24affc8 commit f474284
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import jakarta.enterprise.context.ApplicationScoped;
import java.io.File;
import java.util.List;
import java.util.stream.Collectors;
import xyz.keksdose.spoon.code_solver.analyzer.spoon.SpoonBasedAnalyzer;

@ApplicationScoped
Expand All @@ -31,6 +32,14 @@ public CodeAnalyzerResult analyze(AnalyzerRequest request) {
File folder = project.project().folder();
SpoonBasedAnalyzer analyzer = new SpoonBasedAnalyzer();
List<AnalyzerResult> analyze = analyzer.analyze(folder.toPath());
logger.atInfo().log(
"Spoon found %s results with the following rules: %s",
analyze.size(),
analyze.stream()
.map(v -> v.ruleID().toString())
.distinct()
.collect(Collectors.joining(",")));

CodeAnalyzerResult.Success success = new CodeAnalyzerResult.Success(analyze, project.project());
analyzerResultPersistenceService.persistResults(success);
return success;
Expand Down

0 comments on commit f474284

Please sign in to comment.