aboutsummaryrefslogtreecommitdiffstats
path: root/it/it-projects/duplications
diff options
context:
space:
mode:
authorDuarte Meneses <duarte.meneses@sonarsource.com>2015-12-21 13:54:14 +0100
committerDuarte Meneses <duarte.meneses@sonarsource.com>2015-12-21 14:37:03 +0100
commitd1e303f8412f61f426a6c746cc2ac10b584940bd (patch)
treeb68693cc8caced2aeee5b06a3590b3e1392e8011 /it/it-projects/duplications
parent6fe8b0cd64c4b4e2386d994016b465b0386ed09c (diff)
downloadsonarqube-d1e303f8412f61f426a6c746cc2ac10b584940bd.tar.gz
sonarqube-d1e303f8412f61f426a6c746cc2ac10b584940bd.zip
SONAR-2867 Standard copy-paste detection should happen within a project, not only within a module
Diffstat (limited to 'it/it-projects/duplications')
-rw-r--r--it/it-projects/duplications/cross-module/module1/sonar-project.properties5
-rw-r--r--it/it-projects/duplications/cross-module/module1/src/main/xoo/sample/File1.xoo35
-rw-r--r--it/it-projects/duplications/cross-module/module1/src/main/xoo/sample/File1.xoo.measures1
-rw-r--r--it/it-projects/duplications/cross-module/module1/src/main/xoo/sample/File2.xoo23
-rw-r--r--it/it-projects/duplications/cross-module/module1/src/main/xoo/sample/File2.xoo.measures1
-rw-r--r--it/it-projects/duplications/cross-module/module2/sonar-project.properties5
-rw-r--r--it/it-projects/duplications/cross-module/module2/src/main/xoo/sample/File1.xoo35
-rw-r--r--it/it-projects/duplications/cross-module/module2/src/main/xoo/sample/File1.xoo.measures1
-rw-r--r--it/it-projects/duplications/cross-module/sonar-project.properties4
9 files changed, 110 insertions, 0 deletions
diff --git a/it/it-projects/duplications/cross-module/module1/sonar-project.properties b/it/it-projects/duplications/cross-module/module1/sonar-project.properties
new file mode 100644
index 00000000000..a4b8c4853a5
--- /dev/null
+++ b/it/it-projects/duplications/cross-module/module1/sonar-project.properties
@@ -0,0 +1,5 @@
+sonar.projectKey=module1
+sonar.projectName=Module 1
+sonar.projectVersion=1.0-SNAPSHOT
+sonar.sources=src/main/xoo
+sonar.language=xoo
diff --git a/it/it-projects/duplications/cross-module/module1/src/main/xoo/sample/File1.xoo b/it/it-projects/duplications/cross-module/module1/src/main/xoo/sample/File1.xoo
new file mode 100644
index 00000000000..5e494b196ab
--- /dev/null
+++ b/it/it-projects/duplications/cross-module/module1/src/main/xoo/sample/File1.xoo
@@ -0,0 +1,35 @@
+package sample;
+
+public class File1 {
+
+ public File1() {
+ }
+
+ public void test() {
+ char[] charList = new char[30];
+ for (int i = 0; i < 10; i++) {
+ charList[i] = 'a';
+ }
+ for (int i = 0; i < 10; i++) {
+ charList[i] = 'a';
+ }
+ int intergerToBeIncremented = 0;
+ while (intergerToBeIncremented < 100) {
+ intergerToBeIncremented++;
+ }
+ int intergerToBeIncremented2 = 0;
+ while (intergerToBeIncremented2 < 100) {
+ intergerToBeIncremented2++;
+ }
+ String temp = "";
+ for (int i=0; i<10; i++){
+ temp += "say something"+i;
+ }
+ for (int i=0; i<20; i++){
+ temp += "say nothing"+i;
+ }
+ for (int i=0; i<30; i++){
+ temp += "always say nothing"+i;
+ }
+ }
+}
diff --git a/it/it-projects/duplications/cross-module/module1/src/main/xoo/sample/File1.xoo.measures b/it/it-projects/duplications/cross-module/module1/src/main/xoo/sample/File1.xoo.measures
new file mode 100644
index 00000000000..5a79b0b5dbb
--- /dev/null
+++ b/it/it-projects/duplications/cross-module/module1/src/main/xoo/sample/File1.xoo.measures
@@ -0,0 +1 @@
+ncloc:36
diff --git a/it/it-projects/duplications/cross-module/module1/src/main/xoo/sample/File2.xoo b/it/it-projects/duplications/cross-module/module1/src/main/xoo/sample/File2.xoo
new file mode 100644
index 00000000000..00b502d423a
--- /dev/null
+++ b/it/it-projects/duplications/cross-module/module1/src/main/xoo/sample/File2.xoo
@@ -0,0 +1,23 @@
+package sample;
+
+public class File1 {
+
+ public File1() {
+ }
+
+ public void otherMethod() {
+ String temp = "";
+ for (int i=0; i<10; i++){
+ temp += "say something"+i;
+ int nothing = 0;
+ }
+ for (int i=0; i<20; i++){
+ temp += "say nothing"+i;
+ int nothing = 1;
+ }
+ for (int i=0; i<30; i++){
+ temp += "always say nothing"+i;
+ int nothing = 2;
+ }
+ }
+}
diff --git a/it/it-projects/duplications/cross-module/module1/src/main/xoo/sample/File2.xoo.measures b/it/it-projects/duplications/cross-module/module1/src/main/xoo/sample/File2.xoo.measures
new file mode 100644
index 00000000000..d90983a3e9f
--- /dev/null
+++ b/it/it-projects/duplications/cross-module/module1/src/main/xoo/sample/File2.xoo.measures
@@ -0,0 +1 @@
+ncloc:24
diff --git a/it/it-projects/duplications/cross-module/module2/sonar-project.properties b/it/it-projects/duplications/cross-module/module2/sonar-project.properties
new file mode 100644
index 00000000000..0b71b3d7548
--- /dev/null
+++ b/it/it-projects/duplications/cross-module/module2/sonar-project.properties
@@ -0,0 +1,5 @@
+sonar.projectKey=module2
+sonar.projectName=Module 2
+sonar.projectVersion=1.0-SNAPSHOT
+sonar.sources=src/main/xoo
+sonar.language=xoo
diff --git a/it/it-projects/duplications/cross-module/module2/src/main/xoo/sample/File1.xoo b/it/it-projects/duplications/cross-module/module2/src/main/xoo/sample/File1.xoo
new file mode 100644
index 00000000000..cc0b6612812
--- /dev/null
+++ b/it/it-projects/duplications/cross-module/module2/src/main/xoo/sample/File1.xoo
@@ -0,0 +1,35 @@
+package sample;
+
+public class File1 {
+
+ public File1() {
+ }
+
+ public void test2() {
+ char[] charList = new char[30];
+ for (int i = 0; i < 10; i++) {
+ charList[i] = 'a';
+ }
+ for (int i = 0; i < 10; i++) {
+ charList[i] = 'a';
+ }
+ int intergerToBeIncremented = 0;
+ while (intergerToBeIncremented < 100) {
+ intergerToBeIncremented++;
+ }
+ int intergerToBeIncremented2 = 0;
+ while (intergerToBeIncremented2 < 100) {
+ intergerToBeIncremented2++;
+ }
+ String temp = "";
+ for (int i=0; i<10; i++){
+ temp += "say something"+i;
+ }
+ for (int i=0; i<20; i++){
+ temp += "say nothing"+i;
+ }
+ for (int i=0; i<30; i++){
+ temp += "always say nothing"+i;
+ }
+ }
+}
diff --git a/it/it-projects/duplications/cross-module/module2/src/main/xoo/sample/File1.xoo.measures b/it/it-projects/duplications/cross-module/module2/src/main/xoo/sample/File1.xoo.measures
new file mode 100644
index 00000000000..5a79b0b5dbb
--- /dev/null
+++ b/it/it-projects/duplications/cross-module/module2/src/main/xoo/sample/File1.xoo.measures
@@ -0,0 +1 @@
+ncloc:36
diff --git a/it/it-projects/duplications/cross-module/sonar-project.properties b/it/it-projects/duplications/cross-module/sonar-project.properties
new file mode 100644
index 00000000000..f4c7496f179
--- /dev/null
+++ b/it/it-projects/duplications/cross-module/sonar-project.properties
@@ -0,0 +1,4 @@
+sonar.projectKey=cross-module
+sonar.projectName=Cross Module Duplication
+sonar.projectVersion=1.0-SNAPSHOT
+sonar.modules=module1,module2