Skip to content
This repository has been archived by the owner on Jul 8, 2019. It is now read-only.

Commit

Permalink
Further SonarQube violation fixes (#124)
Browse files Browse the repository at this point in the history
* Fixing vulnerabilities and bugs per default SQ Java profile (related to #112)
  • Loading branch information
Pablissimo committed Feb 19, 2017
1 parent e7eff25 commit ddc7053
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/pablissimo/sonar/PathResolverImpl.java
Expand Up @@ -16,11 +16,11 @@ public String getPath(SensorContext context, String settingKey, String defaultVa

// Fall back to a file system search if null or doesn't exist
if (toReturn == null || toReturn.isEmpty()) {
LOG.debug("Path " + settingKey + " not specified, falling back to " + defaultValue);
LOG.debug("Path {} not specified, falling back to {}", settingKey, defaultValue);
toReturn = defaultValue;
}
else {
LOG.debug("Found " + settingKey + " Lint path to be '" + toReturn + "'");
LOG.debug("Found {} path to be '{}'", settingKey, toReturn);
}

return getAbsolutePath(context, toReturn);
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/pablissimo/sonar/TsLintExecutorImpl.java
Expand Up @@ -92,7 +92,7 @@ else if (files == null) {
}

if (config.useExistingTsLintOutput()) {
LOG.debug("Running with existing JSON file '" + config.getPathToTsLintOutput() + "' instead of calling tslint");
LOG.debug("Running with existing JSON file '{}' instead of calling tslint", config.getPathToTsLintOutput());
List<String> toReturn = new ArrayList<>();
toReturn.add(this.getFileContent(new File(config.getPathToTsLintOutput())));
return toReturn;
Expand All @@ -104,7 +104,7 @@ else if (files == null) {
String tslintOutputFilePath = tslintOutputFile.getAbsolutePath();
Command baseCommand = getBaseCommand(config, tslintOutputFilePath);

LOG.debug("Using a temporary path for TsLint output: " + tslintOutputFilePath);
LOG.debug("Using a temporary path for TsLint output: {}", tslintOutputFilePath);

StringStreamConsumer stdOutConsumer = new StringStreamConsumer();
StringStreamConsumer stdErrConsumer = new StringStreamConsumer();
Expand Down Expand Up @@ -142,7 +142,7 @@ else if (files == null) {
currentBatchLength += nextPath.length() + 1;
}

LOG.debug("Split " + files.size() + " files into " + batches.size() + " batches for processing");
LOG.debug("Split {} files into {} batches for processing", files.size(), batches.size());

for (int i = 0; i < batches.size(); i++) {
List<String> thisBatch = batches.get(i);
Expand All @@ -153,7 +153,7 @@ else if (files == null) {
thisCommand.addArgument(thisBatch.get(fileIndex));
}

LOG.debug("Executing TsLint with command: " + thisCommand.toCommandLine());
LOG.debug("Executing TsLint with command: {}", thisCommand.toCommandLine());

// Timeout is specified per file, not per batch (which can vary a lot)
// so multiply it up
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/pablissimo/sonar/TsLintSensor.java
Expand Up @@ -41,7 +41,7 @@ public void describe(SensorDescriptor desc) {
@Override
public void execute(SensorContext ctx) {
if (!this.settings.getBoolean(TypeScriptPlugin.SETTING_TS_LINT_ENABLED)) {
LOG.debug("Skipping tslint execution - " + TypeScriptPlugin.SETTING_TS_LINT_ENABLED + " set to false");
LOG.debug("Skipping tslint execution - {} - set to false", TypeScriptPlugin.SETTING_TS_LINT_ENABLED);
return;
}

Expand Down Expand Up @@ -114,11 +114,11 @@ public void execute(SensorContext ctx) {
}

if (inputFile == null) {
LOG.warn("TsLint reported issues against a file that isn't in the analysis set - will be ignored: " + filePath);
LOG.warn("TsLint reported issues against a file that isn't in the analysis set - will be ignored: {}", filePath);
continue;
}
else {
LOG.debug("Handling TsLint output for '" + filePath + "' reporting against '" + inputFile.absolutePath() + "'");
LOG.debug("Handling TsLint output for '{}' reporting against '{}'", filePath, inputFile.absolutePath());
}

for (TsLintIssue issue : batchIssues) {
Expand Down

0 comments on commit ddc7053

Please sign in to comment.