Skip to content

Commit 1857e0f

Browse files
committed
QUA-431: update sonar java plugin to 6.12
1 parent 776f887 commit 1857e0f

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ build.dependsOn(infra)
3333
test.dependsOn(infra)
3434

3535
dependencies {
36-
compile("com.github.codeclimate:codeclimate-ss-analyzer-wrapper:channel-sonar-5-14-SNAPSHOT")
36+
compile("com.github.codeclimate:codeclimate-ss-analyzer-wrapper:sonar-wrapper-update-SNAPSHOT")
3737

3838
// Plugins
39-
compile("org.sonarsource.java:sonar-java-plugin:5.14.0.18788")
39+
compile("org.sonarsource.java:sonar-java-plugin:6.12.0.24852")
4040

4141
testCompile("org.assertj:assertj-core:2.8.0")
4242
testCompile("org.skyscreamer:jsonassert:1.5.0")

src/test/java/integration/JavaSourceVersion.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,10 @@ public void specify_java_11_source_version_through_config() throws Exception {
1717
Shell.Process process = Shell.execute("build/codeclimate-sonar fixtures/java_source_version fixtures/java_source_version/config_11.json");
1818
assertThat(process.stderr).contains("Configured Java source version (sonar.java.source): 11");
1919
}
20+
21+
@Test
22+
public void specify_java_15_source_version_through_config() throws Exception {
23+
Shell.Process process = Shell.execute("build/codeclimate-sonar fixtures/java_source_version fixtures/java_source_version/config_15.json");
24+
assertThat(process.stderr).contains("Configured Java source version (sonar.java.source): 15");
25+
}
2026
}

src/test/resources/sanity_check_expected_issues.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[
22
{
33
"type": "issue",
4-
"check_name": "squid:S106",
4+
"check_name": "java:S106",
55
"severity": "major",
66
"description": "Replace this use of System.out or System.err by a logger.",
77
"content": {
8-
"body": "<p>When logging a message there are several important requirements which must be fulfilled:</p>\n<ul>\n <li> The user must be able to easily retrieve the logs </li>\n <li> The format of all logged message must be uniform to allow the user to easily read the log </li>\n <li> Logged data must actually be recorded </li>\n <li> Sensitive data must only be logged securely </li>\n</ul>\n<p>If a program directly writes to the standard outputs, there is absolutely no way to comply with those requirements. That's why defining and using a\ndedicated logger is highly recommended.</p>\n<h2>Noncompliant Code Example</h2>\n<pre>\nSystem.out.println(\"My Message\"); // Noncompliant\n</pre>\n<h2>Compliant Solution</h2>\n<pre>\nlogger.log(\"My Message\");\n</pre>\n<h2>See</h2>\n<ul>\n <li> <a href=\"https://www.securecoding.cert.org/confluence/x/RoElAQ\">CERT, ERR02-J.</a> - Prevent exceptions while logging data </li>\n</ul>"
8+
"body": "<p>When logging a message there are several important requirements which must be fulfilled:</p>\n<ul>\n <li> The user must be able to easily retrieve the logs </li>\n <li> The format of all logged message must be uniform to allow the user to easily read the log </li>\n <li> Logged data must actually be recorded </li>\n <li> Sensitive data must only be logged securely </li>\n</ul>\n<p>If a program directly writes to the standard outputs, there is absolutely no way to comply with those requirements. That's why defining and using a\ndedicated logger is highly recommended.</p>\n<h2>Noncompliant Code Example</h2>\n<pre>\nSystem.out.println(\"My Message\"); // Noncompliant\n</pre>\n<h2>Compliant Solution</h2>\n<pre>\nlogger.log(\"My Message\");\n</pre>\n<h2>See</h2>\n<ul>\n <li> <a href=\"https://wiki.sei.cmu.edu/confluence/x/nzdGBQ\">CERT, ERR02-J.</a> - Prevent exceptions while logging data </li>\n</ul>"
99
},
1010
"location": {
1111
"path": "main/java/Library.java",
@@ -20,7 +20,7 @@
2020
},
2121
{
2222
"type": "issue",
23-
"check_name": "squid:S1134",
23+
"check_name": "java:S1134",
2424
"severity": "major",
2525
"description": "Take the required action to fix the issue indicated by this comment.",
2626
"content": {
@@ -39,7 +39,7 @@
3939
},
4040
{
4141
"type": "issue",
42-
"check_name": "squid:S1186",
42+
"check_name": "java:S1186",
4343
"severity": "critical",
4444
"description": "Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.",
4545
"content": {

0 commit comments

Comments
 (0)