From 16f864c83e06e0d9ccda59197ef41a2d13feaf74 Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Wed, 21 Feb 2024 16:13:27 +0100 Subject: [PATCH 001/228] fix broken edge click --- report-viewer/src/components/ClusterGraph.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/report-viewer/src/components/ClusterGraph.vue b/report-viewer/src/components/ClusterGraph.vue index 60713892fc..8a7e6d92a8 100644 --- a/report-viewer/src/components/ClusterGraph.vue +++ b/report-viewer/src/components/ClusterGraph.vue @@ -286,8 +286,10 @@ const graphOptions = computed(() => { router.push({ name: 'ComparisonView', params: { - firstId: hoveredEdge.value.firstId, - secondId: hoveredEdge.value.secondId + comparisonFileName: store().getComparisonFileName( + hoveredEdge.value.firstId, + hoveredEdge.value.secondId + ) } }) } From 23cda9c6a7f0677598bf031e5a3eb99e46ef5223 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timur=20Sa=C4=9Flam?= Date: Wed, 21 Feb 2024 16:32:30 +0100 Subject: [PATCH 002/228] Change revision to 5.1.0-SNAPSHOT. --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index dba35b8c0e..ee1657039e 100644 --- a/pom.xml +++ b/pom.xml @@ -86,7 +86,7 @@ 1.0.0 - 5.0.0 + 5.1.0-SNAPSHOT From 731aea569f2a91c057834cf575c4875e59c7f2ea Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Feb 2024 10:27:33 +0000 Subject: [PATCH 003/228] Dependency(deps): Bump org.codehaus.mojo:exec-maven-plugin Bumps [org.codehaus.mojo:exec-maven-plugin](https://github.com/mojohaus/exec-maven-plugin) from 1.3.2 to 3.1.1. - [Release notes](https://github.com/mojohaus/exec-maven-plugin/releases) - [Commits](https://github.com/mojohaus/exec-maven-plugin/compare/exec-maven-plugin-1.3.2...3.1.1) --- updated-dependencies: - dependency-name: org.codehaus.mojo:exec-maven-plugin dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- cli/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/pom.xml b/cli/pom.xml index 459daf3eb1..5c6ab259f6 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -183,7 +183,7 @@ org.codehaus.mojo exec-maven-plugin - 1.3.2 + 3.1.1 npm install From 72020a6678e1505a26b8f8e28e8de185fdd2ca7e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Feb 2024 10:27:23 +0000 Subject: [PATCH 004/228] Dependency(deps): Bump org.scalameta:scalameta_2.13 from 4.8.15 to 4.9.0 Bumps [org.scalameta:scalameta_2.13](https://github.com/scalameta/scalameta) from 4.8.15 to 4.9.0. - [Release notes](https://github.com/scalameta/scalameta/releases) - [Commits](https://github.com/scalameta/scalameta/compare/v4.8.15...v4.9.0) --- updated-dependencies: - dependency-name: org.scalameta:scalameta_2.13 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- languages/scala/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages/scala/pom.xml b/languages/scala/pom.xml index 7c43463dc5..50cb9e70fd 100644 --- a/languages/scala/pom.xml +++ b/languages/scala/pom.xml @@ -25,7 +25,7 @@ org.scalameta scalameta_${scala.compat.version} - 4.8.15 + 4.9.0 From 5f4bb2b8275148f904438b49bd950cecfd42e41c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Feb 2024 17:03:07 +0100 Subject: [PATCH 005/228] Dependency(deps-dev): Bump @types/node from 18.19.15 to 18.19.17 in /report-viewer (#1589) Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.19.15 to 18.19.17. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- report-viewer/package-lock.json | 8 ++++---- report-viewer/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/report-viewer/package-lock.json b/report-viewer/package-lock.json index b272d1fce3..1f1c51052a 100644 --- a/report-viewer/package-lock.json +++ b/report-viewer/package-lock.json @@ -30,7 +30,7 @@ "@playwright/test": "^1.40.1", "@rushstack/eslint-patch": "^1.7.2", "@types/jsdom": "^21.1.6", - "@types/node": "^18.19.15", + "@types/node": "^18.19.17", "@vitejs/plugin-vue": "^5.0.4", "@vue/eslint-config-prettier": "^9.0.0", "@vue/eslint-config-typescript": "^12.0.0", @@ -1053,9 +1053,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.19.15", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.15.tgz", - "integrity": "sha512-AMZ2UWx+woHNfM11PyAEQmfSxi05jm9OlkxczuHeEqmvwPkYj6MWv44gbzDPefYOLysTOFyI3ziiy2ONmUZfpA==", + "version": "18.19.17", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.17.tgz", + "integrity": "sha512-SzyGKgwPzuWp2SHhlpXKzCX0pIOfcI4V2eF37nNBJOhwlegQ83omtVQ1XxZpDE06V/d6AQvfQdPfnw0tRC//Ng==", "dev": true, "dependencies": { "undici-types": "~5.26.4" diff --git a/report-viewer/package.json b/report-viewer/package.json index b1d1d8a065..da4584f3f7 100644 --- a/report-viewer/package.json +++ b/report-viewer/package.json @@ -41,7 +41,7 @@ "@playwright/test": "^1.40.1", "@rushstack/eslint-patch": "^1.7.2", "@types/jsdom": "^21.1.6", - "@types/node": "^18.19.15", + "@types/node": "^18.19.17", "@vitejs/plugin-vue": "^5.0.4", "@vue/eslint-config-prettier": "^9.0.0", "@vue/eslint-config-typescript": "^12.0.0", From 0a18b69365f761f523d4da589db211d8cd21a2c1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Feb 2024 17:04:23 +0100 Subject: [PATCH 006/228] Dependency(deps-dev): Bump vitest from 1.2.2 to 1.3.1 in /report-viewer (#1588) Bumps [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) from 1.2.2 to 1.3.1. - [Release notes](https://github.com/vitest-dev/vitest/releases) - [Commits](https://github.com/vitest-dev/vitest/commits/v1.3.1/packages/vitest) --- updated-dependencies: - dependency-name: vitest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- report-viewer/package-lock.json | 89 +++++++++++++++++---------------- report-viewer/package.json | 2 +- 2 files changed, 48 insertions(+), 43 deletions(-) diff --git a/report-viewer/package-lock.json b/report-viewer/package-lock.json index 1f1c51052a..2602644928 100644 --- a/report-viewer/package-lock.json +++ b/report-viewer/package-lock.json @@ -49,7 +49,7 @@ "tailwindcss": "^3.4.1", "typescript": "^5.3.3", "vite": "^5.1.1", - "vitest": "^1.2.2", + "vitest": "^1.3.1", "vue-tsc": "^1.8.27" } }, @@ -1283,13 +1283,13 @@ } }, "node_modules/@vitest/expect": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.2.2.tgz", - "integrity": "sha512-3jpcdPAD7LwHUUiT2pZTj2U82I2Tcgg2oVPvKxhn6mDI2On6tfvPQTjAI4628GUGDZrCm4Zna9iQHm5cEexOAg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.3.1.tgz", + "integrity": "sha512-xofQFwIzfdmLLlHa6ag0dPV8YsnKOCP1KdAeVVh34vSjN2dcUiXYCD9htu/9eM7t8Xln4v03U9HLxLpPlsXdZw==", "dev": true, "dependencies": { - "@vitest/spy": "1.2.2", - "@vitest/utils": "1.2.2", + "@vitest/spy": "1.3.1", + "@vitest/utils": "1.3.1", "chai": "^4.3.10" }, "funding": { @@ -1297,12 +1297,12 @@ } }, "node_modules/@vitest/runner": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.2.2.tgz", - "integrity": "sha512-JctG7QZ4LSDXr5CsUweFgcpEvrcxOV1Gft7uHrvkQ+fsAVylmWQvnaAr/HDp3LAH1fztGMQZugIheTWjaGzYIg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.3.1.tgz", + "integrity": "sha512-5FzF9c3jG/z5bgCnjr8j9LNq/9OxV2uEBAITOXfoe3rdZJTdO7jzThth7FXv/6b+kdY65tpRQB7WaKhNZwX+Kg==", "dev": true, "dependencies": { - "@vitest/utils": "1.2.2", + "@vitest/utils": "1.3.1", "p-limit": "^5.0.0", "pathe": "^1.1.1" }, @@ -1338,9 +1338,9 @@ } }, "node_modules/@vitest/snapshot": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.2.2.tgz", - "integrity": "sha512-SmGY4saEw1+bwE1th6S/cZmPxz/Q4JWsl7LvbQIky2tKE35US4gd0Mjzqfr84/4OD0tikGWaWdMja/nWL5NIPA==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.3.1.tgz", + "integrity": "sha512-EF++BZbt6RZmOlE3SuTPu/NfwBF6q4ABS37HHXzs2LUVPBLx2QoY/K0fKpRChSo8eLiuxcbCVfqKgx/dplCDuQ==", "dev": true, "dependencies": { "magic-string": "^0.30.5", @@ -1352,9 +1352,9 @@ } }, "node_modules/@vitest/spy": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.2.2.tgz", - "integrity": "sha512-k9Gcahssw8d7X3pSLq3e3XEu/0L78mUkCjivUqCQeXJm9clfXR/Td8+AP+VC1O6fKPIDLcHDTAmBOINVuv6+7g==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.3.1.tgz", + "integrity": "sha512-xAcW+S099ylC9VLU7eZfdT9myV67Nor9w9zhf0mGCYJSO+zM2839tOeROTdikOi/8Qeusffvxb/MyBSOja1Uig==", "dev": true, "dependencies": { "tinyspy": "^2.2.0" @@ -1364,9 +1364,9 @@ } }, "node_modules/@vitest/utils": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.2.2.tgz", - "integrity": "sha512-WKITBHLsBHlpjnDQahr+XK6RE7MiAsgrIkr0pGhQ9ygoxBfUeG0lUG5iLlzqjmKSlBv3+j5EGsriBzh+C3Tq9g==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.3.1.tgz", + "integrity": "sha512-d3Waie/299qqRyHTm2DjADeTaNdNSVsnwHPWrs20JMpjh6eiVq7ggggweO8rc4arhf6rRkWuHKwvxGvejUXZZQ==", "dev": true, "dependencies": { "diff-sequences": "^29.6.3", @@ -3976,6 +3976,12 @@ "node": ">=14" } }, + "node_modules/js-tokens": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-8.0.3.tgz", + "integrity": "sha512-UfJMcSJc+SEXEl9lH/VLHSZbThQyLpw1vLO1Lb+j4RWDvG3N2f7yj3PVQA3cmkTBNldJ9eFnM+xEXxHIXrYiJw==", + "dev": true + }, "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -6453,12 +6459,12 @@ } }, "node_modules/strip-literal": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-1.3.0.tgz", - "integrity": "sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-2.0.0.tgz", + "integrity": "sha512-f9vHgsCWBq2ugHAkGMiiYY+AYG0D/cbloKKg0nhaaaSNsujdGIpVXCNsrJpCKr5M0f4aI31mr13UjY6GAuXCKA==", "dev": true, "dependencies": { - "acorn": "^8.10.0" + "js-tokens": "^8.0.2" }, "funding": { "url": "https://github.com/sponsors/antfu" @@ -6630,9 +6636,9 @@ } }, "node_modules/tinyspy": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.0.tgz", - "integrity": "sha512-d2eda04AN/cPOR89F7Xv5bK/jrQEhmcLFe6HFldoeO9AJtps+fqEnh486vnT/8y4bw38pSyxDcTCAq+Ks2aJTg==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.1.tgz", + "integrity": "sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==", "dev": true, "engines": { "node": ">=14.0.0" @@ -6968,9 +6974,9 @@ } }, "node_modules/vite-node": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.2.2.tgz", - "integrity": "sha512-1as4rDTgVWJO3n1uHmUYqq7nsFgINQ9u+mRcXpjeOMJUmviqNKjcZB7UfRZrlM7MjYXMKpuWp5oGkjaFLnjawg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.3.1.tgz", + "integrity": "sha512-azbRrqRxlWTJEVbzInZCTchx0X69M/XPTCz4H+TLvlTcR/xH/3hkRqhOakT41fMJCMzXTu4UvegkZiEoJAWvng==", "dev": true, "dependencies": { "cac": "^6.7.14", @@ -7004,18 +7010,17 @@ } }, "node_modules/vitest": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.2.2.tgz", - "integrity": "sha512-d5Ouvrnms3GD9USIK36KG8OZ5bEvKEkITFtnGv56HFaSlbItJuYr7hv2Lkn903+AvRAgSixiamozUVfORUekjw==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.3.1.tgz", + "integrity": "sha512-/1QJqXs8YbCrfv/GPQ05wAZf2eakUPLPa18vkJAKE7RXOKfVHqMZZ1WlTjiwl6Gcn65M5vpNUB6EFLnEdRdEXQ==", "dev": true, "dependencies": { - "@vitest/expect": "1.2.2", - "@vitest/runner": "1.2.2", - "@vitest/snapshot": "1.2.2", - "@vitest/spy": "1.2.2", - "@vitest/utils": "1.2.2", + "@vitest/expect": "1.3.1", + "@vitest/runner": "1.3.1", + "@vitest/snapshot": "1.3.1", + "@vitest/spy": "1.3.1", + "@vitest/utils": "1.3.1", "acorn-walk": "^8.3.2", - "cac": "^6.7.14", "chai": "^4.3.10", "debug": "^4.3.4", "execa": "^8.0.1", @@ -7024,11 +7029,11 @@ "pathe": "^1.1.1", "picocolors": "^1.0.0", "std-env": "^3.5.0", - "strip-literal": "^1.3.0", + "strip-literal": "^2.0.0", "tinybench": "^2.5.1", "tinypool": "^0.8.2", "vite": "^5.0.0", - "vite-node": "1.2.2", + "vite-node": "1.3.1", "why-is-node-running": "^2.2.2" }, "bin": { @@ -7043,8 +7048,8 @@ "peerDependencies": { "@edge-runtime/vm": "*", "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "^1.0.0", - "@vitest/ui": "^1.0.0", + "@vitest/browser": "1.3.1", + "@vitest/ui": "1.3.1", "happy-dom": "*", "jsdom": "*" }, diff --git a/report-viewer/package.json b/report-viewer/package.json index da4584f3f7..b2eb8f20f5 100644 --- a/report-viewer/package.json +++ b/report-viewer/package.json @@ -60,7 +60,7 @@ "tailwindcss": "^3.4.1", "typescript": "^5.3.3", "vite": "^5.1.1", - "vitest": "^1.2.2", + "vitest": "^1.3.1", "vue-tsc": "^1.8.27" } } From f66bd0737533f26e0123bcd411adbafbe6fb794d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Feb 2024 17:24:30 +0100 Subject: [PATCH 007/228] Dependency(deps-dev): Bump vite from 5.1.1 to 5.1.4 in /report-viewer (#1599) Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.1.1 to 5.1.4. - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v5.1.4/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- report-viewer/package-lock.json | 8 ++++---- report-viewer/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/report-viewer/package-lock.json b/report-viewer/package-lock.json index 2602644928..7b3a9ee5fe 100644 --- a/report-viewer/package-lock.json +++ b/report-viewer/package-lock.json @@ -48,7 +48,7 @@ "prettier-plugin-tailwindcss": "^0.5.11", "tailwindcss": "^3.4.1", "typescript": "^5.3.3", - "vite": "^5.1.1", + "vite": "^5.1.4", "vitest": "^1.3.1", "vue-tsc": "^1.8.27" } @@ -6919,9 +6919,9 @@ } }, "node_modules/vite": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.1.1.tgz", - "integrity": "sha512-wclpAgY3F1tR7t9LL5CcHC41YPkQIpKUGeIuT8MdNwNZr6OqOTLs7JX5vIHAtzqLWXts0T+GDrh9pN2arneKqg==", + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.1.4.tgz", + "integrity": "sha512-n+MPqzq+d9nMVTKyewqw6kSt+R3CkvF9QAKY8obiQn8g1fwTscKxyfaYnC632HtBXAQGc1Yjomphwn1dtwGAHg==", "dev": true, "dependencies": { "esbuild": "^0.19.3", diff --git a/report-viewer/package.json b/report-viewer/package.json index b2eb8f20f5..2c808cde0d 100644 --- a/report-viewer/package.json +++ b/report-viewer/package.json @@ -59,7 +59,7 @@ "prettier-plugin-tailwindcss": "^0.5.11", "tailwindcss": "^3.4.1", "typescript": "^5.3.3", - "vite": "^5.1.1", + "vite": "^5.1.4", "vitest": "^1.3.1", "vue-tsc": "^1.8.27" } From 4d3d80ccedd305449b1298538c7b160ee64cb4db Mon Sep 17 00:00:00 2001 From: Alexander Milster Date: Thu, 22 Feb 2024 13:37:38 +0100 Subject: [PATCH 008/228] Rewritten the CollectedLogger --- .../de/jplag/cli/logger/CollectedLogger.java | 297 +++++------------- .../java/de/jplag/cli/logger/LogEntry.java | 15 + 2 files changed, 93 insertions(+), 219 deletions(-) create mode 100644 cli/src/main/java/de/jplag/cli/logger/LogEntry.java diff --git a/cli/src/main/java/de/jplag/cli/logger/CollectedLogger.java b/cli/src/main/java/de/jplag/cli/logger/CollectedLogger.java index 3be42c8cd7..44a69d8673 100644 --- a/cli/src/main/java/de/jplag/cli/logger/CollectedLogger.java +++ b/cli/src/main/java/de/jplag/cli/logger/CollectedLogger.java @@ -1,308 +1,167 @@ package de.jplag.cli.logger; +import org.slf4j.Marker; +import org.slf4j.event.Level; +import org.slf4j.helpers.AbstractLogger; +import org.slf4j.helpers.MessageFormatter; + import java.io.PrintStream; -import java.io.Serial; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.concurrent.ConcurrentLinkedDeque; -import org.slf4j.helpers.FormattingTuple; -import org.slf4j.helpers.MarkerIgnoringBase; -import org.slf4j.helpers.MessageFormatter; -import org.slf4j.spi.LocationAwareLogger; - -/** - * This logger is able to collect errors and print them at the end. Mainly adopted from org.slf4j.impl.SimpleLogger - * @author Dominik Fuchss - */ -public final class CollectedLogger extends MarkerIgnoringBase { - - @Serial - private static final long serialVersionUID = -1278670638921140275L; - - private static final int LOG_LEVEL_TRACE = LocationAwareLogger.TRACE_INT; - private static final int LOG_LEVEL_DEBUG = LocationAwareLogger.DEBUG_INT; - private static final int LOG_LEVEL_INFO = LocationAwareLogger.INFO_INT; - private static final int LOG_LEVEL_WARN = LocationAwareLogger.WARN_INT; - private static final int LOG_LEVEL_ERROR = LocationAwareLogger.ERROR_INT; +public class CollectedLogger extends AbstractLogger { + private static final Level LOG_LEVEL_TRACE = Level.TRACE; + private static final Level LOG_LEVEL_DEBUG = Level.DEBUG; + private static final Level LOG_LEVEL_INFO = Level.INFO; + private static final Level LOG_LEVEL_WARN = Level.WARN; + private static final Level LOG_LEVEL_ERROR = Level.ERROR; /** * The default log level that shall be used for external libraries (like Stanford Core NLP) */ - private static final int LOG_LEVEL_FOR_EXTERNAL_LIBRARIES = LOG_LEVEL_ERROR; + private static final Level LOG_LEVEL_FOR_EXTERNAL_LIBRARIES = LOG_LEVEL_ERROR; - private static final int CURRENT_LOG_LEVEL = LOG_LEVEL_INFO; + private static final Level CURRENT_LOG_LEVEL = LOG_LEVEL_INFO; - /** - * The short name of this simple log instance - */ - private transient String shortLogName = null; + private static final int MAXIMUM_MESSAGE_LENGTH = 32; + + private static final PrintStream TARGET_STREAM = System.out; /** * Indicator whether finalization is in progress. + * * @see #printAllErrorsForLogger() */ private transient boolean isFinalizing = false; private final transient SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd-hh:mm:ss_SSS"); - private final ConcurrentLinkedDeque> allErrors = new ConcurrentLinkedDeque<>(); + private final ConcurrentLinkedDeque allErrors = new ConcurrentLinkedDeque<>(); - CollectedLogger(String name) { + public CollectedLogger(String name) { this.name = name; } - private void log(int level, String message, Throwable throwable) { - log(level, message, throwable, null); - } - - private void log(int level, String message, Throwable throwable, Date timeOfError) { - if (!isLevelEnabled(level)) { - return; - } + @Override + protected void handleNormalizedLoggingCall(Level level, Marker marker, String format, Object[] args, Throwable cause) { + String logMessage = prepareFormattedMessage(format, args); + LogEntry entry = new LogEntry(logMessage, cause, new Date(), level); if (level == LOG_LEVEL_ERROR && !isFinalizing) { - // Buffer errors for the final output - allErrors.add(new Triple<>(message, throwable, new Date())); - return; - } - - StringBuilder builder = new StringBuilder(32); - - // Append date-time - builder.append(dateFormat.format(timeOfError == null ? new Date() : timeOfError)).append(' '); - - // Append current Level - builder.append('[').append(renderLevel(level)).append(']').append(' '); - - // Append the name of the log instance - if (shortLogName == null) { - shortLogName = computeShortName(); + allErrors.add(entry); + } else { + printLogEntry(entry); } - builder.append(shortLogName).append(" - "); - // Append the message - builder.append(message); - - write(builder, throwable); } - void printAllErrorsForLogger() { - this.isFinalizing = true; - // Copy errors to prevent infinite recursion - var errors = new ArrayList<>(this.allErrors); - if (errors.isEmpty()) { - return; + private String prepareFormattedMessage(String format, Object[] args) { + if (args == null) { + return format; } - this.allErrors.removeAll(errors); - - info("Summary of all Errors:"); - errors.forEach(error -> log(LOG_LEVEL_ERROR, error.first(), error.second(), error.third())); - isFinalizing = false; + return MessageFormatter.arrayFormat(format, args).getMessage(); } - @SuppressWarnings("java:S106") - void write(StringBuilder buf, Throwable throwable) { - PrintStream targetStream = System.out; - - targetStream.println(buf.toString()); - writeThrowable(throwable, targetStream); - targetStream.flush(); - } + private void printLogEntry(LogEntry entry) { + StringBuilder output = prepareLogOutput(entry); - private void writeThrowable(Throwable throwable, PrintStream targetStream) { - if (throwable != null) { - throwable.printStackTrace(targetStream); + TARGET_STREAM.println(output); + if (entry.cause() != null) { + entry.cause().printStackTrace(TARGET_STREAM); } + TARGET_STREAM.flush(); } - private String computeShortName() { - return name.substring(name.lastIndexOf(".") + 1); - } - - private boolean isLevelEnabled(int logLevel) { - return logLevel >= (isJPlagLog() ? CURRENT_LOG_LEVEL : LOG_LEVEL_FOR_EXTERNAL_LIBRARIES); + private StringBuilder prepareLogOutput(LogEntry entry) { + StringBuilder outputBuilder = new StringBuilder(MAXIMUM_MESSAGE_LENGTH); + outputBuilder.append(dateFormat.format(entry.timeOfLog())).append(' '); + outputBuilder.append('[').append(entry.logLevel().name()).append("] "); + outputBuilder.append(computeShortName()).append(" - "); + outputBuilder.append(entry.message()); + return outputBuilder; } - private boolean isJPlagLog() { - return this.name.startsWith("de.jplag."); - } + void printAllErrorsForLogger() { + this.isFinalizing = true; + ArrayList errors = new ArrayList<>(this.allErrors); + + if(!errors.isEmpty()) { + info("Summary of all errors:"); + this.allErrors.removeAll(errors); + for (LogEntry errorEntry : errors) { + printLogEntry(errorEntry); + } + } - private String renderLevel(int level) { - return switch (level) { - case LOG_LEVEL_TRACE -> "TRACE"; - case LOG_LEVEL_DEBUG -> "DEBUG"; - case LOG_LEVEL_INFO -> "INFO"; - case LOG_LEVEL_WARN -> "WARN"; - case LOG_LEVEL_ERROR -> "ERROR"; - default -> throw new IllegalStateException("Unrecognized level [" + level + "]"); - }; + this.isFinalizing = false; } @Override public boolean isTraceEnabled() { - return isLevelEnabled(LOG_LEVEL_TRACE); - } - - @Override - public void trace(String message) { - log(LOG_LEVEL_TRACE, message, null); - } - - @Override - public void trace(String format, Object param1) { - formatAndLog(LOG_LEVEL_TRACE, format, param1, null); - } - - @Override - public void trace(String format, Object param1, Object param2) { - formatAndLog(LOG_LEVEL_TRACE, format, param1, param2); - } - - @Override - public void trace(String format, Object... argArray) { - formatAndLog(LOG_LEVEL_TRACE, format, argArray); + return isLogLevelEnabled(LOG_LEVEL_TRACE); } @Override - public void trace(String message, Throwable t) { - log(LOG_LEVEL_TRACE, message, t); + public boolean isTraceEnabled(Marker marker) { + return isTraceEnabled(); } @Override public boolean isDebugEnabled() { - return isLevelEnabled(LOG_LEVEL_DEBUG); + return isLogLevelEnabled(LOG_LEVEL_DEBUG); } @Override - public void debug(String message) { - log(LOG_LEVEL_DEBUG, message, null); - } - - @Override - public void debug(String format, Object param1) { - formatAndLog(LOG_LEVEL_DEBUG, format, param1, null); - } - - @Override - public void debug(String format, Object param1, Object param2) { - formatAndLog(LOG_LEVEL_DEBUG, format, param1, param2); - } - - @Override - public void debug(String format, Object... argArray) { - formatAndLog(LOG_LEVEL_DEBUG, format, argArray); - } - - @Override - public void debug(String message, Throwable throwable) { - log(LOG_LEVEL_DEBUG, message, throwable); + public boolean isDebugEnabled(Marker marker) { + return isDebugEnabled(); } @Override public boolean isInfoEnabled() { - return isLevelEnabled(LOG_LEVEL_INFO); - } - - @Override - public void info(String message) { - log(LOG_LEVEL_INFO, message, null); - } - - @Override - public void info(String format, Object arg) { - formatAndLog(LOG_LEVEL_INFO, format, arg, null); - } - - @Override - public void info(String format, Object arg1, Object arg2) { - formatAndLog(LOG_LEVEL_INFO, format, arg1, arg2); - } - - @Override - public void info(String format, Object... argArray) { - formatAndLog(LOG_LEVEL_INFO, format, argArray); + return isLogLevelEnabled(LOG_LEVEL_INFO); } @Override - public void info(String message, Throwable throwable) { - log(LOG_LEVEL_INFO, message, throwable); + public boolean isInfoEnabled(Marker marker) { + return isInfoEnabled(); } @Override public boolean isWarnEnabled() { - return isLevelEnabled(LOG_LEVEL_WARN); + return isLogLevelEnabled(LOG_LEVEL_WARN); } @Override - public void warn(String message) { - log(LOG_LEVEL_WARN, message, null); - } - - @Override - public void warn(String format, Object arg) { - formatAndLog(LOG_LEVEL_WARN, format, arg, null); - } - - @Override - public void warn(String format, Object arg1, Object arg2) { - formatAndLog(LOG_LEVEL_WARN, format, arg1, arg2); - } - - @Override - public void warn(String format, Object... argArray) { - formatAndLog(LOG_LEVEL_WARN, format, argArray); - } - - @Override - public void warn(String message, Throwable throwable) { - log(LOG_LEVEL_WARN, message, throwable); + public boolean isWarnEnabled(Marker marker) { + return isWarnEnabled(); } @Override public boolean isErrorEnabled() { - return isLevelEnabled(LOG_LEVEL_ERROR); + return isLogLevelEnabled(LOG_LEVEL_ERROR); } @Override - public void error(String message) { - log(LOG_LEVEL_ERROR, message, null); + public boolean isErrorEnabled(Marker marker) { + return isErrorEnabled(); } - @Override - public void error(String format, Object arg) { - formatAndLog(LOG_LEVEL_ERROR, format, arg, null); + private boolean isLogLevelEnabled(Level logLevel) { + return logLevel.toInt() >= (isJPlagLog() ? CURRENT_LOG_LEVEL.toInt() : LOG_LEVEL_FOR_EXTERNAL_LIBRARIES.toInt()); } - @Override - public void error(String format, Object arg1, Object arg2) { - formatAndLog(LOG_LEVEL_ERROR, format, arg1, arg2); + private boolean isJPlagLog() { + return this.name.startsWith("de.jplag."); } - @Override - public void error(String format, Object... argArray) { - formatAndLog(LOG_LEVEL_ERROR, format, argArray); + private String computeShortName() { + return name.substring(name.lastIndexOf(".") + 1); } @Override - public void error(String message, Throwable throwable) { - log(LOG_LEVEL_ERROR, message, throwable); - } - - private void formatAndLog(int level, String format, Object arg1, Object arg2) { - if (!isLevelEnabled(level)) { - return; - } - FormattingTuple formattingTuple = MessageFormatter.format(format, arg1, arg2); - log(level, formattingTuple.getMessage(), formattingTuple.getThrowable()); - } - - private void formatAndLog(int level, String format, Object... arguments) { - if (!isLevelEnabled(level)) { - return; - } - FormattingTuple formattingTuple = MessageFormatter.arrayFormat(format, arguments); - log(level, formattingTuple.getMessage(), formattingTuple.getThrowable()); + protected String getFullyQualifiedCallerName() { + return null; //does not seem to be used by anything, but is required by SLF4J } } diff --git a/cli/src/main/java/de/jplag/cli/logger/LogEntry.java b/cli/src/main/java/de/jplag/cli/logger/LogEntry.java new file mode 100644 index 0000000000..6b91c5af3c --- /dev/null +++ b/cli/src/main/java/de/jplag/cli/logger/LogEntry.java @@ -0,0 +1,15 @@ +package de.jplag.cli.logger; + +import org.slf4j.event.Level; + +import java.util.Date; + +/** + * Holds a log entry for later usage + * @param message The message of the log + * @param cause The cause of the log + * @param timeOfLog The time of the log + * @param logLevel The level of the log entry + */ +public record LogEntry(String message, Throwable cause, Date timeOfLog, Level logLevel) { +} From 6a8a4d1491380955643363c3fa7d129670d83cdf Mon Sep 17 00:00:00 2001 From: Alexander Milster Date: Thu, 22 Feb 2024 13:37:50 +0100 Subject: [PATCH 009/228] Various minor refactorings --- cli/src/main/java/de/jplag/cli/CLI.java | 7 +++++-- .../main/java/de/jplag/cli/OutputFileGenerator.java | 3 ++- .../java/de/jplag/cli/{ => options}/CliOptions.java | 4 +++- .../java/de/jplag/cli/{ => options}/JPlagMode.java | 2 +- .../de/jplag/cli/{ => options}/LanguageCandidates.java | 2 +- .../de/jplag/cli/{ => options}/LanguageConverter.java | 2 +- .../de/jplag/cli/{ => options}/LanguageLoader.java | 2 +- .../java/de/jplag/cli/{ => picocli}/CustomHelp.java | 2 +- .../java/de/jplag/cli/{ => picocli}/HelpFactory.java | 2 +- .../de/jplag/cli/{ => picocli}/ParamLabelRenderer.java | 2 +- .../main/java/de/jplag/cli/server/ReportViewer.java | 2 +- cli/src/main/java/de/jplag/cli/server/Routing.java | 4 ++-- cli/src/test/java/de/jplag/cli/ArgumentBuilder.java | 2 +- cli/src/test/java/de/jplag/cli/CustomHelpTests.java | 6 ++++-- cli/src/test/java/de/jplag/cli/LanguageTest.java | 2 ++ .../test/java/de/jplag/cli/ParamLabelRendererTest.java | 1 + .../test/java/de/jplag/cli/server/RoutingTreeTest.java | 10 ++-------- .../de/jplag/endtoend/helper/LanguageDeserializer.java | 2 +- 18 files changed, 31 insertions(+), 26 deletions(-) rename cli/src/main/java/de/jplag/cli/{ => options}/CliOptions.java (98%) rename cli/src/main/java/de/jplag/cli/{ => options}/JPlagMode.java (91%) rename cli/src/main/java/de/jplag/cli/{ => options}/LanguageCandidates.java (92%) rename cli/src/main/java/de/jplag/cli/{ => options}/LanguageConverter.java (91%) rename cli/src/main/java/de/jplag/cli/{ => options}/LanguageLoader.java (99%) rename cli/src/main/java/de/jplag/cli/{ => picocli}/CustomHelp.java (96%) rename cli/src/main/java/de/jplag/cli/{ => picocli}/HelpFactory.java (92%) rename cli/src/main/java/de/jplag/cli/{ => picocli}/ParamLabelRenderer.java (98%) diff --git a/cli/src/main/java/de/jplag/cli/CLI.java b/cli/src/main/java/de/jplag/cli/CLI.java index ac79e68c01..afb4ffbac2 100644 --- a/cli/src/main/java/de/jplag/cli/CLI.java +++ b/cli/src/main/java/de/jplag/cli/CLI.java @@ -17,6 +17,9 @@ import java.util.Set; import java.util.stream.Collectors; +import de.jplag.cli.options.CliOptions; +import de.jplag.cli.options.LanguageLoader; +import de.jplag.cli.picocli.HelpFactory; import org.slf4j.ILoggerFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -66,7 +69,7 @@ public final class CLI { private static final String IMPOSSIBLE_EXCEPTION = "This should not have happened." + " Please create an issue on github (https://github.com/jplag/JPlag/issues) with the entire output."; - private static final String UNKOWN_LANGAUGE_EXCEPTION = "Language %s does not exists. Available languages are: %s"; + private static final String UNKNOWN_LANGUAGE_EXCEPTION = "Language %s does not exists. Available languages are: %s"; private static final String DESCRIPTION_PATTERN = "%nJPlag - %s%n%s%n%n"; @@ -180,7 +183,7 @@ public ParseResult parseOptions(String... args) throws CliException { return result; } catch (CommandLine.ParameterException e) { if (e.getArgSpec() != null && e.getArgSpec().isOption() && Arrays.asList(((OptionSpec) e.getArgSpec()).names()).contains("-l")) { - throw new CliException(String.format(UNKOWN_LANGAUGE_EXCEPTION, e.getValue(), + throw new CliException(String.format(UNKNOWN_LANGUAGE_EXCEPTION, e.getValue(), String.join(", ", LanguageLoader.getAllAvailableLanguageIdentifiers()))); } throw new CliException("Error during parsing", e); diff --git a/cli/src/main/java/de/jplag/cli/OutputFileGenerator.java b/cli/src/main/java/de/jplag/cli/OutputFileGenerator.java index 028361346f..5c42ff2df4 100644 --- a/cli/src/main/java/de/jplag/cli/OutputFileGenerator.java +++ b/cli/src/main/java/de/jplag/cli/OutputFileGenerator.java @@ -3,6 +3,7 @@ import java.io.File; import java.io.IOException; +import de.jplag.cli.options.CliOptions; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -17,7 +18,7 @@ private OutputFileGenerator() { } /** - * Exports the given result as csvs, if the csvExport is activated in the options. Both a full and an anonymized version + * Exports the given result as CSVs, if the csvExport is activated in the options. Both a full and an anonymized version * will be written. * @param result The result to export * @param outputRoot The root folder for the output diff --git a/cli/src/main/java/de/jplag/cli/CliOptions.java b/cli/src/main/java/de/jplag/cli/options/CliOptions.java similarity index 98% rename from cli/src/main/java/de/jplag/cli/CliOptions.java rename to cli/src/main/java/de/jplag/cli/options/CliOptions.java index 384a2d41ce..b1caeffbce 100644 --- a/cli/src/main/java/de/jplag/cli/CliOptions.java +++ b/cli/src/main/java/de/jplag/cli/options/CliOptions.java @@ -1,4 +1,4 @@ -package de.jplag.cli; +package de.jplag.cli.options; import java.io.File; @@ -16,6 +16,7 @@ import picocli.CommandLine.Option; import picocli.CommandLine.Parameters; +@SuppressWarnings({"CanBeFinal", "unused"}) @CommandLine.Command(name = "jplag", description = "", usageHelpAutoWidth = true, abbreviateSynopsis = true) public class CliOptions implements Runnable { public static final Language defaultLanguage = new JavaLanguage(); @@ -108,6 +109,7 @@ public static class Clustering { @ArgGroup public ClusteringEnabled enabled = new ClusteringEnabled(); + @SuppressWarnings("CanBeFinal") public static class ClusteringEnabled { @Option(names = {"--cluster-alg", "--cluster-algorithm"}, description = "Specifies the clustering algorithm (default: ${DEFAULT-VALUE}).") public ClusteringAlgorithm algorithm = new ClusteringOptions().algorithm(); diff --git a/cli/src/main/java/de/jplag/cli/JPlagMode.java b/cli/src/main/java/de/jplag/cli/options/JPlagMode.java similarity index 91% rename from cli/src/main/java/de/jplag/cli/JPlagMode.java rename to cli/src/main/java/de/jplag/cli/options/JPlagMode.java index 402a18b58b..8d1607d46b 100644 --- a/cli/src/main/java/de/jplag/cli/JPlagMode.java +++ b/cli/src/main/java/de/jplag/cli/options/JPlagMode.java @@ -1,4 +1,4 @@ -package de.jplag.cli; +package de.jplag.cli.options; /** * The mode JPlag runs in. This influences which steps JPlag will execute. diff --git a/cli/src/main/java/de/jplag/cli/LanguageCandidates.java b/cli/src/main/java/de/jplag/cli/options/LanguageCandidates.java similarity index 92% rename from cli/src/main/java/de/jplag/cli/LanguageCandidates.java rename to cli/src/main/java/de/jplag/cli/options/LanguageCandidates.java index 715d504ea3..e1c764b8f5 100644 --- a/cli/src/main/java/de/jplag/cli/LanguageCandidates.java +++ b/cli/src/main/java/de/jplag/cli/options/LanguageCandidates.java @@ -1,4 +1,4 @@ -package de.jplag.cli; +package de.jplag.cli.options; import java.util.ArrayList; diff --git a/cli/src/main/java/de/jplag/cli/LanguageConverter.java b/cli/src/main/java/de/jplag/cli/options/LanguageConverter.java similarity index 91% rename from cli/src/main/java/de/jplag/cli/LanguageConverter.java rename to cli/src/main/java/de/jplag/cli/options/LanguageConverter.java index 0a2523b952..9f92ec9449 100644 --- a/cli/src/main/java/de/jplag/cli/LanguageConverter.java +++ b/cli/src/main/java/de/jplag/cli/options/LanguageConverter.java @@ -1,4 +1,4 @@ -package de.jplag.cli; +package de.jplag.cli.options; import de.jplag.Language; diff --git a/cli/src/main/java/de/jplag/cli/LanguageLoader.java b/cli/src/main/java/de/jplag/cli/options/LanguageLoader.java similarity index 99% rename from cli/src/main/java/de/jplag/cli/LanguageLoader.java rename to cli/src/main/java/de/jplag/cli/options/LanguageLoader.java index 2ee1c815ba..4082476381 100644 --- a/cli/src/main/java/de/jplag/cli/LanguageLoader.java +++ b/cli/src/main/java/de/jplag/cli/options/LanguageLoader.java @@ -1,4 +1,4 @@ -package de.jplag.cli; +package de.jplag.cli.options; import java.util.Collections; import java.util.Map; diff --git a/cli/src/main/java/de/jplag/cli/CustomHelp.java b/cli/src/main/java/de/jplag/cli/picocli/CustomHelp.java similarity index 96% rename from cli/src/main/java/de/jplag/cli/CustomHelp.java rename to cli/src/main/java/de/jplag/cli/picocli/CustomHelp.java index 368f358cec..9926486971 100644 --- a/cli/src/main/java/de/jplag/cli/CustomHelp.java +++ b/cli/src/main/java/de/jplag/cli/picocli/CustomHelp.java @@ -1,4 +1,4 @@ -package de.jplag.cli; +package de.jplag.cli.picocli; import picocli.CommandLine; diff --git a/cli/src/main/java/de/jplag/cli/HelpFactory.java b/cli/src/main/java/de/jplag/cli/picocli/HelpFactory.java similarity index 92% rename from cli/src/main/java/de/jplag/cli/HelpFactory.java rename to cli/src/main/java/de/jplag/cli/picocli/HelpFactory.java index 53aa208b77..a587f38038 100644 --- a/cli/src/main/java/de/jplag/cli/HelpFactory.java +++ b/cli/src/main/java/de/jplag/cli/picocli/HelpFactory.java @@ -1,4 +1,4 @@ -package de.jplag.cli; +package de.jplag.cli.picocli; import picocli.CommandLine; diff --git a/cli/src/main/java/de/jplag/cli/ParamLabelRenderer.java b/cli/src/main/java/de/jplag/cli/picocli/ParamLabelRenderer.java similarity index 98% rename from cli/src/main/java/de/jplag/cli/ParamLabelRenderer.java rename to cli/src/main/java/de/jplag/cli/picocli/ParamLabelRenderer.java index 2d815af309..bd23f8735c 100644 --- a/cli/src/main/java/de/jplag/cli/ParamLabelRenderer.java +++ b/cli/src/main/java/de/jplag/cli/picocli/ParamLabelRenderer.java @@ -1,4 +1,4 @@ -package de.jplag.cli; +package de.jplag.cli.picocli; import java.util.Arrays; import java.util.List; diff --git a/cli/src/main/java/de/jplag/cli/server/ReportViewer.java b/cli/src/main/java/de/jplag/cli/server/ReportViewer.java index 6e861c9266..b571be8eca 100644 --- a/cli/src/main/java/de/jplag/cli/server/ReportViewer.java +++ b/cli/src/main/java/de/jplag/cli/server/ReportViewer.java @@ -89,7 +89,7 @@ public void stop() { /** * Do not call manually. Called by the running web server. - * @param exchange The http reqest + * @param exchange The http request * @throws IOException If the IO handling goes wrong */ @Override diff --git a/cli/src/main/java/de/jplag/cli/server/Routing.java b/cli/src/main/java/de/jplag/cli/server/Routing.java index a6152a031e..e0a001dbf7 100644 --- a/cli/src/main/java/de/jplag/cli/server/Routing.java +++ b/cli/src/main/java/de/jplag/cli/server/Routing.java @@ -3,7 +3,7 @@ import com.sun.net.httpserver.HttpExchange; /** - * Handles the data for a url prefix. + * Handles the data for an url prefix. */ public interface Routing { /** @@ -15,7 +15,7 @@ default HttpRequestMethod[] allowedMethods() { /** * Gets the data for the given url - * @param subPath The remaining suffix of the url, that is not jet interpreted + * @param subPath The remaining suffix of the url, that is not yet interpreted * @param request The original http request * @param viewer The current report viewer * @return The data to respond with diff --git a/cli/src/test/java/de/jplag/cli/ArgumentBuilder.java b/cli/src/test/java/de/jplag/cli/ArgumentBuilder.java index b5503791b2..49848a96b8 100644 --- a/cli/src/test/java/de/jplag/cli/ArgumentBuilder.java +++ b/cli/src/test/java/de/jplag/cli/ArgumentBuilder.java @@ -138,7 +138,7 @@ public ArgumentBuilder minTokens(int count) { } /** - * Sets the similarity threshold as a string, so invalid values can be configures + * Sets the similarity threshold as a string, so invalid values can be configured * @param value The value * @return self reference */ diff --git a/cli/src/test/java/de/jplag/cli/CustomHelpTests.java b/cli/src/test/java/de/jplag/cli/CustomHelpTests.java index 3abde75055..ac3d37b861 100644 --- a/cli/src/test/java/de/jplag/cli/CustomHelpTests.java +++ b/cli/src/test/java/de/jplag/cli/CustomHelpTests.java @@ -1,5 +1,8 @@ package de.jplag.cli; +import de.jplag.cli.picocli.CustomHelp; +import de.jplag.cli.picocli.HelpFactory; +import de.jplag.cli.picocli.ParamLabelRenderer; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -26,7 +29,6 @@ void setup() { */ @Test void testReturnsCustomRenderer() { - Assertions.assertTrue(this.help.parameterLabelRenderer() instanceof ParamLabelRenderer, - "The custom help object returned the wrong ParamLabelRenderer type."); + Assertions.assertInstanceOf(ParamLabelRenderer.class, this.help.parameterLabelRenderer(), "The custom help object returned the wrong ParamLabelRenderer type."); } } diff --git a/cli/src/test/java/de/jplag/cli/LanguageTest.java b/cli/src/test/java/de/jplag/cli/LanguageTest.java index 6561c8034c..167faeae27 100644 --- a/cli/src/test/java/de/jplag/cli/LanguageTest.java +++ b/cli/src/test/java/de/jplag/cli/LanguageTest.java @@ -5,6 +5,8 @@ import java.util.Arrays; import java.util.List; +import de.jplag.cli.options.CliOptions; +import de.jplag.cli.options.LanguageLoader; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/cli/src/test/java/de/jplag/cli/ParamLabelRendererTest.java b/cli/src/test/java/de/jplag/cli/ParamLabelRendererTest.java index f10a2d3502..7348f92376 100644 --- a/cli/src/test/java/de/jplag/cli/ParamLabelRendererTest.java +++ b/cli/src/test/java/de/jplag/cli/ParamLabelRendererTest.java @@ -2,6 +2,7 @@ import java.util.List; +import de.jplag.cli.picocli.ParamLabelRenderer; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/cli/src/test/java/de/jplag/cli/server/RoutingTreeTest.java b/cli/src/test/java/de/jplag/cli/server/RoutingTreeTest.java index 318c00db22..dc0bf86a70 100644 --- a/cli/src/test/java/de/jplag/cli/server/RoutingTreeTest.java +++ b/cli/src/test/java/de/jplag/cli/server/RoutingTreeTest.java @@ -54,7 +54,7 @@ void testPartialPathRoute() { } @Test - void testPartialPathRouteWithSubpath() { + void testPartialPathRouteWithSubPath() { RoutingTree routingTree = new RoutingTree(); routingTree.insertRouting("/path/", new TestRouting("/path/")); routingTree.insertRouting("/path/subPath/a.html", new TestRouting("")); @@ -65,13 +65,7 @@ void testPartialPathRouteWithSubpath() { assertEquals("/path/", ((TestRouting) result.getRight()).path); } - private static class TestRouting implements Routing { - private final String path; - - public TestRouting(String path) { - this.path = path; - } - + private record TestRouting(String path) implements Routing { @Override public ResponseData fetchData(RoutingPath subPath, HttpExchange request, ReportViewer viewer) { return null; diff --git a/endtoend-testing/src/main/java/de/jplag/endtoend/helper/LanguageDeserializer.java b/endtoend-testing/src/main/java/de/jplag/endtoend/helper/LanguageDeserializer.java index 07848b72e7..22e231eac9 100644 --- a/endtoend-testing/src/main/java/de/jplag/endtoend/helper/LanguageDeserializer.java +++ b/endtoend-testing/src/main/java/de/jplag/endtoend/helper/LanguageDeserializer.java @@ -3,7 +3,7 @@ import java.io.IOException; import de.jplag.Language; -import de.jplag.cli.LanguageLoader; +import de.jplag.cli.options.LanguageLoader; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; From 3a76c2574036d146e7b7c3f5c9e3bde6c19ffb1e Mon Sep 17 00:00:00 2001 From: Alexander Milster Date: Fri, 23 Feb 2024 09:49:21 +0100 Subject: [PATCH 010/228] Split up the CLI class. --- cli/src/main/java/de/jplag/cli/CLI.java | 313 +++++------------- .../de/jplag/cli/JPlagOptionsBuilder.java | 97 ++++++ .../main/java/de/jplag/cli/JPlagRunner.java | 59 ++++ .../de/jplag/cli/OutputFileGenerator.java | 55 ++- .../de/jplag/cli/picocli/CliInputHandler.java | 168 ++++++++++ .../jplag/cli/CommandLineInterfaceTest.java | 8 +- 6 files changed, 444 insertions(+), 256 deletions(-) create mode 100644 cli/src/main/java/de/jplag/cli/JPlagOptionsBuilder.java create mode 100644 cli/src/main/java/de/jplag/cli/JPlagRunner.java create mode 100644 cli/src/main/java/de/jplag/cli/picocli/CliInputHandler.java diff --git a/cli/src/main/java/de/jplag/cli/CLI.java b/cli/src/main/java/de/jplag/cli/CLI.java index afb4ffbac2..ad8aeda143 100644 --- a/cli/src/main/java/de/jplag/cli/CLI.java +++ b/cli/src/main/java/de/jplag/cli/CLI.java @@ -1,198 +1,120 @@ package de.jplag.cli; -import static picocli.CommandLine.Model.UsageMessageSpec.SECTION_KEY_DESCRIPTION_HEADING; -import static picocli.CommandLine.Model.UsageMessageSpec.SECTION_KEY_OPTION_LIST; -import static picocli.CommandLine.Model.UsageMessageSpec.SECTION_KEY_SYNOPSIS; - -import java.awt.Desktop; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.net.URI; -import java.security.SecureRandom; -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; -import java.util.Random; -import java.util.Set; -import java.util.stream.Collectors; - -import de.jplag.cli.options.CliOptions; -import de.jplag.cli.options.LanguageLoader; -import de.jplag.cli.picocli.HelpFactory; -import org.slf4j.ILoggerFactory; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import de.jplag.JPlag; import de.jplag.JPlagResult; -import de.jplag.Language; import de.jplag.cli.logger.CollectedLoggerFactory; import de.jplag.cli.logger.TongfeiProgressBarProvider; -import de.jplag.cli.server.ReportViewer; -import de.jplag.clustering.ClusteringOptions; -import de.jplag.clustering.Preprocessing; +import de.jplag.cli.picocli.CliInputHandler; import de.jplag.exceptions.ExitException; import de.jplag.logging.ProgressBarLogger; -import de.jplag.merging.MergingOptions; import de.jplag.options.JPlagOptions; -import de.jplag.options.LanguageOption; -import de.jplag.options.LanguageOptions; -import de.jplag.reporting.reportobject.ReportObjectFactory; +import org.slf4j.ILoggerFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; -import picocli.CommandLine; -import picocli.CommandLine.Model.CommandSpec; -import picocli.CommandLine.Model.OptionSpec; -import picocli.CommandLine.ParseResult; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; /** * Command line interface class, allows using via command line. + * * @see CLI#main(String[]) */ public final class CLI { - private static final Logger logger = LoggerFactory.getLogger(CLI.class); - private static final Random RANDOM = new SecureRandom(); - - private static final String CREDITS = "Created by IPD Tichy, Guido Malpohl, and others. Maintained by Timur Saglam and Sebastian Hahner. Logo by Sandro Koch."; - - private static final String[] DESCRIPTIONS = {"Detecting Software Plagiarism", "Software-Archaeological Playground", "Since 1996", - "Scientifically Published", "Maintained by SDQ", "RIP Structure and Table", "What else?", "You have been warned!", "Since Java 1.0", - "More Abstract than Tree", "Students Nightmare", "No, changing variable names does not work...", "The tech is out there!", - "Developed by plagiarism experts.", "State of the Art Obfuscation Resilience", "www.helmholtz.software/software/jplag"}; + private static final String DEFAULT_FILE_ENDING = ".zip"; - private static final String OPTION_LIST_HEADING = "Parameter descriptions: "; + private final JPlagRunner runner; + private final CliInputHandler inputHandler; + private final OutputFileGenerator outputFileGenerator; - private final CommandLine commandLine; - private final CliOptions options; + /** + * Creates a cli. + * + * @param runner The way to run JPlag + * @param args The command line arguments + */ + public CLI(JPlagRunner runner, OutputFileGenerator outputFileGenerator, String[] args) { + this.runner = runner; + this.outputFileGenerator = outputFileGenerator; + this.inputHandler = new CliInputHandler(args); + } - private static final String IMPOSSIBLE_EXCEPTION = "This should not have happened." - + " Please create an issue on github (https://github.com/jplag/JPlag/issues) with the entire output."; - private static final String UNKNOWN_LANGUAGE_EXCEPTION = "Language %s does not exists. Available languages are: %s"; + /** + * Executes the cli + * + * @throws ExitException If anything on the side of JPlag goes wrong + * @throws IOException If any files did not work + */ + public void executeCli() throws ExitException, IOException { + logger.debug("Your version of JPlag is {}", JPlag.JPLAG_VERSION); - private static final String DESCRIPTION_PATTERN = "%nJPlag - %s%n%s%n%n"; + if (!this.inputHandler.parse()) { + ProgressBarLogger.setProgressBarProvider(new TongfeiProgressBarProvider()); - private static final String DEFAULT_FILE_ENDING = ".zip"; + switch (this.inputHandler.getCliOptions().mode) { + case RUN -> runJPlag(); + case VIEW -> runViewer(null); + case RUN_AND_VIEW -> runViewer(runJPlag()); + } + } + } /** - * Main class for using JPlag via the CLI. - * @param args are the CLI arguments that will be passed to JPlag. + * Executes the cli and handles the exceptions that might occur. + * + * @return true, if an exception has been caught. */ - public static void main(String[] args) { - try { - logger.debug("Your version of JPlag is {}", JPlag.JPLAG_VERSION); - - CLI cli = new CLI(); - - ParseResult parseResult = cli.parseOptions(args); + public boolean executeCliAndHandleErrors() { + boolean hadErrors = false; - if (!parseResult.isUsageHelpRequested() && !(parseResult.subcommand() != null && parseResult.subcommand().isUsageHelpRequested())) { - ProgressBarLogger.setProgressBarProvider(new TongfeiProgressBarProvider()); - switch (cli.options.mode) { - case RUN -> cli.runJPlag(parseResult); - case VIEW -> cli.runViewer(null); - case RUN_AND_VIEW -> cli.runViewer(cli.runJPlag(parseResult)); - } - } - } catch (ExitException | IOException exception) { // do not pass exceptions here to keep log clean + try { + this.executeCli(); + } catch (IOException | ExitException exception) { if (exception.getCause() != null) { logger.error("{} - {}", exception.getMessage(), exception.getCause().getMessage()); } else { logger.error(exception.getMessage()); } - + hadErrors = true; + } finally { finalizeLogger(); - System.exit(1); } + + return hadErrors; } /** - * Creates a new instance + * Runs JPlag and returns the file the result has been written to + * + * @return The file containing the result + * @throws ExitException If JPlag threw an exception + * @throws FileNotFoundException If the file could not be written */ - public CLI() { - this.options = new CliOptions(); - this.commandLine = new CommandLine(options); - - this.commandLine.setHelpFactory(new HelpFactory()); - - this.commandLine.getHelpSectionMap().put(SECTION_KEY_OPTION_LIST, help -> help.optionList().lines().map(it -> { - if (it.startsWith(" -")) { - return " " + it; - } - return it; - }).collect(Collectors.joining(System.lineSeparator()))); - - buildSubcommands().forEach(commandLine::addSubcommand); + public File runJPlag() throws ExitException, FileNotFoundException { + JPlagOptionsBuilder optionsBuilder = new JPlagOptionsBuilder(this.inputHandler); + JPlagOptions options = optionsBuilder.buildOptions(); + JPlagResult result = this.runner.runJPlag(options); - this.commandLine.getHelpSectionMap().put(SECTION_KEY_SYNOPSIS, help -> help.synopsis(help.synopsisHeadingLength()) + generateDescription()); - this.commandLine.getHelpSectionMap().put(SECTION_KEY_DESCRIPTION_HEADING, help -> OPTION_LIST_HEADING); - this.commandLine.setAllowSubcommandsAsOptionParameters(true); - } - - public File runJPlag(ParseResult parseResult) throws ExitException, FileNotFoundException { - JPlagOptions jplagOptions = buildOptionsFromArguments(parseResult); - JPlagResult result = JPlag.run(jplagOptions); File target = new File(getResultFilePath()); - ReportObjectFactory reportObjectFactory = new ReportObjectFactory(target); - reportObjectFactory.createAndSaveReport(result); - logger.info("Successfully written the result: {}", target.getPath()); - logger.info("View the result using --mode or at: https://jplag.github.io/JPlag/"); - OutputFileGenerator.generateCsvOutput(result, new File(getResultFileBaseName()), this.options); - return target; - } - - public void runViewer(File zipFile) throws IOException { - ReportViewer reportViewer = new ReportViewer(zipFile, this.options.advanced.port); - int port = reportViewer.start(); - logger.info("ReportViewer started on port http://localhost:{}", port); - Desktop.getDesktop().browse(URI.create("http://localhost:" + port + "/")); - - System.out.println("Press Enter key to exit..."); - System.in.read(); - reportViewer.stop(); - } - - private List buildSubcommands() { - return LanguageLoader.getAllAvailableLanguages().values().stream().map(language -> { - CommandSpec command = CommandSpec.create().name(language.getIdentifier()); - - for (LanguageOption option : language.getOptions().getOptionsAsList()) { - command.addOption(OptionSpec.builder(option.getNameAsUnixParameter()).type(option.getType().getJavaType()) - .description(option.getDescription()).build()); - } - command.mixinStandardHelpOptions(true); - command.addPositional( - CommandLine.Model.PositionalParamSpec.builder().type(List.class).auxiliaryTypes(File.class).hidden(true).required(false).build()); + this.outputFileGenerator.generateJPlagResultZip(result, target); + this.outputFileGenerator.generateCsvOutput(result, new File(getResultFileBaseName()), this.inputHandler.getCliOptions()); - return command; - }).toList(); + return target; } /** - * Parses the options from the given command line arguments. Also prints help pages when requested. - * @param args The command line arguments - * @return the parse result generated by picocli + * Runs the report viewer using the given file as the default result.zip + * @param zipFile The zip file to pass to the viewer. Can be null, if no result should be opened by default + * @throws IOException If something went wrong with the internal server */ - public ParseResult parseOptions(String... args) throws CliException { - try { - ParseResult result = commandLine.parseArgs(args); - if (result.isUsageHelpRequested() || (result.subcommand() != null && result.subcommand().isUsageHelpRequested())) { - commandLine.getExecutionStrategy().execute(result); - } - return result; - } catch (CommandLine.ParameterException e) { - if (e.getArgSpec() != null && e.getArgSpec().isOption() && Arrays.asList(((OptionSpec) e.getArgSpec()).names()).contains("-l")) { - throw new CliException(String.format(UNKNOWN_LANGUAGE_EXCEPTION, e.getValue(), - String.join(", ", LanguageLoader.getAllAvailableLanguageIdentifiers()))); - } - throw new CliException("Error during parsing", e); - } catch (CommandLine.PicocliException e) { - throw new CliException("Error during parsing", e); - } + public void runViewer(File zipFile) throws IOException { + this.runner.runInternalServer(zipFile, this.inputHandler.getCliOptions().advanced.port); } - private static void finalizeLogger() { + private void finalizeLogger() { ILoggerFactory factory = LoggerFactory.getILoggerFactory(); if (!(factory instanceof CollectedLoggerFactory collectedLoggerFactory)) { return; @@ -200,94 +122,8 @@ private static void finalizeLogger() { collectedLoggerFactory.finalizeInstances(); } - /** - * Builds an options instance from parsed options. - * @return the newly built options - */ - public JPlagOptions buildOptionsFromArguments(ParseResult parseResult) throws CliException { - Set submissionDirectories = new HashSet<>(List.of(this.options.rootDirectory)); - Set oldSubmissionDirectories = Set.of(this.options.oldDirectories); - List suffixes = List.of(this.options.advanced.suffixes); - submissionDirectories.addAll(List.of(this.options.newDirectories)); - - if (parseResult.subcommand() != null && parseResult.subcommand().hasMatchedPositional(0)) { - submissionDirectories.addAll(parseResult.subcommand().matchedPositional(0).getValue()); - } - - ClusteringOptions clusteringOptions = getClusteringOptions(this.options); - MergingOptions mergingOptions = getMergingOptions(this.options); - - JPlagOptions jPlagOptions = new JPlagOptions(loadLanguage(parseResult), this.options.minTokenMatch, submissionDirectories, - oldSubmissionDirectories, null, this.options.advanced.subdirectory, suffixes, this.options.advanced.exclusionFileName, - JPlagOptions.DEFAULT_SIMILARITY_METRIC, this.options.advanced.similarityThreshold, this.options.shownComparisons, clusteringOptions, - this.options.advanced.debug, mergingOptions, this.options.normalize); - - String baseCodePath = this.options.baseCode; - File baseCodeDirectory = baseCodePath == null ? null : new File(baseCodePath); - if (baseCodeDirectory == null || baseCodeDirectory.exists()) { - return jPlagOptions.withBaseCodeSubmissionDirectory(baseCodeDirectory); - } - logger.warn("Using legacy partial base code API. Please migrate to new full path base code API."); - return jPlagOptions.withBaseCodeSubmissionName(baseCodePath); - } - - private Language loadLanguage(ParseResult result) throws CliException { - if (result.subcommand() == null) { - return this.options.language; - } - ParseResult subcommandResult = result.subcommand(); - Language language = LanguageLoader.getLanguage(subcommandResult.commandSpec().name()) - .orElseThrow(() -> new CliException(IMPOSSIBLE_EXCEPTION)); - LanguageOptions languageOptions = language.getOptions(); - languageOptions.getOptionsAsList().forEach(option -> { - if (subcommandResult.hasMatchedOption(option.getNameAsUnixParameter())) { - option.setValue(subcommandResult.matchedOptionValue(option.getNameAsUnixParameter(), null)); - } - }); - return language; - } - - private static ClusteringOptions getClusteringOptions(CliOptions options) { - ClusteringOptions clusteringOptions = new ClusteringOptions().withEnabled(!options.clustering.disable) - .withAlgorithm(options.clustering.enabled.algorithm).withSimilarityMetric(options.clustering.enabled.metric) - .withSpectralKernelBandwidth(options.clusterSpectralBandwidth).withSpectralGaussianProcessVariance(options.clusterSpectralNoise) - .withSpectralMinRuns(options.clusterSpectralMinRuns).withSpectralMaxRuns(options.clusterSpectralMaxRuns) - .withSpectralMaxKMeansIterationPerRun(options.clusterSpectralKMeansIterations) - .withAgglomerativeThreshold(options.clusterAgglomerativeThreshold) - .withAgglomerativeInterClusterSimilarity(options.clusterAgglomerativeInterClusterSimilarity); - - if (options.clusterPreprocessingNone) { - clusteringOptions = clusteringOptions.withPreprocessor(Preprocessing.NONE); - } - - if (options.clusterPreprocessingCdf) { - clusteringOptions = clusteringOptions.withPreprocessor(Preprocessing.CUMULATIVE_DISTRIBUTION_FUNCTION); - } - - if (options.clusterPreprocessingPercentile != 0) { - clusteringOptions = clusteringOptions.withPreprocessor(Preprocessing.PERCENTILE) - .withPreprocessorPercentile(options.clusterPreprocessingPercentile); - } - - if (options.clusterPreprocessingThreshold != 0) { - clusteringOptions = clusteringOptions.withPreprocessor(Preprocessing.THRESHOLD) - .withPreprocessorThreshold(options.clusterPreprocessingThreshold); - } - - return clusteringOptions; - } - - private static MergingOptions getMergingOptions(CliOptions options) { - return new MergingOptions(options.merging.enabled, options.merging.minimumNeighborLength, options.merging.maximumGapSize); - } - - private String generateDescription() { - var randomDescription = DESCRIPTIONS[RANDOM.nextInt(DESCRIPTIONS.length)]; - return String.format(DESCRIPTION_PATTERN, randomDescription, CREDITS); - } - private String getResultFilePath() { - String optionValue = this.options.resultFile; + String optionValue = this.inputHandler.getCliOptions().resultFile; if (optionValue.endsWith(DEFAULT_FILE_ENDING)) { return optionValue; } @@ -298,4 +134,11 @@ private String getResultFileBaseName() { String defaultOutputFile = getResultFilePath(); return defaultOutputFile.substring(0, defaultOutputFile.length() - DEFAULT_FILE_ENDING.length()); } + + public static void main(String[] args) { + CLI cli = new CLI(JPlagRunner.DEFAULT_JPLAG_RUNNER, OutputFileGenerator.DEFAULT_OUTPUT_FILE_GENERATOR, args); + if (cli.executeCliAndHandleErrors()) { + System.exit(1); + } + } } diff --git a/cli/src/main/java/de/jplag/cli/JPlagOptionsBuilder.java b/cli/src/main/java/de/jplag/cli/JPlagOptionsBuilder.java new file mode 100644 index 0000000000..651a9b2061 --- /dev/null +++ b/cli/src/main/java/de/jplag/cli/JPlagOptionsBuilder.java @@ -0,0 +1,97 @@ +package de.jplag.cli; + +import de.jplag.cli.options.CliOptions; +import de.jplag.cli.picocli.CliInputHandler; +import de.jplag.clustering.ClusteringOptions; +import de.jplag.clustering.Preprocessing; +import de.jplag.merging.MergingOptions; +import de.jplag.options.JPlagOptions; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * Handles the building of JPlag options from the cli options + */ +public class JPlagOptionsBuilder { + private static final Logger logger = LoggerFactory.getLogger(JPlagOptionsBuilder.class); + + private final CliInputHandler cliInputHandler; + private final CliOptions cliOptions; + + /** + * @param cliInputHandler The cli handler containing the parsed cli options + */ + public JPlagOptionsBuilder(CliInputHandler cliInputHandler) { + this.cliInputHandler = cliInputHandler; + this.cliOptions = this.cliInputHandler.getCliOptions(); + } + + /** + * Builds the JPlag options + * @return The JPlag options + * @throws CliException If the input handler could properly parse everything. + */ + public JPlagOptions buildOptions() throws CliException { + Set submissionDirectories = new HashSet<>(List.of(this.cliOptions.rootDirectory)); + Set oldSubmissionDirectories = Set.of(this.cliOptions.oldDirectories); + List suffixes = List.of(this.cliOptions.advanced.suffixes); + submissionDirectories.addAll(List.of(this.cliOptions.newDirectories)); + submissionDirectories.addAll(this.cliInputHandler.getSubcommandSubmissionDirectories()); + + + ClusteringOptions clusteringOptions = getClusteringOptions(); + MergingOptions mergingOptions = getMergingOptions(); + + JPlagOptions jPlagOptions = new JPlagOptions(this.cliInputHandler.getSelectedLanguage(), this.cliOptions.minTokenMatch, submissionDirectories, + oldSubmissionDirectories, null, this.cliOptions.advanced.subdirectory, suffixes, this.cliOptions.advanced.exclusionFileName, + JPlagOptions.DEFAULT_SIMILARITY_METRIC, this.cliOptions.advanced.similarityThreshold, this.cliOptions.shownComparisons, clusteringOptions, + this.cliOptions.advanced.debug, mergingOptions, this.cliOptions.normalize); + + String baseCodePath = this.cliOptions.baseCode; + File baseCodeDirectory = baseCodePath == null ? null : new File(baseCodePath); + if (baseCodeDirectory == null || baseCodeDirectory.exists()) { + return jPlagOptions.withBaseCodeSubmissionDirectory(baseCodeDirectory); + } + logger.error("Using legacy partial base code API. Please migrate to new full path base code API."); + return jPlagOptions.withBaseCodeSubmissionName(baseCodePath); + } + + private ClusteringOptions getClusteringOptions() { + ClusteringOptions clusteringOptions = new ClusteringOptions().withEnabled(!this.cliOptions.clustering.disable) + .withAlgorithm(this.cliOptions.clustering.enabled.algorithm).withSimilarityMetric(this.cliOptions.clustering.enabled.metric) + .withSpectralKernelBandwidth(this.cliOptions.clusterSpectralBandwidth).withSpectralGaussianProcessVariance(this.cliOptions.clusterSpectralNoise) + .withSpectralMinRuns(this.cliOptions.clusterSpectralMinRuns).withSpectralMaxRuns(this.cliOptions.clusterSpectralMaxRuns) + .withSpectralMaxKMeansIterationPerRun(this.cliOptions.clusterSpectralKMeansIterations) + .withAgglomerativeThreshold(this.cliOptions.clusterAgglomerativeThreshold) + .withAgglomerativeInterClusterSimilarity(this.cliOptions.clusterAgglomerativeInterClusterSimilarity); + + if (this.cliOptions.clusterPreprocessingNone) { + clusteringOptions = clusteringOptions.withPreprocessor(Preprocessing.NONE); + } + + if (this.cliOptions.clusterPreprocessingCdf) { + clusteringOptions = clusteringOptions.withPreprocessor(Preprocessing.CUMULATIVE_DISTRIBUTION_FUNCTION); + } + + if (this.cliOptions.clusterPreprocessingPercentile != 0) { + clusteringOptions = clusteringOptions.withPreprocessor(Preprocessing.PERCENTILE) + .withPreprocessorPercentile(this.cliOptions.clusterPreprocessingPercentile); + } + + if (this.cliOptions.clusterPreprocessingThreshold != 0) { + clusteringOptions = clusteringOptions.withPreprocessor(Preprocessing.THRESHOLD) + .withPreprocessorThreshold(this.cliOptions.clusterPreprocessingThreshold); + } + + return clusteringOptions; + } + + private MergingOptions getMergingOptions() { + return new MergingOptions(this.cliOptions.merging.enabled, this.cliOptions.merging.minimumNeighborLength, this.cliOptions.merging.maximumGapSize); + } +} diff --git a/cli/src/main/java/de/jplag/cli/JPlagRunner.java b/cli/src/main/java/de/jplag/cli/JPlagRunner.java new file mode 100644 index 0000000000..ca2aa2effd --- /dev/null +++ b/cli/src/main/java/de/jplag/cli/JPlagRunner.java @@ -0,0 +1,59 @@ +package de.jplag.cli; + +import de.jplag.JPlag; +import de.jplag.JPlagResult; +import de.jplag.cli.server.ReportViewer; +import de.jplag.exceptions.ExitException; +import de.jplag.options.JPlagOptions; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.awt.Desktop; +import java.io.File; +import java.io.IOException; +import java.net.URI; + +/** + * Wraps the execution of the JPlag elements, so dummy implementations can be used for unit tests. + */ +public interface JPlagRunner { + Logger logger = LoggerFactory.getLogger(JPlagRunner.class); + + /** + * The default JPlag runner. Simply passes the calls to the appropriate JPlag elements + */ + JPlagRunner DEFAULT_JPLAG_RUNNER = new JPlagRunner() { + @Override + public JPlagResult runJPlag(JPlagOptions options) throws ExitException { + return JPlag.run(options); + } + + @Override + public void runInternalServer(File zipFile, int port) throws IOException { + ReportViewer reportViewer = new ReportViewer(zipFile, port); + int actualPort = reportViewer.start(); + logger.info("ReportViewer started on port http://localhost:{}", actualPort); + Desktop.getDesktop().browse(URI.create("http://localhost:" + actualPort + "/")); + + System.out.println("Press Enter key to exit..."); + System.in.read(); + reportViewer.stop(); + } + }; + + /** + * Executes JPlag + * @param options The options to pass to JPlag + * @return The result returned by JPlag + * @throws ExitException If JPlag throws an error + */ + JPlagResult runJPlag(JPlagOptions options) throws ExitException; + + /** + * Runs the internal server. Blocks until the server has stopped. + * @param zipFile The zip file to pass to the server. May be null. + * @param port The port to open the server on + * @throws IOException If the internal server throws an exception + */ + void runInternalServer(File zipFile, int port) throws IOException; +} diff --git a/cli/src/main/java/de/jplag/cli/OutputFileGenerator.java b/cli/src/main/java/de/jplag/cli/OutputFileGenerator.java index 5c42ff2df4..1790aa3a92 100644 --- a/cli/src/main/java/de/jplag/cli/OutputFileGenerator.java +++ b/cli/src/main/java/de/jplag/cli/OutputFileGenerator.java @@ -1,37 +1,58 @@ package de.jplag.cli; import java.io.File; +import java.io.FileNotFoundException; import java.io.IOException; import de.jplag.cli.options.CliOptions; +import de.jplag.reporting.reportobject.ReportObjectFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import de.jplag.JPlagResult; import de.jplag.csv.comparisons.CsvComparisonOutput; -public final class OutputFileGenerator { - private static final Logger logger = LoggerFactory.getLogger(OutputFileGenerator.class); +public interface OutputFileGenerator { + OutputFileGenerator DEFAULT_OUTPUT_FILE_GENERATOR = new OutputFileGenerator() { + private static final Logger logger = LoggerFactory.getLogger(OutputFileGenerator.class); - private OutputFileGenerator() { - // Prevents default constructor - } + @Override + public void generateCsvOutput(JPlagResult result, File outputRoot, CliOptions options) { + if (options.advanced.csvExport) { + try { + CsvComparisonOutput.writeCsvResults(result.getAllComparisons(), false, outputRoot, "results"); + CsvComparisonOutput.writeCsvResults(result.getAllComparisons(), true, outputRoot, "results-anonymous"); + } catch (IOException e) { + logger.warn("Could not write csv results", e); + } + } + } + + @Override + public void generateJPlagResultZip(JPlagResult result, File outputFile) throws FileNotFoundException { + ReportObjectFactory reportObjectFactory = new ReportObjectFactory(outputFile); + reportObjectFactory.createAndSaveReport(result); + logger.info("Successfully written the result: {}", outputFile.getPath()); + logger.info("View the result using --mode or at: https://jplag.github.io/JPlag/"); + } + }; /** * Exports the given result as CSVs, if the csvExport is activated in the options. Both a full and an anonymized version * will be written. - * @param result The result to export + * + * @param result The result to export * @param outputRoot The root folder for the output - * @param options The cli options + * @param options The cli options */ - public static void generateCsvOutput(JPlagResult result, File outputRoot, CliOptions options) { - if (options.advanced.csvExport) { - try { - CsvComparisonOutput.writeCsvResults(result.getAllComparisons(), false, outputRoot, "results"); - CsvComparisonOutput.writeCsvResults(result.getAllComparisons(), true, outputRoot, "results-anonymous"); - } catch (IOException e) { - logger.warn("Could not write csv results", e); - } - } - } + void generateCsvOutput(JPlagResult result, File outputRoot, CliOptions options); + + /** + * Generates the JPLag result zip + * + * @param result The JPlag result + * @param outputFile The output file + * @throws FileNotFoundException If the file cannot be written + */ + void generateJPlagResultZip(JPlagResult result, File outputFile) throws FileNotFoundException; } diff --git a/cli/src/main/java/de/jplag/cli/picocli/CliInputHandler.java b/cli/src/main/java/de/jplag/cli/picocli/CliInputHandler.java new file mode 100644 index 0000000000..a878cab706 --- /dev/null +++ b/cli/src/main/java/de/jplag/cli/picocli/CliInputHandler.java @@ -0,0 +1,168 @@ +package de.jplag.cli.picocli; + +import de.jplag.Language; +import de.jplag.cli.CliException; +import de.jplag.cli.options.CliOptions; +import de.jplag.cli.options.LanguageLoader; +import de.jplag.options.LanguageOption; +import de.jplag.options.LanguageOptions; +import picocli.CommandLine; +import picocli.CommandLine.ParseResult; + +import java.io.File; +import java.security.SecureRandom; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Random; +import java.util.stream.Collectors; + +import static picocli.CommandLine.Model.UsageMessageSpec.SECTION_KEY_DESCRIPTION_HEADING; +import static picocli.CommandLine.Model.UsageMessageSpec.SECTION_KEY_OPTION_LIST; +import static picocli.CommandLine.Model.UsageMessageSpec.SECTION_KEY_SYNOPSIS; + +/** + * Handles the parsing of the command line arguments + */ +public class CliInputHandler { + private static final String OPTION_LIST_HEADING = "Parameter descriptions: "; + + private static final String UNKNOWN_LANGUAGE_EXCEPTION = "Language %s does not exists. Available languages are: %s"; + private static final String IMPOSSIBLE_EXCEPTION = "This should not have happened." + + " Please create an issue on github (https://github.com/jplag/JPlag/issues) with the entire output."; + + private static final String[] DESCRIPTIONS = {"Detecting Software Plagiarism", "Software-Archaeological Playground", "Since 1996", + "Scientifically Published", "Maintained by SDQ", "RIP Structure and Table", "What else?", "You have been warned!", "Since Java 1.0", + "More Abstract than Tree", "Students Nightmare", "No, changing variable names does not work...", "The tech is out there!", + "Developed by plagiarism experts.", "State of the Art Obfuscation Resilience", "www.helmholtz.software/software/jplag"}; + private static final String DESCRIPTION_PATTERN = "%nJPlag - %s%n%s%n%n"; + private static final String CREDITS = "Created by IPD Tichy, Guido Malpohl, and others. Maintained by Timur Saglam and Sebastian Hahner. Logo by Sandro Koch."; + + private static final Random RANDOM = new SecureRandom(); + + private final String[] args; + private final CliOptions options; + private final CommandLine commandLine; + + private ParseResult parseResult; + + /** + * Creates a new handler. Before using it you need to call {@link #parse()} + * @param args The arguments. + */ + public CliInputHandler(String[] args) { + this.args = args; + this.options = new CliOptions(); + this.commandLine = buildCommandLine(); + } + + private CommandLine buildCommandLine() { + CommandLine cli = new CommandLine(this.options); + cli.setHelpFactory(new HelpFactory()); + + cli.getHelpSectionMap().put(SECTION_KEY_OPTION_LIST, help -> help.optionList().lines().map(it -> { + if (it.startsWith(" -")) { + return " " + it; + } + return it; + }).collect(Collectors.joining(System.lineSeparator()))); + + buildSubcommands().forEach(cli::addSubcommand); + + cli.getHelpSectionMap().put(SECTION_KEY_SYNOPSIS, help -> help.synopsis(help.synopsisHeadingLength()) + generateDescription()); + cli.getHelpSectionMap().put(SECTION_KEY_DESCRIPTION_HEADING, help -> OPTION_LIST_HEADING); + cli.setAllowSubcommandsAsOptionParameters(true); + + return cli; + } + + private List buildSubcommands() { + return LanguageLoader.getAllAvailableLanguages().values().stream().map(language -> { + CommandLine.Model.CommandSpec command = CommandLine.Model.CommandSpec.create().name(language.getIdentifier()); + + for (LanguageOption option : language.getOptions().getOptionsAsList()) { + command.addOption(CommandLine.Model.OptionSpec.builder(option.getNameAsUnixParameter()).type(option.getType().getJavaType()) + .description(option.getDescription()).build()); + } + command.mixinStandardHelpOptions(true); + command.addPositional( + CommandLine.Model.PositionalParamSpec.builder().type(List.class).auxiliaryTypes(File.class).hidden(true).required(false).build()); + + return command; + }).toList(); + } + + /** + * Parses the cli parameters and prints the usage help if requested. + * + * @return true, if the usage help has been requested. In this case the program should stop. + * @throws CliException If something went wrong during parsing. + */ + public boolean parse() throws CliException { + try { + this.parseResult = this.commandLine.parseArgs(args); + if (this.parseResult.isUsageHelpRequested() || (this.parseResult.subcommand() != null && this.parseResult.subcommand().isUsageHelpRequested())) { + commandLine.getExecutionStrategy().execute(this.parseResult); + return true; + } + } catch (CommandLine.ParameterException e) { + if (e.getArgSpec() != null && e.getArgSpec().isOption() && Arrays.asList(((CommandLine.Model.OptionSpec) e.getArgSpec()).names()).contains("-l")) { + throw new CliException(String.format(UNKNOWN_LANGUAGE_EXCEPTION, e.getValue(), + String.join(", ", LanguageLoader.getAllAvailableLanguageIdentifiers()))); + } + throw new CliException("Error during parsing", e); + } catch (CommandLine.PicocliException e) { + throw new CliException("Error during parsing", e); + } + return false; + } + + /** + * If {@link #parse()} has not been called yet, this will be empty, otherwise it will be a valid object. + * + * @return The parsed cli options. + */ + public CliOptions getCliOptions() { + return options; + } + + /** + * Resolves the language selected by the cli arguments. + * @return The selected language + * @throws CliException In the event the language cannot be resolved. Should not happen under normal circumstances. + */ + public Language getSelectedLanguage() throws CliException { + if (this.parseResult.subcommand() == null) { + return this.options.language; + } + + ParseResult subcommand = this.parseResult.subcommand(); + + Language language = LanguageLoader.getLanguage(subcommand.commandSpec().name()) + .orElseThrow(() -> new CliException(IMPOSSIBLE_EXCEPTION)); + + LanguageOptions languageOptions = language.getOptions(); + languageOptions.getOptionsAsList().forEach(option -> { + if (subcommand.hasMatchedOption(option.getNameAsUnixParameter())) { + option.setValue(subcommand.matchedOptionValue(option.getNameAsUnixParameter(), null)); + } + }); + return language; + } + + /** + * @return The submission directories configured for the subcommand, if one has been given. + */ + public List getSubcommandSubmissionDirectories() { + if (this.parseResult.subcommand() != null && this.parseResult.subcommand().hasMatchedPositional(0)) { + return this.parseResult.subcommand().matchedPositional(0).getValue(); + } + return Collections.emptyList(); + } + + private String generateDescription() { + var randomDescription = DESCRIPTIONS[RANDOM.nextInt(DESCRIPTIONS.length)]; + return String.format(DESCRIPTION_PATTERN, randomDescription, CREDITS); + } +} + diff --git a/cli/src/test/java/de/jplag/cli/CommandLineInterfaceTest.java b/cli/src/test/java/de/jplag/cli/CommandLineInterfaceTest.java index eb6ffca8c1..7e8e2d7836 100644 --- a/cli/src/test/java/de/jplag/cli/CommandLineInterfaceTest.java +++ b/cli/src/test/java/de/jplag/cli/CommandLineInterfaceTest.java @@ -1,5 +1,6 @@ package de.jplag.cli; +import de.jplag.cli.picocli.CliInputHandler; import de.jplag.options.JPlagOptions; import picocli.CommandLine; @@ -14,7 +15,6 @@ public abstract class CommandLineInterfaceTest { protected static final String CURRENT_DIRECTORY = "."; protected static final double DELTA = 1E-5; - protected CLI cli; protected JPlagOptions options; /** @@ -36,9 +36,9 @@ protected ArgumentBuilder defaultArguments() { * @param builder The argument builder containing the values to pass to the cli */ protected void buildOptionsFromCLI(ArgumentBuilder builder) throws CliException { - cli = new CLI(); - CommandLine.ParseResult result = cli.parseOptions(builder.getArgumentsAsArray()); - options = cli.buildOptionsFromArguments(result); + CliInputHandler inputHandler = new CliInputHandler(builder.getArgumentsAsArray()); + inputHandler.parse(); + this.options = new JPlagOptionsBuilder(inputHandler).buildOptions(); } } From c339e1d2b1841019e277b3640be964a0fd609331 Mon Sep 17 00:00:00 2001 From: Alexander Milster Date: Fri, 23 Feb 2024 10:27:20 +0100 Subject: [PATCH 011/228] Split the CollectedLogger into two classes. --- .../de/jplag/cli/logger/CollectedLogger.java | 86 ++--------------- .../de/jplag/cli/logger/JPlagLoggerBase.java | 92 +++++++++++++++++++ 2 files changed, 98 insertions(+), 80 deletions(-) create mode 100644 cli/src/main/java/de/jplag/cli/logger/JPlagLoggerBase.java diff --git a/cli/src/main/java/de/jplag/cli/logger/CollectedLogger.java b/cli/src/main/java/de/jplag/cli/logger/CollectedLogger.java index 44a69d8673..9236c1470b 100644 --- a/cli/src/main/java/de/jplag/cli/logger/CollectedLogger.java +++ b/cli/src/main/java/de/jplag/cli/logger/CollectedLogger.java @@ -2,7 +2,6 @@ import org.slf4j.Marker; import org.slf4j.event.Level; -import org.slf4j.helpers.AbstractLogger; import org.slf4j.helpers.MessageFormatter; import java.io.PrintStream; @@ -11,20 +10,10 @@ import java.util.Date; import java.util.concurrent.ConcurrentLinkedDeque; -public class CollectedLogger extends AbstractLogger { - private static final Level LOG_LEVEL_TRACE = Level.TRACE; - private static final Level LOG_LEVEL_DEBUG = Level.DEBUG; - private static final Level LOG_LEVEL_INFO = Level.INFO; - private static final Level LOG_LEVEL_WARN = Level.WARN; - private static final Level LOG_LEVEL_ERROR = Level.ERROR; - - /** - * The default log level that shall be used for external libraries (like Stanford Core NLP) - */ - private static final Level LOG_LEVEL_FOR_EXTERNAL_LIBRARIES = LOG_LEVEL_ERROR; - - private static final Level CURRENT_LOG_LEVEL = LOG_LEVEL_INFO; - +/** + * A logger implementation, that prints all errors during finalization + */ +public class CollectedLogger extends JPlagLoggerBase { private static final int MAXIMUM_MESSAGE_LENGTH = 32; private static final PrintStream TARGET_STREAM = System.out; @@ -41,7 +30,7 @@ public class CollectedLogger extends AbstractLogger { private final ConcurrentLinkedDeque allErrors = new ConcurrentLinkedDeque<>(); public CollectedLogger(String name) { - this.name = name; + super(LOG_LEVEL_INFO, name); } @Override @@ -87,7 +76,7 @@ void printAllErrorsForLogger() { this.isFinalizing = true; ArrayList errors = new ArrayList<>(this.allErrors); - if(!errors.isEmpty()) { + if (!errors.isEmpty()) { info("Summary of all errors:"); this.allErrors.removeAll(errors); for (LogEntry errorEntry : errors) { @@ -98,70 +87,7 @@ void printAllErrorsForLogger() { this.isFinalizing = false; } - @Override - public boolean isTraceEnabled() { - return isLogLevelEnabled(LOG_LEVEL_TRACE); - } - - @Override - public boolean isTraceEnabled(Marker marker) { - return isTraceEnabled(); - } - - @Override - public boolean isDebugEnabled() { - return isLogLevelEnabled(LOG_LEVEL_DEBUG); - } - - @Override - public boolean isDebugEnabled(Marker marker) { - return isDebugEnabled(); - } - - @Override - public boolean isInfoEnabled() { - return isLogLevelEnabled(LOG_LEVEL_INFO); - } - - @Override - public boolean isInfoEnabled(Marker marker) { - return isInfoEnabled(); - } - - @Override - public boolean isWarnEnabled() { - return isLogLevelEnabled(LOG_LEVEL_WARN); - } - - @Override - public boolean isWarnEnabled(Marker marker) { - return isWarnEnabled(); - } - - @Override - public boolean isErrorEnabled() { - return isLogLevelEnabled(LOG_LEVEL_ERROR); - } - - @Override - public boolean isErrorEnabled(Marker marker) { - return isErrorEnabled(); - } - - private boolean isLogLevelEnabled(Level logLevel) { - return logLevel.toInt() >= (isJPlagLog() ? CURRENT_LOG_LEVEL.toInt() : LOG_LEVEL_FOR_EXTERNAL_LIBRARIES.toInt()); - } - - private boolean isJPlagLog() { - return this.name.startsWith("de.jplag."); - } - private String computeShortName() { return name.substring(name.lastIndexOf(".") + 1); } - - @Override - protected String getFullyQualifiedCallerName() { - return null; //does not seem to be used by anything, but is required by SLF4J - } } diff --git a/cli/src/main/java/de/jplag/cli/logger/JPlagLoggerBase.java b/cli/src/main/java/de/jplag/cli/logger/JPlagLoggerBase.java new file mode 100644 index 0000000000..fb63bdf199 --- /dev/null +++ b/cli/src/main/java/de/jplag/cli/logger/JPlagLoggerBase.java @@ -0,0 +1,92 @@ +package de.jplag.cli.logger; + +import org.slf4j.Marker; +import org.slf4j.event.Level; +import org.slf4j.helpers.AbstractLogger; + +/** + * Handles the enabled log levels for SLF4J. + */ +public abstract class JPlagLoggerBase extends AbstractLogger { + protected static final Level LOG_LEVEL_TRACE = Level.TRACE; + protected static final Level LOG_LEVEL_DEBUG = Level.DEBUG; + protected static final Level LOG_LEVEL_INFO = Level.INFO; + protected static final Level LOG_LEVEL_WARN = Level.WARN; + protected static final Level LOG_LEVEL_ERROR = Level.ERROR; + + private static final Level LOG_LEVEL_FOR_EXTERNAL_LIBRARIES = LOG_LEVEL_ERROR; + + private Level currentLogLevel; + + /** + * @param currentLogLevel The current log level + * @param name The name of the logger + */ + public JPlagLoggerBase(Level currentLogLevel, String name) { + this.currentLogLevel = currentLogLevel; + this.name = name; + } + + @Override + public boolean isTraceEnabled() { + return isLogLevelEnabled(LOG_LEVEL_TRACE); + } + + @Override + public boolean isTraceEnabled(Marker marker) { + return isTraceEnabled(); + } + + @Override + public boolean isDebugEnabled() { + return isLogLevelEnabled(LOG_LEVEL_DEBUG); + } + + @Override + public boolean isDebugEnabled(Marker marker) { + return isDebugEnabled(); + } + + @Override + public boolean isInfoEnabled() { + return isLogLevelEnabled(LOG_LEVEL_INFO); + } + + @Override + public boolean isInfoEnabled(Marker marker) { + return isInfoEnabled(); + } + + @Override + public boolean isWarnEnabled() { + return isLogLevelEnabled(LOG_LEVEL_WARN); + } + + @Override + public boolean isWarnEnabled(Marker marker) { + return isWarnEnabled(); + } + + @Override + public boolean isErrorEnabled() { + return isLogLevelEnabled(LOG_LEVEL_ERROR); + } + + @Override + public boolean isErrorEnabled(Marker marker) { + return isErrorEnabled(); + } + + private boolean isLogLevelEnabled(Level logLevel) { + return logLevel.toInt() >= (isJPlagLog() ? this.currentLogLevel.toInt() : LOG_LEVEL_FOR_EXTERNAL_LIBRARIES.toInt()); + } + + private boolean isJPlagLog() { + return this.name.startsWith("de.jplag."); + } + + @Override + protected String getFullyQualifiedCallerName() { + return null; //does not seem to be used by anything, but is required by SLF4J + } +} From 791ebfa3d642406be2ef39640a9dbfb3ecb4ae4c Mon Sep 17 00:00:00 2001 From: Alexander Milster Date: Fri, 23 Feb 2024 10:28:01 +0100 Subject: [PATCH 012/228] Split the CollectedLogger into two classes. --- cli/src/main/java/de/jplag/cli/logger/JPlagLoggerBase.java | 2 +- cli/src/test/java/de/jplag/cli/CommandLineInterfaceTest.java | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/cli/src/main/java/de/jplag/cli/logger/JPlagLoggerBase.java b/cli/src/main/java/de/jplag/cli/logger/JPlagLoggerBase.java index fb63bdf199..5ca6d5da95 100644 --- a/cli/src/main/java/de/jplag/cli/logger/JPlagLoggerBase.java +++ b/cli/src/main/java/de/jplag/cli/logger/JPlagLoggerBase.java @@ -16,7 +16,7 @@ public abstract class JPlagLoggerBase extends AbstractLogger { private static final Level LOG_LEVEL_FOR_EXTERNAL_LIBRARIES = LOG_LEVEL_ERROR; - private Level currentLogLevel; + private final Level currentLogLevel; /** * @param currentLogLevel The current log level diff --git a/cli/src/test/java/de/jplag/cli/CommandLineInterfaceTest.java b/cli/src/test/java/de/jplag/cli/CommandLineInterfaceTest.java index 7e8e2d7836..3946dbe45e 100644 --- a/cli/src/test/java/de/jplag/cli/CommandLineInterfaceTest.java +++ b/cli/src/test/java/de/jplag/cli/CommandLineInterfaceTest.java @@ -3,8 +3,6 @@ import de.jplag.cli.picocli.CliInputHandler; import de.jplag.options.JPlagOptions; -import picocli.CommandLine; - /** * Test base for tests regarding the {@link CLI}. Solely tests if the arguments set via the command line interface are * propagated correctly into options. JPlag is not executed for the different command line arguments, thus these tests @@ -32,7 +30,7 @@ protected ArgumentBuilder defaultArguments() { } /** - * Builds {@link JPlagOptions} via the command line interface. Sets {@link CommandLineInterfaceTest#cli} + * Builds {@link JPlagOptions} via the command line interface. * @param builder The argument builder containing the values to pass to the cli */ protected void buildOptionsFromCLI(ArgumentBuilder builder) throws CliException { From c78a13af593947bfd8371d63b51ec1783995fba0 Mon Sep 17 00:00:00 2001 From: Alexander Milster Date: Fri, 23 Feb 2024 10:34:28 +0100 Subject: [PATCH 013/228] Simple refactorings for the cli module --- cli/src/main/java/de/jplag/cli/CLI.java | 28 ++++++------ .../de/jplag/cli/JPlagOptionsBuilder.java | 43 +++++++++++-------- .../main/java/de/jplag/cli/JPlagRunner.java | 15 ++++--- .../de/jplag/cli/OutputFileGenerator.java | 12 +++--- .../de/jplag/cli/logger/CollectedLogger.java | 9 ++-- .../de/jplag/cli/logger/JPlagLoggerBase.java | 2 +- .../java/de/jplag/cli/logger/LogEntry.java | 4 +- .../main/java/de/jplag/cli/logger/Triple.java | 4 -- .../de/jplag/cli/picocli/CliInputHandler.java | 35 ++++++++------- .../java/de/jplag/cli/CustomHelpTests.java | 10 +++-- .../test/java/de/jplag/cli/LanguageTest.java | 4 +- .../de/jplag/cli/ParamLabelRendererTest.java | 3 +- 12 files changed, 84 insertions(+), 85 deletions(-) delete mode 100644 cli/src/main/java/de/jplag/cli/logger/Triple.java diff --git a/cli/src/main/java/de/jplag/cli/CLI.java b/cli/src/main/java/de/jplag/cli/CLI.java index ad8aeda143..f5184bc835 100644 --- a/cli/src/main/java/de/jplag/cli/CLI.java +++ b/cli/src/main/java/de/jplag/cli/CLI.java @@ -1,5 +1,13 @@ package de.jplag.cli; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; + +import org.slf4j.ILoggerFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import de.jplag.JPlag; import de.jplag.JPlagResult; import de.jplag.cli.logger.CollectedLoggerFactory; @@ -8,17 +16,9 @@ import de.jplag.exceptions.ExitException; import de.jplag.logging.ProgressBarLogger; import de.jplag.options.JPlagOptions; -import org.slf4j.ILoggerFactory; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; /** * Command line interface class, allows using via command line. - * * @see CLI#main(String[]) */ public final class CLI { @@ -32,9 +32,8 @@ public final class CLI { /** * Creates a cli. - * * @param runner The way to run JPlag - * @param args The command line arguments + * @param args The command line arguments */ public CLI(JPlagRunner runner, OutputFileGenerator outputFileGenerator, String[] args) { this.runner = runner; @@ -44,9 +43,8 @@ public CLI(JPlagRunner runner, OutputFileGenerator outputFileGenerator, String[] /** * Executes the cli - * * @throws ExitException If anything on the side of JPlag goes wrong - * @throws IOException If any files did not work + * @throws IOException If any files did not work */ public void executeCli() throws ExitException, IOException { logger.debug("Your version of JPlag is {}", JPlag.JPLAG_VERSION); @@ -64,7 +62,6 @@ public void executeCli() throws ExitException, IOException { /** * Executes the cli and handles the exceptions that might occur. - * * @return true, if an exception has been caught. */ public boolean executeCliAndHandleErrors() { @@ -88,9 +85,8 @@ public boolean executeCliAndHandleErrors() { /** * Runs JPlag and returns the file the result has been written to - * * @return The file containing the result - * @throws ExitException If JPlag threw an exception + * @throws ExitException If JPlag threw an exception * @throws FileNotFoundException If the file could not be written */ public File runJPlag() throws ExitException, FileNotFoundException { @@ -111,7 +107,7 @@ public File runJPlag() throws ExitException, FileNotFoundException { * @throws IOException If something went wrong with the internal server */ public void runViewer(File zipFile) throws IOException { - this.runner.runInternalServer(zipFile, this.inputHandler.getCliOptions().advanced.port); + this.runner.runInternalServer(zipFile, this.inputHandler.getCliOptions().advanced.port); } private void finalizeLogger() { diff --git a/cli/src/main/java/de/jplag/cli/JPlagOptionsBuilder.java b/cli/src/main/java/de/jplag/cli/JPlagOptionsBuilder.java index 651a9b2061..16c309f4b9 100644 --- a/cli/src/main/java/de/jplag/cli/JPlagOptionsBuilder.java +++ b/cli/src/main/java/de/jplag/cli/JPlagOptionsBuilder.java @@ -1,18 +1,19 @@ package de.jplag.cli; +import java.io.File; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import de.jplag.cli.options.CliOptions; import de.jplag.cli.picocli.CliInputHandler; import de.jplag.clustering.ClusteringOptions; import de.jplag.clustering.Preprocessing; import de.jplag.merging.MergingOptions; import de.jplag.options.JPlagOptions; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.util.HashSet; -import java.util.List; -import java.util.Set; /** * Handles the building of JPlag options from the cli options @@ -43,14 +44,7 @@ public JPlagOptions buildOptions() throws CliException { submissionDirectories.addAll(List.of(this.cliOptions.newDirectories)); submissionDirectories.addAll(this.cliInputHandler.getSubcommandSubmissionDirectories()); - - ClusteringOptions clusteringOptions = getClusteringOptions(); - MergingOptions mergingOptions = getMergingOptions(); - - JPlagOptions jPlagOptions = new JPlagOptions(this.cliInputHandler.getSelectedLanguage(), this.cliOptions.minTokenMatch, submissionDirectories, - oldSubmissionDirectories, null, this.cliOptions.advanced.subdirectory, suffixes, this.cliOptions.advanced.exclusionFileName, - JPlagOptions.DEFAULT_SIMILARITY_METRIC, this.cliOptions.advanced.similarityThreshold, this.cliOptions.shownComparisons, clusteringOptions, - this.cliOptions.advanced.debug, mergingOptions, this.cliOptions.normalize); + JPlagOptions jPlagOptions = initializeJPlagOptions(submissionDirectories, oldSubmissionDirectories, suffixes); String baseCodePath = this.cliOptions.baseCode; File baseCodeDirectory = baseCodePath == null ? null : new File(baseCodePath); @@ -61,11 +55,23 @@ public JPlagOptions buildOptions() throws CliException { return jPlagOptions.withBaseCodeSubmissionName(baseCodePath); } + private JPlagOptions initializeJPlagOptions(Set submissionDirectories, Set oldSubmissionDirectories, List suffixes) + throws CliException { + ClusteringOptions clusteringOptions = getClusteringOptions(); + MergingOptions mergingOptions = getMergingOptions(); + + return new JPlagOptions(this.cliInputHandler.getSelectedLanguage(), this.cliOptions.minTokenMatch, submissionDirectories, + oldSubmissionDirectories, null, this.cliOptions.advanced.subdirectory, suffixes, this.cliOptions.advanced.exclusionFileName, + JPlagOptions.DEFAULT_SIMILARITY_METRIC, this.cliOptions.advanced.similarityThreshold, this.cliOptions.shownComparisons, + clusteringOptions, this.cliOptions.advanced.debug, mergingOptions, this.cliOptions.normalize); + } + private ClusteringOptions getClusteringOptions() { ClusteringOptions clusteringOptions = new ClusteringOptions().withEnabled(!this.cliOptions.clustering.disable) .withAlgorithm(this.cliOptions.clustering.enabled.algorithm).withSimilarityMetric(this.cliOptions.clustering.enabled.metric) - .withSpectralKernelBandwidth(this.cliOptions.clusterSpectralBandwidth).withSpectralGaussianProcessVariance(this.cliOptions.clusterSpectralNoise) - .withSpectralMinRuns(this.cliOptions.clusterSpectralMinRuns).withSpectralMaxRuns(this.cliOptions.clusterSpectralMaxRuns) + .withSpectralKernelBandwidth(this.cliOptions.clusterSpectralBandwidth) + .withSpectralGaussianProcessVariance(this.cliOptions.clusterSpectralNoise).withSpectralMinRuns(this.cliOptions.clusterSpectralMinRuns) + .withSpectralMaxRuns(this.cliOptions.clusterSpectralMaxRuns) .withSpectralMaxKMeansIterationPerRun(this.cliOptions.clusterSpectralKMeansIterations) .withAgglomerativeThreshold(this.cliOptions.clusterAgglomerativeThreshold) .withAgglomerativeInterClusterSimilarity(this.cliOptions.clusterAgglomerativeInterClusterSimilarity); @@ -92,6 +98,7 @@ private ClusteringOptions getClusteringOptions() { } private MergingOptions getMergingOptions() { - return new MergingOptions(this.cliOptions.merging.enabled, this.cliOptions.merging.minimumNeighborLength, this.cliOptions.merging.maximumGapSize); + return new MergingOptions(this.cliOptions.merging.enabled, this.cliOptions.merging.minimumNeighborLength, + this.cliOptions.merging.maximumGapSize); } } diff --git a/cli/src/main/java/de/jplag/cli/JPlagRunner.java b/cli/src/main/java/de/jplag/cli/JPlagRunner.java index ca2aa2effd..8a69bd7a25 100644 --- a/cli/src/main/java/de/jplag/cli/JPlagRunner.java +++ b/cli/src/main/java/de/jplag/cli/JPlagRunner.java @@ -1,17 +1,18 @@ package de.jplag.cli; +import java.awt.Desktop; +import java.io.File; +import java.io.IOException; +import java.net.URI; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import de.jplag.JPlag; import de.jplag.JPlagResult; import de.jplag.cli.server.ReportViewer; import de.jplag.exceptions.ExitException; import de.jplag.options.JPlagOptions; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.awt.Desktop; -import java.io.File; -import java.io.IOException; -import java.net.URI; /** * Wraps the execution of the JPlag elements, so dummy implementations can be used for unit tests. diff --git a/cli/src/main/java/de/jplag/cli/OutputFileGenerator.java b/cli/src/main/java/de/jplag/cli/OutputFileGenerator.java index 1790aa3a92..90248ed6f5 100644 --- a/cli/src/main/java/de/jplag/cli/OutputFileGenerator.java +++ b/cli/src/main/java/de/jplag/cli/OutputFileGenerator.java @@ -4,13 +4,13 @@ import java.io.FileNotFoundException; import java.io.IOException; -import de.jplag.cli.options.CliOptions; -import de.jplag.reporting.reportobject.ReportObjectFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import de.jplag.JPlagResult; +import de.jplag.cli.options.CliOptions; import de.jplag.csv.comparisons.CsvComparisonOutput; +import de.jplag.reporting.reportobject.ReportObjectFactory; public interface OutputFileGenerator { OutputFileGenerator DEFAULT_OUTPUT_FILE_GENERATOR = new OutputFileGenerator() { @@ -40,17 +40,15 @@ public void generateJPlagResultZip(JPlagResult result, File outputFile) throws F /** * Exports the given result as CSVs, if the csvExport is activated in the options. Both a full and an anonymized version * will be written. - * - * @param result The result to export + * @param result The result to export * @param outputRoot The root folder for the output - * @param options The cli options + * @param options The cli options */ void generateCsvOutput(JPlagResult result, File outputRoot, CliOptions options); /** * Generates the JPLag result zip - * - * @param result The JPlag result + * @param result The JPlag result * @param outputFile The output file * @throws FileNotFoundException If the file cannot be written */ diff --git a/cli/src/main/java/de/jplag/cli/logger/CollectedLogger.java b/cli/src/main/java/de/jplag/cli/logger/CollectedLogger.java index 9236c1470b..85b40629a1 100644 --- a/cli/src/main/java/de/jplag/cli/logger/CollectedLogger.java +++ b/cli/src/main/java/de/jplag/cli/logger/CollectedLogger.java @@ -1,15 +1,15 @@ package de.jplag.cli.logger; -import org.slf4j.Marker; -import org.slf4j.event.Level; -import org.slf4j.helpers.MessageFormatter; - import java.io.PrintStream; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.concurrent.ConcurrentLinkedDeque; +import org.slf4j.Marker; +import org.slf4j.event.Level; +import org.slf4j.helpers.MessageFormatter; + /** * A logger implementation, that prints all errors during finalization */ @@ -20,7 +20,6 @@ public class CollectedLogger extends JPlagLoggerBase { /** * Indicator whether finalization is in progress. - * * @see #printAllErrorsForLogger() */ private transient boolean isFinalizing = false; diff --git a/cli/src/main/java/de/jplag/cli/logger/JPlagLoggerBase.java b/cli/src/main/java/de/jplag/cli/logger/JPlagLoggerBase.java index 5ca6d5da95..687426e8a0 100644 --- a/cli/src/main/java/de/jplag/cli/logger/JPlagLoggerBase.java +++ b/cli/src/main/java/de/jplag/cli/logger/JPlagLoggerBase.java @@ -87,6 +87,6 @@ private boolean isJPlagLog() { @Override protected String getFullyQualifiedCallerName() { - return null; //does not seem to be used by anything, but is required by SLF4J + return null; // does not seem to be used by anything, but is required by SLF4J } } diff --git a/cli/src/main/java/de/jplag/cli/logger/LogEntry.java b/cli/src/main/java/de/jplag/cli/logger/LogEntry.java index 6b91c5af3c..86d94d2ce7 100644 --- a/cli/src/main/java/de/jplag/cli/logger/LogEntry.java +++ b/cli/src/main/java/de/jplag/cli/logger/LogEntry.java @@ -1,9 +1,9 @@ package de.jplag.cli.logger; -import org.slf4j.event.Level; - import java.util.Date; +import org.slf4j.event.Level; + /** * Holds a log entry for later usage * @param message The message of the log diff --git a/cli/src/main/java/de/jplag/cli/logger/Triple.java b/cli/src/main/java/de/jplag/cli/logger/Triple.java deleted file mode 100644 index 76a3090634..0000000000 --- a/cli/src/main/java/de/jplag/cli/logger/Triple.java +++ /dev/null @@ -1,4 +0,0 @@ -package de.jplag.cli.logger; - -public record Triple(A first, B second, C third) { -} diff --git a/cli/src/main/java/de/jplag/cli/picocli/CliInputHandler.java b/cli/src/main/java/de/jplag/cli/picocli/CliInputHandler.java index a878cab706..c27e91fafd 100644 --- a/cli/src/main/java/de/jplag/cli/picocli/CliInputHandler.java +++ b/cli/src/main/java/de/jplag/cli/picocli/CliInputHandler.java @@ -1,13 +1,8 @@ package de.jplag.cli.picocli; -import de.jplag.Language; -import de.jplag.cli.CliException; -import de.jplag.cli.options.CliOptions; -import de.jplag.cli.options.LanguageLoader; -import de.jplag.options.LanguageOption; -import de.jplag.options.LanguageOptions; -import picocli.CommandLine; -import picocli.CommandLine.ParseResult; +import static picocli.CommandLine.Model.UsageMessageSpec.SECTION_KEY_DESCRIPTION_HEADING; +import static picocli.CommandLine.Model.UsageMessageSpec.SECTION_KEY_OPTION_LIST; +import static picocli.CommandLine.Model.UsageMessageSpec.SECTION_KEY_SYNOPSIS; import java.io.File; import java.security.SecureRandom; @@ -17,9 +12,15 @@ import java.util.Random; import java.util.stream.Collectors; -import static picocli.CommandLine.Model.UsageMessageSpec.SECTION_KEY_DESCRIPTION_HEADING; -import static picocli.CommandLine.Model.UsageMessageSpec.SECTION_KEY_OPTION_LIST; -import static picocli.CommandLine.Model.UsageMessageSpec.SECTION_KEY_SYNOPSIS; +import de.jplag.Language; +import de.jplag.cli.CliException; +import de.jplag.cli.options.CliOptions; +import de.jplag.cli.options.LanguageLoader; +import de.jplag.options.LanguageOption; +import de.jplag.options.LanguageOptions; + +import picocli.CommandLine; +import picocli.CommandLine.ParseResult; /** * Handles the parsing of the command line arguments @@ -94,19 +95,20 @@ private List buildSubcommands() { /** * Parses the cli parameters and prints the usage help if requested. - * * @return true, if the usage help has been requested. In this case the program should stop. * @throws CliException If something went wrong during parsing. */ public boolean parse() throws CliException { try { this.parseResult = this.commandLine.parseArgs(args); - if (this.parseResult.isUsageHelpRequested() || (this.parseResult.subcommand() != null && this.parseResult.subcommand().isUsageHelpRequested())) { + if (this.parseResult.isUsageHelpRequested() + || (this.parseResult.subcommand() != null && this.parseResult.subcommand().isUsageHelpRequested())) { commandLine.getExecutionStrategy().execute(this.parseResult); return true; } } catch (CommandLine.ParameterException e) { - if (e.getArgSpec() != null && e.getArgSpec().isOption() && Arrays.asList(((CommandLine.Model.OptionSpec) e.getArgSpec()).names()).contains("-l")) { + if (e.getArgSpec() != null && e.getArgSpec().isOption() + && Arrays.asList(((CommandLine.Model.OptionSpec) e.getArgSpec()).names()).contains("-l")) { throw new CliException(String.format(UNKNOWN_LANGUAGE_EXCEPTION, e.getValue(), String.join(", ", LanguageLoader.getAllAvailableLanguageIdentifiers()))); } @@ -119,7 +121,6 @@ public boolean parse() throws CliException { /** * If {@link #parse()} has not been called yet, this will be empty, otherwise it will be a valid object. - * * @return The parsed cli options. */ public CliOptions getCliOptions() { @@ -138,8 +139,7 @@ public Language getSelectedLanguage() throws CliException { ParseResult subcommand = this.parseResult.subcommand(); - Language language = LanguageLoader.getLanguage(subcommand.commandSpec().name()) - .orElseThrow(() -> new CliException(IMPOSSIBLE_EXCEPTION)); + Language language = LanguageLoader.getLanguage(subcommand.commandSpec().name()).orElseThrow(() -> new CliException(IMPOSSIBLE_EXCEPTION)); LanguageOptions languageOptions = language.getOptions(); languageOptions.getOptionsAsList().forEach(option -> { @@ -165,4 +165,3 @@ private String generateDescription() { return String.format(DESCRIPTION_PATTERN, randomDescription, CREDITS); } } - diff --git a/cli/src/test/java/de/jplag/cli/CustomHelpTests.java b/cli/src/test/java/de/jplag/cli/CustomHelpTests.java index ac3d37b861..9fecd3f3ba 100644 --- a/cli/src/test/java/de/jplag/cli/CustomHelpTests.java +++ b/cli/src/test/java/de/jplag/cli/CustomHelpTests.java @@ -1,12 +1,13 @@ package de.jplag.cli; -import de.jplag.cli.picocli.CustomHelp; -import de.jplag.cli.picocli.HelpFactory; -import de.jplag.cli.picocli.ParamLabelRenderer; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import de.jplag.cli.picocli.CustomHelp; +import de.jplag.cli.picocli.HelpFactory; +import de.jplag.cli.picocli.ParamLabelRenderer; + import picocli.CommandLine; /** @@ -29,6 +30,7 @@ void setup() { */ @Test void testReturnsCustomRenderer() { - Assertions.assertInstanceOf(ParamLabelRenderer.class, this.help.parameterLabelRenderer(), "The custom help object returned the wrong ParamLabelRenderer type."); + Assertions.assertInstanceOf(ParamLabelRenderer.class, this.help.parameterLabelRenderer(), + "The custom help object returned the wrong ParamLabelRenderer type."); } } diff --git a/cli/src/test/java/de/jplag/cli/LanguageTest.java b/cli/src/test/java/de/jplag/cli/LanguageTest.java index 167faeae27..a239112842 100644 --- a/cli/src/test/java/de/jplag/cli/LanguageTest.java +++ b/cli/src/test/java/de/jplag/cli/LanguageTest.java @@ -5,12 +5,12 @@ import java.util.Arrays; import java.util.List; -import de.jplag.cli.options.CliOptions; -import de.jplag.cli.options.LanguageLoader; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import de.jplag.Language; +import de.jplag.cli.options.CliOptions; +import de.jplag.cli.options.LanguageLoader; class LanguageTest extends CommandLineInterfaceTest { diff --git a/cli/src/test/java/de/jplag/cli/ParamLabelRendererTest.java b/cli/src/test/java/de/jplag/cli/ParamLabelRendererTest.java index 7348f92376..817b84fef9 100644 --- a/cli/src/test/java/de/jplag/cli/ParamLabelRendererTest.java +++ b/cli/src/test/java/de/jplag/cli/ParamLabelRendererTest.java @@ -2,13 +2,14 @@ import java.util.List; -import de.jplag.cli.picocli.ParamLabelRenderer; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; +import de.jplag.cli.picocli.ParamLabelRenderer; + import picocli.CommandLine; /** From 0ab8cd99b3f6d66f18c3d2d8d34fdae74c6f3249 Mon Sep 17 00:00:00 2001 From: Alexander Milster Date: Fri, 23 Feb 2024 11:11:41 +0100 Subject: [PATCH 014/228] Sonarcloud issues --- cli/src/main/java/de/jplag/cli/OutputFileGenerator.java | 4 ++-- cli/src/main/java/de/jplag/cli/logger/JPlagLoggerBase.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/src/main/java/de/jplag/cli/OutputFileGenerator.java b/cli/src/main/java/de/jplag/cli/OutputFileGenerator.java index 90248ed6f5..15d5cd5aa0 100644 --- a/cli/src/main/java/de/jplag/cli/OutputFileGenerator.java +++ b/cli/src/main/java/de/jplag/cli/OutputFileGenerator.java @@ -13,9 +13,9 @@ import de.jplag.reporting.reportobject.ReportObjectFactory; public interface OutputFileGenerator { - OutputFileGenerator DEFAULT_OUTPUT_FILE_GENERATOR = new OutputFileGenerator() { - private static final Logger logger = LoggerFactory.getLogger(OutputFileGenerator.class); + Logger logger = LoggerFactory.getLogger(OutputFileGenerator.class); + OutputFileGenerator DEFAULT_OUTPUT_FILE_GENERATOR = new OutputFileGenerator() { @Override public void generateCsvOutput(JPlagResult result, File outputRoot, CliOptions options) { if (options.advanced.csvExport) { diff --git a/cli/src/main/java/de/jplag/cli/logger/JPlagLoggerBase.java b/cli/src/main/java/de/jplag/cli/logger/JPlagLoggerBase.java index 687426e8a0..34a59fedc7 100644 --- a/cli/src/main/java/de/jplag/cli/logger/JPlagLoggerBase.java +++ b/cli/src/main/java/de/jplag/cli/logger/JPlagLoggerBase.java @@ -22,7 +22,7 @@ public abstract class JPlagLoggerBase extends AbstractLogger { * @param currentLogLevel The current log level * @param name The name of the logger */ - public JPlagLoggerBase(Level currentLogLevel, String name) { + protected JPlagLoggerBase(Level currentLogLevel, String name) { this.currentLogLevel = currentLogLevel; this.name = name; } From 9dbfa3dd4ee2b99b930a134271d38343346a8a1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timur=20Sa=C4=9Flam?= Date: Fri, 23 Feb 2024 12:58:04 +0100 Subject: [PATCH 015/228] Adapt deploy action to also trigger when release drafts are published. --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b4ea875e36..24b94c6a4e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,7 +2,7 @@ name: Deploy to Maven Central & GitHub on: workflow_dispatch: release: - types: [created] + types: [created, published] jobs: publish-maven-central: runs-on: ubuntu-latest From ba6b1f01412bb1030037e0e86f51575492004f4d Mon Sep 17 00:00:00 2001 From: Alexander Milster Date: Sat, 24 Feb 2024 17:47:58 +0100 Subject: [PATCH 016/228] Changed the zip file creation to use the Path api instead of manually working with paths. --- .../java/de/jplag/reporting/FilePathUtil.java | 34 ++++++++++--------- .../jsonfactory/ComparisonReportWriter.java | 3 +- .../reportobject/ReportObjectFactory.java | 21 ++++++------ .../writer/DummyResultWriter.java | 7 ++-- .../writer/JPlagResultWriter.java | 7 ++-- .../reportobject/writer/ZipWriter.java | 15 ++++---- .../de/jplag/reporting/FilePathUtilTest.java | 26 -------------- 7 files changed, 48 insertions(+), 65 deletions(-) delete mode 100644 core/src/test/java/de/jplag/reporting/FilePathUtilTest.java diff --git a/core/src/main/java/de/jplag/reporting/FilePathUtil.java b/core/src/main/java/de/jplag/reporting/FilePathUtil.java index aff67ef3ec..e0b207d461 100644 --- a/core/src/main/java/de/jplag/reporting/FilePathUtil.java +++ b/core/src/main/java/de/jplag/reporting/FilePathUtil.java @@ -8,7 +8,6 @@ public final class FilePathUtil { private static final String ZIP_PATH_SEPARATOR = "/"; // Paths in zip files are always separated by a slash - private static final String WINDOWS_PATH_SEPARATOR = "\\"; private FilePathUtil() { // private constructor to prevent instantiation @@ -28,23 +27,26 @@ public static String getRelativeSubmissionPath(File file, Submission submission, return Path.of(submissionToIdFunction.apply(submission), submission.getRoot().toPath().relativize(file.toPath()).toString()).toString(); } - /** - * Joins logical paths using a slash. This method ensures, that no duplicate slashes are created in between. - * @param left The left path segment - * @param right The right path segment - * @return The joined paths - */ - public static String joinZipPathSegments(String left, String right) { - String rightStripped = right; - while (rightStripped.startsWith(ZIP_PATH_SEPARATOR) || rightStripped.startsWith(WINDOWS_PATH_SEPARATOR)) { - rightStripped = rightStripped.substring(1); + public static Path forceRelativePath(Path path) { + if (path.isAbsolute()) { + return Path.of("/").relativize(path); } + return path; + } - String leftStripped = left; - while (leftStripped.endsWith(ZIP_PATH_SEPARATOR) || leftStripped.startsWith(WINDOWS_PATH_SEPARATOR)) { - leftStripped = leftStripped.substring(0, leftStripped.length() - 1); - } + public static Path createRelativePath(String path) { + return forceRelativePath(Path.of(path)); + } - return leftStripped + ZIP_PATH_SEPARATOR + rightStripped; + public static String pathAsZipPath(Path path) { + Path real = forceRelativePath(path); + StringBuilder builder = new StringBuilder(); + for (int i = 0; i < real.getNameCount(); i++) { + if (i != 0) { + builder.append(ZIP_PATH_SEPARATOR); + } + builder.append(real.getName(i)); + } + return builder.toString(); } } diff --git a/core/src/main/java/de/jplag/reporting/jsonfactory/ComparisonReportWriter.java b/core/src/main/java/de/jplag/reporting/jsonfactory/ComparisonReportWriter.java index 29f93744c0..de599fd09b 100644 --- a/core/src/main/java/de/jplag/reporting/jsonfactory/ComparisonReportWriter.java +++ b/core/src/main/java/de/jplag/reporting/jsonfactory/ComparisonReportWriter.java @@ -1,5 +1,6 @@ package de.jplag.reporting.jsonfactory; +import java.nio.file.Path; import java.util.Comparator; import java.util.List; import java.util.Map; @@ -58,7 +59,7 @@ private void writeComparisons(List comparisons) { var comparisonReport = new ComparisonReport(firstSubmissionId, secondSubmissionId, Map.of(SimilarityMetric.AVG.name(), comparison.similarity(), SimilarityMetric.MAX.name(), comparison.maximalSimilarity()), convertMatchesToReportMatches(comparison), comparison.similarityOfFirst(), comparison.similarityOfSecond()); - resultWriter.addJsonEntry(comparisonReport, fileName); + resultWriter.addJsonEntry(comparisonReport, Path.of(fileName)); } } diff --git a/core/src/main/java/de/jplag/reporting/reportobject/ReportObjectFactory.java b/core/src/main/java/de/jplag/reporting/reportobject/ReportObjectFactory.java index d569a52520..5411aab820 100644 --- a/core/src/main/java/de/jplag/reporting/reportobject/ReportObjectFactory.java +++ b/core/src/main/java/de/jplag/reporting/reportobject/ReportObjectFactory.java @@ -4,6 +4,7 @@ import java.io.File; import java.io.FileNotFoundException; +import java.nio.file.Path; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; @@ -41,17 +42,17 @@ public class ReportObjectFactory { private static final Logger logger = LoggerFactory.getLogger(ReportObjectFactory.class); - public static final String OVERVIEW_FILE_NAME = "overview.json"; + public static final Path OVERVIEW_FILE_NAME = Path.of("overview.json"); - public static final String README_FILE_NAME = "README.txt"; - public static final String OPTIONS_FILE_NAME = "options.json"; + public static final Path README_FILE_NAME = Path.of("README.txt"); + public static final Path OPTIONS_FILE_NAME = Path.of("options.json"); private static final String[] README_CONTENT = new String[] {"This is a software plagiarism report generated by JPlag.", "To view the report go to https://jplag.github.io/JPlag/ and drag the generated zip file onto the page."}; - public static final String SUBMISSION_FILE_INDEX_FILE_NAME = "submissionFileIndex.json"; + public static final Path SUBMISSION_FILE_INDEX_FILE_NAME = Path.of("submissionFileIndex.json"); public static final Version REPORT_VIEWER_VERSION = JPlag.JPLAG_VERSION; - private static final String SUBMISSIONS_ROOT_PATH = "files/"; + private static final Path SUBMISSIONS_ROOT_PATH = Path.of("files"); private Map submissionNameToIdMap; private Function submissionToIdFunction; @@ -106,13 +107,13 @@ private void copySubmissionFilesToReport(JPlagResult result) { Set submissions = getSubmissions(comparisons); Language language = result.getOptions().language(); for (Submission submission : submissions) { - String submissionRootPath = SUBMISSIONS_ROOT_PATH + submissionToIdFunction.apply(submission); + Path submissionRootPath = SUBMISSIONS_ROOT_PATH.resolve(FilePathUtil.createRelativePath(submissionToIdFunction.apply(submission))); for (File file : submission.getFiles()) { - String relativeFilePath = file.getAbsolutePath().substring(submission.getRoot().getAbsolutePath().length()); - if (relativeFilePath.isEmpty()) { - relativeFilePath = file.getName(); + Path relativeFilePath = Path.of(submission.getRoot().getAbsolutePath()).relativize(Path.of(file.getAbsolutePath())); + if (relativeFilePath.getNameCount() == 0) { + relativeFilePath = Path.of(file.getName()); } - String zipPath = FilePathUtil.joinZipPathSegments(submissionRootPath, relativeFilePath); + Path zipPath = submissionRootPath.resolve(relativeFilePath); File fileToCopy = getFileToCopy(language, file); this.resultWriter.addFileContentEntry(zipPath, fileToCopy); diff --git a/core/src/main/java/de/jplag/reporting/reportobject/writer/DummyResultWriter.java b/core/src/main/java/de/jplag/reporting/reportobject/writer/DummyResultWriter.java index 1da95b72dd..4ca847090c 100644 --- a/core/src/main/java/de/jplag/reporting/reportobject/writer/DummyResultWriter.java +++ b/core/src/main/java/de/jplag/reporting/reportobject/writer/DummyResultWriter.java @@ -1,6 +1,7 @@ package de.jplag.reporting.reportobject.writer; import java.io.File; +import java.nio.file.Path; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -16,17 +17,17 @@ public class DummyResultWriter implements JPlagResultWriter { private static final String MESSAGE_CLOSE = "DummyWriter closed."; @Override - public void addJsonEntry(Object jsonContent, String path) { + public void addJsonEntry(Object jsonContent, Path path) { logger.info(MESSAGE_JSON, jsonContent, path); } @Override - public void addFileContentEntry(String path, File original) { + public void addFileContentEntry(Path path, File original) { logger.info(MESSAGE_FILE, original.getAbsolutePath(), path); } @Override - public void writeStringEntry(String entry, String path) { + public void writeStringEntry(String entry, Path path) { logger.info(MESSAGE_STRING, entry, path); } diff --git a/core/src/main/java/de/jplag/reporting/reportobject/writer/JPlagResultWriter.java b/core/src/main/java/de/jplag/reporting/reportobject/writer/JPlagResultWriter.java index 57fbed8c46..24f6dd4f78 100644 --- a/core/src/main/java/de/jplag/reporting/reportobject/writer/JPlagResultWriter.java +++ b/core/src/main/java/de/jplag/reporting/reportobject/writer/JPlagResultWriter.java @@ -1,6 +1,7 @@ package de.jplag.reporting.reportobject.writer; import java.io.File; +import java.nio.file.Path; /** * Writer for JPlag result data. The way paths are resolved depends on the implementation @@ -11,21 +12,21 @@ public interface JPlagResultWriter { * @param jsonContent The json content * @param path The path to write to */ - void addJsonEntry(Object jsonContent, String path); + void addJsonEntry(Object jsonContent, Path path); /** * Writes data from a file * @param path The path to write to * @param original The original file */ - void addFileContentEntry(String path, File original); + void addFileContentEntry(Path path, File original); /** * Writes data from a string * @param entry The string to write * @param path The path to write to */ - void writeStringEntry(String entry, String path); + void writeStringEntry(String entry, Path path); /** * Closes the writer diff --git a/core/src/main/java/de/jplag/reporting/reportobject/writer/ZipWriter.java b/core/src/main/java/de/jplag/reporting/reportobject/writer/ZipWriter.java index b7606c5353..db64237b00 100644 --- a/core/src/main/java/de/jplag/reporting/reportobject/writer/ZipWriter.java +++ b/core/src/main/java/de/jplag/reporting/reportobject/writer/ZipWriter.java @@ -6,12 +6,15 @@ import java.io.FileOutputStream; import java.io.IOException; import java.nio.charset.StandardCharsets; +import java.nio.file.Path; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import de.jplag.reporting.FilePathUtil; + import com.fasterxml.jackson.databind.ObjectMapper; /** @@ -39,9 +42,9 @@ public ZipWriter(File zipFile) throws FileNotFoundException { } @Override - public void addJsonEntry(Object jsonContent, String path) { + public void addJsonEntry(Object jsonContent, Path path) { try { - this.file.putNextEntry(new ZipEntry(path)); + this.file.putNextEntry(new ZipEntry(FilePathUtil.pathAsZipPath(path))); this.file.write(objectMapper.writeValueAsBytes(jsonContent)); this.file.closeEntry(); } catch (IOException e) { @@ -50,9 +53,9 @@ public void addJsonEntry(Object jsonContent, String path) { } @Override - public void addFileContentEntry(String path, File original) { + public void addFileContentEntry(Path path, File original) { try (FileInputStream inputStream = new FileInputStream(original)) { - this.file.putNextEntry(new ZipEntry(path)); + this.file.putNextEntry(new ZipEntry(FilePathUtil.pathAsZipPath(path))); inputStream.transferTo(this.file); } catch (IOException e) { logger.error(String.format(COPY_FILE_ERROR, original.getAbsolutePath(), path), e); @@ -60,9 +63,9 @@ public void addFileContentEntry(String path, File original) { } @Override - public void writeStringEntry(String entry, String path) { + public void writeStringEntry(String entry, Path path) { try { - this.file.putNextEntry(new ZipEntry(path)); + this.file.putNextEntry(new ZipEntry(FilePathUtil.pathAsZipPath(path))); this.file.write(entry.getBytes(StandardCharsets.UTF_8)); } catch (IOException e) { logger.error(String.format(WRITE_STRING_ERROR, path), e); diff --git a/core/src/test/java/de/jplag/reporting/FilePathUtilTest.java b/core/src/test/java/de/jplag/reporting/FilePathUtilTest.java deleted file mode 100644 index 661d7cc0b8..0000000000 --- a/core/src/test/java/de/jplag/reporting/FilePathUtilTest.java +++ /dev/null @@ -1,26 +0,0 @@ -package de.jplag.reporting; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -import org.junit.jupiter.api.Test; - -class FilePathUtilTest { - private static final String JOINED = "left/right"; - private static final String LEFT = "left"; - private static final String RIGHT = "right"; - - @Test - void testJoinPath() { - assertEquals(JOINED, FilePathUtil.joinZipPathSegments(LEFT, RIGHT)); - } - - @Test - void testJoinPathWithLeftSlashSuffix() { - assertEquals(JOINED, FilePathUtil.joinZipPathSegments(LEFT + "/", RIGHT)); - } - - @Test - void testJoinPathWithRightSlashSuffix() { - assertEquals(JOINED, FilePathUtil.joinZipPathSegments(LEFT, "/" + RIGHT)); - } -} \ No newline at end of file From cb4d0942a8d8367343f727f0fc7c9505ef316d84 Mon Sep 17 00:00:00 2001 From: Alexander Milster Date: Sun, 25 Feb 2024 13:22:30 +0100 Subject: [PATCH 017/228] Fixed bug if submission directories contain no subdirectories. --- .../de/jplag/reporting/reportobject/ReportObjectFactory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/de/jplag/reporting/reportobject/ReportObjectFactory.java b/core/src/main/java/de/jplag/reporting/reportobject/ReportObjectFactory.java index 5411aab820..a9a153b23e 100644 --- a/core/src/main/java/de/jplag/reporting/reportobject/ReportObjectFactory.java +++ b/core/src/main/java/de/jplag/reporting/reportobject/ReportObjectFactory.java @@ -110,7 +110,7 @@ private void copySubmissionFilesToReport(JPlagResult result) { Path submissionRootPath = SUBMISSIONS_ROOT_PATH.resolve(FilePathUtil.createRelativePath(submissionToIdFunction.apply(submission))); for (File file : submission.getFiles()) { Path relativeFilePath = Path.of(submission.getRoot().getAbsolutePath()).relativize(Path.of(file.getAbsolutePath())); - if (relativeFilePath.getNameCount() == 0) { + if (relativeFilePath.getNameCount() == 0 || relativeFilePath.equals(Path.of(""))) { relativeFilePath = Path.of(file.getName()); } Path zipPath = submissionRootPath.resolve(relativeFilePath); From 645110cb564bcd79823a55ce701f88e9a1dbcdb7 Mon Sep 17 00:00:00 2001 From: Alexander Milster Date: Sun, 25 Feb 2024 13:46:57 +0100 Subject: [PATCH 018/228] Fixed wrong paths in results.zip with multiple root directories. --- .../src/main/java/de/jplag/reporting/FilePathUtil.java | 10 +++------- .../reporting/jsonfactory/ComparisonReportWriter.java | 5 +++-- .../reporting/reportobject/ReportObjectFactory.java | 10 +++------- 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/core/src/main/java/de/jplag/reporting/FilePathUtil.java b/core/src/main/java/de/jplag/reporting/FilePathUtil.java index e0b207d461..0cd3347b04 100644 --- a/core/src/main/java/de/jplag/reporting/FilePathUtil.java +++ b/core/src/main/java/de/jplag/reporting/FilePathUtil.java @@ -20,11 +20,11 @@ private FilePathUtil() { * @param submissionToIdFunction Function to map names to ids * @return Relative path */ - public static String getRelativeSubmissionPath(File file, Submission submission, Function submissionToIdFunction) { + public static Path getRelativeSubmissionPath(File file, Submission submission, Function submissionToIdFunction) { if (file.toPath().equals(submission.getRoot().toPath())) { - return Path.of(submissionToIdFunction.apply(submission), submissionToIdFunction.apply(submission)).toString(); + return Path.of(submissionToIdFunction.apply(submission), submissionToIdFunction.apply(submission)); } - return Path.of(submissionToIdFunction.apply(submission), submission.getRoot().toPath().relativize(file.toPath()).toString()).toString(); + return Path.of(submissionToIdFunction.apply(submission), submission.getRoot().toPath().relativize(file.toPath()).toString()); } public static Path forceRelativePath(Path path) { @@ -34,10 +34,6 @@ public static Path forceRelativePath(Path path) { return path; } - public static Path createRelativePath(String path) { - return forceRelativePath(Path.of(path)); - } - public static String pathAsZipPath(Path path) { Path real = forceRelativePath(path); StringBuilder builder = new StringBuilder(); diff --git a/core/src/main/java/de/jplag/reporting/jsonfactory/ComparisonReportWriter.java b/core/src/main/java/de/jplag/reporting/jsonfactory/ComparisonReportWriter.java index de599fd09b..914d586723 100644 --- a/core/src/main/java/de/jplag/reporting/jsonfactory/ComparisonReportWriter.java +++ b/core/src/main/java/de/jplag/reporting/jsonfactory/ComparisonReportWriter.java @@ -105,8 +105,9 @@ private Match convertMatchToReportMatch(JPlagComparison comparison, de.jplag.Mat Token startOfSecond = tokensSecond.stream().min(lineComparator).orElseThrow(); Token endOfSecond = tokensSecond.stream().max(lineComparator).orElseThrow(); - return new Match(FilePathUtil.getRelativeSubmissionPath(startOfFirst.getFile(), comparison.firstSubmission(), submissionToIdFunction), - FilePathUtil.getRelativeSubmissionPath(startOfSecond.getFile(), comparison.secondSubmission(), submissionToIdFunction), + return new Match( + FilePathUtil.getRelativeSubmissionPath(startOfFirst.getFile(), comparison.firstSubmission(), submissionToIdFunction).toString(), + FilePathUtil.getRelativeSubmissionPath(startOfSecond.getFile(), comparison.secondSubmission(), submissionToIdFunction).toString(), startOfFirst.getLine(), endOfFirst.getLine(), startOfSecond.getLine(), endOfSecond.getLine(), match.length()); } diff --git a/core/src/main/java/de/jplag/reporting/reportobject/ReportObjectFactory.java b/core/src/main/java/de/jplag/reporting/reportobject/ReportObjectFactory.java index a9a153b23e..8ce7d205a4 100644 --- a/core/src/main/java/de/jplag/reporting/reportobject/ReportObjectFactory.java +++ b/core/src/main/java/de/jplag/reporting/reportobject/ReportObjectFactory.java @@ -107,13 +107,9 @@ private void copySubmissionFilesToReport(JPlagResult result) { Set submissions = getSubmissions(comparisons); Language language = result.getOptions().language(); for (Submission submission : submissions) { - Path submissionRootPath = SUBMISSIONS_ROOT_PATH.resolve(FilePathUtil.createRelativePath(submissionToIdFunction.apply(submission))); for (File file : submission.getFiles()) { - Path relativeFilePath = Path.of(submission.getRoot().getAbsolutePath()).relativize(Path.of(file.getAbsolutePath())); - if (relativeFilePath.getNameCount() == 0 || relativeFilePath.equals(Path.of(""))) { - relativeFilePath = Path.of(file.getName()); - } - Path zipPath = submissionRootPath.resolve(relativeFilePath); + Path filePath = FilePathUtil.getRelativeSubmissionPath(file, submission, submissionToIdFunction); + Path zipPath = SUBMISSIONS_ROOT_PATH.resolve(filePath); File fileToCopy = getFileToCopy(language, file); this.resultWriter.addFileContentEntry(zipPath, fileToCopy); @@ -176,7 +172,7 @@ private void writeSubmissionIndexFile(JPlagResult result) { List>> submissionTokenCountList = submissions.stream().parallel().map(submission -> { Map tokenCounts = new HashMap<>(); for (Map.Entry entry : submission.getTokenCountPerFile().entrySet()) { - String key = FilePathUtil.getRelativeSubmissionPath(entry.getKey(), submission, submissionToIdFunction); + String key = FilePathUtil.getRelativeSubmissionPath(entry.getKey(), submission, submissionToIdFunction).toString(); tokenCounts.put(key, new SubmissionFile(entry.getValue())); } return Map.of(submissionNameToIdMap.get(submission.getName()), tokenCounts); From ad948ae273034ef401f362095835d4817779f892 Mon Sep 17 00:00:00 2001 From: Alexander Milster Date: Mon, 26 Feb 2024 12:32:49 +0100 Subject: [PATCH 019/228] Revert "Fixed wrong paths in results.zip with multiple root directories." This reverts commit 645110cb564bcd79823a55ce701f88e9a1dbcdb7. --- .../src/main/java/de/jplag/reporting/FilePathUtil.java | 10 +++++++--- .../reporting/jsonfactory/ComparisonReportWriter.java | 5 ++--- .../reporting/reportobject/ReportObjectFactory.java | 10 +++++++--- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/core/src/main/java/de/jplag/reporting/FilePathUtil.java b/core/src/main/java/de/jplag/reporting/FilePathUtil.java index 0cd3347b04..e0b207d461 100644 --- a/core/src/main/java/de/jplag/reporting/FilePathUtil.java +++ b/core/src/main/java/de/jplag/reporting/FilePathUtil.java @@ -20,11 +20,11 @@ private FilePathUtil() { * @param submissionToIdFunction Function to map names to ids * @return Relative path */ - public static Path getRelativeSubmissionPath(File file, Submission submission, Function submissionToIdFunction) { + public static String getRelativeSubmissionPath(File file, Submission submission, Function submissionToIdFunction) { if (file.toPath().equals(submission.getRoot().toPath())) { - return Path.of(submissionToIdFunction.apply(submission), submissionToIdFunction.apply(submission)); + return Path.of(submissionToIdFunction.apply(submission), submissionToIdFunction.apply(submission)).toString(); } - return Path.of(submissionToIdFunction.apply(submission), submission.getRoot().toPath().relativize(file.toPath()).toString()); + return Path.of(submissionToIdFunction.apply(submission), submission.getRoot().toPath().relativize(file.toPath()).toString()).toString(); } public static Path forceRelativePath(Path path) { @@ -34,6 +34,10 @@ public static Path forceRelativePath(Path path) { return path; } + public static Path createRelativePath(String path) { + return forceRelativePath(Path.of(path)); + } + public static String pathAsZipPath(Path path) { Path real = forceRelativePath(path); StringBuilder builder = new StringBuilder(); diff --git a/core/src/main/java/de/jplag/reporting/jsonfactory/ComparisonReportWriter.java b/core/src/main/java/de/jplag/reporting/jsonfactory/ComparisonReportWriter.java index 914d586723..de599fd09b 100644 --- a/core/src/main/java/de/jplag/reporting/jsonfactory/ComparisonReportWriter.java +++ b/core/src/main/java/de/jplag/reporting/jsonfactory/ComparisonReportWriter.java @@ -105,9 +105,8 @@ private Match convertMatchToReportMatch(JPlagComparison comparison, de.jplag.Mat Token startOfSecond = tokensSecond.stream().min(lineComparator).orElseThrow(); Token endOfSecond = tokensSecond.stream().max(lineComparator).orElseThrow(); - return new Match( - FilePathUtil.getRelativeSubmissionPath(startOfFirst.getFile(), comparison.firstSubmission(), submissionToIdFunction).toString(), - FilePathUtil.getRelativeSubmissionPath(startOfSecond.getFile(), comparison.secondSubmission(), submissionToIdFunction).toString(), + return new Match(FilePathUtil.getRelativeSubmissionPath(startOfFirst.getFile(), comparison.firstSubmission(), submissionToIdFunction), + FilePathUtil.getRelativeSubmissionPath(startOfSecond.getFile(), comparison.secondSubmission(), submissionToIdFunction), startOfFirst.getLine(), endOfFirst.getLine(), startOfSecond.getLine(), endOfSecond.getLine(), match.length()); } diff --git a/core/src/main/java/de/jplag/reporting/reportobject/ReportObjectFactory.java b/core/src/main/java/de/jplag/reporting/reportobject/ReportObjectFactory.java index 8ce7d205a4..a9a153b23e 100644 --- a/core/src/main/java/de/jplag/reporting/reportobject/ReportObjectFactory.java +++ b/core/src/main/java/de/jplag/reporting/reportobject/ReportObjectFactory.java @@ -107,9 +107,13 @@ private void copySubmissionFilesToReport(JPlagResult result) { Set submissions = getSubmissions(comparisons); Language language = result.getOptions().language(); for (Submission submission : submissions) { + Path submissionRootPath = SUBMISSIONS_ROOT_PATH.resolve(FilePathUtil.createRelativePath(submissionToIdFunction.apply(submission))); for (File file : submission.getFiles()) { - Path filePath = FilePathUtil.getRelativeSubmissionPath(file, submission, submissionToIdFunction); - Path zipPath = SUBMISSIONS_ROOT_PATH.resolve(filePath); + Path relativeFilePath = Path.of(submission.getRoot().getAbsolutePath()).relativize(Path.of(file.getAbsolutePath())); + if (relativeFilePath.getNameCount() == 0 || relativeFilePath.equals(Path.of(""))) { + relativeFilePath = Path.of(file.getName()); + } + Path zipPath = submissionRootPath.resolve(relativeFilePath); File fileToCopy = getFileToCopy(language, file); this.resultWriter.addFileContentEntry(zipPath, fileToCopy); @@ -172,7 +176,7 @@ private void writeSubmissionIndexFile(JPlagResult result) { List>> submissionTokenCountList = submissions.stream().parallel().map(submission -> { Map tokenCounts = new HashMap<>(); for (Map.Entry entry : submission.getTokenCountPerFile().entrySet()) { - String key = FilePathUtil.getRelativeSubmissionPath(entry.getKey(), submission, submissionToIdFunction).toString(); + String key = FilePathUtil.getRelativeSubmissionPath(entry.getKey(), submission, submissionToIdFunction); tokenCounts.put(key, new SubmissionFile(entry.getValue())); } return Map.of(submissionNameToIdMap.get(submission.getName()), tokenCounts); From 8ad5794e8d6dff3ea2f6d394c4bea00d88f4a5ae Mon Sep 17 00:00:00 2001 From: Alexander Milster Date: Mon, 26 Feb 2024 13:03:33 +0100 Subject: [PATCH 020/228] Fixed a bug, where the cpp listener could throw a null pointer exception. --- languages/cpp/src/main/java/de/jplag/cpp/CPPListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages/cpp/src/main/java/de/jplag/cpp/CPPListener.java b/languages/cpp/src/main/java/de/jplag/cpp/CPPListener.java index 28a6a88b9a..6bfa81c098 100644 --- a/languages/cpp/src/main/java/de/jplag/cpp/CPPListener.java +++ b/languages/cpp/src/main/java/de/jplag/cpp/CPPListener.java @@ -207,7 +207,7 @@ private void declarationRules() { visit(ParameterDeclarationContext.class).map(VARDEF).withSemantics(CodeSemantics::new).onEnter((ctx, varReg) -> { // don't register parameters in function declarations, e.g. bc6h_enc lines 117-120 - if (hasAncestor(ctx, FunctionDefinitionContext.class, SimpleDeclarationContext.class)) { + if (hasAncestor(ctx, FunctionDefinitionContext.class, SimpleDeclarationContext.class) && ctx.declarator() != null) { CPP14Parser.PointerDeclaratorContext pd = ctx.declarator().pointerDeclarator(); String name = pd.noPointerDeclarator().getText(); varReg.registerVariable(name, VariableScope.LOCAL, true); From dddd8f2a6c6801ba3ed8d662a8cc88e31a4d78cc Mon Sep 17 00:00:00 2001 From: Alexander Milster Date: Tue, 27 Feb 2024 15:00:01 +0100 Subject: [PATCH 021/228] Javadoc --- .../java/de/jplag/reporting/FilePathUtil.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/core/src/main/java/de/jplag/reporting/FilePathUtil.java b/core/src/main/java/de/jplag/reporting/FilePathUtil.java index e0b207d461..fd601941b6 100644 --- a/core/src/main/java/de/jplag/reporting/FilePathUtil.java +++ b/core/src/main/java/de/jplag/reporting/FilePathUtil.java @@ -27,6 +27,11 @@ public static String getRelativeSubmissionPath(File file, Submission submission, return Path.of(submissionToIdFunction.apply(submission), submission.getRoot().toPath().relativize(file.toPath()).toString()).toString(); } + /** + * Forces a path to be relative. If the path is absolute, the returned path will be relative to the root. + * @param path The path to relativize + * @return The relative path + */ public static Path forceRelativePath(Path path) { if (path.isAbsolute()) { return Path.of("/").relativize(path); @@ -34,10 +39,21 @@ public static Path forceRelativePath(Path path) { return path; } + /** + * Returns the relative path found in the string. + * @see #forceRelativePath(Path) + * @param path The path string + * @return The relative path + */ public static Path createRelativePath(String path) { return forceRelativePath(Path.of(path)); } + /** + * Formats the path for usage with zip files. Returns the path segments separated by {@link #ZIP_PATH_SEPARATOR} + * @param path The path to format + * @return The zip file path + */ public static String pathAsZipPath(Path path) { Path real = forceRelativePath(path); StringBuilder builder = new StringBuilder(); From e779e55f26d2f95263651529d374e43c1c2a8e7d Mon Sep 17 00:00:00 2001 From: Alexander Milster Date: Tue, 27 Feb 2024 15:41:21 +0100 Subject: [PATCH 022/228] Avoided null pointer exception in JPlagGoListener. --- .../main/java/de/jplag/golang/JPlagGoListener.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/languages/golang/src/main/java/de/jplag/golang/JPlagGoListener.java b/languages/golang/src/main/java/de/jplag/golang/JPlagGoListener.java index 8774fb81d0..1e6c813546 100644 --- a/languages/golang/src/main/java/de/jplag/golang/JPlagGoListener.java +++ b/languages/golang/src/main/java/de/jplag/golang/JPlagGoListener.java @@ -542,8 +542,16 @@ public void visitTerminal(TerminalNode node) { expectAndLeave(GoBlockContext.IF_BLOCK); enterContext(GoBlockContext.ELSE_BLOCK); } - case "{" -> transformToken(getCurrentContext().getBegin(), token); - case "}" -> transformToken(getCurrentContext().getEnd(), token); + case "{" -> { + if(getCurrentContext() != null) { + transformToken(getCurrentContext().getBegin(), token); + } + } + case "}" -> { + if(getCurrentContext() != null) { + transformToken(getCurrentContext().getEnd(), token); + } + } default -> { // do nothing. } From 51dae1c972a7182ec9428a37869939cb40984881 Mon Sep 17 00:00:00 2001 From: Alexander Milster Date: Tue, 27 Feb 2024 15:42:48 +0100 Subject: [PATCH 023/228] spotless --- .../golang/src/main/java/de/jplag/golang/JPlagGoListener.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/languages/golang/src/main/java/de/jplag/golang/JPlagGoListener.java b/languages/golang/src/main/java/de/jplag/golang/JPlagGoListener.java index 1e6c813546..e2251353d6 100644 --- a/languages/golang/src/main/java/de/jplag/golang/JPlagGoListener.java +++ b/languages/golang/src/main/java/de/jplag/golang/JPlagGoListener.java @@ -543,12 +543,12 @@ public void visitTerminal(TerminalNode node) { enterContext(GoBlockContext.ELSE_BLOCK); } case "{" -> { - if(getCurrentContext() != null) { + if (getCurrentContext() != null) { transformToken(getCurrentContext().getBegin(), token); } } case "}" -> { - if(getCurrentContext() != null) { + if (getCurrentContext() != null) { transformToken(getCurrentContext().getEnd(), token); } } From 1e0f8b1e7ff254f7aea44911f032b7c0f1e74236 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timur=20Sa=C4=9Flam?= Date: Tue, 27 Feb 2024 17:09:12 +0100 Subject: [PATCH 024/228] Fix sonar link of the coverage badge. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 303ce1a573..507651819f 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ [![Maven Central](https://maven-badges.herokuapp.com/maven-central/de.jplag/jplag/badge.svg)](https://maven-badges.herokuapp.com/maven-central/de.jplag/jplag) [![License](https://img.shields.io/github/license/jplag/jplag.svg)](https://github.com/jplag/jplag/blob/main/LICENSE) [![GitHub commit activity](https://img.shields.io/github/commit-activity/y/jplag/JPlag)](https://github.com/jplag/JPlag/pulse) -[![SonarCloud Coverage](https://sonarcloud.io/api/project_badges/measure?project=jplag_JPlag&metric=coverage)](https://sonarcloud.io/component_measures/metric/coverage/list?id=jplag_JPlag) +[![SonarCloud Coverage](https://sonarcloud.io/api/project_badges/measure?project=jplag_JPlag&metric=coverage)](https://sonarcloud.io/component_measures?metric=Coverage&view=list&id=jplag_JPlag) [![Report Viewer](https://img.shields.io/badge/report%20viewer-online-b80025)](https://jplag.github.io/JPlag/) [![Java Version](https://img.shields.io/badge/java-SE%2021-yellowgreen)](#download-and-installation) From 025e4c7c6945b11723755b396d1d0d234cb4bc19 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Feb 2024 11:21:00 +0100 Subject: [PATCH 025/228] Dependency(deps-dev): Bump @playwright/test from 1.41.2 to 1.42.0 in /report-viewer (#1623) Bumps [@playwright/test](https://github.com/microsoft/playwright) from 1.41.2 to 1.42.0. - [Release notes](https://github.com/microsoft/playwright/releases) - [Commits](https://github.com/microsoft/playwright/compare/v1.41.2...v1.42.0) --- updated-dependencies: - dependency-name: "@playwright/test" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- report-viewer/package-lock.json | 24 ++++++++++++------------ report-viewer/package.json | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/report-viewer/package-lock.json b/report-viewer/package-lock.json index 7b3a9ee5fe..578fc90e30 100644 --- a/report-viewer/package-lock.json +++ b/report-viewer/package-lock.json @@ -27,7 +27,7 @@ "vue-virtual-scroller": "^2.0.0-beta.8" }, "devDependencies": { - "@playwright/test": "^1.40.1", + "@playwright/test": "^1.42.0", "@rushstack/eslint-patch": "^1.7.2", "@types/jsdom": "^21.1.6", "@types/node": "^18.19.17", @@ -824,12 +824,12 @@ } }, "node_modules/@playwright/test": { - "version": "1.41.2", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.41.2.tgz", - "integrity": "sha512-qQB9h7KbibJzrDpkXkYvsmiDJK14FULCCZgEcoe2AvFAS64oCirWTwzTlAYEbKaRxWs5TFesE1Na6izMv3HfGg==", + "version": "1.42.0", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.42.0.tgz", + "integrity": "sha512-2k1HzC28Fs+HiwbJOQDUwrWMttqSLUVdjCqitBOjdCD0svWOMQUVqrXX6iFD7POps6xXAojsX/dGBpKnjZctLA==", "dev": true, "dependencies": { - "playwright": "1.41.2" + "playwright": "1.42.0" }, "bin": { "playwright": "cli.js" @@ -5309,12 +5309,12 @@ } }, "node_modules/playwright": { - "version": "1.41.2", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.41.2.tgz", - "integrity": "sha512-v0bOa6H2GJChDL8pAeLa/LZC4feoAMbSQm1/jF/ySsWWoaNItvrMP7GEkvEEFyCTUYKMxjQKaTSg5up7nR6/8A==", + "version": "1.42.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.42.0.tgz", + "integrity": "sha512-Ko7YRUgj5xBHbntrgt4EIw/nE//XBHOKVKnBjO1KuZkmkhlbgyggTe5s9hjqQ1LpN+Xg+kHsQyt5Pa0Bw5XpvQ==", "dev": true, "dependencies": { - "playwright-core": "1.41.2" + "playwright-core": "1.42.0" }, "bin": { "playwright": "cli.js" @@ -5327,9 +5327,9 @@ } }, "node_modules/playwright-core": { - "version": "1.41.2", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.41.2.tgz", - "integrity": "sha512-VaTvwCA4Y8kxEe+kfm2+uUUw5Lubf38RxF7FpBxLPmGe5sdNkSg5e3ChEigaGrX7qdqT3pt2m/98LiyvU2x6CA==", + "version": "1.42.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.42.0.tgz", + "integrity": "sha512-0HD9y8qEVlcbsAjdpBaFjmaTHf+1FeIddy8VJLeiqwhcNqGCBe4Wp2e8knpqiYbzxtxarxiXyNDw2cG8sCaNMQ==", "dev": true, "bin": { "playwright-core": "cli.js" diff --git a/report-viewer/package.json b/report-viewer/package.json index 2c808cde0d..c2c6187838 100644 --- a/report-viewer/package.json +++ b/report-viewer/package.json @@ -38,7 +38,7 @@ "vue-virtual-scroller": "^2.0.0-beta.8" }, "devDependencies": { - "@playwright/test": "^1.40.1", + "@playwright/test": "^1.42.0", "@rushstack/eslint-patch": "^1.7.2", "@types/jsdom": "^21.1.6", "@types/node": "^18.19.17", From 273e22764b30957c8106b2b929db035242c88764 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Feb 2024 11:22:15 +0100 Subject: [PATCH 026/228] Dependency(deps): Bump vue-router from 4.2.5 to 4.3.0 in /report-viewer (#1624) Bumps [vue-router](https://github.com/vuejs/router) from 4.2.5 to 4.3.0. - [Release notes](https://github.com/vuejs/router/releases) - [Commits](https://github.com/vuejs/router/compare/v4.2.5...v4.3.0) --- updated-dependencies: - dependency-name: vue-router dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- report-viewer/package-lock.json | 10 +++++----- report-viewer/package.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/report-viewer/package-lock.json b/report-viewer/package-lock.json index 578fc90e30..f6dc4d0ae6 100644 --- a/report-viewer/package-lock.json +++ b/report-viewer/package-lock.json @@ -23,7 +23,7 @@ "vue": "^3.3.4", "vue-chartjs": "^5.3.0", "vue-draggable-next": "^2.2.1", - "vue-router": "^4.2.5", + "vue-router": "^4.3.0", "vue-virtual-scroller": "^2.0.0-beta.8" }, "devDependencies": { @@ -7159,11 +7159,11 @@ } }, "node_modules/vue-router": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.2.5.tgz", - "integrity": "sha512-DIUpKcyg4+PTQKfFPX88UWhlagBEBEfJ5A8XDXRJLUnZOvcpMF8o/dnL90vpVkGaPbjvXazV/rC1qBKrZlFugw==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.3.0.tgz", + "integrity": "sha512-dqUcs8tUeG+ssgWhcPbjHvazML16Oga5w34uCUmsk7i0BcnskoLGwjpa15fqMr2Fa5JgVBrdL2MEgqz6XZ/6IQ==", "dependencies": { - "@vue/devtools-api": "^6.5.0" + "@vue/devtools-api": "^6.5.1" }, "funding": { "url": "https://github.com/sponsors/posva" diff --git a/report-viewer/package.json b/report-viewer/package.json index c2c6187838..789e3b13fd 100644 --- a/report-viewer/package.json +++ b/report-viewer/package.json @@ -34,7 +34,7 @@ "vue": "^3.3.4", "vue-chartjs": "^5.3.0", "vue-draggable-next": "^2.2.1", - "vue-router": "^4.2.5", + "vue-router": "^4.3.0", "vue-virtual-scroller": "^2.0.0-beta.8" }, "devDependencies": { From 20f5c924d2465af60b29fa1d726382820ea8150d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Feb 2024 11:40:54 +0100 Subject: [PATCH 027/228] Dependency(deps-dev): Bump eslint from 8.56.0 to 8.57.0 in /report-viewer (#1626) Bumps [eslint](https://github.com/eslint/eslint) from 8.56.0 to 8.57.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.56.0...v8.57.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- report-viewer/package-lock.json | 18 +++++++++--------- report-viewer/package.json | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/report-viewer/package-lock.json b/report-viewer/package-lock.json index f6dc4d0ae6..8c71324aa3 100644 --- a/report-viewer/package-lock.json +++ b/report-viewer/package-lock.json @@ -37,7 +37,7 @@ "@vue/test-utils": "^2.4.3", "@vue/tsconfig": "^0.5.1", "autoprefixer": "^10.4.16", - "eslint": "^8.56.0", + "eslint": "^8.57.0", "eslint-plugin-vue": "^9.20.1", "husky": "^9.0.11", "jsdom": "^24.0.0", @@ -523,9 +523,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.56.0.tgz", - "integrity": "sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -2712,16 +2712,16 @@ } }, "node_modules/eslint": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.56.0.tgz", - "integrity": "sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.56.0", - "@humanwhocodes/config-array": "^0.11.13", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "@ungap/structured-clone": "^1.2.0", diff --git a/report-viewer/package.json b/report-viewer/package.json index 789e3b13fd..84573fb1ce 100644 --- a/report-viewer/package.json +++ b/report-viewer/package.json @@ -48,7 +48,7 @@ "@vue/test-utils": "^2.4.3", "@vue/tsconfig": "^0.5.1", "autoprefixer": "^10.4.16", - "eslint": "^8.56.0", + "eslint": "^8.57.0", "eslint-plugin-vue": "^9.20.1", "husky": "^9.0.11", "jsdom": "^24.0.0", From db7379807d277e4f187f2c82c98ea795632dc0d1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Feb 2024 11:47:13 +0100 Subject: [PATCH 028/228] Dependency(deps-dev): Bump eslint-plugin-vue from 9.21.1 to 9.22.0 in /report-viewer (#1627) Bumps [eslint-plugin-vue](https://github.com/vuejs/eslint-plugin-vue) from 9.21.1 to 9.22.0. - [Release notes](https://github.com/vuejs/eslint-plugin-vue/releases) - [Commits](https://github.com/vuejs/eslint-plugin-vue/compare/v9.21.1...v9.22.0) --- updated-dependencies: - dependency-name: eslint-plugin-vue dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- report-viewer/package-lock.json | 18 +++++++++--------- report-viewer/package.json | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/report-viewer/package-lock.json b/report-viewer/package-lock.json index 8c71324aa3..e3d25ac81f 100644 --- a/report-viewer/package-lock.json +++ b/report-viewer/package-lock.json @@ -38,7 +38,7 @@ "@vue/tsconfig": "^0.5.1", "autoprefixer": "^10.4.16", "eslint": "^8.57.0", - "eslint-plugin-vue": "^9.20.1", + "eslint-plugin-vue": "^9.22.0", "husky": "^9.0.11", "jsdom": "^24.0.0", "lint-staged": "^15.2.2", @@ -2809,16 +2809,16 @@ } }, "node_modules/eslint-plugin-vue": { - "version": "9.21.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-9.21.1.tgz", - "integrity": "sha512-XVtI7z39yOVBFJyi8Ljbn7kY9yHzznKXL02qQYn+ta63Iy4A9JFBw6o4OSB9hyD2++tVT+su9kQqetUyCCwhjw==", + "version": "9.22.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-9.22.0.tgz", + "integrity": "sha512-7wCXv5zuVnBtZE/74z4yZ0CM8AjH6bk4MQGm7hZjUC2DBppKU5ioeOk5LGSg/s9a1ZJnIsdPLJpXnu1Rc+cVHg==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "natural-compare": "^1.4.0", "nth-check": "^2.1.1", - "postcss-selector-parser": "^6.0.13", - "semver": "^7.5.4", + "postcss-selector-parser": "^6.0.15", + "semver": "^7.6.0", "vue-eslint-parser": "^9.4.2", "xml-name-validator": "^4.0.0" }, @@ -6027,9 +6027,9 @@ } }, "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" diff --git a/report-viewer/package.json b/report-viewer/package.json index 84573fb1ce..54eff801e1 100644 --- a/report-viewer/package.json +++ b/report-viewer/package.json @@ -49,7 +49,7 @@ "@vue/tsconfig": "^0.5.1", "autoprefixer": "^10.4.16", "eslint": "^8.57.0", - "eslint-plugin-vue": "^9.20.1", + "eslint-plugin-vue": "^9.22.0", "husky": "^9.0.11", "jsdom": "^24.0.0", "lint-staged": "^15.2.2", From b890f0136e88155a838c147dfe84aecc187717f4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Feb 2024 11:51:35 +0100 Subject: [PATCH 029/228] Dependency(deps-dev): Bump @types/node from 18.19.17 to 18.19.19 in /report-viewer (#1625) Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.19.17 to 18.19.19. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- report-viewer/package-lock.json | 8 ++++---- report-viewer/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/report-viewer/package-lock.json b/report-viewer/package-lock.json index e3d25ac81f..25fbf6c8db 100644 --- a/report-viewer/package-lock.json +++ b/report-viewer/package-lock.json @@ -30,7 +30,7 @@ "@playwright/test": "^1.42.0", "@rushstack/eslint-patch": "^1.7.2", "@types/jsdom": "^21.1.6", - "@types/node": "^18.19.17", + "@types/node": "^18.19.19", "@vitejs/plugin-vue": "^5.0.4", "@vue/eslint-config-prettier": "^9.0.0", "@vue/eslint-config-typescript": "^12.0.0", @@ -1053,9 +1053,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.19.17", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.17.tgz", - "integrity": "sha512-SzyGKgwPzuWp2SHhlpXKzCX0pIOfcI4V2eF37nNBJOhwlegQ83omtVQ1XxZpDE06V/d6AQvfQdPfnw0tRC//Ng==", + "version": "18.19.19", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.19.tgz", + "integrity": "sha512-qqV6hSy9zACEhQUy5CEGeuXAZN0fNjqLWRIvOXOwdFYhFoKBiY08VKR5kgchr90+TitLVhpUEb54hk4bYaArUw==", "dev": true, "dependencies": { "undici-types": "~5.26.4" diff --git a/report-viewer/package.json b/report-viewer/package.json index 54eff801e1..1d12e5ed37 100644 --- a/report-viewer/package.json +++ b/report-viewer/package.json @@ -41,7 +41,7 @@ "@playwright/test": "^1.42.0", "@rushstack/eslint-patch": "^1.7.2", "@types/jsdom": "^21.1.6", - "@types/node": "^18.19.17", + "@types/node": "^18.19.19", "@vitejs/plugin-vue": "^5.0.4", "@vue/eslint-config-prettier": "^9.0.0", "@vue/eslint-config-typescript": "^12.0.0", From fd0aa7bd5f12582084843a2dd36bb969edace169 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Feb 2024 10:16:23 +0000 Subject: [PATCH 030/228] Dependency(deps): Bump org.codehaus.mojo:exec-maven-plugin Bumps [org.codehaus.mojo:exec-maven-plugin](https://github.com/mojohaus/exec-maven-plugin) from 3.1.1 to 3.2.0. - [Release notes](https://github.com/mojohaus/exec-maven-plugin/releases) - [Commits](https://github.com/mojohaus/exec-maven-plugin/compare/3.1.1...3.2.0) --- updated-dependencies: - dependency-name: org.codehaus.mojo:exec-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- cli/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/pom.xml b/cli/pom.xml index 5c6ab259f6..833b0d3840 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -183,7 +183,7 @@ org.codehaus.mojo exec-maven-plugin - 3.1.1 + 3.2.0 npm install From a7e60f278a924872d89b2ec20a276687bf64d95e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Feb 2024 10:16:37 +0000 Subject: [PATCH 031/228] Dependency(deps): Bump org.scala-lang:scala-library Bumps [org.scala-lang:scala-library](https://github.com/scala/scala) from 2.13.12 to 2.13.13. - [Release notes](https://github.com/scala/scala/releases) - [Commits](https://github.com/scala/scala/compare/v2.13.12...v2.13.13) --- updated-dependencies: - dependency-name: org.scala-lang:scala-library dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- languages/scala/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages/scala/pom.xml b/languages/scala/pom.xml index 50cb9e70fd..c0dca1f03b 100644 --- a/languages/scala/pom.xml +++ b/languages/scala/pom.xml @@ -10,7 +10,7 @@ scala - 2.13.12 + 2.13.13 2.13 From 2f4e07076f86ac049dc45392f9f8be5120b7531b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Feb 2024 10:16:31 +0000 Subject: [PATCH 032/228] Dependency(deps): Bump org.eclipse.emf:org.eclipse.emf.common Bumps [org.eclipse.emf:org.eclipse.emf.common](https://github.com/eclipse-emf/org.eclipse.emf) from 2.29.0 to 2.30.0. - [Commits](https://github.com/eclipse-emf/org.eclipse.emf/commits) --- updated-dependencies: - dependency-name: org.eclipse.emf:org.eclipse.emf.common dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ee1657039e..12d8f6cd2f 100644 --- a/pom.xml +++ b/pom.xml @@ -81,7 +81,7 @@ 2.7.7 4.13.1 2.35.0 - 2.29.0 + 2.30.0 2.36.0 1.0.0 From 4dc6b2bb811e5c51a72670598d74e8a57bc3a13e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Feb 2024 14:04:53 +0000 Subject: [PATCH 033/228] Dependency(deps): Bump org.eclipse.emf:org.eclipse.emf.ecore Bumps [org.eclipse.emf:org.eclipse.emf.ecore](https://github.com/eclipse-emf/org.eclipse.emf) from 2.35.0 to 2.36.0. - [Commits](https://github.com/eclipse-emf/org.eclipse.emf/commits) --- updated-dependencies: - dependency-name: org.eclipse.emf:org.eclipse.emf.ecore dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 12d8f6cd2f..b7116fc47e 100644 --- a/pom.xml +++ b/pom.xml @@ -80,7 +80,7 @@ 2.7.7 4.13.1 - 2.35.0 + 2.36.0 2.30.0 2.36.0 1.0.0 From 72737109e8f688968a7a1eff2f71ad5f5f0f0887 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Feb 2024 14:05:08 +0000 Subject: [PATCH 034/228] Dependency(deps): Bump org.eclipse.emf:org.eclipse.emf.ecore.xmi Bumps [org.eclipse.emf:org.eclipse.emf.ecore.xmi](https://github.com/eclipse-emf/org.eclipse.emf) from 2.36.0 to 2.37.0. - [Commits](https://github.com/eclipse-emf/org.eclipse.emf/commits) --- updated-dependencies: - dependency-name: org.eclipse.emf:org.eclipse.emf.ecore.xmi dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b7116fc47e..080bc524d2 100644 --- a/pom.xml +++ b/pom.xml @@ -82,7 +82,7 @@ 4.13.1 2.36.0 2.30.0 - 2.36.0 + 2.37.0 1.0.0 From 204ef0528bb81b00b66b05635a6ff391e493905d Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Thu, 29 Feb 2024 15:47:09 +0100 Subject: [PATCH 035/228] check for multiple text/html variants --- report-viewer/src/model/factories/BaseFactory.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/report-viewer/src/model/factories/BaseFactory.ts b/report-viewer/src/model/factories/BaseFactory.ts index 4a01d60c92..238d9b65f8 100644 --- a/report-viewer/src/model/factories/BaseFactory.ts +++ b/report-viewer/src/model/factories/BaseFactory.ts @@ -55,7 +55,7 @@ export class BaseFactory { if (request.status == 200) { const blob = await request.blob() // Check that file is not the index.html - if (blob.type == 'text/html') { + if (blob.type.includes('text/html')) { throw new Error(`Could not find ${path} in local files.`) } return blob From 61bbbccda4224c14f08054ad87ce068e5658f64b Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Thu, 29 Feb 2024 16:57:40 +0100 Subject: [PATCH 036/228] first layout of workflow file --- .github/workflows/complete-e2e.yml | 164 ++++++++++++++++++++++++ .github/workflows/report-viewer-e2e.yml | 58 --------- 2 files changed, 164 insertions(+), 58 deletions(-) create mode 100644 .github/workflows/complete-e2e.yml delete mode 100644 .github/workflows/report-viewer-e2e.yml diff --git a/.github/workflows/complete-e2e.yml b/.github/workflows/complete-e2e.yml new file mode 100644 index 0000000000..adf3455c5e --- /dev/null +++ b/.github/workflows/complete-e2e.yml @@ -0,0 +1,164 @@ +# Builds JPlag and then runs Datasets and Report Viewer e2e tests on multiple OS +name: Complete e2e Test + +on: + workflow_dispatch: + # temprary + push: + pull_request: + types: [opened, synchronize, reopened] + paths: + - ".github/workflows/complete-e2e.yml" + - "report-viewer/**" + - "**/pom.xml" + - "**.java" + - "**.g4" + +jobs: + pre_job: + runs-on: ubuntu-latest + outputs: + should_skip: ${{ steps.skip_check.outputs.should_skip }} + steps: + - id: skip_check + uses: fkirc/skip-duplicate-actions@master + with: + concurrent_skipping: 'same_content_newer' + skip_after_successful_duplicate: 'true' + + build_jar: + needs: pre_job + if: ${{ needs.pre_job.outputs.should_skip != 'true' }} + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up JDK + uses: actions/setup-java@v4 + with: + java-version: 21 + distribution: 'temurin' + + - uses: actions/setup-node@v4 + with: + node-version: "18" + + - name: Run Tests + run: mvn verify -B -U + + - name: Build Assembly + run: mvn -Pwith-report-viewer -DskipTests clean package assembly:single + + - name: Raname Jar + run: mv cli/target/jplag-*-jar-with-dependencies.jar cli/target/jplag.jar + + - name: Upload Assembly + uses: actions/upload-artifact@v4 + with: + name: "JPlag" + path: "cli/target/jplag.jar" + + run_jplag: + needs: build_jar + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + dataset: [ + {zip: "progpedia.zip", name: "progpedia", folder: "ACCEPTED", base: "base", language: "java", cliArgs: ""}, + ] + + steps: + - name: Checkout πŸ›ŽοΈ + uses: actions/checkout@v4 + + - name: Set up JDK + uses: actions/setup-java@v4 + with: + java-version: 21 + distribution: 'temurin' + + - name: Get JAR + uses: actions/download-artifact@v4 + with: + name: JPlag + + - name: Copy and unzip dataset + run: | + if [${{matrix.os}} == "windows-latest"]; then + Expand-Archive -LiteralPath .github/workflows/files/${{ matrix.dataset.zip }} -DestinationPath ./ + elif [${{matrix.os}} == "macos-latest"]; then + unzip .github/workflows/files/${{ matrix.dataset.zip }} -d ./ + else + unzip ./ .github/workflows/files/${{ matrix.dataset.zip }} + fi + + - name: Run JPlag + run: | + if [${{matrix.dataset.base}} == "undefined"]; then + java -jar jplag.jar ${{ matrix.dataset.folder }} -l ${{ matrix.dataset.language }} -r ${{ matrix.dataset.name }}-report ${{ matrix.dataset.cliArgs }} + else + java -jar jplag.jar ${{ matrix.dataset.folder }} -l ${{ matrix.dataset.language }} -r ${{ matrix.dataset.name }}-report -bc ${{ matrix.os.base }} ${{ matrix.dataset.cliArgs }} + fi + + - name: Upload Result + uses: actions/upload-artifact@v4 + with: + name: "${{ matrix.dataset.name }}-${{ matrix.os }}" + path: "${{ matrix.dataset.name }}-report.zip" + + e2e_test: + needs: run_jplag + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + + steps: + - name: Checkout πŸ›ŽοΈ + uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: "18" + + - name: Install and Build πŸ”§ + working-directory: report-viewer + run: | + npm install + npm run build + + - name: Install playwright πŸ”§ + working-directory: report-viewer + run: npx playwright install --with-deps + + - name: Download JPlag Reports + uses: actions/download-artifact@v4 + with: + name: "progpedia-${{ matrix.os }}" + path: "report-viewer/tests/e2e/assets/progpedia.zip" + + - name: Rename Files + working-directory: report-viewer/tests/e2e/assets + run: | + if [${{matrix.os}} == "windows-latest"]; then + ren progpedia-${{matrix.os}}.zip progpedia.zip + else + mv progpedia-${{matrix.os}}.zip progpedia.zip + fi + + - name: Run tests πŸ§ͺ + working-directory: report-viewer + run: | + npm run test:e2e + + - name: Upload test results πŸ“€ + uses: actions/upload-artifact@v4 + if: always() + with: + name: "test-results-${{ matrix.os }}" + path: | + report-viewer/test-results + report-viewer/playwright-report + retention-days: 30 \ No newline at end of file diff --git a/.github/workflows/report-viewer-e2e.yml b/.github/workflows/report-viewer-e2e.yml deleted file mode 100644 index 98744e5548..0000000000 --- a/.github/workflows/report-viewer-e2e.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: Report Viewer e2e Test - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize, reopened] - paths: - - ".github/workflows/report-viewer-e2e.yml" - - "report-viewer/**" - -jobs: - pre_job: - runs-on: ubuntu-latest - outputs: - should_skip: ${{ steps.skip_check.outputs.should_skip }} - steps: - - id: skip_check - uses: fkirc/skip-duplicate-actions@master - with: - concurrent_skipping: 'same_content_newer' - skip_after_successful_duplicate: 'true' - - test: - needs: pre_job - if: ${{ needs.pre_job.outputs.should_skip != 'true' }} - runs-on: ubuntu-latest - steps: - - name: Checkout πŸ›ŽοΈ - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - node-version: "18" - - - name: Install and Build πŸ”§ - working-directory: report-viewer - run: | - npm install - npm run build - - - name: Install playwright πŸ”§ - working-directory: report-viewer - run: npx playwright install --with-deps - - - name: Run tests πŸ§ͺ - working-directory: report-viewer - run: | - npm run test:e2e - - - name: Upload test results πŸ“€ - uses: actions/upload-artifact@v4 - if: always() - with: - name: test-results - path: | - report-viewer/test-results - report-viewer/playwright-report - retention-days: 30 \ No newline at end of file From 985a68d3b11f814b3be9d543dccad10437113501 Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Thu, 29 Feb 2024 18:23:21 +0100 Subject: [PATCH 037/228] adapt e2e tests to progpedia dataset --- report-viewer/.gitignore | 1 + report-viewer/tests/e2e/Comparison.spec.ts | 52 +++++++++++--------- report-viewer/tests/e2e/Distribution.spec.ts | 2 +- report-viewer/tests/e2e/Information.spec.ts | 34 ++++++------- 4 files changed, 48 insertions(+), 41 deletions(-) diff --git a/report-viewer/.gitignore b/report-viewer/.gitignore index 719bf30c14..9d12524399 100644 --- a/report-viewer/.gitignore +++ b/report-viewer/.gitignore @@ -29,3 +29,4 @@ coverage test-results/ playwright-report/ +tests/e2e/assets \ No newline at end of file diff --git a/report-viewer/tests/e2e/Comparison.spec.ts b/report-viewer/tests/e2e/Comparison.spec.ts index 3873473e49..a5c62e5bde 100644 --- a/report-viewer/tests/e2e/Comparison.spec.ts +++ b/report-viewer/tests/e2e/Comparison.spec.ts @@ -4,23 +4,24 @@ import { uploadFile } from './TestUtils' test('Test comparison table and comparsion view', async ({ page }) => { await page.goto('/') - await uploadFile('result_small_cluster.zip', page) + await uploadFile('progpedia.zip', page) const comparisonContainer = page.getByText( 'Top Comparisons: Type in the name of a submission to only show comparisons that contain this submission. Fully written out names get unhidden.Hide AllSort By' ) // check for elements in average similarity table - const comparisonTableAverageSorted = await page.getByText('Cluster1').textContent() - expect(comparisonTableAverageSorted).toContain('1CA') - expect(comparisonTableAverageSorted).toContain('2DC') + await page.getByPlaceholder('Filter/Unhide Comparisons').fill('Purple') + const comparisonTableAverageSorted = await page.getByText(/Cluster[0-9]/).textContent() + expect(comparisonTableAverageSorted).toContain('100Purple FishBeige Dog') await comparisonContainer.getByText('Maximum Similarity', { exact: true }).click() // check for elements in maximum similarity table - const comparisonTableMaxSorted = await page.getByText('Cluster1').textContent() - expect(comparisonTableMaxSorted).toContain('1CA') - expect(comparisonTableMaxSorted).toContain('2BC') + await page.getByPlaceholder('Filter/Unhide Comparisons').fill('Blue') + const comparisonTableMaxSorted = await page.getByText(/Cluster[0-9]/).textContent() + expect(comparisonTableMaxSorted).toContain('100Blue AntelopeLime Lynx') + await page.getByPlaceholder('Filter/Unhide Comparisons').fill('') await page.getByText('Hide All').click() // check for elements being hidden const comparisonTableOverviewHidden = await page.getByText('Cluster1').textContent() @@ -28,7 +29,8 @@ test('Test comparison table and comparsion view', async ({ page }) => { expect(comparisonTableOverviewHidden).toMatch(/3anon[0-9]+anon[0-9]+/) expect(comparisonTableOverviewHidden).toMatch(/4anon[0-9]+anon[0-9]+/) - await page.getByPlaceholder('Filter/Unhide Comparisons').fill('A') + // Temporarily disabled due to https://github.com/jplag/JPlag/issues/1629 + /*await page.getByPlaceholder('Filter/Unhide Comparisons').fill('A') // check for elements being unhidden and filtered const comparisonTableOverviewFilteredA = await page.getByText('Cluster1').textContent() expect(comparisonTableOverviewFilteredA).toMatch(/1anon[0-9]+A/) //toContain('1HiddenA') @@ -40,32 +42,36 @@ test('Test comparison table and comparsion view', async ({ page }) => { const comparisonTableOverviewFilteredAC = await page.getByText('Cluster1').textContent() expect(comparisonTableOverviewFilteredAC).toContain('1CA') expect(comparisonTableOverviewFilteredAC).toMatch(/3anon[0-9]+A/) - expect(comparisonTableOverviewFilteredAC).toMatch(/4anon[0-9]+C/) + expect(comparisonTableOverviewFilteredAC).toMatch(/4anon[0-9]+C/)+/*/ + await page.getByText('Show All').click() + await page.getByPlaceholder('Filter/Unhide Comparisons').fill('Blue') // go to comparison page - await page.getByText('1C').click() + await page.getByText('Blue AntelopeLime Lynx').click() await page.waitForURL(/\/comparison\/.*/) // check for elements in comparison page const bodyComparison = await page.locator('body').textContent() - expect(bodyComparison).toContain('Average Similarity: 99.59%') - expect(bodyComparison).toContain('GSTiling.java - GSTiling.java: 308') - expect(bodyComparison).toContain('Matches.java - Matches.java: 58') - expect(bodyComparison).toContain('A/Match.java') - expect(bodyComparison).toContain('C/Match.java') + expect(bodyComparison).toMatch(/Average Similarity: [0-9]{2}.[0-9]{2}%/) + expect(bodyComparison).toMatch(/Similarity Blue Antelope: [0-9]{2}.[0-9]{2}%/) + expect(bodyComparison).toMatch(/Similarity Lime Lynx: [0-9]{2}.[0-9]{2}%/) + + expect(bodyComparison).toMatch(/sociologia.java - Sociologia.java: [0-9]+/) + expect(bodyComparison).toContain('Blue Antelope/sociologia.java') + expect(bodyComparison).toContain('Lime Lynx/Sociologia.java') // check for being able to hide and unhide elements - expect(await isCodeVisible(page, 'public class Match {')).toBe(false) - await page.getByText('A/Match.java').click() - expect(await isCodeVisible(page, 'public class Match {')).toBe(true) - await page.getByText('A/Match.java').click() - expect(await isCodeVisible(page, 'public class Match {')).toBe(false) + expect(await isCodeVisible(page, 'class No')).toBe(false) + await page.getByText('Blue Antelope/sociologia.java').click() + expect(await isCodeVisible(page, 'class No')).toBe(true) + await page.getByText('Blue Antelope/sociologia.java').click() + expect(await isCodeVisible(page, 'class No')).toBe(false) // unhide elements by clicking match list - expect(await isCodeVisible(page, 'public class GSTiling')).toBe(false) - await page.getByText('GSTiling.java - GSTiling.java: 308').click() + expect(await isCodeVisible(page, 'class Node')).toBe(false) + await page.getByText('sociologia.java - Sociologia.java:').first().click() await page.waitForTimeout(1000) - expect(await isCodeVisible(page, 'public class GSTiling')).toBe(true) + expect(await isCodeVisible(page, 'class Node')).toBe(true) }) async function isCodeVisible(page: Page, codePart: string) { diff --git a/report-viewer/tests/e2e/Distribution.spec.ts b/report-viewer/tests/e2e/Distribution.spec.ts index 5ac24191df..e0b2376be8 100644 --- a/report-viewer/tests/e2e/Distribution.spec.ts +++ b/report-viewer/tests/e2e/Distribution.spec.ts @@ -4,7 +4,7 @@ import { uploadFile } from './TestUtils' test('Test distribution diagram', async ({ page }) => { await page.goto('/') - await uploadFile('result_small_cluster.zip', page) + await uploadFile('progpedia.zip', page) const options = getTestCombinations() selectOptions(page, options[0]) diff --git a/report-viewer/tests/e2e/Information.spec.ts b/report-viewer/tests/e2e/Information.spec.ts index f9ca4043db..d41c1c2786 100644 --- a/report-viewer/tests/e2e/Information.spec.ts +++ b/report-viewer/tests/e2e/Information.spec.ts @@ -3,32 +3,32 @@ import { uploadFile } from './TestUtils' test('Test information page', async ({ page }) => { await page.goto('/') - await uploadFile('result_small_cluster.zip', page) + await uploadFile('progpedia.zip', page) // check displayed information on overview page const bodyOverview = await page.locator('body').textContent() - expect(bodyOverview).toContain('Directory: files') - expect(bodyOverview).toContain('Total Submissions: 4') - expect(bodyOverview).toContain('Total Comparisons: 6') - expect(bodyOverview).toContain('Min Token Match: 9') + expect(bodyOverview).toContain('Directory: ') + expect(bodyOverview).toMatch(/Total Submissions: [0-9]+/) + expect(bodyOverview).toMatch(/Total Comparisons: [0-9]+/) + expect(bodyOverview).toMatch(/Min Token Match: [0-9]+/) // go to information page await page.getByText('More', { exact: true }).click() await page.waitForURL('/info') // check displayed run options on information page - const runOptions = await page.getByText('Run Options:Submission Directory:').textContent() - expect(runOptions).toContain('Submission Directory: files') - expect(runOptions).toContain('Basecode Directory:') - expect(runOptions).toContain('Language: Javac based AST plugin') - expect(runOptions).toContain('File Extensions: .java, .JAVA') - expect(runOptions).toContain('Min Token Match: 9') + const runOptions = await page.getByText('Run Options:Language:').textContent() + expect(runOptions).toContain('Submission Directories: ') + expect(runOptions).toContain('Base Directory: ') + expect(runOptions).toContain('Language: ') + expect(runOptions).toContain('File Suffixes: ') + expect(runOptions).toMatch(/Min Token Match: [0-9]+/) const runData = await page.getByText('Run Data:Date of Execution:').textContent() - expect(runData).toContain('Date of Execution: 02/09/23') - expect(runData).toContain('Execution Duration: 12 ms') - expect(runData).toContain('Total Submissions: 4') - expect(runData).toContain('Total Comparisons: 6') - expect(runData).toContain('Shown Comparisons: 6') - expect(runData).toContain('Missing Comparisons: 0') + expect(runData).toMatch(/Date of Execution: [0-9]{2}\/[0-9]{2}\/[0-9]{2}/) + expect(runData).toMatch(/Execution Duration: [0-9]+ ms/) + expect(runData).toMatch(/Total Submissions: [0-9]+/) + expect(runData).toMatch(/Total Comparisons: [0-9]+/) + expect(runData).toMatch(/Shown Comparisons: [0-9]+/) + expect(runData).toMatch(/Missing Comparisons: [0-9]+/) }) From 55884932d528ec514105dc069ebf8a308838cabe Mon Sep 17 00:00:00 2001 From: Alex | Kronox <39801116+Kr0nox@users.noreply.github.com> Date: Thu, 29 Feb 2024 18:40:08 +0100 Subject: [PATCH 038/228] Set version.json version to dev --- report-viewer/src/version.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/report-viewer/src/version.json b/report-viewer/src/version.json index ed3b025ad2..ff2076fac6 100644 --- a/report-viewer/src/version.json +++ b/report-viewer/src/version.json @@ -1,6 +1,6 @@ { "report_viewer_version": { - "major": 5, + "major": 0, "minor": 0, "patch": 0 }, From 257ab6194f7145beade77b61d1292373533d0e36 Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Thu, 29 Feb 2024 23:24:17 +0100 Subject: [PATCH 039/228] fix workflow file --- .github/workflows/complete-e2e.yml | 61 ++++++++++++------------------ 1 file changed, 25 insertions(+), 36 deletions(-) diff --git a/.github/workflows/complete-e2e.yml b/.github/workflows/complete-e2e.yml index adf3455c5e..90fd801fb6 100644 --- a/.github/workflows/complete-e2e.yml +++ b/.github/workflows/complete-e2e.yml @@ -44,13 +44,10 @@ jobs: with: node-version: "18" - - name: Run Tests - run: mvn verify -B -U - - name: Build Assembly run: mvn -Pwith-report-viewer -DskipTests clean package assembly:single - - name: Raname Jar + - name: Rename Jar run: mv cli/target/jplag-*-jar-with-dependencies.jar cli/target/jplag.jar - name: Upload Assembly @@ -58,19 +55,21 @@ jobs: with: name: "JPlag" path: "cli/target/jplag.jar" + retention-days: 30 run_jplag: needs: build_jar runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] dataset: [ - {zip: "progpedia.zip", name: "progpedia", folder: "ACCEPTED", base: "base", language: "java", cliArgs: ""}, + {zip: "progpedia.zip", name: "progpedia", folder: "ACCEPTED", language: "java", cliArgs: "-bc base"} ] steps: - - name: Checkout πŸ›ŽοΈ + - name: Checkout uses: actions/checkout@v4 - name: Set up JDK @@ -84,76 +83,66 @@ jobs: with: name: JPlag - - name: Copy and unzip dataset + - name: Copy and unzip dataset windows + if: ${{ matrix.os == 'windows-latest' }} run: | - if [${{matrix.os}} == "windows-latest"]; then - Expand-Archive -LiteralPath .github/workflows/files/${{ matrix.dataset.zip }} -DestinationPath ./ - elif [${{matrix.os}} == "macos-latest"]; then - unzip .github/workflows/files/${{ matrix.dataset.zip }} -d ./ - else - unzip ./ .github/workflows/files/${{ matrix.dataset.zip }} - fi + Expand-Archive -LiteralPath .github/workflows/files/${{ matrix.dataset.zip }} -DestinationPath ./ + - name: Copy and unzip dataset macos and ubuntu + if: ${{ matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest'}} + run: | + unzip .github/workflows/files/${{ matrix.dataset.zip }} + - name: Run JPlag run: | - if [${{matrix.dataset.base}} == "undefined"]; then - java -jar jplag.jar ${{ matrix.dataset.folder }} -l ${{ matrix.dataset.language }} -r ${{ matrix.dataset.name }}-report ${{ matrix.dataset.cliArgs }} - else - java -jar jplag.jar ${{ matrix.dataset.folder }} -l ${{ matrix.dataset.language }} -r ${{ matrix.dataset.name }}-report -bc ${{ matrix.os.base }} ${{ matrix.dataset.cliArgs }} - fi + java -jar jplag.jar ${{ matrix.dataset.folder }} -l ${{ matrix.dataset.language }} -r ${{ matrix.dataset.name }}-report ${{ matrix.dataset.cliArgs }} - - name: Upload Result + - name: Upload result uses: actions/upload-artifact@v4 with: name: "${{ matrix.dataset.name }}-${{ matrix.os }}" path: "${{ matrix.dataset.name }}-report.zip" + retention-days: 30 e2e_test: needs: run_jplag runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] steps: - - name: Checkout πŸ›ŽοΈ + - name: Checkout uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: "18" - - name: Install and Build πŸ”§ + - name: Install and Build working-directory: report-viewer run: | npm install npm run build - - name: Install playwright πŸ”§ + - name: Install playwright working-directory: report-viewer run: npx playwright install --with-deps - name: Download JPlag Reports uses: actions/download-artifact@v4 with: - name: "progpedia-${{ matrix.os }}" - path: "report-viewer/tests/e2e/assets/progpedia.zip" - - - name: Rename Files - working-directory: report-viewer/tests/e2e/assets - run: | - if [${{matrix.os}} == "windows-latest"]; then - ren progpedia-${{matrix.os}}.zip progpedia.zip - else - mv progpedia-${{matrix.os}}.zip progpedia.zip - fi + pattern: "*-${{ matrix.os }}" + path: "report-viewer/tests/e2e/assets" + merge-multiple: true - - name: Run tests πŸ§ͺ + - name: Run tests working-directory: report-viewer run: | npm run test:e2e - - name: Upload test results πŸ“€ + - name: Upload test results uses: actions/upload-artifact@v4 if: always() with: From e2e03463de4dae0b83e775d077cff37b2c235be5 Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Fri, 1 Mar 2024 11:03:19 +0100 Subject: [PATCH 040/228] fix comparison test --- report-viewer/tests/e2e/Comparison.spec.ts | 39 +++++++++++++--------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/report-viewer/tests/e2e/Comparison.spec.ts b/report-viewer/tests/e2e/Comparison.spec.ts index a5c62e5bde..98a723715b 100644 --- a/report-viewer/tests/e2e/Comparison.spec.ts +++ b/report-viewer/tests/e2e/Comparison.spec.ts @@ -4,7 +4,7 @@ import { uploadFile } from './TestUtils' test('Test comparison table and comparsion view', async ({ page }) => { await page.goto('/') - await uploadFile('progpedia.zip', page) + await uploadFile('progpedia-report.zip', page) const comparisonContainer = page.getByText( 'Top Comparisons: Type in the name of a submission to only show comparisons that contain this submission. Fully written out names get unhidden.Hide AllSort By' @@ -45,33 +45,40 @@ test('Test comparison table and comparsion view', async ({ page }) => { expect(comparisonTableOverviewFilteredAC).toMatch(/4anon[0-9]+C/)+/*/ await page.getByText('Show All').click() - await page.getByPlaceholder('Filter/Unhide Comparisons').fill('Blue') + await page.getByPlaceholder('Filter/Unhide Comparisons').fill('Lazy') // go to comparison page - await page.getByText('Blue AntelopeLime Lynx').click() + await page.getByText('102Gray WolfLazy Bobcat').click() await page.waitForURL(/\/comparison\/.*/) // check for elements in comparison page + const submissionName1 = 'Gray Wolf' + const submissionName2 = 'Lazy Bobcat' + const fileName1 = 'Sociologia.java' + const fileName2 = 'Daa_sociologia.java' + const content1 = 'class Aluno' + const content2 = 'class Node' + const bodyComparison = await page.locator('body').textContent() expect(bodyComparison).toMatch(/Average Similarity: [0-9]{2}.[0-9]{2}%/) - expect(bodyComparison).toMatch(/Similarity Blue Antelope: [0-9]{2}.[0-9]{2}%/) - expect(bodyComparison).toMatch(/Similarity Lime Lynx: [0-9]{2}.[0-9]{2}%/) + expect(bodyComparison).toMatch(new RegExp(`Similarity ${submissionName1}: [0-9]{2}.[0-9]{2}%`)) + expect(bodyComparison).toMatch(new RegExp(`Similarity ${submissionName2}: [0-9]{2}.[0-9]{2}%`)) - expect(bodyComparison).toMatch(/sociologia.java - Sociologia.java: [0-9]+/) - expect(bodyComparison).toContain('Blue Antelope/sociologia.java') - expect(bodyComparison).toContain('Lime Lynx/Sociologia.java') + expect(bodyComparison).toMatch(new RegExp(`${fileName1} - ${fileName2}: [0-9]+`)) + expect(bodyComparison).toContain(`${submissionName1}/${fileName1}`) + expect(bodyComparison).toContain(`${submissionName2}/${fileName2}`) // check for being able to hide and unhide elements - expect(await isCodeVisible(page, 'class No')).toBe(false) - await page.getByText('Blue Antelope/sociologia.java').click() - expect(await isCodeVisible(page, 'class No')).toBe(true) - await page.getByText('Blue Antelope/sociologia.java').click() - expect(await isCodeVisible(page, 'class No')).toBe(false) + expect(await isCodeVisible(page, content1)).toBe(false) + await page.getByText(`${submissionName1}/${fileName1}`).click() + expect(await isCodeVisible(page, content1)).toBe(true) + await page.getByText(`${submissionName1}/${fileName1}`).click() + expect(await isCodeVisible(page, content1)).toBe(false) // unhide elements by clicking match list - expect(await isCodeVisible(page, 'class Node')).toBe(false) - await page.getByText('sociologia.java - Sociologia.java:').first().click() + expect(await isCodeVisible(page, content2)).toBe(false) + await page.getByText(`${fileName1} - ${fileName2}:`).first().click() await page.waitForTimeout(1000) - expect(await isCodeVisible(page, 'class Node')).toBe(true) + expect(await isCodeVisible(page, content2)).toBe(true) }) async function isCodeVisible(page: Page, codePart: string) { From ac21a8740dc49f9b10ad4c01656d6b8a8b180bf9 Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Fri, 1 Mar 2024 11:18:45 +0100 Subject: [PATCH 041/228] fix other tests --- report-viewer/tests/e2e/Distribution.spec.ts | 2 +- report-viewer/tests/e2e/Information.spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/report-viewer/tests/e2e/Distribution.spec.ts b/report-viewer/tests/e2e/Distribution.spec.ts index e0b2376be8..17a7b5b4e0 100644 --- a/report-viewer/tests/e2e/Distribution.spec.ts +++ b/report-viewer/tests/e2e/Distribution.spec.ts @@ -4,7 +4,7 @@ import { uploadFile } from './TestUtils' test('Test distribution diagram', async ({ page }) => { await page.goto('/') - await uploadFile('progpedia.zip', page) + await uploadFile('progpedia-report.zip', page) const options = getTestCombinations() selectOptions(page, options[0]) diff --git a/report-viewer/tests/e2e/Information.spec.ts b/report-viewer/tests/e2e/Information.spec.ts index d41c1c2786..2ecb21fbb8 100644 --- a/report-viewer/tests/e2e/Information.spec.ts +++ b/report-viewer/tests/e2e/Information.spec.ts @@ -3,7 +3,7 @@ import { uploadFile } from './TestUtils' test('Test information page', async ({ page }) => { await page.goto('/') - await uploadFile('progpedia.zip', page) + await uploadFile('progpedia-report.zip', page) // check displayed information on overview page const bodyOverview = await page.locator('body').textContent() From abeccf4830d3160caf8ac70b85f585c8177daaa7 Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Fri, 1 Mar 2024 12:22:00 +0100 Subject: [PATCH 042/228] test different input formats --- .github/workflows/complete-e2e.yml | 6 ++- .github/workflows/files/fileMultiRoot.zip | Bin 0 -> 5812 bytes .github/workflows/files/fileSingleRoot.zip | Bin 0 -> 5860 bytes .github/workflows/files/folderMultiRoot.zip | Bin 0 -> 6014 bytes .github/workflows/files/folderSingleRoot.zip | Bin 0 -> 6126 bytes .../tests/e2e/OpenComparisonTest.spec.ts | 49 ++++++++++++++++++ 6 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/files/fileMultiRoot.zip create mode 100644 .github/workflows/files/fileSingleRoot.zip create mode 100644 .github/workflows/files/folderMultiRoot.zip create mode 100644 .github/workflows/files/folderSingleRoot.zip create mode 100644 report-viewer/tests/e2e/OpenComparisonTest.spec.ts diff --git a/.github/workflows/complete-e2e.yml b/.github/workflows/complete-e2e.yml index 90fd801fb6..4e4a736924 100644 --- a/.github/workflows/complete-e2e.yml +++ b/.github/workflows/complete-e2e.yml @@ -65,7 +65,11 @@ jobs: matrix: os: [ubuntu-latest, windows-latest, macos-latest] dataset: [ - {zip: "progpedia.zip", name: "progpedia", folder: "ACCEPTED", language: "java", cliArgs: "-bc base"} + {zip: "progpedia.zip", name: "progpedia", folder: "ACCEPTED", language: "java", cliArgs: "-bc base"}, + {zip: "fileSingleRoot.zip", name: "fileSingleRoot", folder: "fileSingleRoot", language: "java", cliArgs: ""}, + {zip: "folderSingleRoot.zip", name: "folderSingleRoot", folder: "folderSingleRoot", language: "java", cliArgs: ""}, + {zip: "fileMultiRoot.zip", name: "fileMultiRoot", folder: "f0", language: "java", cliArgs: "--new f1"}, + {zip: "folderMultiRoot.zip", name: "fileMultiRoot", folder: "f0", language: "java", cliArgs: "--new f1"} ] steps: diff --git a/.github/workflows/files/fileMultiRoot.zip b/.github/workflows/files/fileMultiRoot.zip new file mode 100644 index 0000000000000000000000000000000000000000..24baa4dbfc8163464c49157c2919e96d8ce10f0d GIT binary patch literal 5812 zcmZ{oRag{Ww}bh8PCV!0 zoV733v-aM<`**!M>c}X>2nYxm2*I`~#;r<|gXb6s2$b{)2$+9w9r*e9d7W**HVvlc zpcOIFP`;^GS@Is)nS^36-CafASN|DvhfF}c&>6QwVr1_7q7+4ECC)sK$BlalW|rxW zU^Ryr0GR!{_+oX^M!nSPs=&H{Je0>w?Cr60#oJ2OTp=&T?;ws6iYQOMUCcgjDdrWZ(pN z#{7gjAfj3>b+N^F@Zchq?qCkRFj#t9(=zn7!1)mDUzHSDf2#N~-ez)qtFExG-pA5? zeNWD9-TNn(6~^H=FtK0XerLTOZOQj59n@jv;xB!=g zQ-vw3WrSJ+P4UehtXeqEDEc`Z@j5#P<-s1}gBYa{O_4XYgW`=-q3Wprt7!qancF5S;vJDs)@mM^L4}B_; z;Rr=~9bMD&Bnn@MC~OInBqwe68XjMl^xk+8r^$k{tQW=&RdY;2Sh9~Ywpxvb>X#&1 z04AbKTn)XforS9cr6Ec&OpRLPQ&~!u{3=<7+XKSPlcO(0AM`3&9bB91V023exx1e> zMM{WRkS!61(o^y|=mF2S)sGoI=|)Jc6iwZz%%4#&mRDOXJfKZe9yy2vW!KbT&d)2{ zKN1(}bS4Lpm-sO6IJU|$KEZ>tunw$ZybT!jtju$NIk#8+)L^W*l(1GY{h*J-J3idd zt{%>6rhv6~=ZaJw7(DaiHs!5&(CsghF|LOOq3n-In09fs%8m#b=DUCgs^t{mho9(b z7eW<^-(l%F<$7U*yTl{S<6t-1e1tpIQs8S!w-{Ra1q`H$%Eg*B_NcEy&~40po*El5 zl6UolSN5}?Iz&v0&XPJ!rZ`0u(tfP##DZh(3+q>@bj(gISJ2ZYJDFOXuo%kAl^-Qa z-i5lqhf8B&WSn#KDP4I0L-5)0#0iS_-9V{b;BBevWctz`s*$JyxO>tTD3<=9tAGQ8Lrr=`;D|rp7q9u^!*)5aA zh52Mg{oTRn5}ePot+L+G7KNIGkHh;GS<#G{ z`CO)V@BNearZ&LL7hHZtx>f4>Nm|p{wK@7FIH1)OoCyPg6p?i%tNc$;Y>wlghc!{aldY~(oij~F61-B1%t zT+!cLQkTn~2|lJ*k`A~7wc+{nqXJUhSH*vRTtsIylQ1a}U-O+e6GayZ&KXbE( z`76Dk7!%#`UF#p`WN55LPjA*TBfcMfmU*0Aj=uWU}PvLwbXMae4S zri2yMN4$d^tr!71f(XFODjEA4#AZ;?yg3s!FTC`vuP#>`@?0}~ed^&%q2g-Avf_8i zeGJ%8XF{{e_YBd}f~HyX$)NLUedzi4_{mePaG5 z-cd>^V^CK)p12O0HZ^e%)8tNk_`j1OZ3OB6;6mGX!2%9B3j5!Or=45!iCyU64h zf2tunFs5TIYt&-<3iJA+bMKgSb#(Lm=c;V@QQo^mGituO|Qz(C!Zs!uKu1o01F7LYzerLiMf6`P66}n87N9F=z$⁣OaZw*<3XBoiIBlh*&R-XtC^T|BK$5MI9B?N<#kR zq2jCH`4}6yR~o~j9$k&qlt$}VOQ|$4@a6f4=(;!?z>LN?M6|T=#!{#?6_U*)zhkoc zR&P@zi%JXji}9W$D(vmZD9rV-lV&f0Z1<2(=2dXGrLtCgW?MWK(6)t{BCKDsgLSZsUn{vAK<49} z)wkDfAK1`kvoNpaJ~5RQ6Pu1?O0E+D>~UY!8Nr(NKb_=%zRwO7WU2y}`7|Q#>#X-WlyA=&$ zwYoZgBx(5C{l=>;|BP3@3;rkI;jpL}Ho&}GW;7n+1g|NqeI1IUr^B-No`}tdB%&%NjT8fMbX^hRB1jU*%JC4~0%8ZHntfr{tu5^c*U`)VdJsa<# zrWo;TI#TKzEoLvuO$u3%Y|zkJvK(u*c#L|2x^lFDy%y!d~SR^tVNq6R*TMd2%=N!t0$@ORc!*U#^Co~5nYdSy) z8PJHQ%E+NG(jJja^0Eo6KYT6NE+s5$7?-78_2_!H;$@7PD`9 z1>`iGb?TlwRlZCI%ygPL#ykDWm!7=4i6(X1c>$f)mlsOM$78jl($blVZ{eW$`yYiz z-jMQhilkYVC%i5+W-v&#|D{k8?ka9-k=KG)IVn4Wr18ce1R#|h_pO8Gs#Pu}p0@#f|UKP~cl zMAu@nB+rQ|2i|upmrJc-hU{mXqN|XQAngS}+>aAsdNxS&d+22~avL{MfpNxGq5VeG zct$1D=ryOPjn4cjh66acnJ>9|6dT0>;KW;ziT0Y46JN~}(u`iaglMtfeP1GF^3nI= zEe&O`ETzuE0j8n=v7}#gJ-zd=z^?fKn4jdmp)zQ+mc7B*y6%Ln1N(L|>YNWs&fgfJ zar(3sabzwfC0ovz3Djh0r`HXV;yK5-W6^>oi5|BZkQAxp$JUW#-}ntiAE?e=V`$(~ z4~f<4M2AHpZN0$=5b%Jyjv#zs*2&zYly%z;L39xqdi`_$1XpVH=?fqhSD}!As z8+-Q_Di?zkTaBnJ&0dXQ?K}KiX$YcuY&dtLds0U+_KmC@rC!NOv6tqH!3AGYoINn+CX!~w9U`%>&(JDs(Wn7E^NRaI>#c|7jPD@s4O&NN#% zQLcu!uH89#LT%swB~G%Vt&B2?M1PFZa-|!gL8ekX+nk*4H6J8HXu71}Vgcd@ z@5S2h*L`9XI-J2Rjae7Nb_LrR^t|&hQaXIY8ZWM9QU@kH!zr6$7vBDof@DquIbQjN zF>5st5UVLd;(AeBC(J=5rX#FTTHvzD>f?Xz?a&IAK6ft_@i8{YH9RbCsmJcq+i}E@%fCR225Z}vy`GqeMN!XxtNgU|-{rJ>x9rl6^c*QOEa4_>L=;mbL9D~)k7 z?0$UrB~ik$hboHRnx`J1`uTtug@qEfri$}jnxWV;*Ov)DLA%9X!ykprG+M$<%E7@M zp!SnrJ61SL3+3NO1fX@(gGlmkjkdAX=fKIUXds%t?fHWprqA~c!rY6!xSE&AoN4Ek z4u0=L{bOxn(q|ds8rs6d14R3a8yX{zg2k!$YU{O);V@^Q)KN~{1p<60XxhhhCp+;|!a~TTJcm(S!8G z0yzdn#%{(!CMx+_F}sGacs3)nrgHoSKb-8T)h4+1K^qmDWb20jG$)#)w0vW44MW?ZMj*ybR)EZ!OzSav(+xEOO!Fka3=+e1$vGK#q zSaKsw%F}S@)%~j<>HRr&PplywI#s)Rhbf+6M?SOvC2`_m`NLv@YQSnv|l)HOqKXu ze}rmdt7ZU959x-3hslO@1fIHzv3Y~eY~uGNO-ZdcX=(R7^izR-K_02J(p`dmPyCL6 zj9KbQw(!|V`|(F#-6FT7uDn9cP^uark*S$nYEVBr$Y$B&*xay$!6)vw>s>Q?{o z&4u}P6r(tjwar35Zcstor-O1t4|?1p(&%_S8_?QUK(y@cd#xsYW<)9C`v-CM-^nxX z5Zd#DjZc44Y$z`>&Ne})?QU>k>$8B(fx7`XhdJ{BHm~_5RbfW*cG@gA;gaVQnT5;= zUHfm$o^ghpfV+G;E@0dMwO_I>EfsPia`G-PbX4%TQBqJQ^n|lUdw{dgtm%ZNXj(F( zwa#VX@?t^L>YVR+?WLoRj6#fnfPjGzY@1@-sx&!xj)8zcNsoX)^3Sb?c!O})yJ_sGs96ocvRD)PSh&zL)80^)_vxE&HBb3YWN zC^{=~=5ai3+)FUCOm_sUIm7_K?AOH?tCKeBrB+u3)&=CDJl@h&HQm8i57Rp;t?a(` z%f_J-ae8vJ4#MocCLuZdUs^t9I*Uj;52RifG**?6_0T@(m_c%udrL$O z;-FaSTQ?@8f(Ir8C%`l2C)5EE)pDteExv;X7pZgybLfS^(%YJrp|=IjhhYDzq{#YH z#ZU1zljB=;g?;rtmhS6&a&GJ1zqqV04!?`Z%KW$(x|fQfIVGVIi$Ft9pQy_58Fr%J z`Vx`4p43Y{ZxohUP_h%#;Osg0V5gVh0&5`O;IO208mj*bO&bf$9M7%>ipJ9H34X{x z1o2{3e6}I`q8FTreRp=n6w5{}kZT^SQN0axNk*~Ow>s$f`$VF@9s2{ky5jequ)0iq z`u^=>;1C-lTLfo=TPAGm^H?B(Rl?lyaq8M&Lq3Ep1~9_VSy=6zVbua@B!{RE?bbZh zB5~;N&k$xreS3-ICzc5db{M|%RsU`4*HjvME*nGw%t~h*c$10pgogg&3&&aAzDF&6 zWeD3`;wQrexFnn^Oj#`>)DmclZ}wo-!f{5?&*6yI**Pc=_7ES$D1~T>ys;(U z{BPGb`S4BGdLx(`S{@3(sV0<*vN^toOsx_D9mQ)FEVX0g(w zjB?5H-NL@(7|*T5ItTSCa){k$nsLd1e>i8z#=lFva8c)qQE%PBV$f_kyM+G^ne zZJP4PK_n=gVfxKO7vIf%T(hk3`bRgUo)9-M`BU=`zSz^G?sp8MOmz3P_+ zW5uO}wTkISeH`BL;f8kga8@$~ti3x|r1HSvnV+{QZ^eUdf0K-HJv0bqe@eo%i>p<3 zM947T1w2qKrvN|xLRY&Gs!;p^OV26S3me=e9%&v2yV2$&+^LoVUsJlp(8@1hAXQW@ z)~vBdeHDUkWA5|R*ocw5t0%m&U;We}Vp4RL)M+xsDWZ_}V_hc}9BW@#ze=TJc51nT zo;KOZ)Z&E2P+qS5C{gk*)cpfo8Ve)ioTE?a$^#gJ&yFWfP_*v`O6@9VS`r>>?0&1X zPl@WOzQ%=w46>-=7IeO2ocd1ouCVa73+fbL317{LkKIK~>hgPYn`p4cweV#w!sh<` zgRnQ?Go`tqF@f@>N?N;onx_t331v+fibut!{HM{5m2}g>rGQ|s z?{7_>?@zo}(#eYy{G^bUi#l_agoj&{d{A?yhQ_g}Hho`>?*^BF0=ULde#25*T1n`p zIX{736f%DWN@+!_zcSJF68-U#uwYDlY&zH9=lb=L4zG;5ze;;!(I_x>$UU$kCOx&= z4cSBlp;kYD>t{#lysugU0U%uG@mF=r?pAi5T95mUbNnAl*}tUknVN+1co!;^kylFL zrF09G`@ShSo#PaFv=}7Ugp%Rqw}&CbI#i344*lX4tutmPtX?(6WzjPvEL(ll`UjbU zk0Gq&HK>Y~K$d5>OcEF7lNt5*2ct`Hes^w|AMve)rM$CtvrH*&8S7-Mwv3EpvQLYS znE>XA%NEHDji;HZe)W-DbKCqT1w?B+G8QxulYMp3jWZL}a>+*k=Eh}?8TO)POm|8PlNE_){Um|jUb;11M==hKf0NOfNo|NVIpozYCfq(pqp zciv1Sso1INa&q!&=!KP3NF%0#!{lj-_?kifu>~_2#ldc5|0}V+1~EC}5i9Hqt5|ec z7_NhvV;HVUa+t(L43gC98tBOMYUoZ7Kxn&6r0{%x=9gEjZlyMvnC0gCX~FTG0USrKkG3>_e?# z+f`oKoLpr|j9rS7Rm4pRE2>X;2RT|X0(1lsfSFY?_BDvjprCnkCTd=I>04i2t~TVk zX88Kl!={OSY zv}AbK^Pp|%?&9-m-&#N7FWeax za~-QQ2JIfly@b`1M6$j$^CK&F`G$p>uV}TEu3xz-^$Z|7A{vttJyQ6F#4D)zRlkCymY*@qMUvnPkY2A7s>v(Yp{XtoFxjFg}bCEKwLORLUR5D^L2A zM_4miFq}qj?;?|5{JDngz?hD;tWk^Y8_esg&b?#S)zQuK->b6WM|tlO&8YdZAA%1) zp)D9S5e=`7feInK&wi2)(23g2hNR?!AelivS4^%1%cPpofYUNv3RG^tHxpex(ie^k z-&OZ1DkY}GQkTWa3fgn&1^{6$kKROpJmga^fUfB!jGxUi*J1=&T5!8`ZL?xf7%9p6lGlA^Rm|ENh}g0MgO zDo}NKt!PR%Vv$<&M2Vr(h5V2ku(PG)R z{ujM9i#jT(m4y7sL&Z12^D#DZuQY~5J-QmJDUH^#mQrb8;LGz7(RFb)fEkT(h-hi! zjipd)DkPgpe#d0>t=^_c7L^w4H{(4?RM^{*QJCvvC(T|0+3q2o%&XvVOJ%M0%(i$e zplu5?MOeRzWuO8Br4g_r3UFklaS}i4RO}H7(4-7K1(`O|`47U3CF7uY*Rvdv+|Yws zGVjg2X7l%sj2DB!4a7iGEv?#m1acfL`WV^pj1#E>UM*N+Q{~_IUOs>J(c%$E{Cj@d zCAD3G@ha`?*^kOdt8cH}KC+?9W?^2-eP${vCN>?(lw2nQ*yFycGlDhke>utj`j8#2 zlzx?Xk%+SovK_ULf{wnz`Gz?K>qbCP`ngf?k6sZ=yPW`A6x2Pyj+ZETMnu5#`{D+s zF_aI3i-Ux9cPkpiYISw~NYe1N`;Avy{u!@)7yQq_!(mY|Y=C*W%xFBs30_lJ`#Kay zPlsjk*?WnufwM1_0{1WRbaAsuE8XRJ7Q3n#G_Un(xm|wZ5v=kW=(iodL35qpkb{w-0lo=ECSxr&P zUFi-r!I*%_dN$reO)=uxbfnZbTFhRQn-sDj*`T4dWI5Jq@fh_4b>(Pz+avepuoVB4 zo@Q83d_{amyseMfQf7Mfv!V@SuZA)1@BF-i%y>>)+FT#;cNQq$Zq8i2g#X;b6k#bJ z8yWetlNAZ##!{VCmDy%y!d~SR^tVNq6R*TMd2(=N!t0$@OQx zV>u4f6Pg2(H65UY3~0ntW#mv8X^%)IdD#TkAHEiBml77bv3%p_!Mv1f(U&f=^;x|Z ziw&pe;72yMxqWP`M3cJhyns&Y%L}FB`W|57LkcNI6a$ZJ8YoRl3w(s*MK0+33M z``$rw)hd^gP_I{e5(%{d-tZFjv@Cm?f8FxLo1Bp>XvtiU|E${UMY5=Y-pWw0Q?SmC z{^el%cysfFpB8yNqH8f(lIKK~1Mi2G%ca&ZL-w;x(N#!DkoE!~?&paxJsYI?1N5>Q zxs98sz&K;8(0(IoJfo6n^qN!DMrZyM!vUP!%$Hm}ijCp`aN@1VM0?H2iLd4fX-2PI zLbTZLzAuq7`Q&@?mWDD|mQrWo08>$bSkf=Lp5A#_VAp&A%un*cP#H8@%iiE@U3bFP zfqgp}btt?H%DQa_tca4B1Xw%!#qJ?0 zG)Fq`_I@?ImBB8RjlFvdm5V`&twvN9=mfYy^i*{Am(_LHRHj@rS@g_64>^xx z0TGp4U#MQ3ZcKj_x>zoSh#@zXMTFL$G3WbrvAc0_>5P-cfH)DcAfq#GWHN|7jUca3 zclCsdlI%E1`kI|ahL?l-9E7Rw8`yMKYu}Hig%QSO#6Ap|6Wd@uGNMIE-Vv5KGnVP) z;GzjobJa2wY;_;ei)$9bSJw^ku+==Dw`}1pqtC9(d;-Qx=jLG!)Pu3epZ-YOlg?v- zaxj+E4ts3;+`Rvg&UADEq)f2k)&$?j58HP9Br)lG;sDsweJS>?ozB`wOx)4Cs;ah= zJRbMt6{R0tXPPaXC|AQ<*Y2D=p|&6Xp--}-t&B2?M1PFZa-|!gL8ekX+nk*4 zH6J8HXu71}Vgcd@@5S2h*L`LbI-J2Rjae7Nb_LrR^t|^lQaXIY8ZWM9QU@kH!zr6$ z7vBDwf@DquIbQjVF>5st5UVLd;(AeBC(J=5rX#FTTHvzD>f?Xz?a&IAK6ft_@i8{< zU6l;3JZUGEmo6q=f8UYeuWaoVnPJ6-zPDCE(f)oF%WSF3zX{9R9b?Vr_u=MaP)F&@ zt@RBWcUX+m-J1y2e~{blj-$#5fa8cZmUp3T)i=Ft<|;{b@l=4{UC<6Ps3`2y!5HpF z!uK^n>Q=IAGq_YfU?&c2+wx0H(ify$-|Ua>XJ`ikg-7Jk2cZq@OGCMzOhHo>uT3M; zAH7n$!<6G()jxt}hdQf_96& zhCd6LX|#l!l!JpiK-t_9pY8)UVbgFjs4pThCj(leSOX9%EWX=UV zC3#-YsjVmHW3hGlt%=H#gZy#8yE00~J`0_kK44U2Tj+;lE!~@j)GbWQ_syoE#ly8XWsGV^V(jwxYO%*!l7X3ZgC4htG&)|-2DJ7S5G}j=UaLu; z8BvP({z07m5AuvVg!cSkoV*JR9ThxoloXT+J>jg; z9^mXVYdWDRnwHFHt#etpycp0?M?@k<`2S7vKQb8s5#b-L{O|gYUip7V{HI;(UqAml ef&ugYsOkUSymZu2(f;)e>7Nt(Pgf=V*YsaRwKS#x literal 0 HcmV?d00001 diff --git a/.github/workflows/files/folderMultiRoot.zip b/.github/workflows/files/folderMultiRoot.zip new file mode 100644 index 0000000000000000000000000000000000000000..db8f2f80fa946385124852514890fbcc84057fa6 GIT binary patch literal 6014 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 p|(dTaFuCSqh+TA!eEn^(I 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 BYk2?w literal 0 HcmV?d00001 diff --git a/report-viewer/tests/e2e/OpenComparisonTest.spec.ts b/report-viewer/tests/e2e/OpenComparisonTest.spec.ts new file mode 100644 index 0000000000..729d76c37d --- /dev/null +++ b/report-viewer/tests/e2e/OpenComparisonTest.spec.ts @@ -0,0 +1,49 @@ +// Ensures that different styles of passing submissions are supported +import { expect, test } from '@playwright/test' +import { uploadFile } from './TestUtils' + +interface DataSet { + datasetName: string + firstSubmissionName: string + secondSubmissionName: string +} + +const testSets: DataSet[] = [ + { + datasetName: 'fileSingleRoot-report.zip', + firstSubmissionName: '0.java', + secondSubmissionName: '1.java' + }, + { + datasetName: 'folderSingleRoot-report.zip', + firstSubmissionName: '0', + secondSubmissionName: '1' + }, + // Disabled due to https://github.com/jplag/JPlag/issues/1610 + /*{ datasetName: 'fileMultiRoot-report.zip', firstSubmissionName: 'f0\\0.java', secondSubmissionName: 'f1\\1.java' },*/ + { + datasetName: 'folderMultiRoot-report.zip', + firstSubmissionName: 'f0\\0', + secondSubmissionName: 'f1\\1' + } +] + +for (const testSet of testSets) { + test(`Can open ${testSet.datasetName}`, async ({ page }) => { + await page.goto('/') + + await uploadFile(testSet.datasetName, page) + + const comparisonTable = await page.getByText('Cluster1').textContent() + expect(comparisonTable).toContain( + `1${testSet.firstSubmissionName}${testSet.secondSubmissionName}` + ) + await page.getByText(`1${testSet.firstSubmissionName}${testSet.secondSubmissionName}`).click() + await page.waitForURL(/\/comparison\/.*/) + + const bodyComparison = await page.locator('body').textContent() + expect(bodyComparison).toContain( + `Comparison: ${testSet.firstSubmissionName} - ${testSet.secondSubmissionName}` + ) + }) +} From 9c0511943cab70c8b1debdcae6b6aef86e316cb0 Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Fri, 1 Mar 2024 12:29:07 +0100 Subject: [PATCH 043/228] fix typo in workflow --- .github/workflows/complete-e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/complete-e2e.yml b/.github/workflows/complete-e2e.yml index 4e4a736924..c0dc732d7a 100644 --- a/.github/workflows/complete-e2e.yml +++ b/.github/workflows/complete-e2e.yml @@ -69,7 +69,7 @@ jobs: {zip: "fileSingleRoot.zip", name: "fileSingleRoot", folder: "fileSingleRoot", language: "java", cliArgs: ""}, {zip: "folderSingleRoot.zip", name: "folderSingleRoot", folder: "folderSingleRoot", language: "java", cliArgs: ""}, {zip: "fileMultiRoot.zip", name: "fileMultiRoot", folder: "f0", language: "java", cliArgs: "--new f1"}, - {zip: "folderMultiRoot.zip", name: "fileMultiRoot", folder: "f0", language: "java", cliArgs: "--new f1"} + {zip: "folderMultiRoot.zip", name: "folderMultiRoot", folder: "f0", language: "java", cliArgs: "--new f1"} ] steps: From 70ba8994b2ec576728227d6771d2f7c652ce820e Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Fri, 1 Mar 2024 13:00:16 +0100 Subject: [PATCH 044/228] fix sys dependent regex --- .../tests/e2e/OpenComparisonTest.spec.ts | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/report-viewer/tests/e2e/OpenComparisonTest.spec.ts b/report-viewer/tests/e2e/OpenComparisonTest.spec.ts index 729d76c37d..cb9ce75649 100644 --- a/report-viewer/tests/e2e/OpenComparisonTest.spec.ts +++ b/report-viewer/tests/e2e/OpenComparisonTest.spec.ts @@ -20,11 +20,15 @@ const testSets: DataSet[] = [ secondSubmissionName: '1' }, // Disabled due to https://github.com/jplag/JPlag/issues/1610 - /*{ datasetName: 'fileMultiRoot-report.zip', firstSubmissionName: 'f0\\0.java', secondSubmissionName: 'f1\\1.java' },*/ + { + datasetName: 'fileMultiRoot-report.zip', + firstSubmissionName: 'f0\\\\|/0.java', + secondSubmissionName: 'f1\\\\|/1.java' + }, { datasetName: 'folderMultiRoot-report.zip', - firstSubmissionName: 'f0\\0', - secondSubmissionName: 'f1\\1' + firstSubmissionName: 'f0\\\\|/0', + secondSubmissionName: 'f1\\\\|/1' } ] @@ -35,15 +39,15 @@ for (const testSet of testSets) { await uploadFile(testSet.datasetName, page) const comparisonTable = await page.getByText('Cluster1').textContent() - expect(comparisonTable).toContain( - `1${testSet.firstSubmissionName}${testSet.secondSubmissionName}` - ) - await page.getByText(`1${testSet.firstSubmissionName}${testSet.secondSubmissionName}`).click() + + const lineRegEx = RegExp('1' + testSet.firstSubmissionName + testSet.secondSubmissionName) + expect(comparisonTable).toMatch(lineRegEx) + await page.getByText(lineRegEx).click() await page.waitForURL(/\/comparison\/.*/) const bodyComparison = await page.locator('body').textContent() - expect(bodyComparison).toContain( - `Comparison: ${testSet.firstSubmissionName} - ${testSet.secondSubmissionName}` + expect(bodyComparison).toMatch( + RegExp(`Comparison: ${testSet.firstSubmissionName} - ${testSet.secondSubmissionName}`) ) }) } From 385b1517786f63ab8b3bdb94b7ddb83f8d9c4dd4 Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Fri, 1 Mar 2024 13:29:21 +0100 Subject: [PATCH 045/228] disable multi root with file submissions --- report-viewer/tests/e2e/OpenComparisonTest.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/report-viewer/tests/e2e/OpenComparisonTest.spec.ts b/report-viewer/tests/e2e/OpenComparisonTest.spec.ts index cb9ce75649..a0fe30be35 100644 --- a/report-viewer/tests/e2e/OpenComparisonTest.spec.ts +++ b/report-viewer/tests/e2e/OpenComparisonTest.spec.ts @@ -20,11 +20,11 @@ const testSets: DataSet[] = [ secondSubmissionName: '1' }, // Disabled due to https://github.com/jplag/JPlag/issues/1610 - { + /*{ datasetName: 'fileMultiRoot-report.zip', firstSubmissionName: 'f0\\\\|/0.java', secondSubmissionName: 'f1\\\\|/1.java' - }, + },*/ { datasetName: 'folderMultiRoot-report.zip', firstSubmissionName: 'f0\\\\|/0', From 6df05cba035af1c568cd8c47e258a2733da5d573 Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Fri, 1 Mar 2024 14:10:43 +0100 Subject: [PATCH 046/228] remove temporary push --- .github/workflows/complete-e2e.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/complete-e2e.yml b/.github/workflows/complete-e2e.yml index c0dc732d7a..4e06ce371c 100644 --- a/.github/workflows/complete-e2e.yml +++ b/.github/workflows/complete-e2e.yml @@ -3,8 +3,6 @@ name: Complete e2e Test on: workflow_dispatch: - # temprary - push: pull_request: types: [opened, synchronize, reopened] paths: From f8bb719ee53a1861f3550431bc6a9330d37da3ba Mon Sep 17 00:00:00 2001 From: Alexander Milster Date: Sun, 3 Mar 2024 20:08:54 +0100 Subject: [PATCH 047/228] Removed suppress warnings. --- cli/src/main/java/de/jplag/cli/options/CliOptions.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/cli/src/main/java/de/jplag/cli/options/CliOptions.java b/cli/src/main/java/de/jplag/cli/options/CliOptions.java index b1caeffbce..999cd5635f 100644 --- a/cli/src/main/java/de/jplag/cli/options/CliOptions.java +++ b/cli/src/main/java/de/jplag/cli/options/CliOptions.java @@ -16,7 +16,6 @@ import picocli.CommandLine.Option; import picocli.CommandLine.Parameters; -@SuppressWarnings({"CanBeFinal", "unused"}) @CommandLine.Command(name = "jplag", description = "", usageHelpAutoWidth = true, abbreviateSynopsis = true) public class CliOptions implements Runnable { public static final Language defaultLanguage = new JavaLanguage(); @@ -109,7 +108,6 @@ public static class Clustering { @ArgGroup public ClusteringEnabled enabled = new ClusteringEnabled(); - @SuppressWarnings("CanBeFinal") public static class ClusteringEnabled { @Option(names = {"--cluster-alg", "--cluster-algorithm"}, description = "Specifies the clustering algorithm (default: ${DEFAULT-VALUE}).") public ClusteringAlgorithm algorithm = new ClusteringOptions().algorithm(); From 5c234a6d0cb255179bee0e9c76bc1a0b8991b50d Mon Sep 17 00:00:00 2001 From: Alexander Milster Date: Sun, 3 Mar 2024 20:12:29 +0100 Subject: [PATCH 048/228] Improved code style for FilePathUtil --- .../java/de/jplag/reporting/FilePathUtil.java | 16 +++------------- .../reportobject/ReportObjectFactory.java | 3 ++- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/core/src/main/java/de/jplag/reporting/FilePathUtil.java b/core/src/main/java/de/jplag/reporting/FilePathUtil.java index fd601941b6..dc81ac3ace 100644 --- a/core/src/main/java/de/jplag/reporting/FilePathUtil.java +++ b/core/src/main/java/de/jplag/reporting/FilePathUtil.java @@ -39,29 +39,19 @@ public static Path forceRelativePath(Path path) { return path; } - /** - * Returns the relative path found in the string. - * @see #forceRelativePath(Path) - * @param path The path string - * @return The relative path - */ - public static Path createRelativePath(String path) { - return forceRelativePath(Path.of(path)); - } - /** * Formats the path for usage with zip files. Returns the path segments separated by {@link #ZIP_PATH_SEPARATOR} * @param path The path to format * @return The zip file path */ public static String pathAsZipPath(Path path) { - Path real = forceRelativePath(path); + Path relativePath = forceRelativePath(path); StringBuilder builder = new StringBuilder(); - for (int i = 0; i < real.getNameCount(); i++) { + for (int i = 0; i < relativePath.getNameCount(); i++) { if (i != 0) { builder.append(ZIP_PATH_SEPARATOR); } - builder.append(real.getName(i)); + builder.append(relativePath.getName(i)); } return builder.toString(); } diff --git a/core/src/main/java/de/jplag/reporting/reportobject/ReportObjectFactory.java b/core/src/main/java/de/jplag/reporting/reportobject/ReportObjectFactory.java index a9a153b23e..f35ff058d7 100644 --- a/core/src/main/java/de/jplag/reporting/reportobject/ReportObjectFactory.java +++ b/core/src/main/java/de/jplag/reporting/reportobject/ReportObjectFactory.java @@ -107,7 +107,8 @@ private void copySubmissionFilesToReport(JPlagResult result) { Set submissions = getSubmissions(comparisons); Language language = result.getOptions().language(); for (Submission submission : submissions) { - Path submissionRootPath = SUBMISSIONS_ROOT_PATH.resolve(FilePathUtil.createRelativePath(submissionToIdFunction.apply(submission))); + Path submissionRootPath = SUBMISSIONS_ROOT_PATH + .resolve(FilePathUtil.forceRelativePath(Path.of(submissionToIdFunction.apply(submission)))); for (File file : submission.getFiles()) { Path relativeFilePath = Path.of(submission.getRoot().getAbsolutePath()).relativize(Path.of(file.getAbsolutePath())); if (relativeFilePath.getNameCount() == 0 || relativeFilePath.equals(Path.of(""))) { From a537074fe981bddec43a83ba3bf630c58bd5c8fd Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Mon, 4 Mar 2024 18:25:50 +0100 Subject: [PATCH 049/228] fix unhiding through searchbar --- .../src/components/ComparisonTableFilter.vue | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/report-viewer/src/components/ComparisonTableFilter.vue b/report-viewer/src/components/ComparisonTableFilter.vue index 646a7d2c78..0b125f7253 100644 --- a/report-viewer/src/components/ComparisonTableFilter.vue +++ b/report-viewer/src/components/ComparisonTableFilter.vue @@ -64,20 +64,19 @@ const searchStringValue = computed({ emit('update:searchString', value) // Update the anonymous set - const searches = value + const searchParts = value .trimEnd() .toLowerCase() .split(/ +/g) .map((s) => s.trim().replace(/,/g, '')) - if (searches.length == 0) { + if (searchParts.length == 0) { return } - for (const search of searches) { - for (const submissionId of store().getSubmissionIds) { - if (submissionId.toLowerCase() == search) { - store().state.anonymous.delete(submissionId) - } + for (const submissionId of store().getSubmissionIds) { + const submissionParts = submissionId.toLowerCase().split(/ +/g) + if (submissionParts.every((part) => searchParts.includes(part))) { + store().state.anonymous.delete(submissionId) } } } From 3831e73ba1e11911db84bfd346b404ac3111b7c4 Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Tue, 5 Mar 2024 17:05:23 +0100 Subject: [PATCH 050/228] mixed multi root --- .github/workflows/complete-e2e.yml | 4 +++- report-viewer/tests/e2e/OpenComparisonTest.spec.ts | 10 ++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/complete-e2e.yml b/.github/workflows/complete-e2e.yml index 4e06ce371c..d27eb00185 100644 --- a/.github/workflows/complete-e2e.yml +++ b/.github/workflows/complete-e2e.yml @@ -67,7 +67,9 @@ jobs: {zip: "fileSingleRoot.zip", name: "fileSingleRoot", folder: "fileSingleRoot", language: "java", cliArgs: ""}, {zip: "folderSingleRoot.zip", name: "folderSingleRoot", folder: "folderSingleRoot", language: "java", cliArgs: ""}, {zip: "fileMultiRoot.zip", name: "fileMultiRoot", folder: "f0", language: "java", cliArgs: "--new f1"}, - {zip: "folderMultiRoot.zip", name: "folderMultiRoot", folder: "f0", language: "java", cliArgs: "--new f1"} + {zip: "folderMultiRoot.zip", name: "folderMultiRoot", folder: "f0", language: "java", cliArgs: "--new f1"}, + {zip: "mixedMultiRoot.zip", name: "mixedBaseFile", folder: "f0", language: "java", cliArgs: "--new f1"}, + {zip: "mixedMultiRoot.zip", name: "mixedBaseFolder", folder: "f1", language: "java", cliArgs: "--new f0"} ] steps: diff --git a/report-viewer/tests/e2e/OpenComparisonTest.spec.ts b/report-viewer/tests/e2e/OpenComparisonTest.spec.ts index a0fe30be35..5a3976e7c1 100644 --- a/report-viewer/tests/e2e/OpenComparisonTest.spec.ts +++ b/report-viewer/tests/e2e/OpenComparisonTest.spec.ts @@ -24,6 +24,16 @@ const testSets: DataSet[] = [ datasetName: 'fileMultiRoot-report.zip', firstSubmissionName: 'f0\\\\|/0.java', secondSubmissionName: 'f1\\\\|/1.java' + }, + { + datasetName: 'mixedBaseFile-report.zip', + firstSubmissionName: 'f0\\\\|/0.java', + secondSubmissionName: 'f1\\\\|/1' + }, + { + datasetName: 'mixedBaseFolder-report.zip', + firstSubmissionName: 'f0\\\\|/0.java', + secondSubmissionName: 'f1\\\\|/1' },*/ { datasetName: 'folderMultiRoot-report.zip', From 0064cbe8bfcd9a3f9e25494416d0ed9149a97d97 Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Tue, 5 Mar 2024 17:12:23 +0100 Subject: [PATCH 051/228] add zip file --- .github/workflows/files/mixedMultiRoot.zip | Bin 0 -> 5902 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .github/workflows/files/mixedMultiRoot.zip diff --git a/.github/workflows/files/mixedMultiRoot.zip b/.github/workflows/files/mixedMultiRoot.zip new file mode 100644 index 0000000000000000000000000000000000000000..628c301e75ad8bffebddd84e9ad20279f5be56ba GIT binary patch literal 5902 zcmZ`-WmFqno5a1iySo!4xE3hx&I>J4f&>j-+}+)ZrWB`0(NanXl;T$0U4s=UY~RoJ z?4I4{{+N58Gjs0WnbFliMI%K*Lc&5a0NI*0tBm)bVj&?>Ga?~j|JgbS3JCIpY$3LF zW)|Qj3G#OW6VLLLUGh_Lg%F0DvYan|Qx*>CfLM_eUWfSb?6(C;${-c)9IpGdTPaqy z$+jSMhbRDq^Rn=4dE8c`*!m*RCXezRpO-96RcFw}-Q<>PGpCRJqRG3l7=41Z5zE1& zlP8jT2T{&$)8MS#PfhRBL1NONzU0fi`idfoF8VuNb7{t# zMO#sIAdmh#JN-Ckcpc>$mld_sK<#f>%1A)^Xl5l)JeqDt_-z_8m>;L?qbObx%1xkiBAShX^naCEwS?l_ipsx3BI41~`~G!no^P z)8Qi@M*@hf<7N&IlUMrda-keifFY*#{7SDh>n3PDB~)WzyXvkQh09=fia0Ie%Tu@@ zsa!~q!{CjN#?Lpt4aM(H_G`am2obd!A_Sn%p)&w4gZQ~GP4xz zxccotf7?y}jMWE!LpJBSK(m8L{ey@?y!F%oFh*&g%L_}Y#NG}SS4X}M>ns+B&+)ED zH9QolK)Fr&kOo5JV{gJ!5KDlqeg03ron8P2WcD4#sjqr zQcVC;@dci`Zua*4Wuf9=l_-{aZOVxZ6)Qp245Q6HQP%O{CzAL22 zCEoAxb2Yl-{iq89*f(4orC1*kK^ZuE)=^%D%=*?A**`(86+bkY%g&{2RL$NS;PHrfm`%#T?PD?BKuV9N?# zVbBfp#8-;H^7F4dU{3y4h~=!<=xyYL4&N8o@rElrbDw6yY;RAWcy&}n%NrU~iHC_v zPO!QnSuC^M^b>S=U2l)KP&_Yb(|ujx2(tYb3CuwO6Sks?L3i8g?u{JBT6*CsMm&Yh zUPWbF6IyGUV`!f$WOYg>`D!p#&{jlY1T-8kf7RQuldoGk=MnAn{I1IJ`A+amK7N)& zm=N4_R%4+WcXy4J3vNu;)I2oPVeF~$S>rKOf>aqPu372Gs)$@Q=EgCKLuW6*NzE9w z7p8ii;@_U)=1fQr&1QOgTt4435R}mNR_LtF8wW%WxCN9&r6zZ}qMC{!RU7#8d~YkB z^-+%_0)*<`|EO%*-pI^R?{d2W#r~p}|4sgyr9mWzf3EB$>QXVHm|?Db*Cz?DeUvJP z9*gXfSUR-ydOw&{mu8;Yp;xl3dCL5V-LtB&Byx(3ZKH?QU@u+xKA4@d3SHR>$oA-( zPUg&dG^O!+Z+HPA=*A28CB3$^QUvKV$`#|6u#ZRU$jLb-dN=8s3t=BQZ;(yVd6=6S zR30c)R!wZq6U2VhoF}cMn;FeM`8*I56c7}iAM~q4Am>bAwN$&L`(2Y#RosWcUCWF} z=JZ@1vzxbmi8~W(5Y{su-vYe~4TA*j$;|33gCaceauVu&|9Pk7$-qNRq|3a9l8Amv zM2muobjfumk4!?>{%IoJ*DekL{0B&9??V26KVmxv4r!FMos48b=|43RpE zLXlZs0UwxM4BQ9iIV1XB^rsLjcb!K&KaNW?{aVd=31mNY zwS)aLHLvKlEgFmF7`C9=@|S%9531uDw&c@pwgOe_*MyagzI(kXTB>^9A1I+Dun?YA zDgnLW=R;@B*QMwtz8k`5dFW%Auy}?*mbVu#Z^-ekQYH@$Bg@@Xj%zf>_H_QC;S=le8v9_s- zmXX(`tZ6}6?32{90b0j8EII9H&y{lXTF>F7D3#jkwycv?_r8WF1#cPC0^7fV)U zzlv_7AV#`lS`|Jg$X1qgjam73(zi+mlh>$SQF17r9CKhi=WHAe^>jGe&S8DoM~I0GHi7}>?W=p zCz1E5njKoY$u-K?dd8?Oclpdyu5Sp{71JD->RLqULSzrsTQck};c8l#pzDyfJR|G= z%M>9Y>Brcc{_#Qo8T3Cl2O$9=fqzr}>6=FQ{XMSmkdWN?kdScyO%eKsbNXcN>a`?B z{8XIxh^Z`oq6<}Q7ZDeqmQdGe$}&x|J5mPrXjX59si-L{5=n=**0nvIwc`@9s)c7a z%zF}Ru#zXNeCw6Q<*qyu@E%ngejInwY=4s6h3S+?2M_o{hdr6S@)4ryzs&n%Lzp2_ z`H>>Uf+75hct0?wN7}!hdwK=}PJwNN-I%ZrPTs{82C>gw0 z^eWPdm@WAxeCPeH39Bls?%6RwDVYD!SK0wKR-Im#khm8p*Dv6L%@b#pP&Mp-T%t#X z&g=VPtixOO%yI6k+AdYO)PzLxq9jFLYZl?+T+YSrS;_AMO_z4wK-DydkmJ$`wBIb( zGw~IdMGO?@w;g-G(&5ZM=*mU%U2qo&V1#b3KW2;OH#MrFI%_j|Wnb7Gl^FgdFjbhK zEUVc&Y?>b@>W8@uR9jrhcanYDPTnK&I$~UDa!KIbyKf2c*Aq5mm(+A{@tJIIESUI4 zoEa5Jsvkl!U-G5*Nq@z%h6ZLWrFe8#_C@$~goDyEg=t=&p~`wfvw5VcSQZ%Y^mssW zS(pi6#b6#FSy+2vCDNP>&16yBGF^V9zb=+RqYeMbd`lJ)@@i-p?sDHww-ZOPz0V-` zEIim$Uad2=DH#oD*}zT`HK<_gE5kyo2W*K09NFodBv0CvyF~o8sNWrf&FUHa`r#(h zF))J5X|8Zy*j_b-*LqH)#cN0Av;LquQlOc(c6BWhC7w28lzeE~kxU-HHaxze{C8}( zfFI{@;SeFLENPOe*VOo-$Rbv5*Ph=9PI=}!6Mh8l4~k3R0xU}9 zhGU^lh^qYR=YbeT1{}+eUJDF$+&#%u_`gXf3mZ+F8O~2LIMtNFl${Q|OpL7O{>B;z z7S^E4qGwmt_nk<+Th5%Q>$dM+~DmUnHCPXYY)3NUA%3+UYL&ZLk687S}^Yh5bK_!1MS$@d^;t9O)9;fd}|ie zZ1^)MYhOM@p*Q_6w!;v8kr^OG!ya02pJpsgS{9YD&X9D1r)@y({&U`DF>$^t+ZRDT z>~n=C1KEN%-piK~(V>i7f*5-vQM+arKyIUHr_Pz5eAaBs zSc^VQ*MhVno~Uqq%kWq&D6Y#X_?D2uJf4A~<>H|>CBq&GQkzlVsmoAfVILhW)u8ca zR!Fz`>51C${!sm(xOl4UYbZGO_Iv(;7qs-0Dq))KfuI9}6#`c4eae?cxJa5=<}@Lf zkIN6CXudEE2FN7Fd~KtDe^=RhFaH?`k-8quF>G(JMn|V`J8H) z%#v*`kC`6euHb$sB&M3}1JjSui|Vbwl*pzMGvcMO4AcHK0=iw5xEX~MPdRD!Ns^EX zGlTHM6TzG*L^=6-%SSZS6o(12mz;ER{9LrBU~B`QfQFN5`(6xftPmb!&OyM8#2V{? zF+E!1mZ;Q;iCi}q51qfdi?)$)v)hn)hF-Ay8?Dn>t0w*u#>|@Z2Vkshb`Ex5 zEd+=1;g_sE`791N3u{4rzsuIw)$14eR9go?#uOJ}L-ciYzh%o;8k?~z27o)+lVtDG z4$?tk;f>r@Q+qSc=YC6BR{Y*&s?pMkdO5Ut<;KYa_U7#$TS{@Tkyb(#?}t@fs&XaL zFB4j)1Xf}q5xWAvGQNjEBdxG(eadco=~N+FhK;)1hA#0-7>(%xjXUDJPKA~;HH#cu zrZ{-&krUih6_hgDV&TBNFjqI)&(1wK)PC%n~jsQqRUPJxofqsIz_zaP%XR2YIFc+Wb+ zokr;FzAjcZ>*JH%7X1`R4d+xmY(T=GooM^rnvcvP`&0PEQL7TTE)YAzuGj9yD*G?k zVM7d}rbVW6b^PJb&z5PzT z9GW4rr*6e!-X<2^%hEyRN3EoavW29puiMi6UfOtur&)7g?yQtiwZ2})F<ZF7ae8xrMo^CC>`j~92n;i@nO;5lN9(H~ z=Cy(i%kq14u?9O)2z^XZI#uji49{QgagqkKZ1~0}7zk6ZuJ=avGPMGMqC<+9{jfUD zg@No3X5fjk=Y}EK_nyg}p^I5JOZ72woW26LMG>OW`>M)bTF36-+FAc7rMV)GhO*Ob zx`F5um!~mbVY~Tmqwo2wblRc~FN1>Gz^z9=x2*9N=1RW}3BhV6`%x5M8E@ih%s>*C zF~D>^o3ndcET3-cM0w}C@wLtqxl>Nd9em%u^NY5PN}XnkscQ+5^cU|ftg8<{2$G}` zsIJv9LBK&knS-pDGbF@T;H(ka4mV1jdByp$SXe;T=7z8|rH|DBQ&ym;&v$XqFL|$o z(UwVP?nUg<5%e*Zg=GvW5eFdE&+2>wdyd?NZG)j5g8Qw?ORB=dMZ1&FJ2n=V$aYgy zgI<)_z|RfFqRVqI#8x|7LcRD&m$NwYygxvfUTvcb59|(2j(pQrc_g#@zHr(UjyEf0 zXV;y3zbhC7YsZ3|3*wA5E1(;+nr8$}M9Zd_;L>%>PX!BpQxNFOn+>FyLmW`dA6?45~U|Q!Gut(JM8INW}*xb(hHeVL~_CUNMb!)#=~gf+3kxj`RyrgSF{lWCQYkGn;C&o zTP~~LIcdOnBKI7DiXy+q#Kr^YP-0baW30SrFLxC1R|z$9kEL!_4=^IU<=xvuZN00y zUlh~-Pcl%IGn%v1zjzQ5DKRZ9by?K2Dp4N?s13O#fb;_?Tc*v9Tk zn~~eB)6?&`8zcjJ0^O78Wjlm>9t0f$Y16dh9HG$AhqTOnH>M1T6;OqJlz1LwY$QHuTBHj`)>LW zTo$Z*xcnC9H2G-0#0wq|6qa&F46VPgyGEI^{BLp@cz`i|w7!XY^fajPsEOOa zcf-Pm_0qy}?~b^ubo#h^%o~pA3MQq~nrocr&d>UEHIPwAk^cW$`R_P|jKugi{F(oh z%>OO>zk}C5>4blP>`yuUuNd|}fBN4+>~9J3KXelRmi#l8>1v>3{Jls0bISjq5&7S* F{{rKxCZ_-Z literal 0 HcmV?d00001 From c17fd5dfe7c3bbbd14b6846bcab86e407609ca72 Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Wed, 6 Mar 2024 13:26:03 +0100 Subject: [PATCH 052/228] reenable hiding test --- report-viewer/tests/e2e/Comparison.spec.ts | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/report-viewer/tests/e2e/Comparison.spec.ts b/report-viewer/tests/e2e/Comparison.spec.ts index 98a723715b..f2e6d742bc 100644 --- a/report-viewer/tests/e2e/Comparison.spec.ts +++ b/report-viewer/tests/e2e/Comparison.spec.ts @@ -29,21 +29,13 @@ test('Test comparison table and comparsion view', async ({ page }) => { expect(comparisonTableOverviewHidden).toMatch(/3anon[0-9]+anon[0-9]+/) expect(comparisonTableOverviewHidden).toMatch(/4anon[0-9]+anon[0-9]+/) - // Temporarily disabled due to https://github.com/jplag/JPlag/issues/1629 - /*await page.getByPlaceholder('Filter/Unhide Comparisons').fill('A') + await page.getByPlaceholder('Filter/Unhide Comparisons').fill('Lazy Bobcat') // check for elements being unhidden and filtered - const comparisonTableOverviewFilteredA = await page.getByText('Cluster1').textContent() - expect(comparisonTableOverviewFilteredA).toMatch(/1anon[0-9]+A/) //toContain('1HiddenA') - expect(comparisonTableOverviewFilteredA).toMatch(/3anon[0-9]+A/) - // we cant check for 4Hidden because the dynamic scroller just moves it of screen, so the text is still there but not visible - - await page.getByPlaceholder('Filter/Unhide Comparisons').fill('A C') - // check for elements being unhidden and filtered - const comparisonTableOverviewFilteredAC = await page.getByText('Cluster1').textContent() - expect(comparisonTableOverviewFilteredAC).toContain('1CA') - expect(comparisonTableOverviewFilteredAC).toMatch(/3anon[0-9]+A/) - expect(comparisonTableOverviewFilteredAC).toMatch(/4anon[0-9]+C/)+/*/ + const comparisonTableOverviewFiltered = await page.getByText(/Cluster[0-9]/).textContent() + expect(comparisonTableOverviewFiltered).toMatch(/[0-9]+anon[0-9]+Lazy Bobcat/) + expect(comparisonTableOverviewFiltered).toMatch(/[0-9]+Lazy Bobcatanon[0-9]+/) + await page.getByText('Hide All').click() await page.getByText('Show All').click() await page.getByPlaceholder('Filter/Unhide Comparisons').fill('Lazy') // go to comparison page From d33408fc816d3feefdf2cf6440035c74a788b15c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Mar 2024 13:33:25 +0100 Subject: [PATCH 053/228] Dependency(deps): Bump chart.js from 4.4.1 to 4.4.2 in /report-viewer (#1635) Bumps [chart.js](https://github.com/chartjs/Chart.js) from 4.4.1 to 4.4.2. - [Release notes](https://github.com/chartjs/Chart.js/releases) - [Commits](https://github.com/chartjs/Chart.js/compare/v4.4.1...v4.4.2) --- updated-dependencies: - dependency-name: chart.js dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- report-viewer/package-lock.json | 10 +++++----- report-viewer/package.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/report-viewer/package-lock.json b/report-viewer/package-lock.json index 25fbf6c8db..6b92de4ce7 100644 --- a/report-viewer/package-lock.json +++ b/report-viewer/package-lock.json @@ -13,7 +13,7 @@ "@fortawesome/free-regular-svg-icons": "^6.5.1", "@fortawesome/free-solid-svg-icons": "^6.5.1", "@fortawesome/vue-fontawesome": "^3.0.5", - "chart.js": "^4.4.1", + "chart.js": "^4.4.2", "chartjs-chart-graph": "^4.2.8", "chartjs-plugin-datalabels": "^2.2.0", "highlight.js": "^11.9.0", @@ -2025,14 +2025,14 @@ } }, "node_modules/chart.js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.4.1.tgz", - "integrity": "sha512-C74QN1bxwV1v2PEujhmKjOZ7iUM4w6BWs23Md/6aOZZSlwMzeCIDGuZay++rBgChYru7/+QFeoQW0fQoP534Dg==", + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.4.2.tgz", + "integrity": "sha512-6GD7iKwFpP5kbSD4MeRRRlTnQvxfQREy36uEtm1hzHzcOqwWx0YEHuspuoNlslu+nciLIB7fjjsHkUv/FzFcOg==", "dependencies": { "@kurkle/color": "^0.3.0" }, "engines": { - "pnpm": ">=7" + "pnpm": ">=8" } }, "node_modules/chartjs-chart-graph": { diff --git a/report-viewer/package.json b/report-viewer/package.json index 1d12e5ed37..bfafe03409 100644 --- a/report-viewer/package.json +++ b/report-viewer/package.json @@ -24,7 +24,7 @@ "@fortawesome/free-regular-svg-icons": "^6.5.1", "@fortawesome/free-solid-svg-icons": "^6.5.1", "@fortawesome/vue-fontawesome": "^3.0.5", - "chart.js": "^4.4.1", + "chart.js": "^4.4.2", "chartjs-chart-graph": "^4.2.8", "chartjs-plugin-datalabels": "^2.2.0", "highlight.js": "^11.9.0", From a0322d0fd7c6eb7a6b8735e9b842fc207f5b3e91 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Mar 2024 13:34:51 +0100 Subject: [PATCH 054/228] Dependency(deps-dev): Bump @types/node from 18.19.19 to 18.19.21 in /report-viewer (#1634) Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.19.19 to 18.19.21. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- report-viewer/package-lock.json | 8 ++++---- report-viewer/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/report-viewer/package-lock.json b/report-viewer/package-lock.json index 6b92de4ce7..420be45342 100644 --- a/report-viewer/package-lock.json +++ b/report-viewer/package-lock.json @@ -30,7 +30,7 @@ "@playwright/test": "^1.42.0", "@rushstack/eslint-patch": "^1.7.2", "@types/jsdom": "^21.1.6", - "@types/node": "^18.19.19", + "@types/node": "^18.19.21", "@vitejs/plugin-vue": "^5.0.4", "@vue/eslint-config-prettier": "^9.0.0", "@vue/eslint-config-typescript": "^12.0.0", @@ -1053,9 +1053,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.19.19", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.19.tgz", - "integrity": "sha512-qqV6hSy9zACEhQUy5CEGeuXAZN0fNjqLWRIvOXOwdFYhFoKBiY08VKR5kgchr90+TitLVhpUEb54hk4bYaArUw==", + "version": "18.19.21", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.21.tgz", + "integrity": "sha512-2Q2NeB6BmiTFQi4DHBzncSoq/cJMLDdhPaAoJFnFCyD9a8VPZRf7a1GAwp1Edb7ROaZc5Jz/tnZyL6EsWMRaqw==", "dev": true, "dependencies": { "undici-types": "~5.26.4" diff --git a/report-viewer/package.json b/report-viewer/package.json index bfafe03409..c573793c00 100644 --- a/report-viewer/package.json +++ b/report-viewer/package.json @@ -41,7 +41,7 @@ "@playwright/test": "^1.42.0", "@rushstack/eslint-patch": "^1.7.2", "@types/jsdom": "^21.1.6", - "@types/node": "^18.19.19", + "@types/node": "^18.19.21", "@vitejs/plugin-vue": "^5.0.4", "@vue/eslint-config-prettier": "^9.0.0", "@vue/eslint-config-typescript": "^12.0.0", From 7830a315d7170fd3ebaac20e5d6ea44bb073ccc4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Mar 2024 14:11:27 +0100 Subject: [PATCH 055/228] Dependency(deps-dev): Bump @playwright/test from 1.42.0 to 1.42.1 in /report-viewer (#1633) Bumps [@playwright/test](https://github.com/microsoft/playwright) from 1.42.0 to 1.42.1. - [Release notes](https://github.com/microsoft/playwright/releases) - [Commits](https://github.com/microsoft/playwright/compare/v1.42.0...v1.42.1) --- updated-dependencies: - dependency-name: "@playwright/test" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- report-viewer/package-lock.json | 24 ++++++++++++------------ report-viewer/package.json | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/report-viewer/package-lock.json b/report-viewer/package-lock.json index 420be45342..3914f1472a 100644 --- a/report-viewer/package-lock.json +++ b/report-viewer/package-lock.json @@ -27,7 +27,7 @@ "vue-virtual-scroller": "^2.0.0-beta.8" }, "devDependencies": { - "@playwright/test": "^1.42.0", + "@playwright/test": "^1.42.1", "@rushstack/eslint-patch": "^1.7.2", "@types/jsdom": "^21.1.6", "@types/node": "^18.19.21", @@ -824,12 +824,12 @@ } }, "node_modules/@playwright/test": { - "version": "1.42.0", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.42.0.tgz", - "integrity": "sha512-2k1HzC28Fs+HiwbJOQDUwrWMttqSLUVdjCqitBOjdCD0svWOMQUVqrXX6iFD7POps6xXAojsX/dGBpKnjZctLA==", + "version": "1.42.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.42.1.tgz", + "integrity": "sha512-Gq9rmS54mjBL/7/MvBaNOBwbfnh7beHvS6oS4srqXFcQHpQCV1+c8JXWE8VLPyRDhgS3H8x8A7hztqI9VnwrAQ==", "dev": true, "dependencies": { - "playwright": "1.42.0" + "playwright": "1.42.1" }, "bin": { "playwright": "cli.js" @@ -5309,12 +5309,12 @@ } }, "node_modules/playwright": { - "version": "1.42.0", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.42.0.tgz", - "integrity": "sha512-Ko7YRUgj5xBHbntrgt4EIw/nE//XBHOKVKnBjO1KuZkmkhlbgyggTe5s9hjqQ1LpN+Xg+kHsQyt5Pa0Bw5XpvQ==", + "version": "1.42.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.42.1.tgz", + "integrity": "sha512-PgwB03s2DZBcNRoW+1w9E+VkLBxweib6KTXM0M3tkiT4jVxKSi6PmVJ591J+0u10LUrgxB7dLRbiJqO5s2QPMg==", "dev": true, "dependencies": { - "playwright-core": "1.42.0" + "playwright-core": "1.42.1" }, "bin": { "playwright": "cli.js" @@ -5327,9 +5327,9 @@ } }, "node_modules/playwright-core": { - "version": "1.42.0", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.42.0.tgz", - "integrity": "sha512-0HD9y8qEVlcbsAjdpBaFjmaTHf+1FeIddy8VJLeiqwhcNqGCBe4Wp2e8knpqiYbzxtxarxiXyNDw2cG8sCaNMQ==", + "version": "1.42.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.42.1.tgz", + "integrity": "sha512-mxz6zclokgrke9p1vtdy/COWBH+eOZgYUVVU34C73M+4j4HLlQJHtfcqiqqxpP0o8HhMkflvfbquLX5dg6wlfA==", "dev": true, "bin": { "playwright-core": "cli.js" diff --git a/report-viewer/package.json b/report-viewer/package.json index c573793c00..63e4906acc 100644 --- a/report-viewer/package.json +++ b/report-viewer/package.json @@ -38,7 +38,7 @@ "vue-virtual-scroller": "^2.0.0-beta.8" }, "devDependencies": { - "@playwright/test": "^1.42.0", + "@playwright/test": "^1.42.1", "@rushstack/eslint-patch": "^1.7.2", "@types/jsdom": "^21.1.6", "@types/node": "^18.19.21", From c52e977caca64669875cff7ccc2ab366ca866af1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Mar 2024 15:04:47 +0100 Subject: [PATCH 056/228] Dependency(deps-dev): Bump autoprefixer from 10.4.17 to 10.4.18 in /report-viewer (#1637) Bumps [autoprefixer](https://github.com/postcss/autoprefixer) from 10.4.17 to 10.4.18. - [Release notes](https://github.com/postcss/autoprefixer/releases) - [Changelog](https://github.com/postcss/autoprefixer/blob/main/CHANGELOG.md) - [Commits](https://github.com/postcss/autoprefixer/compare/10.4.17...10.4.18) --- updated-dependencies: - dependency-name: autoprefixer dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- report-viewer/package-lock.json | 40 ++++++++++++++++----------------- report-viewer/package.json | 2 +- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/report-viewer/package-lock.json b/report-viewer/package-lock.json index 3914f1472a..50b87dd697 100644 --- a/report-viewer/package-lock.json +++ b/report-viewer/package-lock.json @@ -36,7 +36,7 @@ "@vue/eslint-config-typescript": "^12.0.0", "@vue/test-utils": "^2.4.3", "@vue/tsconfig": "^0.5.1", - "autoprefixer": "^10.4.16", + "autoprefixer": "^10.4.18", "eslint": "^8.57.0", "eslint-plugin-vue": "^9.22.0", "husky": "^9.0.11", @@ -1807,9 +1807,9 @@ "dev": true }, "node_modules/autoprefixer": { - "version": "10.4.17", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.17.tgz", - "integrity": "sha512-/cpVNRLSfhOtcGflT13P2794gVSgmPgTR+erw5ifnMLZb0UnSlkK4tquLmkd3BhA+nLo5tX8Cu0upUsGKvKbmg==", + "version": "10.4.18", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.18.tgz", + "integrity": "sha512-1DKbDfsr6KUElM6wg+0zRNkB/Q7WcKYAaK+pzXn+Xqmszm/5Xa9coeNdtP88Vi+dPzZnMjhge8GIV49ZQkDa+g==", "dev": true, "funding": [ { @@ -1826,8 +1826,8 @@ } ], "dependencies": { - "browserslist": "^4.22.2", - "caniuse-lite": "^1.0.30001578", + "browserslist": "^4.23.0", + "caniuse-lite": "^1.0.30001591", "fraction.js": "^4.3.7", "normalize-range": "^0.1.2", "picocolors": "^1.0.0", @@ -1898,9 +1898,9 @@ } }, "node_modules/browserslist": { - "version": "4.22.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.3.tgz", - "integrity": "sha512-UAp55yfwNv0klWNapjs/ktHoguxuQNGnOzxYmfnXIS+8AsRDZkSDxg7R1AX3GKzn078SBI5dzwzj/Yx0Or0e3A==", + "version": "4.23.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.0.tgz", + "integrity": "sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==", "dev": true, "funding": [ { @@ -1917,8 +1917,8 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001580", - "electron-to-chromium": "^1.4.648", + "caniuse-lite": "^1.0.30001587", + "electron-to-chromium": "^1.4.668", "node-releases": "^2.0.14", "update-browserslist-db": "^1.0.13" }, @@ -1971,9 +1971,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001583", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001583.tgz", - "integrity": "sha512-acWTYaha8xfhA/Du/z4sNZjHUWjkiuoAi2LM+T/aL+kemKQgPT1xBb/YKjlQ0Qo8gvbHsGNplrEJ+9G3gL7i4Q==", + "version": "1.0.30001594", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001594.tgz", + "integrity": "sha512-VblSX6nYqyJVs8DKFMldE2IVCJjZ225LW00ydtUWwh5hk9IfkTOffO6r8gJNsH0qqqeAF8KrbMYA2VEwTlGW5g==", "dev": true, "funding": [ { @@ -2537,9 +2537,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.655", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.655.tgz", - "integrity": "sha512-2yszojF7vIZ68adIOvzV4bku8OZad9w5H9xF3ZAMZjPuOjBarlflUkjN6DggdV+L71WZuKUfKUhov/34+G5QHg==", + "version": "1.4.693", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.693.tgz", + "integrity": "sha512-/if4Ueg0GUQlhCrW2ZlXwDAm40ipuKo+OgeHInlL8sbjt+hzISxZK949fZeJaVsheamrzANXvw1zQTvbxTvSHw==", "dev": true }, "node_modules/emoji-regex": { @@ -2691,9 +2691,9 @@ } }, "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", "dev": true, "engines": { "node": ">=6" diff --git a/report-viewer/package.json b/report-viewer/package.json index 63e4906acc..5d21ca67c4 100644 --- a/report-viewer/package.json +++ b/report-viewer/package.json @@ -47,7 +47,7 @@ "@vue/eslint-config-typescript": "^12.0.0", "@vue/test-utils": "^2.4.3", "@vue/tsconfig": "^0.5.1", - "autoprefixer": "^10.4.16", + "autoprefixer": "^10.4.18", "eslint": "^8.57.0", "eslint-plugin-vue": "^9.22.0", "husky": "^9.0.11", From 9190b2e6392973050cc48358bc9bab6d35917e7a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Mar 2024 17:07:32 +0100 Subject: [PATCH 057/228] Dependency(deps-dev): Bump vue-tsc from 1.8.27 to 2.0.5 in /report-viewer (#1636) Bumps [vue-tsc](https://github.com/vuejs/language-tools/tree/HEAD/packages/tsc) from 1.8.27 to 2.0.5. - [Release notes](https://github.com/vuejs/language-tools/releases) - [Changelog](https://github.com/vuejs/language-tools/blob/master/CHANGELOG.md) - [Commits](https://github.com/vuejs/language-tools/commits/v2.0.5/packages/tsc) --- updated-dependencies: - dependency-name: vue-tsc dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- report-viewer/package-lock.json | 56 ++++++++++++++++----------------- report-viewer/package.json | 2 +- 2 files changed, 28 insertions(+), 30 deletions(-) diff --git a/report-viewer/package-lock.json b/report-viewer/package-lock.json index 50b87dd697..46bc9af075 100644 --- a/report-viewer/package-lock.json +++ b/report-viewer/package-lock.json @@ -50,7 +50,7 @@ "typescript": "^5.3.3", "vite": "^5.1.4", "vitest": "^1.3.1", - "vue-tsc": "^1.8.27" + "vue-tsc": "^2.0.5" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -1379,30 +1379,30 @@ } }, "node_modules/@volar/language-core": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-1.11.1.tgz", - "integrity": "sha512-dOcNn3i9GgZAcJt43wuaEykSluAuOkQgzni1cuxLxTV0nJKanQztp7FxyswdRILaKH+P2XZMPRp2S4MV/pElCw==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-2.1.1.tgz", + "integrity": "sha512-oVbZcj97+5zlowkHMSJMt3aaAFuFyhXeXoOEHcqGECxFvw1TPCNnMM9vxhqNpoiNeWKHvggoq9WCk/HzJHtP8A==", "dev": true, "dependencies": { - "@volar/source-map": "1.11.1" + "@volar/source-map": "2.1.1" } }, "node_modules/@volar/source-map": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-1.11.1.tgz", - "integrity": "sha512-hJnOnwZ4+WT5iupLRnuzbULZ42L7BWWPMmruzwtLhJfpDVoZLjNBxHDi2sY2bgZXCKlpU5XcsMFoYrsQmPhfZg==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-2.1.1.tgz", + "integrity": "sha512-OOtxrEWB2eZ+tnCy5JwDkcCPGlN3+ioNNzkywXE9k4XA7p4cN36frR7QPAOksvd7RXKUGHzSjq6XrYnTPa4z4Q==", "dev": true, "dependencies": { - "muggle-string": "^0.3.1" + "muggle-string": "^0.4.0" } }, "node_modules/@volar/typescript": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@volar/typescript/-/typescript-1.11.1.tgz", - "integrity": "sha512-iU+t2mas/4lYierSnoFOeRFQUhAEMgsFuQxoxvwn5EdQopw43j+J27a4lt9LMInx1gLJBC6qL14WYGlgymaSMQ==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@volar/typescript/-/typescript-2.1.1.tgz", + "integrity": "sha512-5K41AWvFZCMMKZCx8bbFvbkyiKHr0s9k8P0M1FVXLX/9HYHzK5C9B8cX4uhATSehAytFIRnR4fTXVQtWp/Yzag==", "dev": true, "dependencies": { - "@volar/language-core": "1.11.1", + "@volar/language-core": "2.1.1", "path-browserify": "^1.0.1" } }, @@ -1506,18 +1506,16 @@ } }, "node_modules/@vue/language-core": { - "version": "1.8.27", - "resolved": "https://registry.npmjs.org/@vue/language-core/-/language-core-1.8.27.tgz", - "integrity": "sha512-L8Kc27VdQserNaCUNiSFdDl9LWT24ly8Hpwf1ECy3aFb9m6bDhBGQYOujDm21N7EW3moKIOKEanQwe1q5BK+mA==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@vue/language-core/-/language-core-2.0.5.tgz", + "integrity": "sha512-knGXuQqhDSO7QJr8LFklsiWa23N2ikehkdVxtc9UKgnyqsnusughS2Tkg7VN8Hqed35X0B52Z+OGI5OrT/8uxQ==", "dev": true, "dependencies": { - "@volar/language-core": "~1.11.1", - "@volar/source-map": "~1.11.1", - "@vue/compiler-dom": "^3.3.0", - "@vue/shared": "^3.3.0", + "@volar/language-core": "~2.1.1", + "@vue/compiler-dom": "^3.4.0", + "@vue/shared": "^3.4.0", "computeds": "^0.0.1", "minimatch": "^9.0.3", - "muggle-string": "^0.3.1", "path-browserify": "^1.0.1", "vue-template-compiler": "^2.7.14" }, @@ -4607,9 +4605,9 @@ "dev": true }, "node_modules/muggle-string": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/muggle-string/-/muggle-string-0.3.1.tgz", - "integrity": "sha512-ckmWDJjphvd/FvZawgygcUeQCxzvohjFO5RxTjj4eq8kw359gFF3E1brjfI+viLMxss5JrHTDRHZvu2/tuy0Qg==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/muggle-string/-/muggle-string-0.4.1.tgz", + "integrity": "sha512-VNTrAak/KhO2i8dqqnqnAHOa3cYBwXEZe9h+D5h/1ZqFSTEFHdM65lR7RoIqq3tBBYavsOXV84NoHXZ0AkPyqQ==", "dev": true }, "node_modules/mz": { @@ -7183,13 +7181,13 @@ } }, "node_modules/vue-tsc": { - "version": "1.8.27", - "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-1.8.27.tgz", - "integrity": "sha512-WesKCAZCRAbmmhuGl3+VrdWItEvfoFIPXOvUJkjULi+x+6G/Dy69yO3TBRJDr9eUlmsNAwVmxsNZxvHKzbkKdg==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-2.0.5.tgz", + "integrity": "sha512-e8WCgOVTrbmC04XPnI+IpaMTFYKaTm5s/MXFcvxO1l9kxzn+9FpGNVrBSlQE8VpTJaJg4kaBK1nj3NC20VJzjw==", "dev": true, "dependencies": { - "@volar/typescript": "~1.11.1", - "@vue/language-core": "1.8.27", + "@volar/typescript": "~2.1.1", + "@vue/language-core": "2.0.5", "semver": "^7.5.4" }, "bin": { diff --git a/report-viewer/package.json b/report-viewer/package.json index 5d21ca67c4..9495a73e6c 100644 --- a/report-viewer/package.json +++ b/report-viewer/package.json @@ -61,6 +61,6 @@ "typescript": "^5.3.3", "vite": "^5.1.4", "vitest": "^1.3.1", - "vue-tsc": "^1.8.27" + "vue-tsc": "^2.0.5" } } From 404e8f8802616ec53b6ca4b3976601bd282ac503 Mon Sep 17 00:00:00 2001 From: J E <617498+jepst@users.noreply.github.com> Date: Wed, 6 Mar 2024 15:00:30 -0500 Subject: [PATCH 058/228] Fix ParsingException in cases of null file parameter The comment for the constructor indicates that the file parameter can be null, but the constructMessage method will NPE if file is null. --- language-api/src/main/java/de/jplag/ParsingException.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/language-api/src/main/java/de/jplag/ParsingException.java b/language-api/src/main/java/de/jplag/ParsingException.java index c6e1ad6270..2f54e7a62d 100644 --- a/language-api/src/main/java/de/jplag/ParsingException.java +++ b/language-api/src/main/java/de/jplag/ParsingException.java @@ -76,8 +76,9 @@ private ParsingException(String message) { private static String constructMessage(File file, String reason) { StringBuilder messageBuilder = new StringBuilder(); - if (reason == null || !reason.contains(file.toString())) { - messageBuilder.append("failed to parse '%s'".formatted(file)); + String fileName = file == null ? "" : file.toString(); + if (reason == null || !reason.contains(fileName)) { + messageBuilder.append("failed to parse '%s'".formatted(fileName)); } if (reason != null && !reason.isBlank()) { messageBuilder.append(reason); From b466e2fedaacb65b032ca322661b350f85dadf45 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Mar 2024 10:49:47 +0000 Subject: [PATCH 059/228] Dependency(deps): Bump org.scalameta:scalameta_2.13 from 4.9.0 to 4.9.1 Bumps [org.scalameta:scalameta_2.13](https://github.com/scalameta/scalameta) from 4.9.0 to 4.9.1. - [Release notes](https://github.com/scalameta/scalameta/releases) - [Commits](https://github.com/scalameta/scalameta/compare/v4.9.0...v4.9.1) --- updated-dependencies: - dependency-name: org.scalameta:scalameta_2.13 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- languages/scala/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages/scala/pom.xml b/languages/scala/pom.xml index c0dca1f03b..037b9c7c5d 100644 --- a/languages/scala/pom.xml +++ b/languages/scala/pom.xml @@ -25,7 +25,7 @@ org.scalameta scalameta_${scala.compat.version} - 4.9.0 + 4.9.1 From 06011a9fdd8dc615da91f36b398916c77cbc35c5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Mar 2024 10:49:35 +0000 Subject: [PATCH 060/228] Dependency(deps-dev): Bump org.mockito:mockito-core Bumps [org.mockito:mockito-core](https://github.com/mockito/mockito) from 5.10.0 to 5.11.0. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v5.10.0...v5.11.0) --- updated-dependencies: - dependency-name: org.mockito:mockito-core dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 080bc524d2..f5d1dc0571 100644 --- a/pom.xml +++ b/pom.xml @@ -167,7 +167,7 @@ org.mockito mockito-core - 5.10.0 + 5.11.0 test From ec5c8dda6842218e16d49beaa656186d66ce770f Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Sun, 10 Mar 2024 17:32:30 +0100 Subject: [PATCH 061/228] remove view warnings --- .../src/viewWrapper/ClusterViewWrapper.vue | 18 ++++++++++-------- .../src/viewWrapper/ComparisonViewWrapper.vue | 18 ++++++++++-------- .../src/viewWrapper/InformationViewWrapper.vue | 18 ++++++++++-------- .../src/viewWrapper/OverviewViewWrapper.vue | 18 ++++++++++-------- report-viewer/src/views/ComparisonView.vue | 2 +- 5 files changed, 41 insertions(+), 33 deletions(-) diff --git a/report-viewer/src/viewWrapper/ClusterViewWrapper.vue b/report-viewer/src/viewWrapper/ClusterViewWrapper.vue index 6c3e2bbdec..234569c676 100644 --- a/report-viewer/src/viewWrapper/ClusterViewWrapper.vue +++ b/report-viewer/src/viewWrapper/ClusterViewWrapper.vue @@ -1,13 +1,15 @@ + + diff --git a/report-viewer/src/components/fileDisplaying/CodePanel.vue b/report-viewer/src/components/fileDisplaying/CodePanel.vue index 506936f513..a02ff2f5b0 100644 --- a/report-viewer/src/components/fileDisplaying/CodePanel.vue +++ b/report-viewer/src/components/fileDisplaying/CodePanel.vue @@ -22,39 +22,31 @@
- +
+ {{ index + 1 }} +
- - - - - - -
{{ index + 1 }}
+ ref="lineRefs" + :line="line.line" + :lineNumber="index + 1" + :matches="line.matches" + @matchSelected="matchSelected" + /> +
Empty File @@ -68,12 +60,12 @@ import type { MatchInSingleFile } from '@/model/MatchInSingleFile' import { ref, nextTick, type PropType, computed, type Ref } from 'vue' import Interactable from '../InteractableComponent.vue' -import type { Match } from '@/model/Match' import type { SubmissionFile } from '@/model/File' import { highlight } from '@/utils/CodeHighlighter' import type { Language } from '@/model/Language' -import { getMatchColor } from '@/utils/ColorUtils' import ToolTipComponent from '../ToolTipComponent.vue' +import CodeLine from './CodeLine.vue' +import type { Match } from '@/model/Match' const props = defineProps({ /** @@ -99,24 +91,22 @@ const props = defineProps({ } }) -const emit = defineEmits(['lineSelected']) +const emit = defineEmits(['matchSelected']) const collapsed = ref(true) const lineRefs = ref([]) -const codeLines: Ref<{ line: string; match: null | Match }[]> = computed(() => +const codeLines: Ref<{ line: string; matches: MatchInSingleFile[] }[]> = computed(() => highlight(props.file.data, props.highlightLanguage).map((line, index) => { return { line, - match: props.matches?.find((m) => m.start <= index + 1 && index + 1 <= m.end)?.match ?? null + matches: props.matches?.filter((m) => m.start <= index + 1 && index + 1 <= m.end) ?? [] } }) ) -function lineSelected(lineIndex: number) { - if (codeLines.value[lineIndex].match !== null) { - emit('lineSelected', codeLines.value[lineIndex].match) - } +function matchSelected(match: Match) { + emit('matchSelected', match) } /** @@ -154,16 +144,3 @@ function getFileDisplayName(file: SubmissionFile): string { : file.fileName } - - diff --git a/report-viewer/src/components/fileDisplaying/FilesContainer.vue b/report-viewer/src/components/fileDisplaying/FilesContainer.vue index 58c394e4ed..1e9b2365e4 100644 --- a/report-viewer/src/components/fileDisplaying/FilesContainer.vue +++ b/report-viewer/src/components/fileDisplaying/FilesContainer.vue @@ -28,7 +28,7 @@ !matches.get(file.fileName) ? [] : (matches.get(file.fileName) as MatchInSingleFile[]) " :highlight-language="highlightLanguage" - @line-selected="(match) => $emit('lineSelected', match)" + @match-selected="(match) => $emit('matchSelected', match)" class="mt-1 first:mt-0" /> @@ -83,7 +83,7 @@ const props = defineProps({ } }) -defineEmits(['lineSelected']) +defineEmits(['matchSelected']) const codePanels: Ref<(typeof CodePanel)[]> = ref([]) diff --git a/report-viewer/src/views/ComparisonView.vue b/report-viewer/src/views/ComparisonView.vue index 58380799aa..b901b8d4ac 100644 --- a/report-viewer/src/views/ComparisonView.vue +++ b/report-viewer/src/views/ComparisonView.vue @@ -85,7 +85,7 @@ :matches="comparison.matchesInFirstSubmission" :file-owner-display-name="store().getDisplayName(comparison.firstSubmissionId)" :highlight-language="language" - @line-selected="showMatchInSecond" + @match-selected="showMatchInSecond" class="max-h-0 min-h-full flex-1 overflow-hidden print:max-h-none print:overflow-y-visible" />
From 89a33016042bf3ff75286e5fc96d83efb70a15db Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Mon, 18 Mar 2024 22:24:09 +0100 Subject: [PATCH 081/228] clean up code --- .../components/fileDisplaying/CodeLine.vue | 51 +++++++++---------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/report-viewer/src/components/fileDisplaying/CodeLine.vue b/report-viewer/src/components/fileDisplaying/CodeLine.vue index 1b765ef18e..413177c871 100644 --- a/report-viewer/src/components/fileDisplaying/CodeLine.vue +++ b/report-viewer/src/components/fileDisplaying/CodeLine.vue @@ -7,7 +7,7 @@ }" >
a.startColumn - b.startColumn) .sort((a, b) => a.start - b.start) - let matchParts: MatchPart[] = [] + let lineParts: { + start: number + end: number + match?: MatchInSingleFile + }[] = [] if (sortedMatches[0].start == props.lineNumber && sortedMatches[0].startColumn > 0) { const end = sortedMatches[0].startColumn - 1 - matchParts.push({ start: 0, end: end }) + lineParts.push({ start: 0, end: end }) } const start = sortedMatches[0].start == props.lineNumber ? sortedMatches[0].startColumn : 0 const end = sortedMatches[0].end == props.lineNumber ? sortedMatches[0].endColumn : props.line.length - matchParts.push({ start: start, end: end, match: sortedMatches[0] }) + lineParts.push({ start: start, end: end, match: sortedMatches[0] }) let matchIndex = 1 while (matchIndex < sortedMatches.length) { const match = sortedMatches[matchIndex] - const prevMatchPart = matchParts[matchIndex - 1] + const prevMatchPart = lineParts[matchIndex - 1] if (prevMatchPart.end + 1 < match.startColumn) { const end = match.startColumn - 1 - matchParts.push({ start: prevMatchPart.end + 1, end: end }) + lineParts.push({ start: prevMatchPart.end + 1, end: end }) } const end = match.end == props.lineNumber ? match.endColumn : props.line.length - matchParts.push({ start: match.startColumn, end: end, match }) + lineParts.push({ start: match.startColumn, end: end, match }) matchIndex++ } - if (matchParts[matchParts.length - 1].end < props.line.length) { - matchParts.push({ start: matchParts[matchParts.length - 1].end + 1, end: props.line.length }) + if (lineParts[lineParts.length - 1].end < props.line.length) { + lineParts.push({ start: lineParts[lineParts.length - 1].end + 1, end: props.line.length }) } - let parts: Part[] = [] + let textParts: TextPart[] = [] lineIndex.value = 0 colIndex.value = 0 - for (let i = 0; i < matchParts.length; i++) { - const matchPart = matchParts[i] - const line = getNextLinePartTill(matchPart.end) - parts.push({ line, ...matchPart }) + for (let i = 0; i < lineParts.length; i++) { + const matchPart = lineParts[i] + const line = getNextLinePartTillColumn(matchPart.end) + textParts.push({ line, match: matchPart.match }) } - return parts + return textParts } -const parts = compParts() +const textParts = computeTextParts() -function getNextLinePartTill(endCol: number) { +function getNextLinePartTillColumn(endCol: number) { let part = '' while (colIndex.value <= endCol && lineIndex.value < props.line.length) { if (props.line[lineIndex.value] == '<') { From 73809b6637ce165ddea90dedafca704494d2c30e Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Mon, 18 Mar 2024 23:05:54 +0100 Subject: [PATCH 082/228] fix scrolling --- .../src/components/fileDisplaying/CodeLine.vue | 15 +++++++++++++-- .../src/components/fileDisplaying/CodePanel.vue | 6 +++--- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/report-viewer/src/components/fileDisplaying/CodeLine.vue b/report-viewer/src/components/fileDisplaying/CodeLine.vue index 413177c871..fd6d0fc994 100644 --- a/report-viewer/src/components/fileDisplaying/CodeLine.vue +++ b/report-viewer/src/components/fileDisplaying/CodeLine.vue @@ -5,11 +5,12 @@ :style="{ gridRowStart: lineNumber }" + ref="lineRef" >
@@ -94,7 +94,7 @@ const props = defineProps({ const emit = defineEmits(['matchSelected']) const collapsed = ref(true) -const lineRefs = ref([]) +const lineRefs = ref<(typeof CodeLine)[]>([]) const codeLines: Ref<{ line: string; matches: MatchInSingleFile[] }[]> = computed(() => highlight(props.file.data, props.highlightLanguage).map((line, index) => { @@ -116,7 +116,7 @@ function matchSelected(match: Match) { function scrollTo(lineNumber: number) { collapsed.value = false nextTick(function () { - lineRefs.value[lineNumber - 1].scrollIntoView({ block: 'center' }) + lineRefs.value[lineNumber - 1].scrollTo() }) } From f256285e9030988933d3342ee9bb6b9effef37fb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 20 Mar 2024 10:09:03 +0000 Subject: [PATCH 083/228] Dependency(deps): Bump org.apache.maven.plugins:maven-gpg-plugin Bumps [org.apache.maven.plugins:maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) from 3.2.0 to 3.2.1. - [Release notes](https://github.com/apache/maven-gpg-plugin/releases) - [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-3.2.0...maven-gpg-plugin-3.2.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-gpg-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6ef6e0dc5e..3cba0a6640 100644 --- a/pom.xml +++ b/pom.xml @@ -268,7 +268,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.2.0 + 3.2.1 org.apache.maven.plugins From 42179a7015a068929a7725e02fcffb6941860689 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 21 Mar 2024 08:22:21 +0100 Subject: [PATCH 084/228] Dependency(deps-dev): Bump @types/node from 18.19.23 to 18.19.26 in /report-viewer (#1665) Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.19.23 to 18.19.26. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- report-viewer/package-lock.json | 8 ++++---- report-viewer/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/report-viewer/package-lock.json b/report-viewer/package-lock.json index 36316eae4c..7cf246976f 100644 --- a/report-viewer/package-lock.json +++ b/report-viewer/package-lock.json @@ -30,7 +30,7 @@ "@playwright/test": "^1.42.1", "@rushstack/eslint-patch": "^1.7.2", "@types/jsdom": "^21.1.6", - "@types/node": "^18.19.23", + "@types/node": "^18.19.26", "@vitejs/plugin-vue": "^5.0.4", "@vue/eslint-config-prettier": "^9.0.0", "@vue/eslint-config-typescript": "^13.0.0", @@ -1053,9 +1053,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.19.23", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.23.tgz", - "integrity": "sha512-wtE3d0OUfNKtZYAqZb8HAWGxxXsImJcPUAgZNw+dWFxO6s5tIwIjyKnY76tsTatsNCLJPkVYwUpq15D38ng9Aw==", + "version": "18.19.26", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.26.tgz", + "integrity": "sha512-+wiMJsIwLOYCvUqSdKTrfkS8mpTp+MPINe6+Np4TAGFWWRWiBQ5kSq9nZGCSPkzx9mvT+uEukzpX4MOSCydcvw==", "dev": true, "dependencies": { "undici-types": "~5.26.4" diff --git a/report-viewer/package.json b/report-viewer/package.json index 728d385640..62121c664a 100644 --- a/report-viewer/package.json +++ b/report-viewer/package.json @@ -41,7 +41,7 @@ "@playwright/test": "^1.42.1", "@rushstack/eslint-patch": "^1.7.2", "@types/jsdom": "^21.1.6", - "@types/node": "^18.19.23", + "@types/node": "^18.19.26", "@vitejs/plugin-vue": "^5.0.4", "@vue/eslint-config-prettier": "^9.0.0", "@vue/eslint-config-typescript": "^13.0.0", From 0b8193b8f1e3f4b7a27b34f704a542ed0e34f304 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 21 Mar 2024 08:23:39 +0100 Subject: [PATCH 085/228] Dependency(deps-dev): Bump @vue/test-utils from 2.4.4 to 2.4.5 in /report-viewer (#1666) Bumps [@vue/test-utils](https://github.com/vuejs/test-utils) from 2.4.4 to 2.4.5. - [Release notes](https://github.com/vuejs/test-utils/releases) - [Commits](https://github.com/vuejs/test-utils/compare/v2.4.4...v2.4.5) --- updated-dependencies: - dependency-name: "@vue/test-utils" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- report-viewer/package-lock.json | 25 ++++++++----------------- report-viewer/package.json | 2 +- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/report-viewer/package-lock.json b/report-viewer/package-lock.json index 7cf246976f..5ff711d6c5 100644 --- a/report-viewer/package-lock.json +++ b/report-viewer/package-lock.json @@ -34,7 +34,7 @@ "@vitejs/plugin-vue": "^5.0.4", "@vue/eslint-config-prettier": "^9.0.0", "@vue/eslint-config-typescript": "^13.0.0", - "@vue/test-utils": "^2.4.3", + "@vue/test-utils": "^2.4.5", "@vue/tsconfig": "^0.5.1", "autoprefixer": "^10.4.18", "eslint": "^8.57.0", @@ -1573,22 +1573,13 @@ "integrity": "sha512-KzfPTxVaWfB+eGcGdbSf4CWdaXcGDqckoeXUh7SB3fZdEtzPCK2Vq9B/lRRL3yutax/LWITz+SwvgyOxz5V75g==" }, "node_modules/@vue/test-utils": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/@vue/test-utils/-/test-utils-2.4.4.tgz", - "integrity": "sha512-8jkRxz8pNhClAf4Co4ZrpAoFISdvT3nuSkUlY6Ys6rmTpw3DMWG/X3mw3gQ7QJzgCZO9f+zuE2kW57fi09MW7Q==", + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/@vue/test-utils/-/test-utils-2.4.5.tgz", + "integrity": "sha512-oo2u7vktOyKUked36R93NB7mg2B+N7Plr8lxp2JBGwr18ch6EggFjixSCdIVVLkT6Qr0z359Xvnafc9dcKyDUg==", "dev": true, "dependencies": { "js-beautify": "^1.14.9", - "vue-component-type-helpers": "^1.8.21" - }, - "peerDependencies": { - "@vue/server-renderer": "^3.0.1", - "vue": "^3.0.1" - }, - "peerDependenciesMeta": { - "@vue/server-renderer": { - "optional": true - } + "vue-component-type-helpers": "^2.0.0" } }, "node_modules/@vue/tsconfig": { @@ -7106,9 +7097,9 @@ } }, "node_modules/vue-component-type-helpers": { - "version": "1.8.27", - "resolved": "https://registry.npmjs.org/vue-component-type-helpers/-/vue-component-type-helpers-1.8.27.tgz", - "integrity": "sha512-0vOfAtI67UjeO1G6UiX5Kd76CqaQ67wrRZiOe7UAb9Jm6GzlUr/fC7CV90XfwapJRjpCMaZFhv1V0ajWRmE9Dg==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/vue-component-type-helpers/-/vue-component-type-helpers-2.0.6.tgz", + "integrity": "sha512-qdGXCtoBrwqk1BT6r2+1Wcvl583ZVkuSZ3or7Y1O2w5AvWtlvvxwjGhmz5DdPJS9xqRdDlgTJ/38ehWnEi0tFA==", "dev": true }, "node_modules/vue-draggable-next": { diff --git a/report-viewer/package.json b/report-viewer/package.json index 62121c664a..7a2ff65f12 100644 --- a/report-viewer/package.json +++ b/report-viewer/package.json @@ -45,7 +45,7 @@ "@vitejs/plugin-vue": "^5.0.4", "@vue/eslint-config-prettier": "^9.0.0", "@vue/eslint-config-typescript": "^13.0.0", - "@vue/test-utils": "^2.4.3", + "@vue/test-utils": "^2.4.5", "@vue/tsconfig": "^0.5.1", "autoprefixer": "^10.4.18", "eslint": "^8.57.0", From 40088fb1c22184a550e417468ab2af0aaec044ad Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 21 Mar 2024 08:24:31 +0100 Subject: [PATCH 086/228] Dependency(deps-dev): Bump vue-tsc from 2.0.5 to 2.0.6 in /report-viewer (#1664) Bumps [vue-tsc](https://github.com/vuejs/language-tools/tree/HEAD/packages/tsc) from 2.0.5 to 2.0.6. - [Release notes](https://github.com/vuejs/language-tools/releases) - [Changelog](https://github.com/vuejs/language-tools/blob/master/CHANGELOG.md) - [Commits](https://github.com/vuejs/language-tools/commits/v2.0.6/packages/tsc) --- updated-dependencies: - dependency-name: vue-tsc dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- report-viewer/package-lock.json | 42 ++++++++++++++++----------------- report-viewer/package.json | 2 +- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/report-viewer/package-lock.json b/report-viewer/package-lock.json index 5ff711d6c5..13975a76bf 100644 --- a/report-viewer/package-lock.json +++ b/report-viewer/package-lock.json @@ -50,7 +50,7 @@ "typescript": "^5.4.2", "vite": "^5.1.6", "vitest": "^1.3.1", - "vue-tsc": "^2.0.5" + "vue-tsc": "^2.0.6" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -1379,30 +1379,30 @@ } }, "node_modules/@volar/language-core": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-2.1.1.tgz", - "integrity": "sha512-oVbZcj97+5zlowkHMSJMt3aaAFuFyhXeXoOEHcqGECxFvw1TPCNnMM9vxhqNpoiNeWKHvggoq9WCk/HzJHtP8A==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-2.1.3.tgz", + "integrity": "sha512-F93KYZYqcYltG7NihfnLt/omMZOtrQtsh2+wj+cgx3xolopU+TZvmwlZWOjw3ObZGFj3SKBb4jJn6VSfSch6RA==", "dev": true, "dependencies": { - "@volar/source-map": "2.1.1" + "@volar/source-map": "2.1.3" } }, "node_modules/@volar/source-map": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-2.1.1.tgz", - "integrity": "sha512-OOtxrEWB2eZ+tnCy5JwDkcCPGlN3+ioNNzkywXE9k4XA7p4cN36frR7QPAOksvd7RXKUGHzSjq6XrYnTPa4z4Q==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-2.1.3.tgz", + "integrity": "sha512-j+R+NG/OlDgdNMttADxNuSM9Z26StT/Bjw0NgSydI05Vihngn9zvaP/xXwfWs5qQrRzbKVFxJebS2ks5m/URuA==", "dev": true, "dependencies": { "muggle-string": "^0.4.0" } }, "node_modules/@volar/typescript": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@volar/typescript/-/typescript-2.1.1.tgz", - "integrity": "sha512-5K41AWvFZCMMKZCx8bbFvbkyiKHr0s9k8P0M1FVXLX/9HYHzK5C9B8cX4uhATSehAytFIRnR4fTXVQtWp/Yzag==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@volar/typescript/-/typescript-2.1.3.tgz", + "integrity": "sha512-ZZqLMih4mvu2eJAW3UCFm84OM/ojYMoA/BU/W1TctT5F2nVzNJmW4jxMWmP3wQzxCbATfTa5gLb1+BSI9NBMBg==", "dev": true, "dependencies": { - "@volar/language-core": "2.1.1", + "@volar/language-core": "2.1.3", "path-browserify": "^1.0.1" } }, @@ -1506,12 +1506,12 @@ } }, "node_modules/@vue/language-core": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@vue/language-core/-/language-core-2.0.5.tgz", - "integrity": "sha512-knGXuQqhDSO7QJr8LFklsiWa23N2ikehkdVxtc9UKgnyqsnusughS2Tkg7VN8Hqed35X0B52Z+OGI5OrT/8uxQ==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@vue/language-core/-/language-core-2.0.6.tgz", + "integrity": "sha512-UzqU12tzf9XLqRO3TiWPwRNpP4fyUzE6MAfOQWQNZ4jy6a30ARRUpmODDKq6O8C4goMc2AlPqTmjOHPjHkilSg==", "dev": true, "dependencies": { - "@volar/language-core": "~2.1.1", + "@volar/language-core": "~2.1.2", "@vue/compiler-dom": "^3.4.0", "@vue/shared": "^3.4.0", "computeds": "^0.0.1", @@ -7176,13 +7176,13 @@ } }, "node_modules/vue-tsc": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-2.0.5.tgz", - "integrity": "sha512-e8WCgOVTrbmC04XPnI+IpaMTFYKaTm5s/MXFcvxO1l9kxzn+9FpGNVrBSlQE8VpTJaJg4kaBK1nj3NC20VJzjw==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-2.0.6.tgz", + "integrity": "sha512-kK50W4XqQL34vHRkxlRWLicrT6+F9xfgCgJ4KSmCHcytKzc1u3c94XXgI+CjmhOSxyw0krpExF7Obo7y4+0dVQ==", "dev": true, "dependencies": { - "@volar/typescript": "~2.1.1", - "@vue/language-core": "2.0.5", + "@volar/typescript": "~2.1.2", + "@vue/language-core": "2.0.6", "semver": "^7.5.4" }, "bin": { diff --git a/report-viewer/package.json b/report-viewer/package.json index 7a2ff65f12..1e2224d76f 100644 --- a/report-viewer/package.json +++ b/report-viewer/package.json @@ -61,6 +61,6 @@ "typescript": "^5.4.2", "vite": "^5.1.6", "vitest": "^1.3.1", - "vue-tsc": "^2.0.5" + "vue-tsc": "^2.0.6" } } From 56f4457a1eef0d4901d7bc00dd110e7bd8b406b0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 21 Mar 2024 08:58:45 +0100 Subject: [PATCH 087/228] Dependency(deps-dev): Bump @rushstack/eslint-patch from 1.7.2 to 1.8.0 in /report-viewer (#1663) Bumps [@rushstack/eslint-patch](https://github.com/microsoft/rushstack/tree/HEAD/eslint/eslint-patch) from 1.7.2 to 1.8.0. - [Changelog](https://github.com/microsoft/rushstack/blob/main/eslint/eslint-patch/CHANGELOG.md) - [Commits](https://github.com/microsoft/rushstack/commits/@rushstack/eslint-patch_v1.8.0/eslint/eslint-patch) --- updated-dependencies: - dependency-name: "@rushstack/eslint-patch" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- report-viewer/package-lock.json | 8 ++++---- report-viewer/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/report-viewer/package-lock.json b/report-viewer/package-lock.json index 13975a76bf..aee03b9014 100644 --- a/report-viewer/package-lock.json +++ b/report-viewer/package-lock.json @@ -28,7 +28,7 @@ }, "devDependencies": { "@playwright/test": "^1.42.1", - "@rushstack/eslint-patch": "^1.7.2", + "@rushstack/eslint-patch": "^1.8.0", "@types/jsdom": "^21.1.6", "@types/node": "^18.19.26", "@vitejs/plugin-vue": "^5.0.4", @@ -1008,9 +1008,9 @@ ] }, "node_modules/@rushstack/eslint-patch": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.7.2.tgz", - "integrity": "sha512-RbhOOTCNoCrbfkRyoXODZp75MlpiHMgbE5MEBZAnnnLyQNgrigEj4p0lzsMDyc1zVsJDLrivB58tgg3emX0eEA==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.8.0.tgz", + "integrity": "sha512-0HejFckBN2W+ucM6cUOlwsByTKt9/+0tWhqUffNIcHqCXkthY/mZ7AuYPK/2IIaGWhdl0h+tICDO0ssLMd6XMQ==", "dev": true }, "node_modules/@sinclair/typebox": { diff --git a/report-viewer/package.json b/report-viewer/package.json index 1e2224d76f..d03aae0aa5 100644 --- a/report-viewer/package.json +++ b/report-viewer/package.json @@ -39,7 +39,7 @@ }, "devDependencies": { "@playwright/test": "^1.42.1", - "@rushstack/eslint-patch": "^1.7.2", + "@rushstack/eslint-patch": "^1.8.0", "@types/jsdom": "^21.1.6", "@types/node": "^18.19.26", "@vitejs/plugin-vue": "^5.0.4", From 0257a9035270ea862b142bd8fc668d3ae22c0ef7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 20 Mar 2024 10:09:10 +0000 Subject: [PATCH 088/228] Dependency(deps): Bump org.apache.maven.plugins:maven-assembly-plugin Bumps [org.apache.maven.plugins:maven-assembly-plugin](https://github.com/apache/maven-assembly-plugin) from 3.7.0 to 3.7.1. - [Release notes](https://github.com/apache/maven-assembly-plugin/releases) - [Commits](https://github.com/apache/maven-assembly-plugin/compare/maven-assembly-plugin-3.7.0...maven-assembly-plugin-3.7.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-assembly-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3cba0a6640..69646b48b0 100644 --- a/pom.xml +++ b/pom.xml @@ -223,7 +223,7 @@ org.apache.maven.plugins maven-assembly-plugin - 3.7.0 + 3.7.1 jar-with-dependencies From d0a22321c39df9eca660f84ae3af6076209416d2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 24 Mar 2024 09:20:55 +0100 Subject: [PATCH 089/228] Dependency(deps): Bump chartjs-chart-graph from 4.2.8 to 4.3.0 in /report-viewer (#1662) Bumps [chartjs-chart-graph](https://github.com/sgratzl/chartjs-chart-graph) from 4.2.8 to 4.3.0. - [Release notes](https://github.com/sgratzl/chartjs-chart-graph/releases) - [Commits](https://github.com/sgratzl/chartjs-chart-graph/compare/v4.2.8...v4.3.0) --- updated-dependencies: - dependency-name: chartjs-chart-graph dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- report-viewer/package-lock.json | 8 ++++---- report-viewer/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/report-viewer/package-lock.json b/report-viewer/package-lock.json index aee03b9014..bf8de1878e 100644 --- a/report-viewer/package-lock.json +++ b/report-viewer/package-lock.json @@ -14,7 +14,7 @@ "@fortawesome/free-solid-svg-icons": "^6.5.1", "@fortawesome/vue-fontawesome": "^3.0.5", "chart.js": "^4.4.2", - "chartjs-chart-graph": "^4.2.8", + "chartjs-chart-graph": "^4.3.0", "chartjs-plugin-datalabels": "^2.2.0", "highlight.js": "^11.9.0", "jszip": "^3.10.0", @@ -2025,9 +2025,9 @@ } }, "node_modules/chartjs-chart-graph": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/chartjs-chart-graph/-/chartjs-chart-graph-4.2.8.tgz", - "integrity": "sha512-BVymOBPF5QufeAKT9pi7kJj4PYZIH492WPJ7/a7Pt6BAFv4Viuk9LgLVn7P2n1zd3O+N1F3f6fIqkp41VAzHKw==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/chartjs-chart-graph/-/chartjs-chart-graph-4.3.0.tgz", + "integrity": "sha512-eDa7mRL2Lq61kyu5gmtMOc/LUflIKhsC+i277bmSFTg9+Bp5VetAKwaDZUd2N14KXyBrBjCAB7rJSVjnkbMEdA==", "dependencies": { "@types/d3-force": "^3.0.9", "@types/d3-hierarchy": "^3.1.6", diff --git a/report-viewer/package.json b/report-viewer/package.json index d03aae0aa5..36fd8d4153 100644 --- a/report-viewer/package.json +++ b/report-viewer/package.json @@ -25,7 +25,7 @@ "@fortawesome/free-solid-svg-icons": "^6.5.1", "@fortawesome/vue-fontawesome": "^3.0.5", "chart.js": "^4.4.2", - "chartjs-chart-graph": "^4.2.8", + "chartjs-chart-graph": "^4.3.0", "chartjs-plugin-datalabels": "^2.2.0", "highlight.js": "^11.9.0", "jszip": "^3.10.0", From c343ec2899955d6a5eae7cf421f97d4bb6cf02b3 Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Tue, 26 Mar 2024 15:37:37 +0100 Subject: [PATCH 090/228] fix tab indent --- report-viewer/src/components/fileDisplaying/CodeLine.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/report-viewer/src/components/fileDisplaying/CodeLine.vue b/report-viewer/src/components/fileDisplaying/CodeLine.vue index fd6d0fc994..bc6ff058ce 100644 --- a/report-viewer/src/components/fileDisplaying/CodeLine.vue +++ b/report-viewer/src/components/fileDisplaying/CodeLine.vue @@ -141,7 +141,7 @@ function getNextLinePartTillColumn(endCol: number) { } else if (props.line[lineIndex.value] == '\t') { part += ' ' lineIndex.value++ - colIndex.value++ + colIndex.value += 8 } else { part += props.line[lineIndex.value] lineIndex.value++ From a37d92aab4d17f6aaa2c1a0f2c2467baec149016 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Mar 2024 10:29:39 +0000 Subject: [PATCH 091/228] Dependency(deps): Bump me.tongfei:progressbar from 0.10.0 to 0.10.1 Bumps [me.tongfei:progressbar](https://github.com/ctongfei/progressbar) from 0.10.0 to 0.10.1. - [Release notes](https://github.com/ctongfei/progressbar/releases) - [Changelog](https://github.com/ctongfei/progressbar/blob/main/CHANGELOG.md) - [Commits](https://github.com/ctongfei/progressbar/compare/0.10.0...0.10.1) --- updated-dependencies: - dependency-name: me.tongfei:progressbar dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- cli/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/pom.xml b/cli/pom.xml index 833b0d3840..a471278c5b 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -133,7 +133,7 @@ me.tongfei progressbar - 0.10.0 + 0.10.1 From 23e017e137c9f2def644a583e0f07f5f2fe63fce Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Mar 2024 10:29:34 +0000 Subject: [PATCH 092/228] Dependency(deps): Bump org.apache.maven.plugins:maven-gpg-plugin Bumps [org.apache.maven.plugins:maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) from 3.2.1 to 3.2.2. - [Release notes](https://github.com/apache/maven-gpg-plugin/releases) - [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-3.2.1...maven-gpg-plugin-3.2.2) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-gpg-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 69646b48b0..04c67a5337 100644 --- a/pom.xml +++ b/pom.xml @@ -268,7 +268,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.2.1 + 3.2.2 org.apache.maven.plugins From e5e73e2545c39f815b0ca1d9023be14859ebdf78 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 28 Mar 2024 16:42:06 +0100 Subject: [PATCH 093/228] Dependency(deps-dev): Bump typescript from 5.4.2 to 5.4.3 in /report-viewer (#1674) Bumps [typescript](https://github.com/Microsoft/TypeScript) from 5.4.2 to 5.4.3. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml) - [Commits](https://github.com/Microsoft/TypeScript/compare/v5.4.2...v5.4.3) --- updated-dependencies: - dependency-name: typescript dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- report-viewer/package-lock.json | 8 ++++---- report-viewer/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/report-viewer/package-lock.json b/report-viewer/package-lock.json index bf8de1878e..081d1559f0 100644 --- a/report-viewer/package-lock.json +++ b/report-viewer/package-lock.json @@ -47,7 +47,7 @@ "prettier": "^3.2.5", "prettier-plugin-tailwindcss": "^0.5.12", "tailwindcss": "^3.4.1", - "typescript": "^5.4.2", + "typescript": "^5.4.3", "vite": "^5.1.6", "vitest": "^1.3.1", "vue-tsc": "^2.0.6" @@ -6799,9 +6799,9 @@ } }, "node_modules/typescript": { - "version": "5.4.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz", - "integrity": "sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==", + "version": "5.4.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.3.tgz", + "integrity": "sha512-KrPd3PKaCLr78MalgiwJnA25Nm8HAmdwN3mYUYZgG/wizIo9EainNVQI9/yDavtVFRN2h3k8uf3GLHuhDMgEHg==", "devOptional": true, "bin": { "tsc": "bin/tsc", diff --git a/report-viewer/package.json b/report-viewer/package.json index 36fd8d4153..46824c9a47 100644 --- a/report-viewer/package.json +++ b/report-viewer/package.json @@ -58,7 +58,7 @@ "prettier": "^3.2.5", "prettier-plugin-tailwindcss": "^0.5.12", "tailwindcss": "^3.4.1", - "typescript": "^5.4.2", + "typescript": "^5.4.3", "vite": "^5.1.6", "vitest": "^1.3.1", "vue-tsc": "^2.0.6" From 283f3679f370f53e220e2a27d01c3891356527af Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 28 Mar 2024 18:44:25 +0100 Subject: [PATCH 094/228] Dependency(deps-dev): Bump eslint-plugin-vue from 9.22.0 to 9.24.0 in /report-viewer (#1676) Bumps [eslint-plugin-vue](https://github.com/vuejs/eslint-plugin-vue) from 9.22.0 to 9.24.0. - [Release notes](https://github.com/vuejs/eslint-plugin-vue/releases) - [Commits](https://github.com/vuejs/eslint-plugin-vue/compare/v9.22.0...v9.24.0) --- updated-dependencies: - dependency-name: eslint-plugin-vue dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- report-viewer/package-lock.json | 9 +++++---- report-viewer/package.json | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/report-viewer/package-lock.json b/report-viewer/package-lock.json index 081d1559f0..c0cd408fe4 100644 --- a/report-viewer/package-lock.json +++ b/report-viewer/package-lock.json @@ -38,7 +38,7 @@ "@vue/tsconfig": "^0.5.1", "autoprefixer": "^10.4.18", "eslint": "^8.57.0", - "eslint-plugin-vue": "^9.22.0", + "eslint-plugin-vue": "^9.24.0", "husky": "^9.0.11", "jsdom": "^24.0.0", "lint-staged": "^15.2.2", @@ -2798,12 +2798,13 @@ } }, "node_modules/eslint-plugin-vue": { - "version": "9.22.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-9.22.0.tgz", - "integrity": "sha512-7wCXv5zuVnBtZE/74z4yZ0CM8AjH6bk4MQGm7hZjUC2DBppKU5ioeOk5LGSg/s9a1ZJnIsdPLJpXnu1Rc+cVHg==", + "version": "9.24.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-9.24.0.tgz", + "integrity": "sha512-9SkJMvF8NGMT9aQCwFc5rj8Wo1XWSMSHk36i7ZwdI614BU7sIOR28ZjuFPKp8YGymZN12BSEbiSwa7qikp+PBw==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", + "globals": "^13.24.0", "natural-compare": "^1.4.0", "nth-check": "^2.1.1", "postcss-selector-parser": "^6.0.15", diff --git a/report-viewer/package.json b/report-viewer/package.json index 46824c9a47..d20c2d83cd 100644 --- a/report-viewer/package.json +++ b/report-viewer/package.json @@ -49,7 +49,7 @@ "@vue/tsconfig": "^0.5.1", "autoprefixer": "^10.4.18", "eslint": "^8.57.0", - "eslint-plugin-vue": "^9.22.0", + "eslint-plugin-vue": "^9.24.0", "husky": "^9.0.11", "jsdom": "^24.0.0", "lint-staged": "^15.2.2", From 560a0676f73081dea3bbfd5e3ac5a4b837a043f1 Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Fri, 29 Mar 2024 13:17:17 +0100 Subject: [PATCH 095/228] clean up match writing --- .../jsonfactory/ComparisonReportWriter.java | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/de/jplag/reporting/jsonfactory/ComparisonReportWriter.java b/core/src/main/java/de/jplag/reporting/jsonfactory/ComparisonReportWriter.java index b3fc5b8dce..2b2281b912 100644 --- a/core/src/main/java/de/jplag/reporting/jsonfactory/ComparisonReportWriter.java +++ b/core/src/main/java/de/jplag/reporting/jsonfactory/ComparisonReportWriter.java @@ -105,12 +105,23 @@ private Match convertMatchToReportMatch(JPlagComparison comparison, de.jplag.Mat Token startOfSecond = tokensSecond.stream().min(lineComparator).orElseThrow(); Token endOfSecond = tokensSecond.stream().max(lineComparator).orElseThrow(); - return new Match( - FilePathUtil.getRelativeSubmissionPath(startOfFirst.getFile(), comparison.firstSubmission(), submissionToIdFunction).toString(), - FilePathUtil.getRelativeSubmissionPath(startOfSecond.getFile(), comparison.secondSubmission(), submissionToIdFunction).toString(), - startOfFirst.getLine(), startOfFirst.getColumn(), endOfFirst.getLine(), endOfFirst.getColumn() + endOfFirst.getLength(), - startOfSecond.getLine(), startOfSecond.getColumn(), endOfSecond.getLine(), endOfSecond.getColumn() + endOfSecond.getLength(), - match.length()); + String firstFileName = FilePathUtil.getRelativeSubmissionPath(startOfFirst.getFile(), comparison.firstSubmission(), submissionToIdFunction) + .toString(); + String secondFileName = FilePathUtil.getRelativeSubmissionPath(startOfSecond.getFile(), comparison.secondSubmission(), submissionToIdFunction) + .toString(); + + int startLineFirst = startOfFirst.getLine(); + int startColumnFirst = startOfFirst.getColumn(); + int endLineFirst = endOfFirst.getLine(); + int endColumnFirst = endOfFirst.getColumn() + endOfFirst.getLength(); + + int startLineSecond = startOfSecond.getLine(); + int startColumnSecond = startOfSecond.getColumn(); + int endLineSecond = endOfSecond.getLine(); + int endColumnSecond = endOfSecond.getColumn() + endOfSecond.getLength(); + + return new Match(firstFileName, secondFileName, startLineFirst, startColumnFirst, endLineFirst, endColumnFirst, startLineSecond, + startColumnSecond, endLineSecond, endColumnSecond, match.length()); } } From 6e1f53c02f383699485911659005d6aa0949caf9 Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Mon, 1 Apr 2024 11:11:00 +0200 Subject: [PATCH 096/228] added tabbed container --- .../src/components/TabbedContainer.vue | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 report-viewer/src/components/TabbedContainer.vue diff --git a/report-viewer/src/components/TabbedContainer.vue b/report-viewer/src/components/TabbedContainer.vue new file mode 100644 index 0000000000..7cc4a7ceb3 --- /dev/null +++ b/report-viewer/src/components/TabbedContainer.vue @@ -0,0 +1,67 @@ + + + From b60db6a7961cc5c3ccdbcfb7751f8f9614157c18 Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Mon, 1 Apr 2024 12:18:36 +0200 Subject: [PATCH 097/228] add close comparisons table --- .../src/components/TabbedContainer.vue | 4 +- report-viewer/src/views/ClusterView.vue | 84 ++++++++++++------- 2 files changed, 54 insertions(+), 34 deletions(-) diff --git a/report-viewer/src/components/TabbedContainer.vue b/report-viewer/src/components/TabbedContainer.vue index 7cc4a7ceb3..3e092063fb 100644 --- a/report-viewer/src/components/TabbedContainer.vue +++ b/report-viewer/src/components/TabbedContainer.vue @@ -26,8 +26,8 @@ class="flex-1 border-b border-container-border-light dark:border-container-border-dark" >
-
- +
+
diff --git a/report-viewer/src/views/ClusterView.vue b/report-viewer/src/views/ClusterView.vue index 9add250292..ad9b66b11f 100644 --- a/report-viewer/src/views/ClusterView.vue +++ b/report-viewer/src/views/ClusterView.vue @@ -51,21 +51,33 @@

- - - - - + + + + @@ -78,12 +90,12 @@ import Container from '@/components/ContainerComponent.vue' import TextInformation from '@/components/TextInformation.vue' import type { Cluster } from '@/model/Cluster' import type { ClusterListElement, ClusterListElementMember } from '@/model/ClusterListElement' -import type { ComparisonListElement } from '@/model/ComparisonListElement' import { MetricType } from '@/model/MetricType' import type { Overview } from '@/model/Overview' import { computed, ref, onErrorCaptured, type PropType, type Ref } from 'vue' import OptionsSelectorComponent from '@/components/optionsSelectors/OptionsSelectorComponent.vue' import { redirectOnError } from '@/router' +import TabbedContainer from '@/components/TabbedContainer.vue' const props = defineProps({ overview: { @@ -96,7 +108,6 @@ const props = defineProps({ } }) -const comparisons = [] as Array const clusterMemberList = new Map() as ClusterListElementMember const selectedClusterVisualization: Ref<'Graph' | 'Radar'> = ref('Graph') const clusterVisualizationOptions = [ @@ -112,24 +123,33 @@ const clusterVisualizationOptions = [ ] const usedMetric = MetricType.AVERAGE -function getComparisonFor(id1: string, id2: string) { - return props.overview.topComparisons.find( +const comparisons = computed(() => + props.overview.topComparisons.filter( (c) => - (c.firstSubmissionId === id1 && c.secondSubmissionId === id2) || - (c.firstSubmissionId === id2 && c.secondSubmissionId === id1) + props.cluster.members.includes(c.firstSubmissionId) && + props.cluster.members.includes(c.secondSubmissionId) ) -} +) -for (let i = 0; i < props.cluster.members.length; i++) { - for (let j = i + 1; j < props.cluster.members.length; j++) { - const comparison = getComparisonFor(props.cluster.members[i], props.cluster.members[j]) - if (comparison) { - comparisons.push(comparison) - } - } -} let counter = 0 -comparisons +comparisons.value + .sort((a, b) => b.similarities[usedMetric] - a.similarities[usedMetric]) + .forEach((c) => { + c.sortingPlace = counter++ + c.id = counter + }) + +const closeComparisons = computed(() => + props.overview.topComparisons.filter( + (c) => + (props.cluster.members.includes(c.firstSubmissionId) && + !props.cluster.members.includes(c.secondSubmissionId)) || + (!props.cluster.members.includes(c.firstSubmissionId) && + props.cluster.members.includes(c.secondSubmissionId)) + ) +) +counter = 0 +closeComparisons.value .sort((a, b) => b.similarities[usedMetric] - a.similarities[usedMetric]) .forEach((c) => { c.sortingPlace = counter++ @@ -138,7 +158,7 @@ comparisons for (const member of props.cluster.members) { const membersComparisons: { matchedWith: string; similarity: number }[] = [] - comparisons + comparisons.value .filter((c) => c.firstSubmissionId === member || c.secondSubmissionId === member) .forEach((c) => { membersComparisons.push({ From a9e6ef55b9bd38b35af8c8ee2b04351a3c0f93c2 Mon Sep 17 00:00:00 2001 From: Alexander Milster Date: Tue, 2 Apr 2024 10:26:06 +0200 Subject: [PATCH 098/228] Removed superfluous interfaces --- cli/src/main/java/de/jplag/cli/CLI.java | 17 ++---- .../main/java/de/jplag/cli/JPlagRunner.java | 48 +++++++--------- .../de/jplag/cli/OutputFileGenerator.java | 56 +++++++++---------- 3 files changed, 55 insertions(+), 66 deletions(-) diff --git a/cli/src/main/java/de/jplag/cli/CLI.java b/cli/src/main/java/de/jplag/cli/CLI.java index f5184bc835..e64b811185 100644 --- a/cli/src/main/java/de/jplag/cli/CLI.java +++ b/cli/src/main/java/de/jplag/cli/CLI.java @@ -26,18 +26,13 @@ public final class CLI { private static final String DEFAULT_FILE_ENDING = ".zip"; - private final JPlagRunner runner; private final CliInputHandler inputHandler; - private final OutputFileGenerator outputFileGenerator; /** * Creates a cli. - * @param runner The way to run JPlag * @param args The command line arguments */ - public CLI(JPlagRunner runner, OutputFileGenerator outputFileGenerator, String[] args) { - this.runner = runner; - this.outputFileGenerator = outputFileGenerator; + public CLI(String[] args) { this.inputHandler = new CliInputHandler(args); } @@ -92,11 +87,11 @@ public boolean executeCliAndHandleErrors() { public File runJPlag() throws ExitException, FileNotFoundException { JPlagOptionsBuilder optionsBuilder = new JPlagOptionsBuilder(this.inputHandler); JPlagOptions options = optionsBuilder.buildOptions(); - JPlagResult result = this.runner.runJPlag(options); + JPlagResult result = JPlagRunner.runJPlag(options); File target = new File(getResultFilePath()); - this.outputFileGenerator.generateJPlagResultZip(result, target); - this.outputFileGenerator.generateCsvOutput(result, new File(getResultFileBaseName()), this.inputHandler.getCliOptions()); + OutputFileGenerator.generateJPlagResultZip(result, target); + OutputFileGenerator.generateCsvOutput(result, new File(getResultFileBaseName()), this.inputHandler.getCliOptions()); return target; } @@ -107,7 +102,7 @@ public File runJPlag() throws ExitException, FileNotFoundException { * @throws IOException If something went wrong with the internal server */ public void runViewer(File zipFile) throws IOException { - this.runner.runInternalServer(zipFile, this.inputHandler.getCliOptions().advanced.port); + JPlagRunner.runInternalServer(zipFile, this.inputHandler.getCliOptions().advanced.port); } private void finalizeLogger() { @@ -132,7 +127,7 @@ private String getResultFileBaseName() { } public static void main(String[] args) { - CLI cli = new CLI(JPlagRunner.DEFAULT_JPLAG_RUNNER, OutputFileGenerator.DEFAULT_OUTPUT_FILE_GENERATOR, args); + CLI cli = new CLI(args); if (cli.executeCliAndHandleErrors()) { System.exit(1); } diff --git a/cli/src/main/java/de/jplag/cli/JPlagRunner.java b/cli/src/main/java/de/jplag/cli/JPlagRunner.java index 8a69bd7a25..7df62858b6 100644 --- a/cli/src/main/java/de/jplag/cli/JPlagRunner.java +++ b/cli/src/main/java/de/jplag/cli/JPlagRunner.java @@ -15,46 +15,40 @@ import de.jplag.options.JPlagOptions; /** - * Wraps the execution of the JPlag elements, so dummy implementations can be used for unit tests. + * Wraps the execution of the JPlag components */ -public interface JPlagRunner { - Logger logger = LoggerFactory.getLogger(JPlagRunner.class); +public final class JPlagRunner { + private static final Logger logger = LoggerFactory.getLogger(JPlagRunner.class); - /** - * The default JPlag runner. Simply passes the calls to the appropriate JPlag elements - */ - JPlagRunner DEFAULT_JPLAG_RUNNER = new JPlagRunner() { - @Override - public JPlagResult runJPlag(JPlagOptions options) throws ExitException { - return JPlag.run(options); - } - - @Override - public void runInternalServer(File zipFile, int port) throws IOException { - ReportViewer reportViewer = new ReportViewer(zipFile, port); - int actualPort = reportViewer.start(); - logger.info("ReportViewer started on port http://localhost:{}", actualPort); - Desktop.getDesktop().browse(URI.create("http://localhost:" + actualPort + "/")); - - System.out.println("Press Enter key to exit..."); - System.in.read(); - reportViewer.stop(); - } - }; + private JPlagRunner() { + } /** * Executes JPlag + * * @param options The options to pass to JPlag * @return The result returned by JPlag * @throws ExitException If JPlag throws an error */ - JPlagResult runJPlag(JPlagOptions options) throws ExitException; + public static JPlagResult runJPlag(JPlagOptions options) throws ExitException { + return JPlag.run(options); + } /** * Runs the internal server. Blocks until the server has stopped. + * * @param zipFile The zip file to pass to the server. May be null. - * @param port The port to open the server on + * @param port The port to open the server on * @throws IOException If the internal server throws an exception */ - void runInternalServer(File zipFile, int port) throws IOException; + public static void runInternalServer(File zipFile, int port) throws IOException { + ReportViewer reportViewer = new ReportViewer(zipFile, port); + int actualPort = reportViewer.start(); + logger.info("ReportViewer started on port http://localhost:{}", actualPort); + Desktop.getDesktop().browse(URI.create("http://localhost:" + actualPort + "/")); + + System.out.println("Press Enter key to exit..."); + System.in.read(); + reportViewer.stop(); + } } diff --git a/cli/src/main/java/de/jplag/cli/OutputFileGenerator.java b/cli/src/main/java/de/jplag/cli/OutputFileGenerator.java index 15d5cd5aa0..333bcc4289 100644 --- a/cli/src/main/java/de/jplag/cli/OutputFileGenerator.java +++ b/cli/src/main/java/de/jplag/cli/OutputFileGenerator.java @@ -12,45 +12,45 @@ import de.jplag.csv.comparisons.CsvComparisonOutput; import de.jplag.reporting.reportobject.ReportObjectFactory; -public interface OutputFileGenerator { - Logger logger = LoggerFactory.getLogger(OutputFileGenerator.class); +/** + * Manages the creation of output files + */ +public final class OutputFileGenerator { + private static final Logger logger = LoggerFactory.getLogger(OutputFileGenerator.class); - OutputFileGenerator DEFAULT_OUTPUT_FILE_GENERATOR = new OutputFileGenerator() { - @Override - public void generateCsvOutput(JPlagResult result, File outputRoot, CliOptions options) { - if (options.advanced.csvExport) { - try { - CsvComparisonOutput.writeCsvResults(result.getAllComparisons(), false, outputRoot, "results"); - CsvComparisonOutput.writeCsvResults(result.getAllComparisons(), true, outputRoot, "results-anonymous"); - } catch (IOException e) { - logger.warn("Could not write csv results", e); - } - } - } - - @Override - public void generateJPlagResultZip(JPlagResult result, File outputFile) throws FileNotFoundException { - ReportObjectFactory reportObjectFactory = new ReportObjectFactory(outputFile); - reportObjectFactory.createAndSaveReport(result); - logger.info("Successfully written the result: {}", outputFile.getPath()); - logger.info("View the result using --mode or at: https://jplag.github.io/JPlag/"); - } - }; + private OutputFileGenerator() { + } /** * Exports the given result as CSVs, if the csvExport is activated in the options. Both a full and an anonymized version * will be written. - * @param result The result to export + * + * @param result The result to export * @param outputRoot The root folder for the output - * @param options The cli options + * @param options The cli options */ - void generateCsvOutput(JPlagResult result, File outputRoot, CliOptions options); + public static void generateCsvOutput(JPlagResult result, File outputRoot, CliOptions options) { + if (options.advanced.csvExport) { + try { + CsvComparisonOutput.writeCsvResults(result.getAllComparisons(), false, outputRoot, "results"); + CsvComparisonOutput.writeCsvResults(result.getAllComparisons(), true, outputRoot, "results-anonymous"); + } catch (IOException e) { + logger.warn("Could not write csv results", e); + } + } + } /** * Generates the JPLag result zip - * @param result The JPlag result + * + * @param result The JPlag result * @param outputFile The output file * @throws FileNotFoundException If the file cannot be written */ - void generateJPlagResultZip(JPlagResult result, File outputFile) throws FileNotFoundException; + public static void generateJPlagResultZip(JPlagResult result, File outputFile) throws FileNotFoundException { + ReportObjectFactory reportObjectFactory = new ReportObjectFactory(outputFile); + reportObjectFactory.createAndSaveReport(result); + logger.info("Successfully written the result: {}", outputFile.getPath()); + logger.info("View the result using --mode or at: https://jplag.github.io/JPlag/"); + } } From e78d6800fb93874461bbee11fbfc47f6019e474b Mon Sep 17 00:00:00 2001 From: Alexander Milster Date: Tue, 2 Apr 2024 10:57:05 +0200 Subject: [PATCH 099/228] Spotless --- cli/src/main/java/de/jplag/cli/JPlagRunner.java | 4 +--- cli/src/main/java/de/jplag/cli/OutputFileGenerator.java | 8 +++----- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/cli/src/main/java/de/jplag/cli/JPlagRunner.java b/cli/src/main/java/de/jplag/cli/JPlagRunner.java index 7df62858b6..e53a0d03de 100644 --- a/cli/src/main/java/de/jplag/cli/JPlagRunner.java +++ b/cli/src/main/java/de/jplag/cli/JPlagRunner.java @@ -25,7 +25,6 @@ private JPlagRunner() { /** * Executes JPlag - * * @param options The options to pass to JPlag * @return The result returned by JPlag * @throws ExitException If JPlag throws an error @@ -36,9 +35,8 @@ public static JPlagResult runJPlag(JPlagOptions options) throws ExitException { /** * Runs the internal server. Blocks until the server has stopped. - * * @param zipFile The zip file to pass to the server. May be null. - * @param port The port to open the server on + * @param port The port to open the server on * @throws IOException If the internal server throws an exception */ public static void runInternalServer(File zipFile, int port) throws IOException { diff --git a/cli/src/main/java/de/jplag/cli/OutputFileGenerator.java b/cli/src/main/java/de/jplag/cli/OutputFileGenerator.java index 333bcc4289..4d9d41c84a 100644 --- a/cli/src/main/java/de/jplag/cli/OutputFileGenerator.java +++ b/cli/src/main/java/de/jplag/cli/OutputFileGenerator.java @@ -24,10 +24,9 @@ private OutputFileGenerator() { /** * Exports the given result as CSVs, if the csvExport is activated in the options. Both a full and an anonymized version * will be written. - * - * @param result The result to export + * @param result The result to export * @param outputRoot The root folder for the output - * @param options The cli options + * @param options The cli options */ public static void generateCsvOutput(JPlagResult result, File outputRoot, CliOptions options) { if (options.advanced.csvExport) { @@ -42,8 +41,7 @@ public static void generateCsvOutput(JPlagResult result, File outputRoot, CliOpt /** * Generates the JPLag result zip - * - * @param result The JPlag result + * @param result The JPlag result * @param outputFile The output file * @throws FileNotFoundException If the file cannot be written */ From ad5a10c0599215763dcec550d1c4311eb4c8f94d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Apr 2024 11:46:44 +0200 Subject: [PATCH 100/228] Dependency(deps): Bump vue from 3.4.15 to 3.4.21 in /report-viewer (#1675) Bumps [vue](https://github.com/vuejs/core) from 3.4.15 to 3.4.21. - [Release notes](https://github.com/vuejs/core/releases) - [Changelog](https://github.com/vuejs/core/blob/main/CHANGELOG.md) - [Commits](https://github.com/vuejs/core/compare/v3.4.15...v3.4.21) --- updated-dependencies: - dependency-name: vue dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- report-viewer/package-lock.json | 130 ++++++++++++++++---------------- report-viewer/package.json | 2 +- 2 files changed, 66 insertions(+), 66 deletions(-) diff --git a/report-viewer/package-lock.json b/report-viewer/package-lock.json index c0cd408fe4..06f0c1889f 100644 --- a/report-viewer/package-lock.json +++ b/report-viewer/package-lock.json @@ -20,7 +20,7 @@ "jszip": "^3.10.0", "pinia": "^2.1.7", "slash": "^5.1.0", - "vue": "^3.3.4", + "vue": "^3.4.21", "vue-chartjs": "^5.3.0", "vue-draggable-next": "^2.2.1", "vue-router": "^4.3.0", @@ -75,9 +75,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.9.tgz", - "integrity": "sha512-9tcKgqKbs3xGJ+NtKF2ndOBBLVwPjl1SHxPQkd36r3Dlirw3xWUeGaTbqr7uGZcTaxkVNwc+03SVP7aCdWrTlA==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.1.tgz", + "integrity": "sha512-Zo9c7N3xdOIQrNip7Lc9wvRPzlRtovHVE4lkz8WEDr7uYh/GMQhSiIgFxGIArRHYdJE5kxtZjAf8rT0xhdLCzg==", "bin": { "parser": "bin/babel-parser.js" }, @@ -1407,12 +1407,12 @@ } }, "node_modules/@vue/compiler-core": { - "version": "3.4.15", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.15.tgz", - "integrity": "sha512-XcJQVOaxTKCnth1vCxEChteGuwG6wqnUHxAm1DO3gCz0+uXKaJNx8/digSz4dLALCy8n2lKq24jSUs8segoqIw==", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.21.tgz", + "integrity": "sha512-MjXawxZf2SbZszLPYxaFCjxfibYrzr3eYbKxwpLR9EQN+oaziSu3qKVbwBERj1IFIB8OLUewxB5m/BFzi613og==", "dependencies": { - "@babel/parser": "^7.23.6", - "@vue/shared": "3.4.15", + "@babel/parser": "^7.23.9", + "@vue/shared": "3.4.21", "entities": "^4.5.0", "estree-walker": "^2.0.2", "source-map-js": "^1.0.2" @@ -1424,27 +1424,27 @@ "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" }, "node_modules/@vue/compiler-dom": { - "version": "3.4.15", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.4.15.tgz", - "integrity": "sha512-wox0aasVV74zoXyblarOM3AZQz/Z+OunYcIHe1OsGclCHt8RsRm04DObjefaI82u6XDzv+qGWZ24tIsRAIi5MQ==", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.4.21.tgz", + "integrity": "sha512-IZC6FKowtT1sl0CR5DpXSiEB5ayw75oT2bma1BEhV7RRR1+cfwLrxc2Z8Zq/RGFzJ8w5r9QtCOvTjQgdn0IKmA==", "dependencies": { - "@vue/compiler-core": "3.4.15", - "@vue/shared": "3.4.15" + "@vue/compiler-core": "3.4.21", + "@vue/shared": "3.4.21" } }, "node_modules/@vue/compiler-sfc": { - "version": "3.4.15", - "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.4.15.tgz", - "integrity": "sha512-LCn5M6QpkpFsh3GQvs2mJUOAlBQcCco8D60Bcqmf3O3w5a+KWS5GvYbrrJBkgvL1BDnTp+e8q0lXCLgHhKguBA==", - "dependencies": { - "@babel/parser": "^7.23.6", - "@vue/compiler-core": "3.4.15", - "@vue/compiler-dom": "3.4.15", - "@vue/compiler-ssr": "3.4.15", - "@vue/shared": "3.4.15", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.4.21.tgz", + "integrity": "sha512-me7epoTxYlY+2CUM7hy9PCDdpMPfIwrOvAXud2Upk10g4YLv9UBW7kL798TvMeDhPthkZ0CONNrK2GoeI1ODiQ==", + "dependencies": { + "@babel/parser": "^7.23.9", + "@vue/compiler-core": "3.4.21", + "@vue/compiler-dom": "3.4.21", + "@vue/compiler-ssr": "3.4.21", + "@vue/shared": "3.4.21", "estree-walker": "^2.0.2", - "magic-string": "^0.30.5", - "postcss": "^8.4.33", + "magic-string": "^0.30.7", + "postcss": "^8.4.35", "source-map-js": "^1.0.2" } }, @@ -1454,12 +1454,12 @@ "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" }, "node_modules/@vue/compiler-ssr": { - "version": "3.4.15", - "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.4.15.tgz", - "integrity": "sha512-1jdeQyiGznr8gjFDadVmOJqZiLNSsMa5ZgqavkPZ8O2wjHv0tVuAEsw5hTdUoUW4232vpBbL/wJhzVW/JwY1Uw==", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.4.21.tgz", + "integrity": "sha512-M5+9nI2lPpAsgXOGQobnIueVqc9sisBFexh5yMIMRAPYLa7+5wEJs8iqOZc1WAa9WQbx9GR2twgznU8LTIiZ4Q==", "dependencies": { - "@vue/compiler-dom": "3.4.15", - "@vue/shared": "3.4.15" + "@vue/compiler-dom": "3.4.21", + "@vue/shared": "3.4.21" } }, "node_modules/@vue/devtools-api": { @@ -1529,48 +1529,48 @@ } }, "node_modules/@vue/reactivity": { - "version": "3.4.15", - "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.4.15.tgz", - "integrity": "sha512-55yJh2bsff20K5O84MxSvXKPHHt17I2EomHznvFiJCAZpJTNW8IuLj1xZWMLELRhBK3kkFV/1ErZGHJfah7i7w==", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.4.21.tgz", + "integrity": "sha512-UhenImdc0L0/4ahGCyEzc/pZNwVgcglGy9HVzJ1Bq2Mm9qXOpP8RyNTjookw/gOCUlXSEtuZ2fUg5nrHcoqJcw==", "dependencies": { - "@vue/shared": "3.4.15" + "@vue/shared": "3.4.21" } }, "node_modules/@vue/runtime-core": { - "version": "3.4.15", - "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.4.15.tgz", - "integrity": "sha512-6E3by5m6v1AkW0McCeAyhHTw+3y17YCOKG0U0HDKDscV4Hs0kgNT5G+GCHak16jKgcCDHpI9xe5NKb8sdLCLdw==", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.4.21.tgz", + "integrity": "sha512-pQthsuYzE1XcGZznTKn73G0s14eCJcjaLvp3/DKeYWoFacD9glJoqlNBxt3W2c5S40t6CCcpPf+jG01N3ULyrA==", "dependencies": { - "@vue/reactivity": "3.4.15", - "@vue/shared": "3.4.15" + "@vue/reactivity": "3.4.21", + "@vue/shared": "3.4.21" } }, "node_modules/@vue/runtime-dom": { - "version": "3.4.15", - "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.4.15.tgz", - "integrity": "sha512-EVW8D6vfFVq3V/yDKNPBFkZKGMFSvZrUQmx196o/v2tHKdwWdiZjYUBS+0Ez3+ohRyF8Njwy/6FH5gYJ75liUw==", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.4.21.tgz", + "integrity": "sha512-gvf+C9cFpevsQxbkRBS1NpU8CqxKw0ebqMvLwcGQrNpx6gqRDodqKqA+A2VZZpQ9RpK2f9yfg8VbW/EpdFUOJw==", "dependencies": { - "@vue/runtime-core": "3.4.15", - "@vue/shared": "3.4.15", + "@vue/runtime-core": "3.4.21", + "@vue/shared": "3.4.21", "csstype": "^3.1.3" } }, "node_modules/@vue/server-renderer": { - "version": "3.4.15", - "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.4.15.tgz", - "integrity": "sha512-3HYzaidu9cHjrT+qGUuDhFYvF/j643bHC6uUN9BgM11DVy+pM6ATsG6uPBLnkwOgs7BpJABReLmpL3ZPAsUaqw==", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.4.21.tgz", + "integrity": "sha512-aV1gXyKSN6Rz+6kZ6kr5+Ll14YzmIbeuWe7ryJl5muJ4uwSwY/aStXTixx76TwkZFJLm1aAlA/HSWEJ4EyiMkg==", "dependencies": { - "@vue/compiler-ssr": "3.4.15", - "@vue/shared": "3.4.15" + "@vue/compiler-ssr": "3.4.21", + "@vue/shared": "3.4.21" }, "peerDependencies": { - "vue": "3.4.15" + "vue": "3.4.21" } }, "node_modules/@vue/shared": { - "version": "3.4.15", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.15.tgz", - "integrity": "sha512-KzfPTxVaWfB+eGcGdbSf4CWdaXcGDqckoeXUh7SB3fZdEtzPCK2Vq9B/lRRL3yutax/LWITz+SwvgyOxz5V75g==" + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.21.tgz", + "integrity": "sha512-PuJe7vDIi6VYSinuEbUIQgMIRZGgM8e4R+G+/dQTk0X1NEdvgvvgv7m+rfmDH1gZzyA1OjjoWskvHlfRNfQf3g==" }, "node_modules/@vue/test-utils": { "version": "2.4.5", @@ -4469,9 +4469,9 @@ } }, "node_modules/magic-string": { - "version": "0.30.6", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.6.tgz", - "integrity": "sha512-n62qCLbPjNjyo+owKtveQxZFZTBm+Ms6YoGD23Wew6Vw337PElFNifQpknPruVRQV57kVShPnLGo9vWxVhpPvA==", + "version": "0.30.8", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.8.tgz", + "integrity": "sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ==", "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.15" }, @@ -7069,15 +7069,15 @@ } }, "node_modules/vue": { - "version": "3.4.15", - "resolved": "https://registry.npmjs.org/vue/-/vue-3.4.15.tgz", - "integrity": "sha512-jC0GH4KkWLWJOEQjOpkqU1bQsBwf4R1rsFtw5GQJbjHVKWDzO6P0nWWBTmjp1xSemAioDFj1jdaK1qa3DnMQoQ==", - "dependencies": { - "@vue/compiler-dom": "3.4.15", - "@vue/compiler-sfc": "3.4.15", - "@vue/runtime-dom": "3.4.15", - "@vue/server-renderer": "3.4.15", - "@vue/shared": "3.4.15" + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.4.21.tgz", + "integrity": "sha512-5hjyV/jLEIKD/jYl4cavMcnzKwjMKohureP8ejn3hhEjwhWIhWeuzL2kJAjzl/WyVsgPY56Sy4Z40C3lVshxXA==", + "dependencies": { + "@vue/compiler-dom": "3.4.21", + "@vue/compiler-sfc": "3.4.21", + "@vue/runtime-dom": "3.4.21", + "@vue/server-renderer": "3.4.21", + "@vue/shared": "3.4.21" }, "peerDependencies": { "typescript": "*" diff --git a/report-viewer/package.json b/report-viewer/package.json index d20c2d83cd..e41e08a467 100644 --- a/report-viewer/package.json +++ b/report-viewer/package.json @@ -31,7 +31,7 @@ "jszip": "^3.10.0", "pinia": "^2.1.7", "slash": "^5.1.0", - "vue": "^3.3.4", + "vue": "^3.4.21", "vue-chartjs": "^5.3.0", "vue-draggable-next": "^2.2.1", "vue-router": "^4.3.0", From 665e7f145cd9cc53abbb1b555b2c75b7eecb58db Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Apr 2024 11:58:03 +0200 Subject: [PATCH 101/228] Dependency(deps-dev): Bump vite from 5.1.6 to 5.2.6 in /report-viewer (#1672) Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.1.6 to 5.2.6. - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v5.2.6/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- report-viewer/package-lock.json | 356 +++++++++++++++++--------------- report-viewer/package.json | 2 +- 2 files changed, 193 insertions(+), 165 deletions(-) diff --git a/report-viewer/package-lock.json b/report-viewer/package-lock.json index 06f0c1889f..2858e79043 100644 --- a/report-viewer/package-lock.json +++ b/report-viewer/package-lock.json @@ -48,7 +48,7 @@ "prettier-plugin-tailwindcss": "^0.5.12", "tailwindcss": "^3.4.1", "typescript": "^5.4.3", - "vite": "^5.1.6", + "vite": "^5.2.6", "vitest": "^1.3.1", "vue-tsc": "^2.0.6" } @@ -86,9 +86,9 @@ } }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz", - "integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", + "integrity": "sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==", "cpu": [ "ppc64" ], @@ -102,9 +102,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz", - "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.2.tgz", + "integrity": "sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==", "cpu": [ "arm" ], @@ -118,9 +118,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz", - "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.2.tgz", + "integrity": "sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==", "cpu": [ "arm64" ], @@ -134,9 +134,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz", - "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.2.tgz", + "integrity": "sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==", "cpu": [ "x64" ], @@ -150,9 +150,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz", - "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.2.tgz", + "integrity": "sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==", "cpu": [ "arm64" ], @@ -166,9 +166,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz", - "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.2.tgz", + "integrity": "sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==", "cpu": [ "x64" ], @@ -182,9 +182,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz", - "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.2.tgz", + "integrity": "sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==", "cpu": [ "arm64" ], @@ -198,9 +198,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz", - "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.2.tgz", + "integrity": "sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==", "cpu": [ "x64" ], @@ -214,9 +214,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz", - "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.2.tgz", + "integrity": "sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==", "cpu": [ "arm" ], @@ -230,9 +230,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz", - "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.2.tgz", + "integrity": "sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==", "cpu": [ "arm64" ], @@ -246,9 +246,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz", - "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.2.tgz", + "integrity": "sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==", "cpu": [ "ia32" ], @@ -262,9 +262,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz", - "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.2.tgz", + "integrity": "sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==", "cpu": [ "loong64" ], @@ -278,9 +278,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz", - "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.2.tgz", + "integrity": "sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==", "cpu": [ "mips64el" ], @@ -294,9 +294,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz", - "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.2.tgz", + "integrity": "sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==", "cpu": [ "ppc64" ], @@ -310,9 +310,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz", - "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.2.tgz", + "integrity": "sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==", "cpu": [ "riscv64" ], @@ -326,9 +326,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz", - "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.2.tgz", + "integrity": "sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==", "cpu": [ "s390x" ], @@ -342,9 +342,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz", - "integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.2.tgz", + "integrity": "sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==", "cpu": [ "x64" ], @@ -358,9 +358,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz", - "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.2.tgz", + "integrity": "sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==", "cpu": [ "x64" ], @@ -374,9 +374,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz", - "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.2.tgz", + "integrity": "sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==", "cpu": [ "x64" ], @@ -390,9 +390,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz", - "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.2.tgz", + "integrity": "sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==", "cpu": [ "x64" ], @@ -406,9 +406,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz", - "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.2.tgz", + "integrity": "sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==", "cpu": [ "arm64" ], @@ -422,9 +422,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz", - "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.2.tgz", + "integrity": "sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==", "cpu": [ "ia32" ], @@ -438,9 +438,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz", - "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.2.tgz", + "integrity": "sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==", "cpu": [ "x64" ], @@ -839,9 +839,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.9.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.9.6.tgz", - "integrity": "sha512-MVNXSSYN6QXOulbHpLMKYi60ppyO13W9my1qogeiAqtjb2yR4LSmfU2+POvDkLzhjYLXz9Rf9+9a3zFHW1Lecg==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.13.2.tgz", + "integrity": "sha512-3XFIDKWMFZrMnao1mJhnOT1h2g0169Os848NhhmGweEcfJ4rCi+3yMCOLG4zA61rbJdkcrM/DjVZm9Hg5p5w7g==", "cpu": [ "arm" ], @@ -852,9 +852,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.9.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.9.6.tgz", - "integrity": "sha512-T14aNLpqJ5wzKNf5jEDpv5zgyIqcpn1MlwCrUXLrwoADr2RkWA0vOWP4XxbO9aiO3dvMCQICZdKeDrFl7UMClw==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.13.2.tgz", + "integrity": "sha512-GdxxXbAuM7Y/YQM9/TwwP+L0omeE/lJAR1J+olu36c3LqqZEBdsIWeQ91KBe6nxwOnb06Xh7JS2U5ooWU5/LgQ==", "cpu": [ "arm64" ], @@ -865,9 +865,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.9.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.9.6.tgz", - "integrity": "sha512-CqNNAyhRkTbo8VVZ5R85X73H3R5NX9ONnKbXuHisGWC0qRbTTxnF1U4V9NafzJbgGM0sHZpdO83pLPzq8uOZFw==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.13.2.tgz", + "integrity": "sha512-mCMlpzlBgOTdaFs83I4XRr8wNPveJiJX1RLfv4hggyIVhfB5mJfN4P8Z6yKh+oE4Luz+qq1P3kVdWrCKcMYrrA==", "cpu": [ "arm64" ], @@ -878,9 +878,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.9.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.9.6.tgz", - "integrity": "sha512-zRDtdJuRvA1dc9Mp6BWYqAsU5oeLixdfUvkTHuiYOHwqYuQ4YgSmi6+/lPvSsqc/I0Omw3DdICx4Tfacdzmhog==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.13.2.tgz", + "integrity": "sha512-yUoEvnH0FBef/NbB1u6d3HNGyruAKnN74LrPAfDQL3O32e3k3OSfLrPgSJmgb3PJrBZWfPyt6m4ZhAFa2nZp2A==", "cpu": [ "x64" ], @@ -891,9 +891,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.9.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.9.6.tgz", - "integrity": "sha512-oNk8YXDDnNyG4qlNb6is1ojTOGL/tRhbbKeE/YuccItzerEZT68Z9gHrY3ROh7axDc974+zYAPxK5SH0j/G+QQ==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.13.2.tgz", + "integrity": "sha512-GYbLs5ErswU/Xs7aGXqzc3RrdEjKdmoCrgzhJWyFL0r5fL3qd1NPcDKDowDnmcoSiGJeU68/Vy+OMUluRxPiLQ==", "cpu": [ "arm" ], @@ -904,9 +904,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.9.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.9.6.tgz", - "integrity": "sha512-Z3O60yxPtuCYobrtzjo0wlmvDdx2qZfeAWTyfOjEDqd08kthDKexLpV97KfAeUXPosENKd8uyJMRDfFMxcYkDQ==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.13.2.tgz", + "integrity": "sha512-L1+D8/wqGnKQIlh4Zre9i4R4b4noxzH5DDciyahX4oOz62CphY7WDWqJoQ66zNR4oScLNOqQJfNSIAe/6TPUmQ==", "cpu": [ "arm64" ], @@ -917,9 +917,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.9.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.9.6.tgz", - "integrity": "sha512-gpiG0qQJNdYEVad+1iAsGAbgAnZ8j07FapmnIAQgODKcOTjLEWM9sRb+MbQyVsYCnA0Im6M6QIq6ax7liws6eQ==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.13.2.tgz", + "integrity": "sha512-tK5eoKFkXdz6vjfkSTCupUzCo40xueTOiOO6PeEIadlNBkadH1wNOH8ILCPIl8by/Gmb5AGAeQOFeLev7iZDOA==", "cpu": [ "arm64" ], @@ -929,10 +929,23 @@ "linux" ] }, + "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.13.2.tgz", + "integrity": "sha512-zvXvAUGGEYi6tYhcDmb9wlOckVbuD+7z3mzInCSTACJ4DQrdSLPNUeDIcAQW39M3q6PDquqLWu7pnO39uSMRzQ==", + "cpu": [ + "ppc64le" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.9.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.9.6.tgz", - "integrity": "sha512-+uCOcvVmFUYvVDr27aiyun9WgZk0tXe7ThuzoUTAukZJOwS5MrGbmSlNOhx1j80GdpqbOty05XqSl5w4dQvcOA==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.13.2.tgz", + "integrity": "sha512-C3GSKvMtdudHCN5HdmAMSRYR2kkhgdOfye4w0xzyii7lebVr4riCgmM6lRiSCnJn2w1Xz7ZZzHKuLrjx5620kw==", "cpu": [ "riscv64" ], @@ -942,10 +955,23 @@ "linux" ] }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.13.2.tgz", + "integrity": "sha512-l4U0KDFwzD36j7HdfJ5/TveEQ1fUTjFFQP5qIt9gBqBgu1G8/kCaq5Ok05kd5TG9F8Lltf3MoYsUMw3rNlJ0Yg==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.9.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.9.6.tgz", - "integrity": "sha512-HUNqM32dGzfBKuaDUBqFB7tP6VMN74eLZ33Q9Y1TBqRDn+qDonkAUyKWwF9BR9unV7QUzffLnz9GrnKvMqC/fw==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.13.2.tgz", + "integrity": "sha512-xXMLUAMzrtsvh3cZ448vbXqlUa7ZL8z0MwHp63K2IIID2+DeP5iWIT6g1SN7hg1VxPzqx0xZdiDM9l4n9LRU1A==", "cpu": [ "x64" ], @@ -956,9 +982,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.9.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.9.6.tgz", - "integrity": "sha512-ch7M+9Tr5R4FK40FHQk8VnML0Szi2KRujUgHXd/HjuH9ifH72GUmw6lStZBo3c3GB82vHa0ZoUfjfcM7JiiMrQ==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.13.2.tgz", + "integrity": "sha512-M/JYAWickafUijWPai4ehrjzVPKRCyDb1SLuO+ZyPfoXgeCEAlgPkNXewFZx0zcnoIe3ay4UjXIMdXQXOZXWqA==", "cpu": [ "x64" ], @@ -969,9 +995,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.9.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.9.6.tgz", - "integrity": "sha512-VD6qnR99dhmTQ1mJhIzXsRcTBvTjbfbGGwKAHcu+52cVl15AC/kplkhxzW/uT0Xl62Y/meBKDZvoJSJN+vTeGA==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.13.2.tgz", + "integrity": "sha512-2YWwoVg9KRkIKaXSh0mz3NmfurpmYoBBTAXA9qt7VXk0Xy12PoOP40EFuau+ajgALbbhi4uTj3tSG3tVseCjuA==", "cpu": [ "arm64" ], @@ -982,9 +1008,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.9.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.9.6.tgz", - "integrity": "sha512-J9AFDq/xiRI58eR2NIDfyVmTYGyIZmRcvcAoJ48oDld/NTR8wyiPUu2X/v1navJ+N/FGg68LEbX3Ejd6l8B7MQ==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.13.2.tgz", + "integrity": "sha512-2FSsE9aQ6OWD20E498NYKEQLneShWes0NGMPQwxWOdws35qQXH+FplabOSP5zEe1pVjurSDOGEVCE2agFwSEsw==", "cpu": [ "ia32" ], @@ -995,9 +1021,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.9.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.9.6.tgz", - "integrity": "sha512-jqzNLhNDvIZOrt69Ce4UjGRpXJBzhUBzawMwnaDAwyHriki3XollsewxWzOzz+4yOFDkuJHtTsZFwMxhYJWmLQ==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.13.2.tgz", + "integrity": "sha512-7h7J2nokcdPePdKykd8wtc8QqqkqxIrUz7MHj6aNr8waBRU//NLDVnNjQnqQO6fqtjrtCdftpbTuOKAyrAQETQ==", "cpu": [ "x64" ], @@ -2642,9 +2668,9 @@ } }, "node_modules/esbuild": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", - "integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz", + "integrity": "sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==", "dev": true, "hasInstallScript": true, "bin": { @@ -2654,29 +2680,29 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.19.12", - "@esbuild/android-arm": "0.19.12", - "@esbuild/android-arm64": "0.19.12", - "@esbuild/android-x64": "0.19.12", - "@esbuild/darwin-arm64": "0.19.12", - "@esbuild/darwin-x64": "0.19.12", - "@esbuild/freebsd-arm64": "0.19.12", - "@esbuild/freebsd-x64": "0.19.12", - "@esbuild/linux-arm": "0.19.12", - "@esbuild/linux-arm64": "0.19.12", - "@esbuild/linux-ia32": "0.19.12", - "@esbuild/linux-loong64": "0.19.12", - "@esbuild/linux-mips64el": "0.19.12", - "@esbuild/linux-ppc64": "0.19.12", - "@esbuild/linux-riscv64": "0.19.12", - "@esbuild/linux-s390x": "0.19.12", - "@esbuild/linux-x64": "0.19.12", - "@esbuild/netbsd-x64": "0.19.12", - "@esbuild/openbsd-x64": "0.19.12", - "@esbuild/sunos-x64": "0.19.12", - "@esbuild/win32-arm64": "0.19.12", - "@esbuild/win32-ia32": "0.19.12", - "@esbuild/win32-x64": "0.19.12" + "@esbuild/aix-ppc64": "0.20.2", + "@esbuild/android-arm": "0.20.2", + "@esbuild/android-arm64": "0.20.2", + "@esbuild/android-x64": "0.20.2", + "@esbuild/darwin-arm64": "0.20.2", + "@esbuild/darwin-x64": "0.20.2", + "@esbuild/freebsd-arm64": "0.20.2", + "@esbuild/freebsd-x64": "0.20.2", + "@esbuild/linux-arm": "0.20.2", + "@esbuild/linux-arm64": "0.20.2", + "@esbuild/linux-ia32": "0.20.2", + "@esbuild/linux-loong64": "0.20.2", + "@esbuild/linux-mips64el": "0.20.2", + "@esbuild/linux-ppc64": "0.20.2", + "@esbuild/linux-riscv64": "0.20.2", + "@esbuild/linux-s390x": "0.20.2", + "@esbuild/linux-x64": "0.20.2", + "@esbuild/netbsd-x64": "0.20.2", + "@esbuild/openbsd-x64": "0.20.2", + "@esbuild/sunos-x64": "0.20.2", + "@esbuild/win32-arm64": "0.20.2", + "@esbuild/win32-ia32": "0.20.2", + "@esbuild/win32-x64": "0.20.2" } }, "node_modules/escalade": { @@ -5329,9 +5355,9 @@ } }, "node_modules/postcss": { - "version": "8.4.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.35.tgz", - "integrity": "sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==", + "version": "8.4.38", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", + "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", "funding": [ { "type": "opencollective", @@ -5349,7 +5375,7 @@ "dependencies": { "nanoid": "^3.3.7", "picocolors": "^1.0.0", - "source-map-js": "^1.0.2" + "source-map-js": "^1.2.0" }, "engines": { "node": "^10 || ^12 || >=14" @@ -5896,9 +5922,9 @@ } }, "node_modules/rollup": { - "version": "4.9.6", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.9.6.tgz", - "integrity": "sha512-05lzkCS2uASX0CiLFybYfVkwNbKZG5NFQ6Go0VWyogFTXXbR039UVsegViTntkk4OglHBdF54ccApXRRuXRbsg==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.13.2.tgz", + "integrity": "sha512-MIlLgsdMprDBXC+4hsPgzWUasLO9CE4zOkj/u6j+Z6j5A4zRY+CtiXAdJyPtgCsc42g658Aeh1DlrdVEJhsL2g==", "dev": true, "dependencies": { "@types/estree": "1.0.5" @@ -5911,19 +5937,21 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.9.6", - "@rollup/rollup-android-arm64": "4.9.6", - "@rollup/rollup-darwin-arm64": "4.9.6", - "@rollup/rollup-darwin-x64": "4.9.6", - "@rollup/rollup-linux-arm-gnueabihf": "4.9.6", - "@rollup/rollup-linux-arm64-gnu": "4.9.6", - "@rollup/rollup-linux-arm64-musl": "4.9.6", - "@rollup/rollup-linux-riscv64-gnu": "4.9.6", - "@rollup/rollup-linux-x64-gnu": "4.9.6", - "@rollup/rollup-linux-x64-musl": "4.9.6", - "@rollup/rollup-win32-arm64-msvc": "4.9.6", - "@rollup/rollup-win32-ia32-msvc": "4.9.6", - "@rollup/rollup-win32-x64-msvc": "4.9.6", + "@rollup/rollup-android-arm-eabi": "4.13.2", + "@rollup/rollup-android-arm64": "4.13.2", + "@rollup/rollup-darwin-arm64": "4.13.2", + "@rollup/rollup-darwin-x64": "4.13.2", + "@rollup/rollup-linux-arm-gnueabihf": "4.13.2", + "@rollup/rollup-linux-arm64-gnu": "4.13.2", + "@rollup/rollup-linux-arm64-musl": "4.13.2", + "@rollup/rollup-linux-powerpc64le-gnu": "4.13.2", + "@rollup/rollup-linux-riscv64-gnu": "4.13.2", + "@rollup/rollup-linux-s390x-gnu": "4.13.2", + "@rollup/rollup-linux-x64-gnu": "4.13.2", + "@rollup/rollup-linux-x64-musl": "4.13.2", + "@rollup/rollup-win32-arm64-msvc": "4.13.2", + "@rollup/rollup-win32-ia32-msvc": "4.13.2", + "@rollup/rollup-win32-x64-msvc": "4.13.2", "fsevents": "~2.3.2" } }, @@ -6190,9 +6218,9 @@ "peer": true }, "node_modules/source-map-js": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", - "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", + "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", "engines": { "node": ">=0.10.0" } @@ -6913,14 +6941,14 @@ } }, "node_modules/vite": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.1.6.tgz", - "integrity": "sha512-yYIAZs9nVfRJ/AiOLCA91zzhjsHUgMjB+EigzFb6W2XTLO8JixBCKCjvhKZaye+NKYHCrkv3Oh50dH9EdLU2RA==", + "version": "5.2.6", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.2.6.tgz", + "integrity": "sha512-FPtnxFlSIKYjZ2eosBQamz4CbyrTizbZ3hnGJlh/wMtCrlp1Hah6AzBLjGI5I2urTfNnpovpHdrL6YRuBOPnCA==", "dev": true, "dependencies": { - "esbuild": "^0.19.3", - "postcss": "^8.4.35", - "rollup": "^4.2.0" + "esbuild": "^0.20.1", + "postcss": "^8.4.36", + "rollup": "^4.13.0" }, "bin": { "vite": "bin/vite.js" diff --git a/report-viewer/package.json b/report-viewer/package.json index e41e08a467..893f1b6b31 100644 --- a/report-viewer/package.json +++ b/report-viewer/package.json @@ -59,7 +59,7 @@ "prettier-plugin-tailwindcss": "^0.5.12", "tailwindcss": "^3.4.1", "typescript": "^5.4.3", - "vite": "^5.1.6", + "vite": "^5.2.6", "vitest": "^1.3.1", "vue-tsc": "^2.0.6" } From 1b668e236f0d2e45bf6791c2ef0f115e78a7ea8a Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Tue, 2 Apr 2024 12:51:06 +0200 Subject: [PATCH 102/228] change chart/radar section to tabbed container --- report-viewer/src/views/ClusterView.vue | 33 ++++++++++++++----------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/report-viewer/src/views/ClusterView.vue b/report-viewer/src/views/ClusterView.vue index ad9b66b11f..63fa5d772d 100644 --- a/report-viewer/src/views/ClusterView.vue +++ b/report-viewer/src/views/ClusterView.vue @@ -16,25 +16,12 @@ >
- -
+ + + + + Date: Tue, 2 Apr 2024 13:27:01 +0200 Subject: [PATCH 103/228] Added idle bars --- cli/src/main/java/de/jplag/cli/CLI.java | 4 +- ...vider.java => CliProgressBarProvider.java} | 12 +- .../java/de/jplag/cli/logger/IdleBar.java | 112 ++++++++++++++++++ .../de/jplag/logging/ProgressBarLogger.java | 6 +- .../de/jplag/logging/ProgressBarType.java | 18 ++- .../normalization/TokenStringNormalizer.java | 5 + 6 files changed, 146 insertions(+), 11 deletions(-) rename cli/src/main/java/de/jplag/cli/logger/{TongfeiProgressBarProvider.java => CliProgressBarProvider.java} (51%) create mode 100644 cli/src/main/java/de/jplag/cli/logger/IdleBar.java diff --git a/cli/src/main/java/de/jplag/cli/CLI.java b/cli/src/main/java/de/jplag/cli/CLI.java index ac79e68c01..7c5a5aebd8 100644 --- a/cli/src/main/java/de/jplag/cli/CLI.java +++ b/cli/src/main/java/de/jplag/cli/CLI.java @@ -24,8 +24,8 @@ import de.jplag.JPlag; import de.jplag.JPlagResult; import de.jplag.Language; +import de.jplag.cli.logger.CliProgressBarProvider; import de.jplag.cli.logger.CollectedLoggerFactory; -import de.jplag.cli.logger.TongfeiProgressBarProvider; import de.jplag.cli.server.ReportViewer; import de.jplag.clustering.ClusteringOptions; import de.jplag.clustering.Preprocessing; @@ -85,7 +85,7 @@ public static void main(String[] args) { ParseResult parseResult = cli.parseOptions(args); if (!parseResult.isUsageHelpRequested() && !(parseResult.subcommand() != null && parseResult.subcommand().isUsageHelpRequested())) { - ProgressBarLogger.setProgressBarProvider(new TongfeiProgressBarProvider()); + ProgressBarLogger.setProgressBarProvider(new CliProgressBarProvider()); switch (cli.options.mode) { case RUN -> cli.runJPlag(parseResult); case VIEW -> cli.runViewer(null); diff --git a/cli/src/main/java/de/jplag/cli/logger/TongfeiProgressBarProvider.java b/cli/src/main/java/de/jplag/cli/logger/CliProgressBarProvider.java similarity index 51% rename from cli/src/main/java/de/jplag/cli/logger/TongfeiProgressBarProvider.java rename to cli/src/main/java/de/jplag/cli/logger/CliProgressBarProvider.java index da09fff337..23baf8f1f2 100644 --- a/cli/src/main/java/de/jplag/cli/logger/TongfeiProgressBarProvider.java +++ b/cli/src/main/java/de/jplag/cli/logger/CliProgressBarProvider.java @@ -10,11 +10,15 @@ /** * A ProgressBar provider, that used the tongfei progress bar library underneath, to show progress bars on the cli. */ -public class TongfeiProgressBarProvider implements ProgressBarProvider { +public class CliProgressBarProvider implements ProgressBarProvider { @Override public ProgressBar initProgressBar(ProgressBarType type, int totalSteps) { - me.tongfei.progressbar.ProgressBar progressBar = new ProgressBarBuilder().setTaskName(type.getDefaultText()).setInitialMax(totalSteps) - .setStyle(ProgressBarStyle.ASCII).build(); - return new TongfeiProgressBar(progressBar); + if (type.isIdleBar()) { + return new IdleBar(type.getDefaultText()); + } else { + me.tongfei.progressbar.ProgressBar progressBar = new ProgressBarBuilder().setTaskName(type.getDefaultText()).setInitialMax(totalSteps) + .setStyle(ProgressBarStyle.ASCII).build(); + return new TongfeiProgressBar(progressBar); + } } } diff --git a/cli/src/main/java/de/jplag/cli/logger/IdleBar.java b/cli/src/main/java/de/jplag/cli/logger/IdleBar.java new file mode 100644 index 0000000000..a68265c54c --- /dev/null +++ b/cli/src/main/java/de/jplag/cli/logger/IdleBar.java @@ -0,0 +1,112 @@ +package de.jplag.cli.logger; + +import java.io.IOException; + +import org.apache.commons.lang3.time.DurationFormatUtils; +import org.jline.terminal.Terminal; +import org.jline.terminal.TerminalBuilder; + +import de.jplag.logging.ProgressBar; + +/** + * Prints an idle progress bar, that does not count upwards. + */ +public class IdleBar implements ProgressBar { + private final Thread runner; + + private long startTime; + private final String text; + private int length; + + String emptyLine; + + private int currentPos; + private int currentDirection; + + private boolean running = false; + + public IdleBar(String text) { + this.runner = new Thread(this::run); + this.length = 50; + this.currentDirection = -1; + this.currentPos = 0; + this.text = text; + try { + Terminal terminal = TerminalBuilder.terminal(); + this.length = terminal.getWidth() / 2; + terminal.close(); + } catch (IOException e) { + throw new RuntimeException(e); + } + if (this.length < 10) { + this.length = 10; + } + + StringBuilder empty = new StringBuilder(); + empty.append('\r'); + empty.append(" ".repeat(Math.max(0, length + 4 + text.length() + 10))); + empty.append('\r'); + this.emptyLine = empty.toString(); + } + + public void start() { + this.startTime = System.currentTimeMillis(); + this.running = true; + this.runner.start(); + } + + @Override + public void dispose() { + this.running = false; + try { + this.runner.join(); + } catch (InterruptedException ignored) { + } + System.out.println(); + } + + private void run() { + while (running) { + System.out.print('\r'); + System.out.print(printLine()); + if (currentPos == 0 || currentPos == length - 1) { + currentDirection *= -1; + } + try { + Thread.sleep(100); + } catch (InterruptedException ignore) { + // ignore wakeup + } + currentPos += currentDirection; + } + } + + private String printLine() { + StringBuilder line = new StringBuilder(); + line.append(this.text).append(' '); + + line.append('<'); + line.append(" ".repeat(Math.max(0, currentPos))); + line.append("<+>"); + line.append(" ".repeat(Math.max(0, length - currentPos - 1))); + line.append('>'); + + long timeRunning = System.currentTimeMillis() - this.startTime; + line.append(' '); + String duration = DurationFormatUtils.formatDuration(timeRunning, "H:mm:ss"); + line.append(duration); + + return line.toString(); + } + + @Override + public void step(int number) { + } + + public static void main(String[] args) throws InterruptedException { + IdleBar bar = new IdleBar("Printing progress"); + bar.start(); + Thread.sleep(10000); + bar.dispose(); + } +} diff --git a/core/src/main/java/de/jplag/logging/ProgressBarLogger.java b/core/src/main/java/de/jplag/logging/ProgressBarLogger.java index 889d391bbb..b1563677fb 100644 --- a/core/src/main/java/de/jplag/logging/ProgressBarLogger.java +++ b/core/src/main/java/de/jplag/logging/ProgressBarLogger.java @@ -45,7 +45,11 @@ private static class DummyBar implements ProgressBar { public DummyBar(ProgressBarType type, int totalSteps) { this.currentStep = 0; - logger.info("{} ({})", type.getDefaultText(), totalSteps); + if (type.isIdleBar()) { + logger.info("{} - started", type.getDefaultText()); + } else { + logger.info("{} ({})", type.getDefaultText(), totalSteps); + } } @Override diff --git a/core/src/main/java/de/jplag/logging/ProgressBarType.java b/core/src/main/java/de/jplag/logging/ProgressBarType.java index 88e520fcc0..e9772d3a73 100644 --- a/core/src/main/java/de/jplag/logging/ProgressBarType.java +++ b/core/src/main/java/de/jplag/logging/ProgressBarType.java @@ -4,14 +4,17 @@ * The available processes. Used as a hint for the ui, which step JPlag is currently performing. */ public enum ProgressBarType { - LOADING("Loading Submissions "), - PARSING("Parsing Submissions "), - COMPARING("Comparing Submissions"); + LOADING("Loading Submissions ", false), + PARSING("Parsing Submissions ", false), + COMPARING("Comparing Submissions", false), + TokenStringNormalizer("Normalizing token Sequence ", true); private final String defaultText; + private final boolean isIdleBar; - ProgressBarType(String defaultText) { + ProgressBarType(String defaultText, boolean isIdleBar) { this.defaultText = defaultText; + this.isIdleBar = isIdleBar; } /** @@ -20,4 +23,11 @@ public enum ProgressBarType { public String getDefaultText() { return defaultText; } + + /** + * @return True, if this bar should be rendered as an idle bar instead. + */ + public boolean isIdleBar() { + return isIdleBar; + } } diff --git a/core/src/main/java/de/jplag/normalization/TokenStringNormalizer.java b/core/src/main/java/de/jplag/normalization/TokenStringNormalizer.java index 5ece0ff1fe..52a2ae08a1 100644 --- a/core/src/main/java/de/jplag/normalization/TokenStringNormalizer.java +++ b/core/src/main/java/de/jplag/normalization/TokenStringNormalizer.java @@ -11,6 +11,9 @@ import org.jgrapht.graph.SimpleDirectedGraph; import de.jplag.Token; +import de.jplag.logging.ProgressBar; +import de.jplag.logging.ProgressBarLogger; +import de.jplag.logging.ProgressBarType; /** * Performs token sequence normalization. @@ -28,6 +31,7 @@ private TokenStringNormalizer() { * @return The normalized token sequence. */ public static List normalize(List tokens) { + ProgressBar progressBar = ProgressBarLogger.createProgressBar(ProgressBarType.TokenStringNormalizer, 0); SimpleDirectedGraph normalizationGraph = new NormalizationGraphConstructor(tokens).get(); List normalizedTokens = new ArrayList<>(tokens.size()); spreadKeep(normalizationGraph); @@ -50,6 +54,7 @@ public static List normalize(List tokens) { } while (!roots.isEmpty()); roots = newRoots; } + progressBar.dispose(); return normalizedTokens; } From fa9abe777c117fe59fe5c314eb8aec96ecc75468 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 Apr 2024 09:49:15 +0000 Subject: [PATCH 104/228] Dependency(deps): Bump org.scalameta:scalameta_2.13 from 4.9.2 to 4.9.3 Bumps [org.scalameta:scalameta_2.13](https://github.com/scalameta/scalameta) from 4.9.2 to 4.9.3. - [Release notes](https://github.com/scalameta/scalameta/releases) - [Commits](https://github.com/scalameta/scalameta/compare/v4.9.2...v4.9.3) --- updated-dependencies: - dependency-name: org.scalameta:scalameta_2.13 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- languages/scala/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages/scala/pom.xml b/languages/scala/pom.xml index 974ad05dbc..e88fe595d4 100644 --- a/languages/scala/pom.xml +++ b/languages/scala/pom.xml @@ -25,7 +25,7 @@ org.scalameta scalameta_${scala.compat.version} - 4.9.2 + 4.9.3 From 3042219ffe413ec5b8f2cc58c15eb883b09e3010 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 Apr 2024 09:49:22 +0000 Subject: [PATCH 105/228] Dependency(deps): Bump org.jacoco:jacoco-maven-plugin Bumps [org.jacoco:jacoco-maven-plugin](https://github.com/jacoco/jacoco) from 0.8.11 to 0.8.12. - [Release notes](https://github.com/jacoco/jacoco/releases) - [Commits](https://github.com/jacoco/jacoco/compare/v0.8.11...v0.8.12) --- updated-dependencies: - dependency-name: org.jacoco:jacoco-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 04c67a5337..c115157231 100644 --- a/pom.xml +++ b/pom.xml @@ -244,7 +244,7 @@ org.jacoco jacoco-maven-plugin - 0.8.11 + 0.8.12 prepare-agent From 09cfbe8ad4d3ff5c073f564f1aa8a85aa0fcc986 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Apr 2024 11:39:22 +0200 Subject: [PATCH 106/228] Dependency(deps-dev): Bump vitest from 1.3.1 to 1.4.0 in /report-viewer (#1683) Bumps [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) from 1.3.1 to 1.4.0. - [Release notes](https://github.com/vitest-dev/vitest/releases) - [Commits](https://github.com/vitest-dev/vitest/commits/v1.4.0/packages/vitest) --- updated-dependencies: - dependency-name: vitest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- report-viewer/package-lock.json | 66 ++++++++++++++++----------------- report-viewer/package.json | 2 +- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/report-viewer/package-lock.json b/report-viewer/package-lock.json index 2858e79043..56f9c51488 100644 --- a/report-viewer/package-lock.json +++ b/report-viewer/package-lock.json @@ -49,7 +49,7 @@ "tailwindcss": "^3.4.1", "typescript": "^5.4.3", "vite": "^5.2.6", - "vitest": "^1.3.1", + "vitest": "^1.4.0", "vue-tsc": "^2.0.6" } }, @@ -1309,13 +1309,13 @@ } }, "node_modules/@vitest/expect": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.3.1.tgz", - "integrity": "sha512-xofQFwIzfdmLLlHa6ag0dPV8YsnKOCP1KdAeVVh34vSjN2dcUiXYCD9htu/9eM7t8Xln4v03U9HLxLpPlsXdZw==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.4.0.tgz", + "integrity": "sha512-Jths0sWCJZ8BxjKe+p+eKsoqev1/T8lYcrjavEaz8auEJ4jAVY0GwW3JKmdVU4mmNPLPHixh4GNXP7GFtAiDHA==", "dev": true, "dependencies": { - "@vitest/spy": "1.3.1", - "@vitest/utils": "1.3.1", + "@vitest/spy": "1.4.0", + "@vitest/utils": "1.4.0", "chai": "^4.3.10" }, "funding": { @@ -1323,12 +1323,12 @@ } }, "node_modules/@vitest/runner": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.3.1.tgz", - "integrity": "sha512-5FzF9c3jG/z5bgCnjr8j9LNq/9OxV2uEBAITOXfoe3rdZJTdO7jzThth7FXv/6b+kdY65tpRQB7WaKhNZwX+Kg==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.4.0.tgz", + "integrity": "sha512-EDYVSmesqlQ4RD2VvWo3hQgTJ7ZrFQ2VSJdfiJiArkCerDAGeyF1i6dHkmySqk573jLp6d/cfqCN+7wUB5tLgg==", "dev": true, "dependencies": { - "@vitest/utils": "1.3.1", + "@vitest/utils": "1.4.0", "p-limit": "^5.0.0", "pathe": "^1.1.1" }, @@ -1364,9 +1364,9 @@ } }, "node_modules/@vitest/snapshot": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.3.1.tgz", - "integrity": "sha512-EF++BZbt6RZmOlE3SuTPu/NfwBF6q4ABS37HHXzs2LUVPBLx2QoY/K0fKpRChSo8eLiuxcbCVfqKgx/dplCDuQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.4.0.tgz", + "integrity": "sha512-saAFnt5pPIA5qDGxOHxJ/XxhMFKkUSBJmVt5VgDsAqPTX6JP326r5C/c9UuCMPoXNzuudTPsYDZCoJ5ilpqG2A==", "dev": true, "dependencies": { "magic-string": "^0.30.5", @@ -1378,9 +1378,9 @@ } }, "node_modules/@vitest/spy": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.3.1.tgz", - "integrity": "sha512-xAcW+S099ylC9VLU7eZfdT9myV67Nor9w9zhf0mGCYJSO+zM2839tOeROTdikOi/8Qeusffvxb/MyBSOja1Uig==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.4.0.tgz", + "integrity": "sha512-Ywau/Qs1DzM/8Uc+yA77CwSegizMlcgTJuYGAi0jujOteJOUf1ujunHThYo243KG9nAyWT3L9ifPYZ5+As/+6Q==", "dev": true, "dependencies": { "tinyspy": "^2.2.0" @@ -1390,9 +1390,9 @@ } }, "node_modules/@vitest/utils": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.3.1.tgz", - "integrity": "sha512-d3Waie/299qqRyHTm2DjADeTaNdNSVsnwHPWrs20JMpjh6eiVq7ggggweO8rc4arhf6rRkWuHKwvxGvejUXZZQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.4.0.tgz", + "integrity": "sha512-mx3Yd1/6e2Vt/PUC98DcqTirtfxUyAZ32uK82r8rZzbtBeBo+nqgnjx/LvqQdWsrvNtm14VmurNgcf4nqY5gJg==", "dev": true, "dependencies": { "diff-sequences": "^29.6.3", @@ -6996,9 +6996,9 @@ } }, "node_modules/vite-node": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.3.1.tgz", - "integrity": "sha512-azbRrqRxlWTJEVbzInZCTchx0X69M/XPTCz4H+TLvlTcR/xH/3hkRqhOakT41fMJCMzXTu4UvegkZiEoJAWvng==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.4.0.tgz", + "integrity": "sha512-VZDAseqjrHgNd4Kh8icYHWzTKSCZMhia7GyHfhtzLW33fZlG9SwsB6CEhgyVOWkJfJ2pFLrp/Gj1FSfAiqH9Lw==", "dev": true, "dependencies": { "cac": "^6.7.14", @@ -7032,16 +7032,16 @@ } }, "node_modules/vitest": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.3.1.tgz", - "integrity": "sha512-/1QJqXs8YbCrfv/GPQ05wAZf2eakUPLPa18vkJAKE7RXOKfVHqMZZ1WlTjiwl6Gcn65M5vpNUB6EFLnEdRdEXQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.4.0.tgz", + "integrity": "sha512-gujzn0g7fmwf83/WzrDTnncZt2UiXP41mHuFYFrdwaLRVQ6JYQEiME2IfEjU3vcFL3VKa75XhI3lFgn+hfVsQw==", "dev": true, "dependencies": { - "@vitest/expect": "1.3.1", - "@vitest/runner": "1.3.1", - "@vitest/snapshot": "1.3.1", - "@vitest/spy": "1.3.1", - "@vitest/utils": "1.3.1", + "@vitest/expect": "1.4.0", + "@vitest/runner": "1.4.0", + "@vitest/snapshot": "1.4.0", + "@vitest/spy": "1.4.0", + "@vitest/utils": "1.4.0", "acorn-walk": "^8.3.2", "chai": "^4.3.10", "debug": "^4.3.4", @@ -7055,7 +7055,7 @@ "tinybench": "^2.5.1", "tinypool": "^0.8.2", "vite": "^5.0.0", - "vite-node": "1.3.1", + "vite-node": "1.4.0", "why-is-node-running": "^2.2.2" }, "bin": { @@ -7070,8 +7070,8 @@ "peerDependencies": { "@edge-runtime/vm": "*", "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "1.3.1", - "@vitest/ui": "1.3.1", + "@vitest/browser": "1.4.0", + "@vitest/ui": "1.4.0", "happy-dom": "*", "jsdom": "*" }, diff --git a/report-viewer/package.json b/report-viewer/package.json index 893f1b6b31..3b992e1aa4 100644 --- a/report-viewer/package.json +++ b/report-viewer/package.json @@ -60,7 +60,7 @@ "tailwindcss": "^3.4.1", "typescript": "^5.4.3", "vite": "^5.2.6", - "vitest": "^1.3.1", + "vitest": "^1.4.0", "vue-tsc": "^2.0.6" } } From 794384342e1c9ba29f1d591d2c85e82948ad7b3a Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Thu, 4 Apr 2024 11:55:56 +0200 Subject: [PATCH 107/228] change first bottom displayed --- report-viewer/src/components/TabbedContainer.vue | 10 +++++++++- report-viewer/src/views/ClusterView.vue | 13 ++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/report-viewer/src/components/TabbedContainer.vue b/report-viewer/src/components/TabbedContainer.vue index 3e092063fb..d40f52232e 100644 --- a/report-viewer/src/components/TabbedContainer.vue +++ b/report-viewer/src/components/TabbedContainer.vue @@ -12,7 +12,10 @@ : 'border-b bg-container-secondary-light dark:bg-container-secondary-dark' " > - + @@ -42,6 +45,11 @@ const props = defineProps({ tabs: { type: Array, required: true + }, + firstBottomTooltipIndex: { + type: Number, + required: false, + default: 2 } }) diff --git a/report-viewer/src/views/ClusterView.vue b/report-viewer/src/views/ClusterView.vue index 63fa5d772d..33fc2feaf4 100644 --- a/report-viewer/src/views/ClusterView.vue +++ b/report-viewer/src/views/ClusterView.vue @@ -57,7 +57,8 @@ -