Search in sources :

Example 1 with ScannerPlugin

use of org.sonar.ce.task.projectanalysis.analysis.ScannerPlugin in project sonarqube by SonarSource.

the class IssueCreationDateCalculator method basePluginIsNew.

private boolean basePluginIsNew(ScannerPlugin scannerPlugin, long lastAnalysisDate) {
    String basePluginKey = scannerPlugin.getBasePluginKey();
    if (basePluginKey == null) {
        return false;
    }
    ScannerPlugin basePlugin = analysisMetadataHolder.getScannerPluginsByKey().get(basePluginKey);
    return lastAnalysisDate < basePlugin.getUpdatedAt();
}
Also used : ScannerPlugin(org.sonar.ce.task.projectanalysis.analysis.ScannerPlugin)

Example 2 with ScannerPlugin

use of org.sonar.ce.task.projectanalysis.analysis.ScannerPlugin in project sonarqube by SonarSource.

the class LoadReportAnalysisMetadataHolderStep method loadQualityProfiles.

private void loadQualityProfiles(ScannerReport.Metadata reportMetadata) {
    analysisMetadata.setQProfilesByLanguage(reportMetadata.getQprofilesPerLanguageMap().values().stream().collect(toMap(QProfile::getLanguage, qp -> new QualityProfile(qp.getKey(), qp.getName(), qp.getLanguage(), new Date(qp.getRulesUpdatedAt())))));
    analysisMetadata.setScannerPluginsByKey(reportMetadata.getPluginsByKeyMap().values().stream().collect(toMap(Plugin::getKey, p -> new ScannerPlugin(p.getKey(), getBasePluginKey(p), p.getUpdatedAt()))));
}
Also used : ScannerPlugin(org.sonar.ce.task.projectanalysis.analysis.ScannerPlugin) QualityProfile(org.sonar.server.qualityprofile.QualityProfile) QProfile(org.sonar.scanner.protocol.output.ScannerReport.Metadata.QProfile) Date(java.util.Date) Plugin(org.sonar.scanner.protocol.output.ScannerReport.Metadata.Plugin) ScannerPlugin(org.sonar.ce.task.projectanalysis.analysis.ScannerPlugin)

Aggregations

ScannerPlugin (org.sonar.ce.task.projectanalysis.analysis.ScannerPlugin)2 Date (java.util.Date)1 Plugin (org.sonar.scanner.protocol.output.ScannerReport.Metadata.Plugin)1 QProfile (org.sonar.scanner.protocol.output.ScannerReport.Metadata.QProfile)1 QualityProfile (org.sonar.server.qualityprofile.QualityProfile)1