@@ -1,7 +0,0 @@ | |||
public class Hello { | |||
public void hello() { | |||
int i=356; | |||
if (true) i=5658; | |||
} | |||
} |
@@ -0,0 +1,2 @@ | |||
function hello() { | |||
} |
@@ -1,7 +0,0 @@ | |||
public class Hello { | |||
public void hello() { | |||
int i=356; | |||
if (true) i=5658; | |||
} | |||
} |
@@ -0,0 +1,4 @@ | |||
function hello() { | |||
let i=356; | |||
if (true) i=5658; | |||
} |
@@ -1,32 +0,0 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<project name="Java Bytecode" default="all" basedir="." xmlns:sonar="antlib:org.sonar.ant"> | |||
<property name="lib.dir" value="../ant-libs"/> | |||
<property name="build.dir" value="build"/> | |||
<property name="classes.dir" value="${build.dir}/classes"/> | |||
<path id="classpath"> | |||
<fileset dir="./lib" includes="*.jar" /> | |||
</path> | |||
<target name="clean" description="Remove all files created by the build process."> | |||
<delete dir="${build.dir}" /> | |||
</target> | |||
<target name="init"> | |||
<mkdir dir="${build.dir}" /> | |||
<mkdir dir="${classes.dir}" /> | |||
</target> | |||
<target name="compile" depends="init"> | |||
<javac destdir="${classes.dir}" classpathref="classpath" fork="true" debug="true" includeAntRuntime="false"> | |||
<src path="src"/> | |||
</javac> | |||
</target> | |||
<target name="all" | |||
depends="clean,compile" /> | |||
</project> |
@@ -1,8 +0,0 @@ | |||
# Note that the format of project key is still groupId:artifactId in order to support test with sonar 2.6. | |||
sonar.projectKey=java:bytecode | |||
sonar.projectName=Java Bytecode Sample | |||
sonar.projectVersion=1.0 | |||
sonar.sources=src | |||
sonar.java.binaries=build/classes | |||
sonar.java.libraries=lib/*.jar |
@@ -1,13 +0,0 @@ | |||
public class HasFindbugsViolation { | |||
private String field; | |||
public void use() { | |||
new DeprecatedExample().deprecatedMethod(); // violation of squid rule: CallToDeprecatedMethod | |||
System.exit(33); // violation on findbugs rule: DM_EXIT | |||
} | |||
public void useFieldForLcom4() { | |||
System.out.println(field); | |||
} | |||
} |
@@ -1,9 +0,0 @@ | |||
package basic; | |||
public class Hello { | |||
public void hello() { | |||
int i=356; | |||
if (true) i=5658; | |||
} | |||
} |
@@ -1,8 +0,0 @@ | |||
package basic; | |||
public final class World { | |||
public void world() { | |||
System.out.println("hello world"); | |||
} | |||
} |
@@ -1,7 +0,0 @@ | |||
# Note that the format of project key is still groupId:artifactId in order to support test with sonar 2.6. | |||
sonar.projectKey=java:sample | |||
sonar.projectName=Java Sample, with comma | |||
sonar.projectDescription=This is a Java sample | |||
sonar.projectVersion=1.2.3 | |||
sonar.sources=src |
@@ -1,9 +0,0 @@ | |||
package basic; | |||
public class Hello { | |||
public void hello() { | |||
int i=356; | |||
if (true) i=5658; | |||
} | |||
} |
@@ -1,8 +0,0 @@ | |||
package basic; | |||
public final class World { | |||
public void world() { | |||
System.out.println("hello world"); | |||
} | |||
} |
@@ -1,2 +0,0 @@ | |||
public class Hello { | |||
} |
@@ -0,0 +1,2 @@ | |||
function hello() { | |||
} |
@@ -1,2 +0,0 @@ | |||
public class Hello { | |||
} |
@@ -0,0 +1,2 @@ | |||
function hello() { | |||
} |
@@ -1,2 +0,0 @@ | |||
public class Hello { | |||
} |
@@ -0,0 +1,2 @@ | |||
function hello() { | |||
} |
@@ -1,2 +0,0 @@ | |||
public class Hello { | |||
} |
@@ -0,0 +1,2 @@ | |||
function hello() { | |||
} |
@@ -1,2 +0,0 @@ | |||
public class Hello { | |||
} |
@@ -0,0 +1,2 @@ | |||
function hello() { | |||
} |
@@ -1,2 +0,0 @@ | |||
public class Hello { | |||
} |
@@ -0,0 +1,2 @@ | |||
function hello() { | |||
} |
@@ -1,2 +0,0 @@ | |||
public class Hello { | |||
} |
@@ -0,0 +1,2 @@ | |||
function hello() { | |||
} |
@@ -1,2 +0,0 @@ | |||
public class Hello { | |||
} |
@@ -0,0 +1,2 @@ | |||
function hello() { | |||
} |
@@ -1,2 +0,0 @@ | |||
public class Hello { | |||
} |
@@ -0,0 +1,2 @@ | |||
function hello() { | |||
} |
@@ -1,2 +0,0 @@ | |||
public class Hello { | |||
} |
@@ -0,0 +1,2 @@ | |||
function hello() { | |||
} |
@@ -1,2 +0,0 @@ | |||
public class Hello { | |||
} |
@@ -0,0 +1,2 @@ | |||
function hello() { | |||
} |
@@ -1,2 +0,0 @@ | |||
public class Hello { | |||
} |
@@ -0,0 +1,2 @@ | |||
function hello() { | |||
} |
@@ -1,14 +0,0 @@ | |||
sonar.projectKey=multi-language | |||
sonar.projectName=Simplest multi-language project | |||
sonar.projectVersion=1.2.3 | |||
sonar.modules=java-module,js-module | |||
java-module.sonar.language=java | |||
java-module.sonar.projectBaseDir=. | |||
java-module.sonar.sources=src/main/java | |||
js-module.sonar.language=js | |||
js-module.sonar.projectBaseDir=. | |||
js-module.sonar.sources=src/main/js |
@@ -1,2 +0,0 @@ | |||
public class Hello { | |||
} |
@@ -1,3 +0,0 @@ | |||
function hello() { | |||
alert("Hello World"); | |||
} |
@@ -1,2 +0,0 @@ | |||
public class Hello { | |||
} |
@@ -0,0 +1,2 @@ | |||
function hello() { | |||
} |
@@ -1,2 +0,0 @@ | |||
public class Hello { | |||
} |
@@ -0,0 +1,2 @@ | |||
function hello() { | |||
} |
@@ -1 +1 @@ | |||
The root module contains a src folder but it will not be analysed (SONARPLUGINS-2295) and a warning will be displayed. | |||
The root module contains a src folder |
@@ -1,2 +0,0 @@ | |||
public class Hello { | |||
} |
@@ -0,0 +1,2 @@ | |||
function hello() { | |||
} |
@@ -1,2 +0,0 @@ | |||
public class Hello { | |||
} |
@@ -0,0 +1,2 @@ | |||
function hello() { | |||
} |
@@ -1,7 +0,0 @@ | |||
public class Hello { | |||
public void hello() { | |||
int i=356; | |||
if (true) i=5658; | |||
} | |||
} |
@@ -0,0 +1,2 @@ | |||
function hello() { | |||
} |
@@ -0,0 +1,2 @@ | |||
function hello() { | |||
} |
@@ -0,0 +1,2 @@ | |||
function world() { | |||
} |
@@ -0,0 +1,6 @@ | |||
sonar.projectKey=sample | |||
sonar.projectName=Sample, with comma | |||
sonar.projectDescription=This is a sample | |||
sonar.projectVersion=1.2.3 | |||
sonar.sources=src |
@@ -0,0 +1,2 @@ | |||
function hello() { | |||
} |
@@ -0,0 +1,2 @@ | |||
function world() { | |||
} |
@@ -1,8 +0,0 @@ | |||
sonar.projectKey=using-deprecated-props | |||
sonar.projectName=Deprecated Props | |||
sonar.projectVersion=1.2.3 | |||
sources=src | |||
tests=tests | |||
binaries=build | |||
libraries=lib/*.jar |
@@ -1,2 +0,0 @@ | |||
public class Hello { | |||
} |
@@ -1,2 +0,0 @@ | |||
public class HelloTest { | |||
} |
@@ -21,7 +21,6 @@ package com.sonarsource.scanner.it; | |||
import com.sonar.orchestrator.build.BuildFailureException; | |||
import com.sonar.orchestrator.build.SonarScanner; | |||
import com.sonar.orchestrator.locator.ResourceLocation; | |||
import java.io.File; | |||
import java.io.IOException; | |||
import java.util.Map; | |||
@@ -41,10 +40,7 @@ public class DistributionTest extends ScannerTestCase { | |||
@Test | |||
public void should_succeed_with_self_contained_jre_despite_rubbish_java_home() throws IOException, InterruptedException { | |||
String projectKey = "java:basedir-with-source"; | |||
orchestrator.getServer().restoreProfile(ResourceLocation.create("/sonar-way-profile.xml")); | |||
orchestrator.getServer().provisionProject(projectKey, "Basedir with source"); | |||
orchestrator.getServer().associateProjectToQualityProfile(projectKey, "java", "sonar-way"); | |||
String projectKey = "basedir-with-source"; | |||
File projectDir = new File("projects/basedir-with-source"); | |||
SonarScanner build = newScanner(projectDir, "sonar.projectKey", projectKey) | |||
@@ -59,10 +55,7 @@ public class DistributionTest extends ScannerTestCase { | |||
@Test(expected = BuildFailureException.class) | |||
public void should_fail_without_self_contained_jre_when_rubbish_java_home() throws IOException, InterruptedException { | |||
String projectKey = "java:basedir-with-source"; | |||
orchestrator.getServer().restoreProfile(ResourceLocation.create("/sonar-way-profile.xml")); | |||
orchestrator.getServer().provisionProject(projectKey, "Basedir with source"); | |||
orchestrator.getServer().associateProjectToQualityProfile(projectKey, "java", "sonar-way"); | |||
String projectKey = "basedir-with-source"; | |||
File projectDir = new File("projects/basedir-with-source"); | |||
SonarScanner build = newScanner(projectDir, "sonar.projectKey", projectKey) |
@@ -60,23 +60,6 @@ public class MultimoduleTest extends ScannerTestCase { | |||
assertThat(new File("projects/multi-module/simplest/simplest-with-props-on-root/module2/.scannerwork")).doesNotExist(); | |||
} | |||
/** | |||
* SONARPLUGINS-2421 | |||
*/ | |||
@Test | |||
public void test_multi_language_with_same_projectdir() { | |||
SonarScanner build = newScanner(new File("projects/multi-module/multi-language")); | |||
orchestrator.executeBuild(build); | |||
assertThat(getComponent("multi-language").getName()).isEqualTo("Simplest multi-language project"); | |||
// Verify that we have the modules | |||
assertThat(getComponent("multi-language:java-module").getName()).isEqualTo("java-module"); | |||
assertThat(getComponent("multi-language:js-module").getName()).isEqualTo("js-module"); | |||
} | |||
/** | |||
* SONARPLUGINS-2202 | |||
*/ |
@@ -21,10 +21,8 @@ package com.sonarsource.scanner.it; | |||
import com.sonar.orchestrator.build.BuildResult; | |||
import com.sonar.orchestrator.build.SonarScanner; | |||
import com.sonar.orchestrator.locator.ResourceLocation; | |||
import java.io.File; | |||
import java.io.IOException; | |||
import java.util.List; | |||
import java.util.Map; | |||
import java.util.stream.Collectors; | |||
import org.fest.assertions.Condition; | |||
@@ -32,15 +30,12 @@ import org.junit.After; | |||
import org.junit.Rule; | |||
import org.junit.Test; | |||
import org.junit.rules.TemporaryFolder; | |||
import org.sonar.wsclient.issue.Issue; | |||
import org.sonar.wsclient.issue.IssueQuery; | |||
import org.sonarqube.ws.WsComponents.Component; | |||
import org.sonarqube.ws.WsMeasures.Measure; | |||
import static java.lang.Integer.parseInt; | |||
import static org.fest.assertions.Assertions.assertThat; | |||
public class JavaTest extends ScannerTestCase { | |||
public class ScannerTest extends ScannerTestCase { | |||
@Rule | |||
public TemporaryFolder temp = new TemporaryFolder(); | |||
@@ -50,96 +45,8 @@ public class JavaTest extends ScannerTestCase { | |||
orchestrator.resetData(); | |||
} | |||
/** | |||
* No bytecode, only sources | |||
*/ | |||
@Test | |||
public void scan_java_sources() { | |||
orchestrator.getServer().restoreProfile(ResourceLocation.create("/sonar-way-profile.xml")); | |||
orchestrator.getServer().provisionProject("java:sample", "Java Sample, with comma"); | |||
orchestrator.getServer().associateProjectToQualityProfile("java:sample", "java", "sonar-way"); | |||
SonarScanner build = newScanner(new File("projects/java-sample")) | |||
.setProperty("sonar.verbose", "true"); | |||
// SONARPLUGINS-3061 | |||
// Add a trailing slash | |||
build.setProperty("sonar.host.url", orchestrator.getServer().getUrl() + "/"); | |||
orchestrator.executeBuild(build); | |||
Component project = getComponent("java:sample"); | |||
assertThat(project.getName()).isEqualTo("Java Sample, with comma"); | |||
assertThat(project.getDescription()).isEqualTo("This is a Java sample"); | |||
Map<String, Measure> projectMeasures = getMeasures("java:sample", "files", "ncloc", "classes", "violations"); | |||
// SONARPLUGINS-2399 | |||
assertThat(parseInt(projectMeasures.get("files").getValue())).isEqualTo(2); | |||
assertThat(parseInt(projectMeasures.get("classes").getValue())).isEqualTo(2); | |||
assertThat(parseInt(projectMeasures.get("ncloc").getValue())).isGreaterThan(10); | |||
assertThat(parseInt(projectMeasures.get("violations").getValue())).isGreaterThan(0); | |||
Component file = getComponent("java:sample:src/basic/Hello.java"); | |||
assertThat(file.getName()).isEqualTo("Hello.java"); | |||
Map<String, Measure> fileMeasures = getMeasures("java:sample:src/basic/Hello.java", "files", "ncloc", "classes", "violations"); | |||
assertThat(parseInt(fileMeasures.get("ncloc").getValue())).isEqualTo(7); | |||
assertThat(parseInt(fileMeasures.get("violations").getValue())).isGreaterThan(0); | |||
} | |||
/** | |||
* Only tests, no sources | |||
*/ | |||
@Test | |||
public void scan_java_tests() { | |||
orchestrator.getServer().restoreProfile(ResourceLocation.create("/sonar-way-profile.xml")); | |||
orchestrator.getServer().provisionProject("java:sampletest", "Java Sample"); | |||
orchestrator.getServer().associateProjectToQualityProfile("java:sampletest", "java", "sonar-way"); | |||
SonarScanner build = newScanner(new File("projects/java-sample")) | |||
.setProperty("sonar.projectKey", "java:sampletest") | |||
.setProperty("sonar.tests", "src") | |||
.setProperty("sonar.sources", ""); | |||
orchestrator.executeBuild(build); | |||
Component file = getComponent("java:sampletest:src/basic/Hello.java"); | |||
assertThat(file.getName()).isEqualTo("Hello.java"); | |||
assertThat(file.getQualifier()).isEqualTo("UTS"); | |||
} | |||
@Test | |||
public void scan_java_sources_and_bytecode() { | |||
orchestrator.getServer().restoreProfile(ResourceLocation.create("/requires-bytecode-profile.xml")); | |||
orchestrator.getServer().provisionProject("java:bytecode", "Java Bytecode Sample"); | |||
orchestrator.getServer().associateProjectToQualityProfile("java:bytecode", "java", "requires-bytecode"); | |||
SonarScanner build = newScanner(new File("projects/java-bytecode")); | |||
orchestrator.executeBuild(build); | |||
Component project = getComponent("java:bytecode"); | |||
assertThat(project.getName()).isEqualTo("Java Bytecode Sample"); | |||
Map<String, Measure> projectMeasures = getMeasures("java:bytecode", "violations"); | |||
// the squid rules enabled in sonar-way-profile do not exist in SQ 3.0 | |||
assertThat(parseInt(projectMeasures.get("violations").getValue())).isGreaterThan(0); | |||
assertThat(getMeasureAsInteger("java:bytecode:src/HasFindbugsViolation.java", "violations")).isGreaterThan(0); | |||
// findbugs is executed on bytecode | |||
List<Issue> issues = orchestrator.getServer().wsClient().issueClient().find(IssueQuery.create().componentRoots("java:bytecode").rules("squid:S1147")).list(); | |||
assertThat(issues).hasSize(1); | |||
assertThat(issues.get(0).ruleKey()).isEqualTo("squid:S1147"); | |||
// Squid performs analysis of dependencies | |||
issues = orchestrator.getServer().wsClient().issueClient().find(IssueQuery.create().componentRoots("java:bytecode").rules("squid:CallToDeprecatedMethod")).list(); | |||
assertThat(issues).hasSize(1); | |||
assertThat(issues.get(0).ruleKey()).isEqualTo("squid:CallToDeprecatedMethod"); | |||
} | |||
@Test | |||
public void basedir_contains_java_sources() { | |||
orchestrator.getServer().restoreProfile(ResourceLocation.create("/sonar-way-profile.xml")); | |||
orchestrator.getServer().provisionProject("java:basedir-with-source", "Basedir with source"); | |||
orchestrator.getServer().associateProjectToQualityProfile("java:basedir-with-source", "java", "sonar-way"); | |||
public void basedir_contains_sources() { | |||
SonarScanner build = newScanner(new File("projects/basedir-with-source")); | |||
orchestrator.executeBuild(build); | |||
@@ -153,11 +60,7 @@ public class JavaTest extends ScannerTestCase { | |||
*/ | |||
@Test | |||
public void should_support_simple_project_keys() { | |||
orchestrator.getServer().restoreProfile(ResourceLocation.create("/sonar-way-profile.xml")); | |||
orchestrator.getServer().provisionProject("SAMPLE", "Java Sample, with comma"); | |||
orchestrator.getServer().associateProjectToQualityProfile("SAMPLE", "java", "sonar-way"); | |||
SonarScanner build = newScanner(new File("projects/java-sample")) | |||
SonarScanner build = newScanner(new File("projects/simple-sample")) | |||
.setProjectKey("SAMPLE"); | |||
orchestrator.executeBuild(build); | |||
@@ -211,7 +114,7 @@ public class JavaTest extends ScannerTestCase { | |||
*/ | |||
@Test | |||
public void should_warn_when_analysis_is_platform_dependent() { | |||
SonarScanner build = newScanner(new File("projects/java-sample")) | |||
SonarScanner build = newScanner(new File("projects/simple-sample")) | |||
// ORCH-243 | |||
.setSourceEncoding(""); | |||
String log = orchestrator.executeBuild(build).getLogs(); | |||
@@ -230,7 +133,7 @@ public class JavaTest extends ScannerTestCase { | |||
public void should_enable_verbose() { | |||
// this line should appear in all versions (LTS-DEV) in debug only | |||
String expectedLog = "Available languages:"; | |||
SonarScanner build = newScanner(new File("projects/java-sample")) | |||
SonarScanner build = newScanner(new File("projects/simple-sample")) | |||
.setProperty("sonar.verbose", "true"); | |||
String logs = orchestrator.executeBuild(build).getLogs(); | |||
assertThat(logs).contains(expectedLog); | |||
@@ -238,11 +141,11 @@ public class JavaTest extends ScannerTestCase { | |||
@Test | |||
public void should_use_environment_props() { | |||
SonarScanner build = newScanner(new File("projects/java-sample-no-properties")) | |||
SonarScanner build = newScanner(new File("projects/simple-sample-no-properties")) | |||
.setEnvironmentVariable("SONARQUBE_SCANNER_PARAMS", "{" | |||
+ "\"sonar.projectKey\" : \"java:sample\"," + | |||
"\"sonar.projectName\" : \"Java Sample, with comma\"," + | |||
"\"sonar.projectDescription\" : \"This is a Java sample\"," + | |||
+ "\"sonar.projectKey\" : \"sample\"," + | |||
"\"sonar.projectName\" : \"Sample, with comma\"," + | |||
"\"sonar.projectDescription\" : \"This is a sample\"," + | |||
"\"sonar.projectVersion\" : \"1.2.3\"," + | |||
"\"sonar.sources\" : \"src\" }"); | |||
orchestrator.executeBuild(build); | |||
@@ -250,7 +153,7 @@ public class JavaTest extends ScannerTestCase { | |||
@Test | |||
public void should_skip_analysis() { | |||
SonarScanner build = newScanner(new File("projects/java-sample")) | |||
SonarScanner build = newScanner(new File("projects/simple-sample")) | |||
.setProperty("sonar.host.url", "http://foo") | |||
.setEnvironmentVariable("SONARQUBE_SCANNER_PARAMS", "{ \"sonar.scanner.skip\":\"true\" }"); | |||
@@ -260,7 +163,7 @@ public class JavaTest extends ScannerTestCase { | |||
@Test | |||
public void should_fail_if_unable_to_connect() { | |||
SonarScanner build = newScanner(new File("projects/java-sample")) | |||
SonarScanner build = newScanner(new File("projects/simple-sample")) | |||
.setProperty("sonar.host.url", "http://foo"); | |||
BuildResult result = orchestrator.executeBuildQuietly(build); | |||
@@ -275,18 +178,18 @@ public class JavaTest extends ScannerTestCase { | |||
public void run_from_external_location() throws IOException { | |||
File tempDir = temp.newFolder(); | |||
SonarScanner build = newScanner(tempDir) | |||
.setProperty("sonar.projectBaseDir", new File("projects/java-sample").getAbsolutePath()) | |||
.setProperty("sonar.projectBaseDir", new File("projects/simple-sample").getAbsolutePath()) | |||
.addArguments("-e"); | |||
orchestrator.executeBuild(build); | |||
assertThat(getComponent("java:sample").getDescription()).isEqualTo("This is a Java sample"); | |||
Map<String, Measure> projectMeasures = getMeasures("java:sample", "files", "ncloc", "classes", "violations"); | |||
assertThat(getComponent("sample").getDescription()).isEqualTo("This is a sample"); | |||
Map<String, Measure> projectMeasures = getMeasures("sample", "files", "ncloc", "classes", "violations"); | |||
assertThat(projectMeasures.values().stream().filter(measure -> measure.getValue() != null).collect(Collectors.toList())).hasSize(4); | |||
} | |||
@Test | |||
public void verify_env_variable() { | |||
SonarScanner build = newScanner(new File("projects/java-sample")) | |||
SonarScanner build = newScanner(new File("projects/simple-sample")) | |||
.setEnvironmentVariable("SONAR_SCANNER_OPTS", "-Xmx2m"); | |||
BuildResult executeBuild = orchestrator.executeBuildQuietly(build); | |||
assertThat(executeBuild.getStatus()).isNotEqualTo(0); | |||
@@ -294,7 +197,7 @@ public class JavaTest extends ScannerTestCase { | |||
assertThat(logs).satisfies(new Condition<String>("Contain error message about OOM") { | |||
@Override | |||
public boolean matches(String value) { | |||
return value.contains("java.lang.OutOfMemoryError") | |||
return value.contains("java.lang.OutOfMemoryError") | |||
|| value.contains("GC overhead limit exceeded") || value.contains("Java heap space"); | |||
} | |||
}); |
@@ -26,13 +26,11 @@ import org.junit.runners.Suite; | |||
import org.junit.runners.Suite.SuiteClasses; | |||
@RunWith(Suite.class) | |||
@SuiteClasses({JavaTest.class, MultimoduleTest.class, DistributionTest.class}) | |||
@SuiteClasses({ScannerTest.class, MultimoduleTest.class, DistributionTest.class}) | |||
public class SonarScannerTestSuite { | |||
@ClassRule | |||
public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv() | |||
.setOrchestratorProperty("javaVersion", "4.11") | |||
.addPlugin("java") | |||
.setOrchestratorProperty("javascriptVersion", "LATEST_RELEASE") | |||
.addPlugin("javascript") | |||
.build(); |
@@ -1,17 +0,0 @@ | |||
<?xml version="1.0" encoding="UTF-8"?><!-- Generated by Sonar --> | |||
<profile> | |||
<name>requires-bytecode</name> | |||
<language>java</language> | |||
<rules> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>CallToDeprecatedMethod</key> | |||
<priority>MINOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1147</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
</rules> | |||
</profile> |
@@ -1,691 +0,0 @@ | |||
<?xml version="1.0" encoding="UTF-8"?><!-- Generated by SonarQube --> | |||
<profile> | |||
<name>sonar-way</name> | |||
<language>java</language> | |||
<rules> | |||
<rule> | |||
<repositoryKey>common-java</repositoryKey> | |||
<key>DuplicatedBlocks</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>common-java</repositoryKey> | |||
<key>InsufficientBranchCoverage</key> | |||
<priority>MAJOR</priority> | |||
<parameters> | |||
<parameter> | |||
<key>minimumBranchCoverageRatio</key> | |||
<value>65.0</value> | |||
</parameter> | |||
</parameters> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S00105</key> | |||
<priority>MINOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>MethodCyclomaticComplexity</key> | |||
<priority>MAJOR</priority> | |||
<parameters> | |||
<parameter> | |||
<key>max</key> | |||
<value>10</value> | |||
</parameter> | |||
</parameters> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>ClassCyclomaticComplexity</key> | |||
<priority>MAJOR</priority> | |||
<parameters> | |||
<parameter> | |||
<key>max</key> | |||
<value>200</value> | |||
</parameter> | |||
</parameters> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>CommentedOutCodeLine</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S00108</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S00107</key> | |||
<priority>MAJOR</priority> | |||
<parameters> | |||
<parameter> | |||
<key>maximumMethodParameters</key> | |||
<value>7</value> | |||
</parameter> | |||
</parameters> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S00112</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S00100</key> | |||
<priority>MAJOR</priority> | |||
<parameters> | |||
<parameter> | |||
<key>format</key> | |||
<value>^[a-z][a-zA-Z0-9]*$</value> | |||
</parameter> | |||
</parameters> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S00101</key> | |||
<priority>MAJOR</priority> | |||
<parameters> | |||
<parameter> | |||
<key>format</key> | |||
<value>^[A-Z][a-zA-Z0-9]*$</value> | |||
</parameter> | |||
</parameters> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S00114</key> | |||
<priority>MAJOR</priority> | |||
<parameters> | |||
<parameter> | |||
<key>format</key> | |||
<value>^[A-Z][a-zA-Z0-9]*$</value> | |||
</parameter> | |||
</parameters> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S00115</key> | |||
<priority>MAJOR</priority> | |||
<parameters> | |||
<parameter> | |||
<key>format</key> | |||
<value>^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$</value> | |||
</parameter> | |||
</parameters> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S00116</key> | |||
<priority>MAJOR</priority> | |||
<parameters> | |||
<parameter> | |||
<key>format</key> | |||
<value>^[a-z][a-zA-Z0-9]*$</value> | |||
</parameter> | |||
</parameters> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S00117</key> | |||
<priority>MAJOR</priority> | |||
<parameters> | |||
<parameter> | |||
<key>format</key> | |||
<value>^[a-z][a-zA-Z0-9]*$</value> | |||
</parameter> | |||
</parameters> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S00119</key> | |||
<priority>MAJOR</priority> | |||
<parameters> | |||
<parameter> | |||
<key>format</key> | |||
<value>^[A-Z]$</value> | |||
</parameter> | |||
</parameters> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S00120</key> | |||
<priority>MAJOR</priority> | |||
<parameters> | |||
<parameter> | |||
<key>format</key> | |||
<value>^[a-z]+(\.[a-z][a-z0-9]*)*$</value> | |||
</parameter> | |||
</parameters> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S00121</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S00122</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>RightCurlyBraceSameLineAsNextBlockCheck</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>RightCurlyBraceStartLineCheck</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>LeftCurlyBraceEndLineCheck</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>UselessParenthesesCheck</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>ObjectFinalizeCheck</key> | |||
<priority>CRITICAL</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>ObjectFinalizeOverridenCheck</key> | |||
<priority>CRITICAL</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>ObjectFinalizeOverridenCallsSuperFinalizeCheck</key> | |||
<priority>BLOCKER</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>ClassVariableVisibilityCheck</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>ForLoopCounterChangedCheck</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>LabelsShouldNotBeUsedCheck</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>SwitchLastCaseIsDefaultCheck</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>EmptyStatementUsageCheck</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>ModifiersOrderCheck</key> | |||
<priority>MINOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>AssignmentInSubExpressionCheck</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>StringEqualityComparisonCheck</key> | |||
<priority>CRITICAL</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>TrailingCommentCheck</key> | |||
<priority>MINOR</priority> | |||
<parameters> | |||
<parameter> | |||
<key>legalCommentPattern</key> | |||
<value>^\s*+[^\s]++$</value> | |||
</parameter> | |||
</parameters> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>UselessImportCheck</key> | |||
<priority>MINOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>LowerCaseLongSuffixCheck</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>MissingDeprecatedCheck</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>HiddenFieldCheck</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1133</key> | |||
<priority>INFO</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1134</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1135</key> | |||
<priority>INFO</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1118</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1132</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1126</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1125</key> | |||
<priority>MINOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1067</key> | |||
<priority>MAJOR</priority> | |||
<parameters> | |||
<parameter> | |||
<key>max</key> | |||
<value>3</value> | |||
</parameter> | |||
</parameters> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1141</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1147</key> | |||
<priority>CRITICAL</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1143</key> | |||
<priority>BLOCKER</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1145</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1157</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1155</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1149</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1171</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1168</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1170</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1163</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S106</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1165</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1066</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S134</key> | |||
<priority>MINOR</priority> | |||
<parameters> | |||
<parameter> | |||
<key>max</key> | |||
<value>3</value> | |||
</parameter> | |||
</parameters> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1181</key> | |||
<priority>BLOCKER</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1150</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1182</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1151</key> | |||
<priority>MAJOR</priority> | |||
<parameters> | |||
<parameter> | |||
<key>max</key> | |||
<value>5</value> | |||
</parameter> | |||
</parameters> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S128</key> | |||
<priority>CRITICAL</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1166</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1190</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1188</key> | |||
<priority>MAJOR</priority> | |||
<parameters> | |||
<parameter> | |||
<key>max</key> | |||
<value>20</value> | |||
</parameter> | |||
</parameters> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1191</key> | |||
<priority>MAJOR</priority> | |||
<parameters></parameters> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S135</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1186</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1185</key> | |||
<priority>MINOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1174</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1175</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1153</key> | |||
<priority>MINOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1148</key> | |||
<priority>CRITICAL</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1195</key> | |||
<priority>MINOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1194</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1193</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1192</key> | |||
<priority>MINOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1158</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1215</key> | |||
<priority>CRITICAL</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1197</key> | |||
<priority>MINOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1220</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1221</key> | |||
<priority>CRITICAL</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1199</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1214</key> | |||
<priority>MINOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1201</key> | |||
<priority>CRITICAL</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1210</key> | |||
<priority>CRITICAL</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1206</key> | |||
<priority>BLOCKER</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1219</key> | |||
<priority>CRITICAL</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1301</key> | |||
<priority>MINOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1314</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1226</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1313</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1312</key> | |||
<priority>MAJOR</priority> | |||
<parameters> | |||
<parameter> | |||
<key>format</key> | |||
<value>LOG(?:GER)?</value> | |||
</parameter> | |||
</parameters> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1318</key> | |||
<priority>CRITICAL</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1223</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1319</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1231</key> | |||
<priority>MINOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1444</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1452</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1481</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1068</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1317</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1596</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>UnusedPrivateMethod</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>RedundantThrowsDeclarationCheck</key> | |||
<priority>MINOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1160</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1217</key> | |||
<priority>CRITICAL</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1488</key> | |||
<priority>MINOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1602</key> | |||
<priority>MAJOR</priority> | |||
</rule> | |||
<rule> | |||
<repositoryKey>squid</repositoryKey> | |||
<key>S1611</key> | |||
<priority>MINOR</priority> | |||
</rule> | |||
</rules> | |||
</profile> |