Search in sources :

Example 1 with AnalysisContainer

use of org.sonarsource.sonarlint.core.analysis.container.analysis.AnalysisContainer in project sonarlint-core by SonarSource.

the class ModuleContainer method analyze.

public AnalysisResults analyze(AnalysisConfiguration configuration, Consumer<Issue> issueListener, ProgressMonitor progress) {
    var analysisContainer = new AnalysisContainer(this, progress);
    analysisContainer.add(configuration);
    analysisContainer.add(new IssueListenerHolder(issueListener));
    analysisContainer.add(new ActiveRulesAdapter(configuration.activeRules().stream().map(ActiveRuleAdapter::new).collect(Collectors.toList())));
    var defaultAnalysisResult = new AnalysisResults();
    analysisContainer.add(defaultAnalysisResult);
    analysisContainer.execute();
    return defaultAnalysisResult;
}
Also used : AnalysisResults(org.sonarsource.sonarlint.core.analysis.api.AnalysisResults) AnalysisContainer(org.sonarsource.sonarlint.core.analysis.container.analysis.AnalysisContainer) ActiveRulesAdapter(org.sonarsource.sonarlint.core.analysis.sonarapi.ActiveRulesAdapter) IssueListenerHolder(org.sonarsource.sonarlint.core.analysis.container.analysis.IssueListenerHolder)

Aggregations

AnalysisResults (org.sonarsource.sonarlint.core.analysis.api.AnalysisResults)1 AnalysisContainer (org.sonarsource.sonarlint.core.analysis.container.analysis.AnalysisContainer)1 IssueListenerHolder (org.sonarsource.sonarlint.core.analysis.container.analysis.IssueListenerHolder)1 ActiveRulesAdapter (org.sonarsource.sonarlint.core.analysis.sonarapi.ActiveRulesAdapter)1