diff options
author | Matteo Mara <matteo.mara@sonarsource.com> | 2023-12-18 16:26:38 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2023-12-21 20:02:33 +0000 |
commit | ac97b614d4746f683712851488d88952e06c59fc (patch) | |
tree | ebdc34f49565eeefa4f7324107d276a7265e14c3 /sonar-scanner-engine/src/main/java/org/sonar/scanner/scan | |
parent | 4d04d1b26abaf409d0c68b97f0cac05e251ff16d (diff) | |
download | sonarqube-ac97b614d4746f683712851488d88952e06c59fc.tar.gz sonarqube-ac97b614d4746f683712851488d88952e06c59fc.zip |
SONAR-21195 Fix issues raised by SonarQube
Diffstat (limited to 'sonar-scanner-engine/src/main/java/org/sonar/scanner/scan')
2 files changed, 6 insertions, 10 deletions
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/DirectoryFileVisitor.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/DirectoryFileVisitor.java index eec0ed9c8d0..e99b966d6c8 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/DirectoryFileVisitor.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/DirectoryFileVisitor.java @@ -47,7 +47,8 @@ public class DirectoryFileVisitor implements FileVisitor<Path> { private final InputModuleHierarchy inputModuleHierarchy; private final InputFile.Type type; - DirectoryFileVisitor(FileVisitAction fileVisitAction, DefaultInputModule module, ModuleExclusionFilters moduleExclusionFilters, InputModuleHierarchy inputModuleHierarchy, InputFile.Type type) { + DirectoryFileVisitor(FileVisitAction fileVisitAction, DefaultInputModule module, ModuleExclusionFilters moduleExclusionFilters, + InputModuleHierarchy inputModuleHierarchy, InputFile.Type type) { this.fileVisitAction = fileVisitAction; this.module = module; this.moduleExclusionFilters = moduleExclusionFilters; diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/ProjectFilePreprocessor.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/ProjectFilePreprocessor.java index 54d4f2b8d6c..4fd5eda7a25 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/ProjectFilePreprocessor.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/ProjectFilePreprocessor.java @@ -54,7 +54,6 @@ import static java.util.Collections.singletonList; public class ProjectFilePreprocessor { private static final Logger LOG = LoggerFactory.getLogger(ProjectFilePreprocessor.class); - private static final String TELEMETRY_STEP_NAME = "file.preprocessing"; private final AnalysisWarnings analysisWarnings; private final IgnoreCommand ignoreCommand; @@ -113,17 +112,13 @@ public class ProjectFilePreprocessor { pluralizeWithCount("preprocessed file", totalFilesPreprocessed))); int excludedFileByPatternCount = exclusionCounter.getByPatternsCount(); - if (projectExclusionFilters.hasPattern() || excludedFileByPatternCount > 0) { - if (LOG.isInfoEnabled()) { - LOG.info("{} ignored because of inclusion/exclusion patterns", pluralizeWithCount("file", excludedFileByPatternCount)); - } + if ((projectExclusionFilters.hasPattern() || excludedFileByPatternCount > 0) && LOG.isInfoEnabled()) { + LOG.info("{} ignored because of inclusion/exclusion patterns", pluralizeWithCount("file", excludedFileByPatternCount)); } int excludedFileByScmCount = exclusionCounter.getByScmCount(); - if (useScmExclusion) { - if (LOG.isInfoEnabled()) { - LOG.info("{} ignored because of scm ignore settings", pluralizeWithCount("file", excludedFileByScmCount)); - } + if (useScmExclusion && LOG.isInfoEnabled()) { + LOG.info("{} ignored because of scm ignore settings", pluralizeWithCount("file", excludedFileByScmCount)); } } |