diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2017-06-23 21:31:56 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2017-06-25 23:42:50 +0200 |
commit | 70b6899988da0d2ba0a39b846e4f1bd3fa27304f (patch) | |
tree | 1ac093a87e0fba6b07c6feb6aceae89bdd9663cf /tests/projects/duplications | |
parent | 5dd574819854e9ce7e2f4e181e78153a7ecbf828 (diff) | |
download | sonarqube-70b6899988da0d2ba0a39b846e4f1bd3fa27304f.tar.gz sonarqube-70b6899988da0d2ba0a39b846e4f1bd3fa27304f.zip |
Move integration tests to directory tests/
Diffstat (limited to 'tests/projects/duplications')
54 files changed, 1165 insertions, 0 deletions
diff --git a/tests/projects/duplications/cross-module/module1/sonar-project.properties b/tests/projects/duplications/cross-module/module1/sonar-project.properties new file mode 100644 index 00000000000..a4b8c4853a5 --- /dev/null +++ b/tests/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/tests/projects/duplications/cross-module/module1/src/main/xoo/sample/File1.xoo b/tests/projects/duplications/cross-module/module1/src/main/xoo/sample/File1.xoo new file mode 100644 index 00000000000..5e494b196ab --- /dev/null +++ b/tests/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/tests/projects/duplications/cross-module/module1/src/main/xoo/sample/File1.xoo.measures b/tests/projects/duplications/cross-module/module1/src/main/xoo/sample/File1.xoo.measures new file mode 100644 index 00000000000..5a79b0b5dbb --- /dev/null +++ b/tests/projects/duplications/cross-module/module1/src/main/xoo/sample/File1.xoo.measures @@ -0,0 +1 @@ +ncloc:36 diff --git a/tests/projects/duplications/cross-module/module1/src/main/xoo/sample/File2.xoo b/tests/projects/duplications/cross-module/module1/src/main/xoo/sample/File2.xoo new file mode 100644 index 00000000000..00b502d423a --- /dev/null +++ b/tests/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/tests/projects/duplications/cross-module/module1/src/main/xoo/sample/File2.xoo.measures b/tests/projects/duplications/cross-module/module1/src/main/xoo/sample/File2.xoo.measures new file mode 100644 index 00000000000..d90983a3e9f --- /dev/null +++ b/tests/projects/duplications/cross-module/module1/src/main/xoo/sample/File2.xoo.measures @@ -0,0 +1 @@ +ncloc:24 diff --git a/tests/projects/duplications/cross-module/module2/sonar-project.properties b/tests/projects/duplications/cross-module/module2/sonar-project.properties new file mode 100644 index 00000000000..0b71b3d7548 --- /dev/null +++ b/tests/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/tests/projects/duplications/cross-module/module2/src/main/xoo/sample/File1.xoo b/tests/projects/duplications/cross-module/module2/src/main/xoo/sample/File1.xoo new file mode 100644 index 00000000000..cc0b6612812 --- /dev/null +++ b/tests/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/tests/projects/duplications/cross-module/module2/src/main/xoo/sample/File1.xoo.measures b/tests/projects/duplications/cross-module/module2/src/main/xoo/sample/File1.xoo.measures new file mode 100644 index 00000000000..5a79b0b5dbb --- /dev/null +++ b/tests/projects/duplications/cross-module/module2/src/main/xoo/sample/File1.xoo.measures @@ -0,0 +1 @@ +ncloc:36 diff --git a/tests/projects/duplications/cross-module/sonar-project.properties b/tests/projects/duplications/cross-module/sonar-project.properties new file mode 100644 index 00000000000..f4c7496f179 --- /dev/null +++ b/tests/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 diff --git a/tests/projects/duplications/cross-project/duplicate/sonar-project.properties b/tests/projects/duplications/cross-project/duplicate/sonar-project.properties new file mode 100644 index 00000000000..cc020389cbd --- /dev/null +++ b/tests/projects/duplications/cross-project/duplicate/sonar-project.properties @@ -0,0 +1,5 @@ +sonar.projectKey=cross-project +sonar.projectName=Cross project +sonar.projectVersion=1.0-SNAPSHOT +sonar.sources=src/main/xoo +sonar.language=xoo diff --git a/tests/projects/duplications/cross-project/duplicate/src/main/xoo/sample/File1.xoo b/tests/projects/duplications/cross-project/duplicate/src/main/xoo/sample/File1.xoo new file mode 100644 index 00000000000..5e494b196ab --- /dev/null +++ b/tests/projects/duplications/cross-project/duplicate/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/tests/projects/duplications/cross-project/duplicate/src/main/xoo/sample/File1.xoo.measures b/tests/projects/duplications/cross-project/duplicate/src/main/xoo/sample/File1.xoo.measures new file mode 100644 index 00000000000..5a79b0b5dbb --- /dev/null +++ b/tests/projects/duplications/cross-project/duplicate/src/main/xoo/sample/File1.xoo.measures @@ -0,0 +1 @@ +ncloc:36 diff --git a/tests/projects/duplications/cross-project/duplicate/src/main/xoo/sample/File2.xoo b/tests/projects/duplications/cross-project/duplicate/src/main/xoo/sample/File2.xoo new file mode 100644 index 00000000000..00b502d423a --- /dev/null +++ b/tests/projects/duplications/cross-project/duplicate/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/tests/projects/duplications/cross-project/duplicate/src/main/xoo/sample/File2.xoo.measures b/tests/projects/duplications/cross-project/duplicate/src/main/xoo/sample/File2.xoo.measures new file mode 100644 index 00000000000..d90983a3e9f --- /dev/null +++ b/tests/projects/duplications/cross-project/duplicate/src/main/xoo/sample/File2.xoo.measures @@ -0,0 +1 @@ +ncloc:24 diff --git a/tests/projects/duplications/cross-project/origin/sonar-project.properties b/tests/projects/duplications/cross-project/origin/sonar-project.properties new file mode 100644 index 00000000000..cc020389cbd --- /dev/null +++ b/tests/projects/duplications/cross-project/origin/sonar-project.properties @@ -0,0 +1,5 @@ +sonar.projectKey=cross-project +sonar.projectName=Cross project +sonar.projectVersion=1.0-SNAPSHOT +sonar.sources=src/main/xoo +sonar.language=xoo diff --git a/tests/projects/duplications/cross-project/origin/src/main/xoo/sample/File1.xoo b/tests/projects/duplications/cross-project/origin/src/main/xoo/sample/File1.xoo new file mode 100644 index 00000000000..cc0b6612812 --- /dev/null +++ b/tests/projects/duplications/cross-project/origin/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/tests/projects/duplications/cross-project/origin/src/main/xoo/sample/File1.xoo.measures b/tests/projects/duplications/cross-project/origin/src/main/xoo/sample/File1.xoo.measures new file mode 100644 index 00000000000..5a79b0b5dbb --- /dev/null +++ b/tests/projects/duplications/cross-project/origin/src/main/xoo/sample/File1.xoo.measures @@ -0,0 +1 @@ +ncloc:36 diff --git a/tests/projects/duplications/file-duplications/sonar-project.properties b/tests/projects/duplications/file-duplications/sonar-project.properties new file mode 100644 index 00000000000..ae173196ce4 --- /dev/null +++ b/tests/projects/duplications/file-duplications/sonar-project.properties @@ -0,0 +1,5 @@ +sonar.projectKey=file-duplications +sonar.projectName=File duplications +sonar.projectVersion=1.0-SNAPSHOT +sonar.sources=src/main/xoo +sonar.language=xoo diff --git a/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_lines_with_other_dir1/DuplicatedLinesWithOtherDirectory.xoo b/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_lines_with_other_dir1/DuplicatedLinesWithOtherDirectory.xoo new file mode 100644 index 00000000000..88e610b4a74 --- /dev/null +++ b/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_lines_with_other_dir1/DuplicatedLinesWithOtherDirectory.xoo @@ -0,0 +1,41 @@ +package duplicated_lines_with_other_dir1; + +public class DuplicatedLinesWithOtherDirectory { + + public DuplicatedLinesWithOtherDirectory() { + } + + public void duplicatedMethodWithOtherDirectory() { + 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'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + } +} diff --git a/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_lines_with_other_dir1/DuplicatedLinesWithOtherDirectory.xoo.measures b/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_lines_with_other_dir1/DuplicatedLinesWithOtherDirectory.xoo.measures new file mode 100644 index 00000000000..03005736cf7 --- /dev/null +++ b/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_lines_with_other_dir1/DuplicatedLinesWithOtherDirectory.xoo.measures @@ -0,0 +1 @@ +ncloc:42 diff --git a/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_lines_with_other_dir2/DuplicatedLinesWithOtherDirectory.xoo b/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_lines_with_other_dir2/DuplicatedLinesWithOtherDirectory.xoo new file mode 100644 index 00000000000..bb3cc734be4 --- /dev/null +++ b/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_lines_with_other_dir2/DuplicatedLinesWithOtherDirectory.xoo @@ -0,0 +1,41 @@ +package duplicated_lines_with_other_dir2; + +public class DuplicatedLinesWithOtherDirectory { + + public DuplicatedLinesWithOtherDirectory() { + } + + public void duplicatedMethodWithOtherDirectory() { + 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'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + } +} diff --git a/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_lines_with_other_dir2/DuplicatedLinesWithOtherDirectory.xoo.measures b/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_lines_with_other_dir2/DuplicatedLinesWithOtherDirectory.xoo.measures new file mode 100644 index 00000000000..03005736cf7 --- /dev/null +++ b/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_lines_with_other_dir2/DuplicatedLinesWithOtherDirectory.xoo.measures @@ -0,0 +1 @@ +ncloc:42 diff --git a/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_lines_within_dir/DuplicatedLinesInSameDirectory1.xoo b/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_lines_within_dir/DuplicatedLinesInSameDirectory1.xoo new file mode 100644 index 00000000000..5f23377bed4 --- /dev/null +++ b/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_lines_within_dir/DuplicatedLinesInSameDirectory1.xoo @@ -0,0 +1,105 @@ +package duplicated_lines_within_dir; + +public class DuplicatedLinesInSameDirectory1 { + + public DuplicatedLinesInSameDirectory1() { + } + + /* + * sddfgdfgfg + */ + public void duplicatedMethodInSameFile1() { + int intergerToBeIncremented = 0; + while (intergerToBeIncremented < 100) { + intergerToBeIncremented++; + } + int intergerToBeIncremented2 = 0; + while (intergerToBeIncremented2 < 100) { + intergerToBeIncremented2++; + } + // first + int intergerToBeIncremented3 = 0; + while (intergerToBeIncremented3 < 100) { + intergerToBeIncremented3++; + } + int intergerToBeIncremented4 = 0; + while (intergerToBeIncremented4 < 100) { + intergerToBeIncremented4++; + } + int intergerToBeIncremented5 = 0; + while (intergerToBeIncremented5 < 100) { + intergerToBeIncremented5++; + } + int intergerToBeIncremented6 = 0; + while (intergerToBeIncremented6 < 100) { + intergerToBeIncremented6++; + } + int intergerToBeIncremented7 = 0; + while (intergerToBeIncremented7 < 100) { + intergerToBeIncremented7++; + } + } + + + public void duplicatedMethodInSameFile3() { + int intergerToBeIncremented = 0; + while (intergerToBeIncremented < 100) { + intergerToBeIncremented++; + } + // test2 + int intergerToBeIncremented2 = 0; + while (intergerToBeIncremented2 < 100) { + intergerToBeIncremented2++; + } + int intergerToBeIncremented8 = 0; + while (intergerToBeIncremented8 < 100) { + intergerToBeIncremented8++; + } + int intergerToBeIncremented9 = 0; + while (intergerToBeIncremented9 < 100) { + intergerToBeIncremented9++; + } + // test 1 + int intergerToBeIncremented10 = 0; + while (intergerToBeIncremented10 < 100) { + intergerToBeIncremented10++; + } + int intergerToBeIncremented60 = 0; + while (intergerToBeIncremented60 < 100) { + intergerToBeIncremented60++; + } + int intergerToBeIncremented70 = 0; + while (intergerToBeIncremented70 < 100) { + intergerToBeIncremented70++; + } + } + + public void duplicated2MethodInSameFile3() { + System.out.print("copy test start"); + int intergerToBeIncremented1 = 0; + while (intergerToBeIncremented1 < 100) { + intergerToBeIncremented1++; + } + int intergerToBeIncremented20 = 0; + while (intergerToBeIncremented20 < 100) { + intergerToBeIncremented20++; + } + int intergerToBeIncremented8 = 0; + while (intergerToBeIncremented8 < 100) { + intergerToBeIncremented8++; + } + int intergerToBeIncremented9 = 0; + while (intergerToBeIncremented9 < 100) { + intergerToBeIncremented9++; + } + int intergerToBeIncremented10 = 0; + while (intergerToBeIncremented10 < 100) { + intergerToBeIncremented10++; + } + int intergerToBeIncremented60 = 0; + while (intergerToBeIncremented60 < 100) { + intergerToBeIncremented60++; + } + System.out.print("copy test end"); + } +} diff --git a/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_lines_within_dir/DuplicatedLinesInSameDirectory1.xoo.measures b/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_lines_within_dir/DuplicatedLinesInSameDirectory1.xoo.measures new file mode 100644 index 00000000000..c71c98ec52e --- /dev/null +++ b/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_lines_within_dir/DuplicatedLinesInSameDirectory1.xoo.measures @@ -0,0 +1 @@ +ncloc:106 diff --git a/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_lines_within_dir/DuplicatedLinesInSameDirectory2.xoo b/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_lines_within_dir/DuplicatedLinesInSameDirectory2.xoo new file mode 100644 index 00000000000..b565bfd75a2 --- /dev/null +++ b/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_lines_within_dir/DuplicatedLinesInSameDirectory2.xoo @@ -0,0 +1,71 @@ +package duplicated_lines_within_dir; + +public class DuplicatedLinesInSameDirectory2 { + + public DuplicatedLinesInSameDirectory2() { + } + + public void duplicated2MethodInSameFile3() { + System.out.print("copy test start"); + int intergerToBeIncremented1 = 0; + while (intergerToBeIncremented1 < 100) { + intergerToBeIncremented1++; + } + int intergerToBeIncremented20 = 0; + while (intergerToBeIncremented20 < 100) { + intergerToBeIncremented20++; + } + int intergerToBeIncremented8 = 0; + while (intergerToBeIncremented8 < 100) { + intergerToBeIncremented8++; + } + int intergerToBeIncremented9 = 0; + while (intergerToBeIncremented9 < 100) { + intergerToBeIncremented9++; + } + int intergerToBeIncremented10 = 0; + while (intergerToBeIncremented10 < 100) { + intergerToBeIncremented10++; + } + int intergerToBeIncremented60 = 0; + while (intergerToBeIncremented60 < 100) { + intergerToBeIncremented60++; + } + System.out.print("copy test end"); + } + + public void duplicatedMethodInSameFile1() { + int intergerToBeIncremented = 0; + while (intergerToBeIncremented < 100) { + intergerToBeIncremented++; + } + int intergerToBeIncremented2 = 0; + while (intergerToBeIncremented2 < 100) { + intergerToBeIncremented2++; + } + // second + int intergerToBeIncremented3 = 0; + while (intergerToBeIncremented3 < 100) { + intergerToBeIncremented3++; + } + int intergerToBeIncremented4 = 0; + while (intergerToBeIncremented4 < 100) { + intergerToBeIncremented4++; + } + int intergerToBeIncremented5 = 0; + while (intergerToBeIncremented5 < 100) { + intergerToBeIncremented5++; + } + // vghgvhz + // bhjjh + int intergerToBeIncremented6 = 0; + while (intergerToBeIncremented6 < 100) { + intergerToBeIncremented6++; + } + int intergerToBeIncremented7 = 0; + while (intergerToBeIncremented7 < 100) { + intergerToBeIncremented7++; + } + } + +} diff --git a/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_lines_within_dir/DuplicatedLinesInSameDirectory2.xoo.measures b/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_lines_within_dir/DuplicatedLinesInSameDirectory2.xoo.measures new file mode 100644 index 00000000000..f175998c7cc --- /dev/null +++ b/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_lines_within_dir/DuplicatedLinesInSameDirectory2.xoo.measures @@ -0,0 +1 @@ +ncloc:72 diff --git a/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_lines_within_same_file/DuplicatedLinesInSameFile.xoo b/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_lines_within_same_file/DuplicatedLinesInSameFile.xoo new file mode 100644 index 00000000000..6a0d3345eb7 --- /dev/null +++ b/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_lines_within_same_file/DuplicatedLinesInSameFile.xoo @@ -0,0 +1,70 @@ +package duplicated_lines_within_same_file; + +public class DuplicatedLinesInSameFile { + + public DuplicatedLinesInSameFile() { + } + + public void duplicatedMethodInSameFile1() { + 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; + } + for (int i=0; i<40; i++){ + temp += "really nothing to say "+i; + } + for (int i=0; i<50; i++){ + temp += "really really nothing to say "+i; + } + for (int i=0; i<60; i++){ + temp += ".. "+i; + } + for (int i=0; i<70; i++){ + temp += "you say something? "+i; + } + for (int i=0; i<80; i++){ + temp += "ah no..."+i; + } + for (int i=0; i<90; i++){ + temp += "bye"+i; + } + } + + public void duplicatedMethodInSameFile2() { + 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; + } + for (int i=0; i<40; i++){ + temp += "really nothing to say "+i; + } + for (int i=0; i<50; i++){ + temp += "really really nothing to say "+i; + } + for (int i=0; i<60; i++){ + temp += ".. "+i; + } + for (int i=0; i<70; i++){ + temp += "you say something? "+i; + } + for (int i=0; i<80; i++){ + temp += "ah no..."+i; + } + for (int i=0; i<90; i++){ + temp += "bye"+i; + } + } + +} diff --git a/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_lines_within_same_file/DuplicatedLinesInSameFile.xoo.measures b/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_lines_within_same_file/DuplicatedLinesInSameFile.xoo.measures new file mode 100644 index 00000000000..5e818e5e054 --- /dev/null +++ b/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_lines_within_same_file/DuplicatedLinesInSameFile.xoo.measures @@ -0,0 +1 @@ +ncloc:71 diff --git a/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_same_lines_within_3_files/File1.xoo b/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_same_lines_within_3_files/File1.xoo new file mode 100644 index 00000000000..8083fdec9d6 --- /dev/null +++ b/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_same_lines_within_3_files/File1.xoo @@ -0,0 +1,41 @@ +package duplicated_same_lines_within_3_files; + +public class File1 { + + public void someMethod() { + System.out.println("Test"); + } + + public void duplicatedMethod() { + int intergerToBeIncremented = 0; + while (intergerToBeIncremented < 100) { + intergerToBeIncremented++; + } + System.out.println("test"); + int intergerToBeIncremented3 = 0; + while (intergerToBeIncremented3 < 100) { + intergerToBeIncremented3++; + } + System.out.println("test"); + int intergerToBeIncremented4 = 0; + while (intergerToBeIncremented4 < 100) { + intergerToBeIncremented4++; + } + System.out.println("test"); + int intergerToBeIncremented5 = 0; + while (intergerToBeIncremented5 < 100) { + intergerToBeIncremented5++; + } + System.out.println("test"); + int intergerToBeIncremented6 = 0; + while (intergerToBeIncremented6 < 100) { + intergerToBeIncremented6++; + } + System.out.println("test"); + int intergerToBeIncremented7 = 0; + while (intergerToBeIncremented7 < 100) { + intergerToBeIncremented7++; + } + } + +} diff --git a/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_same_lines_within_3_files/File1.xoo.measures b/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_same_lines_within_3_files/File1.xoo.measures new file mode 100644 index 00000000000..03005736cf7 --- /dev/null +++ b/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_same_lines_within_3_files/File1.xoo.measures @@ -0,0 +1 @@ +ncloc:42 diff --git a/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_same_lines_within_3_files/File2.xoo b/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_same_lines_within_3_files/File2.xoo new file mode 100644 index 00000000000..b76919dbd67 --- /dev/null +++ b/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_same_lines_within_3_files/File2.xoo @@ -0,0 +1,40 @@ +package duplicated_same_lines_within_3_files; + +public class File2 { + + public void duplicatedMethod() { + int intergerToBeIncremented = 0; + while (intergerToBeIncremented < 100) { + intergerToBeIncremented++; + } + System.out.println("test"); + int intergerToBeIncremented3 = 0; + while (intergerToBeIncremented3 < 100) { + intergerToBeIncremented3++; + } + System.out.println("test"); + int intergerToBeIncremented4 = 0; + while (intergerToBeIncremented4 < 100) { + intergerToBeIncremented4++; + } + System.out.println("test"); + int intergerToBeIncremented5 = 0; + while (intergerToBeIncremented5 < 100) { + intergerToBeIncremented5++; + } + System.out.println("test"); + int intergerToBeIncremented6 = 0; + while (intergerToBeIncremented6 < 100) { + intergerToBeIncremented6++; + } + System.out.println("test"); + int intergerToBeIncremented7 = 0; + while (intergerToBeIncremented7 < 100) { + intergerToBeIncremented7++; + } + } + + public void someOtherMethod() { + System.out.println("Test2"); + } +} diff --git a/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_same_lines_within_3_files/File2.xoo.measures b/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_same_lines_within_3_files/File2.xoo.measures new file mode 100644 index 00000000000..076450c97b0 --- /dev/null +++ b/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_same_lines_within_3_files/File2.xoo.measures @@ -0,0 +1 @@ +ncloc:41 diff --git a/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_same_lines_within_3_files/File3.xoo b/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_same_lines_within_3_files/File3.xoo new file mode 100644 index 00000000000..5db9d2fd221 --- /dev/null +++ b/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_same_lines_within_3_files/File3.xoo @@ -0,0 +1,43 @@ +package duplicated_same_lines_within_3_files; + +public class File3 { + + private String test; + + public void duplicatedMethod() { + int intergerToBeIncremented = 0; + while (intergerToBeIncremented < 100) { + intergerToBeIncremented++; + } + System.out.println("test"); + int intergerToBeIncremented3 = 0; + while (intergerToBeIncremented3 < 100) { + intergerToBeIncremented3++; + } + System.out.println("test"); + int intergerToBeIncremented4 = 0; + while (intergerToBeIncremented4 < 100) { + intergerToBeIncremented4++; + } + System.out.println("test"); + int intergerToBeIncremented5 = 0; + while (intergerToBeIncremented5 < 100) { + intergerToBeIncremented5++; + } + System.out.println("test"); + int intergerToBeIncremented6 = 0; + while (intergerToBeIncremented6 < 100) { + intergerToBeIncremented6++; + } + System.out.println("test"); + int intergerToBeIncremented7 = 0; + while (intergerToBeIncremented7 < 100) { + intergerToBeIncremented7++; + } + } + + public String getTest() { + return test; + } + +} diff --git a/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_same_lines_within_3_files/File3.xoo.measures b/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_same_lines_within_3_files/File3.xoo.measures new file mode 100644 index 00000000000..9fd62445ebd --- /dev/null +++ b/tests/projects/duplications/file-duplications/src/main/xoo/duplicated_same_lines_within_3_files/File3.xoo.measures @@ -0,0 +1 @@ +ncloc:44 diff --git a/tests/projects/duplications/new-duplications-v1/sonar-project.properties b/tests/projects/duplications/new-duplications-v1/sonar-project.properties new file mode 100644 index 00000000000..6f0a3e53d33 --- /dev/null +++ b/tests/projects/duplications/new-duplications-v1/sonar-project.properties @@ -0,0 +1,6 @@ +sonar.projectKey=new-duplications +sonar.projectName=New duplications +sonar.projectVersion=1.0-SNAPSHOT +sonar.sources=src/main/xoo +sonar.language=xoo +sonar.scm.provider=xoo diff --git a/tests/projects/duplications/new-duplications-v1/src/main/xoo/duplicated_lines_with_other_dir1/DuplicatedLinesWithOtherDirectory.xoo b/tests/projects/duplications/new-duplications-v1/src/main/xoo/duplicated_lines_with_other_dir1/DuplicatedLinesWithOtherDirectory.xoo new file mode 100644 index 00000000000..366e85ec229 --- /dev/null +++ b/tests/projects/duplications/new-duplications-v1/src/main/xoo/duplicated_lines_with_other_dir1/DuplicatedLinesWithOtherDirectory.xoo @@ -0,0 +1,17 @@ +package duplicated_lines_with_other_dir1; + +public class DuplicatedLinesWithOtherDirectory { + + public DuplicatedLinesWithOtherDirectory() { + } + + public void duplicatedMethodWithOtherDirectory() { + 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'; + } + } +} diff --git a/tests/projects/duplications/new-duplications-v1/src/main/xoo/duplicated_lines_with_other_dir1/DuplicatedLinesWithOtherDirectory.xoo.measures b/tests/projects/duplications/new-duplications-v1/src/main/xoo/duplicated_lines_with_other_dir1/DuplicatedLinesWithOtherDirectory.xoo.measures new file mode 100644 index 00000000000..57948d5b8c6 --- /dev/null +++ b/tests/projects/duplications/new-duplications-v1/src/main/xoo/duplicated_lines_with_other_dir1/DuplicatedLinesWithOtherDirectory.xoo.measures @@ -0,0 +1 @@ +ncloc:18 diff --git a/tests/projects/duplications/new-duplications-v1/src/main/xoo/duplicated_lines_with_other_dir1/DuplicatedLinesWithOtherDirectory.xoo.scm b/tests/projects/duplications/new-duplications-v1/src/main/xoo/duplicated_lines_with_other_dir1/DuplicatedLinesWithOtherDirectory.xoo.scm new file mode 100644 index 00000000000..a4f7ca6c8b0 --- /dev/null +++ b/tests/projects/duplications/new-duplications-v1/src/main/xoo/duplicated_lines_with_other_dir1/DuplicatedLinesWithOtherDirectory.xoo.scm @@ -0,0 +1,18 @@ +1,user1,2015-01-04 +1,user1,2015-01-04 +1,user1,2015-01-04 +1,user1,2015-01-04 +2,user2,2015-01-05 +2,user2,2015-01-05 +3,user3,2015-01-06 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 diff --git a/tests/projects/duplications/new-duplications-v1/src/main/xoo/duplicated_lines_with_other_dir2/DuplicatedLinesWithOtherDirectory.xoo b/tests/projects/duplications/new-duplications-v1/src/main/xoo/duplicated_lines_with_other_dir2/DuplicatedLinesWithOtherDirectory.xoo new file mode 100644 index 00000000000..366e85ec229 --- /dev/null +++ b/tests/projects/duplications/new-duplications-v1/src/main/xoo/duplicated_lines_with_other_dir2/DuplicatedLinesWithOtherDirectory.xoo @@ -0,0 +1,17 @@ +package duplicated_lines_with_other_dir1; + +public class DuplicatedLinesWithOtherDirectory { + + public DuplicatedLinesWithOtherDirectory() { + } + + public void duplicatedMethodWithOtherDirectory() { + 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'; + } + } +} diff --git a/tests/projects/duplications/new-duplications-v1/src/main/xoo/duplicated_lines_with_other_dir2/DuplicatedLinesWithOtherDirectory.xoo.measures b/tests/projects/duplications/new-duplications-v1/src/main/xoo/duplicated_lines_with_other_dir2/DuplicatedLinesWithOtherDirectory.xoo.measures new file mode 100644 index 00000000000..57948d5b8c6 --- /dev/null +++ b/tests/projects/duplications/new-duplications-v1/src/main/xoo/duplicated_lines_with_other_dir2/DuplicatedLinesWithOtherDirectory.xoo.measures @@ -0,0 +1 @@ +ncloc:18 diff --git a/tests/projects/duplications/new-duplications-v1/src/main/xoo/duplicated_lines_with_other_dir2/DuplicatedLinesWithOtherDirectory.xoo.scm b/tests/projects/duplications/new-duplications-v1/src/main/xoo/duplicated_lines_with_other_dir2/DuplicatedLinesWithOtherDirectory.xoo.scm new file mode 100644 index 00000000000..a4f7ca6c8b0 --- /dev/null +++ b/tests/projects/duplications/new-duplications-v1/src/main/xoo/duplicated_lines_with_other_dir2/DuplicatedLinesWithOtherDirectory.xoo.scm @@ -0,0 +1,18 @@ +1,user1,2015-01-04 +1,user1,2015-01-04 +1,user1,2015-01-04 +1,user1,2015-01-04 +2,user2,2015-01-05 +2,user2,2015-01-05 +3,user3,2015-01-06 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 diff --git a/tests/projects/duplications/new-duplications-v1/src/main/xoo/duplicated_lines_within_same_file/DuplicatedLinesInSameFile.xoo b/tests/projects/duplications/new-duplications-v1/src/main/xoo/duplicated_lines_within_same_file/DuplicatedLinesInSameFile.xoo new file mode 100644 index 00000000000..89addba19cf --- /dev/null +++ b/tests/projects/duplications/new-duplications-v1/src/main/xoo/duplicated_lines_within_same_file/DuplicatedLinesInSameFile.xoo @@ -0,0 +1,39 @@ +package duplicated_lines_within_same_file; + +public class DuplicatedLinesInSameFile { + + public DuplicatedLinesInSameFile() { + } + + public void duplicatedMethodInSameFile1() { + 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; + } + for (int i=0; i<40; i++){ + temp += "really nothing to say "+i; + } + for (int i=0; i<50; i++){ + temp += "really really nothing to say "+i; + } + for (int i=0; i<60; i++){ + temp += ".. "+i; + } + for (int i=0; i<70; i++){ + temp += "you say something? "+i; + } + for (int i=0; i<80; i++){ + temp += "ah no..."+i; + } + for (int i=0; i<90; i++){ + temp += "bye"+i; + } + } + +} diff --git a/tests/projects/duplications/new-duplications-v1/src/main/xoo/duplicated_lines_within_same_file/DuplicatedLinesInSameFile.xoo.measures b/tests/projects/duplications/new-duplications-v1/src/main/xoo/duplicated_lines_within_same_file/DuplicatedLinesInSameFile.xoo.measures new file mode 100644 index 00000000000..9680b5f6c8a --- /dev/null +++ b/tests/projects/duplications/new-duplications-v1/src/main/xoo/duplicated_lines_within_same_file/DuplicatedLinesInSameFile.xoo.measures @@ -0,0 +1 @@ +ncloc:40 diff --git a/tests/projects/duplications/new-duplications-v1/src/main/xoo/duplicated_lines_within_same_file/DuplicatedLinesInSameFile.xoo.scm b/tests/projects/duplications/new-duplications-v1/src/main/xoo/duplicated_lines_within_same_file/DuplicatedLinesInSameFile.xoo.scm new file mode 100644 index 00000000000..50df6bcf039 --- /dev/null +++ b/tests/projects/duplications/new-duplications-v1/src/main/xoo/duplicated_lines_within_same_file/DuplicatedLinesInSameFile.xoo.scm @@ -0,0 +1,40 @@ +1,user1,2015-01-04 +1,user1,2015-01-04 +1,user1,2015-01-04 +1,user1,2015-01-04 +2,user2,2015-01-05 +2,user2,2015-01-05 +3,user3,2015-01-06 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 diff --git a/tests/projects/duplications/new-duplications-v2/sonar-project.properties b/tests/projects/duplications/new-duplications-v2/sonar-project.properties new file mode 100644 index 00000000000..6f0a3e53d33 --- /dev/null +++ b/tests/projects/duplications/new-duplications-v2/sonar-project.properties @@ -0,0 +1,6 @@ +sonar.projectKey=new-duplications +sonar.projectName=New duplications +sonar.projectVersion=1.0-SNAPSHOT +sonar.sources=src/main/xoo +sonar.language=xoo +sonar.scm.provider=xoo diff --git a/tests/projects/duplications/new-duplications-v2/src/main/xoo/duplicated_lines_with_other_dir1/DuplicatedLinesWithOtherDirectory.xoo b/tests/projects/duplications/new-duplications-v2/src/main/xoo/duplicated_lines_with_other_dir1/DuplicatedLinesWithOtherDirectory.xoo new file mode 100644 index 00000000000..88e610b4a74 --- /dev/null +++ b/tests/projects/duplications/new-duplications-v2/src/main/xoo/duplicated_lines_with_other_dir1/DuplicatedLinesWithOtherDirectory.xoo @@ -0,0 +1,41 @@ +package duplicated_lines_with_other_dir1; + +public class DuplicatedLinesWithOtherDirectory { + + public DuplicatedLinesWithOtherDirectory() { + } + + public void duplicatedMethodWithOtherDirectory() { + 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'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + } +} diff --git a/tests/projects/duplications/new-duplications-v2/src/main/xoo/duplicated_lines_with_other_dir1/DuplicatedLinesWithOtherDirectory.xoo.measures b/tests/projects/duplications/new-duplications-v2/src/main/xoo/duplicated_lines_with_other_dir1/DuplicatedLinesWithOtherDirectory.xoo.measures new file mode 100644 index 00000000000..03005736cf7 --- /dev/null +++ b/tests/projects/duplications/new-duplications-v2/src/main/xoo/duplicated_lines_with_other_dir1/DuplicatedLinesWithOtherDirectory.xoo.measures @@ -0,0 +1 @@ +ncloc:42 diff --git a/tests/projects/duplications/new-duplications-v2/src/main/xoo/duplicated_lines_with_other_dir1/DuplicatedLinesWithOtherDirectory.xoo.scm b/tests/projects/duplications/new-duplications-v2/src/main/xoo/duplicated_lines_with_other_dir1/DuplicatedLinesWithOtherDirectory.xoo.scm new file mode 100644 index 00000000000..728006a3575 --- /dev/null +++ b/tests/projects/duplications/new-duplications-v2/src/main/xoo/duplicated_lines_with_other_dir1/DuplicatedLinesWithOtherDirectory.xoo.scm @@ -0,0 +1,42 @@ +1,user1,2015-01-04 +1,user1,2015-01-04 +1,user1,2015-01-04 +1,user1,2015-01-04 +2,user2,2015-01-05 +2,user2,2015-01-05 +3,user3,2015-01-06 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 diff --git a/tests/projects/duplications/new-duplications-v2/src/main/xoo/duplicated_lines_with_other_dir2/DuplicatedLinesWithOtherDirectory.xoo b/tests/projects/duplications/new-duplications-v2/src/main/xoo/duplicated_lines_with_other_dir2/DuplicatedLinesWithOtherDirectory.xoo new file mode 100644 index 00000000000..433514f17af --- /dev/null +++ b/tests/projects/duplications/new-duplications-v2/src/main/xoo/duplicated_lines_with_other_dir2/DuplicatedLinesWithOtherDirectory.xoo @@ -0,0 +1,35 @@ +package duplicated_lines_with_other_dir2; + +public class DuplicatedLinesWithOtherDirectory { + + public DuplicatedLinesWithOtherDirectory() { + } + + public void duplicatedMethodWithOtherDirectory() { + 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'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + } +} diff --git a/tests/projects/duplications/new-duplications-v2/src/main/xoo/duplicated_lines_with_other_dir2/DuplicatedLinesWithOtherDirectory.xoo.measures b/tests/projects/duplications/new-duplications-v2/src/main/xoo/duplicated_lines_with_other_dir2/DuplicatedLinesWithOtherDirectory.xoo.measures new file mode 100644 index 00000000000..33a558499a3 --- /dev/null +++ b/tests/projects/duplications/new-duplications-v2/src/main/xoo/duplicated_lines_with_other_dir2/DuplicatedLinesWithOtherDirectory.xoo.measures @@ -0,0 +1,2 @@ +ncloc:36 + diff --git a/tests/projects/duplications/new-duplications-v2/src/main/xoo/duplicated_lines_with_other_dir2/DuplicatedLinesWithOtherDirectory.xoo.scm b/tests/projects/duplications/new-duplications-v2/src/main/xoo/duplicated_lines_with_other_dir2/DuplicatedLinesWithOtherDirectory.xoo.scm new file mode 100644 index 00000000000..8320f408e7a --- /dev/null +++ b/tests/projects/duplications/new-duplications-v2/src/main/xoo/duplicated_lines_with_other_dir2/DuplicatedLinesWithOtherDirectory.xoo.scm @@ -0,0 +1,36 @@ +1,user1,2015-01-04 +1,user1,2015-01-04 +1,user1,2015-01-04 +1,user1,2015-01-04 +2,user2,2015-01-05 +2,user2,2015-01-05 +3,user3,2015-01-06 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 diff --git a/tests/projects/duplications/new-duplications-v2/src/main/xoo/duplicated_lines_within_same_file/DuplicatedLinesInSameFile.xoo b/tests/projects/duplications/new-duplications-v2/src/main/xoo/duplicated_lines_within_same_file/DuplicatedLinesInSameFile.xoo new file mode 100644 index 00000000000..a0d79b856c6 --- /dev/null +++ b/tests/projects/duplications/new-duplications-v2/src/main/xoo/duplicated_lines_within_same_file/DuplicatedLinesInSameFile.xoo @@ -0,0 +1,80 @@ +package duplicated_lines_within_same_file; + +public class DuplicatedLinesInSameFile { + + public DuplicatedLinesInSameFile() { + } + + public void duplicatedMethodInSameFile1() { + 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; + } + for (int i=0; i<40; i++){ + temp += "really nothing to say "+i; + } + for (int i=0; i<50; i++){ + temp += "really really nothing to say "+i; + } + for (int i=0; i<60; i++){ + temp += ".. "+i; + } + for (int i=0; i<70; i++){ + temp += "you say something? "+i; + } + for (int i=0; i<80; i++){ + temp += "ah no..."+i; + } + for (int i=0; i<90; i++){ + temp += "bye"+i; + } + } + + public void duplicatedMethodInSameFile2() { + 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; + } + for (int i=0; i<40; i++){ + temp += "really nothing to say "+i; + } + // Some comment + // Some comment + // Some comment + for (int i=0; i<50; i++){ + temp += "really really nothing to say "+i; + } + for (int i=0; i<60; i++){ + temp += ".. "+i; + } + for (int i=0; i<70; i++){ + temp += "you say something? "+i; + } + for (int i=0; i<80; i++){ + temp += "ah no..."+i; + } + for (int i=0; i<90; i++){ + temp += "bye"+i; + } + } + + public void notDuplicated(){ + int intergerToBeIncremented6 = 0; + while (intergerToBeIncremented6 < 100) { + intergerToBeIncremented6++; + } + } + +} diff --git a/tests/projects/duplications/new-duplications-v2/src/main/xoo/duplicated_lines_within_same_file/DuplicatedLinesInSameFile.xoo.measures b/tests/projects/duplications/new-duplications-v2/src/main/xoo/duplicated_lines_within_same_file/DuplicatedLinesInSameFile.xoo.measures new file mode 100644 index 00000000000..2fb2025cb32 --- /dev/null +++ b/tests/projects/duplications/new-duplications-v2/src/main/xoo/duplicated_lines_within_same_file/DuplicatedLinesInSameFile.xoo.measures @@ -0,0 +1,2 @@ +ncloc:81 + diff --git a/tests/projects/duplications/new-duplications-v2/src/main/xoo/duplicated_lines_within_same_file/DuplicatedLinesInSameFile.xoo.scm b/tests/projects/duplications/new-duplications-v2/src/main/xoo/duplicated_lines_within_same_file/DuplicatedLinesInSameFile.xoo.scm new file mode 100644 index 00000000000..f3cf9706ffa --- /dev/null +++ b/tests/projects/duplications/new-duplications-v2/src/main/xoo/duplicated_lines_within_same_file/DuplicatedLinesInSameFile.xoo.scm @@ -0,0 +1,81 @@ +1,user1,2015-01-04 +1,user1,2015-01-04 +1,user1,2015-01-04 +1,user1,2015-01-04 +2,user2,2015-01-05 +2,user2,2015-01-05 +3,user3,2015-01-06 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +5,user4,2015-06-07 +4,user4,2015-01-07 +4,user4,2015-01-07 +4,user4,2015-01-07 |