From 9a131959bbaf1062f5579080d9dc7afda81274c5 Mon Sep 17 00:00:00 2001 From: Alexander Vogt Date: Sat, 14 Sep 2024 14:52:03 +0200 Subject: [PATCH 1/4] update contributing chapter in wiki --- docs/3.-Contributing-to-JPlag.md | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/docs/3.-Contributing-to-JPlag.md b/docs/3.-Contributing-to-JPlag.md index d60d33408..f87801e79 100644 --- a/docs/3.-Contributing-to-JPlag.md +++ b/docs/3.-Contributing-to-JPlag.md @@ -4,10 +4,14 @@ If you are new to JPlag, maybe check the [good first issues](https://github.com/ Please try to make well-documented and clearly structured submissions: * All artifacts (code, comments...) should be in English * Please avoid abbreviations! -* Make use of JavaDoc to document classes and public methods -* We provide a [formatter configuration](https://github.com/jplag/JPlag/blob/master/formatter.xml), which is enforced by spotless - * Eclipse/IntelliJ users can use it directly - * It can always be applied via maven with `mvn spotless:apply` +* Make use of JavaDoc/TsDoc to document classes and public methods +* We provide a formatter configurations + * For java code we use this [formatter configuration](https://github.com/jplag/JPlag/blob/master/formatter.xml), which is enforced by spotless + * Eclipse/IntelliJ users can use it directly + * It can always be applied via maven with `mvn spotless:apply` + * For typescript/vue code we use prettier und eslint + * They can both be executed with `npm run lint` and `npm run format` + * They can also be executed automatically on commit * Use well-explained pull requests to propose your features * When re-using code from other projects, mark them accordingly and make sure their license allows the re-use * Your changes should always improve the code quality of the codebase, especially when working on older components @@ -17,12 +21,17 @@ Please try to make well-documented and clearly structured submissions: ## Building from sources 1. Download or clone the code from this repository. +### Core 2. Run `mvn clean package` from the root of the repository to compile and build all submodules. - Run `mvn clean package assembly:single` instead if you need the full jar, which includes all dependencies. -5. You will find the generated JARs in the subdirectory `jplag.cli/target`. + Run `mvn clean package assembly:single -P with-report-viewer` instead if you need the full jar, which includes all dependencies. +3. You will find the generated JARs in the subdirectory `jplag.cli/target`. +### Report Viewer +2. Run `npm install` to install all dependencies. +3. Run `npm run dev` to launch the development server. The report viewer will be available at `http://localhost:8080/`. + Different versions of the build command are described in the [report-viewer README](../report-viewer/README.md). ### Git hooks -The repository contains a pre-commit hook that prevents commits if they fail spotless. -To set up the hooks, call `git config --local core.hooksPath gitHooks/hooks` once within your local repository. +The repository contains a pre-commit hook that prevents commits if they fail spotless and executes prettier and eslint on report-viewer code. +To set up the hooks, call `git config --local core.hooksPath gitHooks/hooks` once within your local repository or run `npm i`/`npm run prepare` in the report-viewer package. From 5b98e7d39356414083bdec98026c11c2bf078b49 Mon Sep 17 00:00:00 2001 From: Alexander Vogt Date: Sun, 15 Sep 2024 08:38:04 +0200 Subject: [PATCH 2/4] update section on report file generation --- docs/6.-Report-File-Generation.md | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/docs/6.-Report-File-Generation.md b/docs/6.-Report-File-Generation.md index 3753993d6..3d1fd24d6 100644 --- a/docs/6.-Report-File-Generation.md +++ b/docs/6.-Report-File-Generation.md @@ -32,6 +32,11 @@ result.zip │ submission2-submission....json │ submission2-submissionN.json │ ... +│ +└───basecode +│ └───submissionId1.json +│ └───submissionId2.json +│ ... ``` The report zip contains @@ -41,20 +46,21 @@ The report zip contains - The `overview.json` encapsulates the main information from a JPlagResult such as base directory path, language, min- and max-metric, etc. The `overview.json` provides data to the `OverviewView.vue` that is first displayed after the report is dropped into the viewer. Corresponds to the Java record `OverviewReport`. - submissionFileIndex.json - - The `submissionFileIndex.json` stores a list of all files in the submission for each submission id. + - The `submissionFileIndex.json` stores a list of all files in the submission for each submission id. This file is also used to track the tokens per file. It is represented by a Map from the submission id to an instance of `SubmissionFile`. - options.json - - This File contains all options given to JPlag either over the CLI or programmatically + - This File contains all options given to JPlag either over the CLI or programmatically. It is represented diretly by the `JPlagOptions` class. - submissions - - This folder contains all files of all submissions JPlag was run with. For each submission the `submissions` folder contains a subfolder with the name of the corresponding submission id. A subfolder for a submission contains all files of said submission. These files are displayed in the `ComparisonView.vue` - comparison files - - For each submission pair submission1 submission2 with ids submissionId1 and submissionId2, the report contains either submissionId1-submissionId2.json or submissionId2-submissionId1.json. This file contains information the comparison between the two submissions, such as the similarity and concrete matches. Corresponds to the Java record `ComparisonReport`. +- base code + - Each JSON file in the `basecode` folder contains the data where the provided basecode was found in each submission. Each submission has its own file. If no basecode was provided, each file contains an empty array of matches. Each JSON file corresponds to an array the Java record `BaseCodeMatch`. + ## Submission ids ### Report Viewer @@ -89,5 +95,5 @@ Task: Adding the number of tokens in a match, which has to be displayed in the M 2. Modify the existing component `ComparisonReportWriter.java` to additionally extract the number of tokens in a match from the `JPlagResult.java` and save it in the Match DTO 3. Add `tokens: number` to `Match.ts` -4. Edit `ComparisonFactory.ts` to get the number of tokens from the JSON report file. [report-viewer] -5. Edit `MatchTable.vue` to display the tokens number in the `ComparisonView.vue`. +4. Edit `ComparisonFactory.ts` to get the number of tokens from the JSON report file. +5. Edit `MatchList.vue` to display the tokens number in the `ComparisonView.vue`. \ No newline at end of file From 034e63a66e345a0479d4c6a01b71f8da61bd09f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timur=20Sa=C4=9Flam?= Date: Sun, 22 Sep 2024 15:46:07 +0200 Subject: [PATCH 3/4] Update docs/6.-Report-File-Generation.md --- docs/6.-Report-File-Generation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/6.-Report-File-Generation.md b/docs/6.-Report-File-Generation.md index 3d1fd24d6..a251c2a5c 100644 --- a/docs/6.-Report-File-Generation.md +++ b/docs/6.-Report-File-Generation.md @@ -49,7 +49,7 @@ The report zip contains - The `submissionFileIndex.json` stores a list of all files in the submission for each submission id. This file is also used to track the tokens per file. It is represented by a Map from the submission id to an instance of `SubmissionFile`. - options.json - - This File contains all options given to JPlag either over the CLI or programmatically. It is represented diretly by the `JPlagOptions` class. + - This File contains all options given to JPlag either over the CLI or programmatically. It is represented directly by the `JPlagOptions` class. - submissions - This folder contains all files of all submissions JPlag was run with. For each submission the `submissions` folder contains a subfolder with the name of the corresponding submission id. A subfolder for a submission contains all files of said submission. From 099b96638aff301ad8387dfe017cd6b2740e8b7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timur=20Sa=C4=9Flam?= Date: Sun, 22 Sep 2024 15:46:24 +0200 Subject: [PATCH 4/4] Update docs/6.-Report-File-Generation.md --- docs/6.-Report-File-Generation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/6.-Report-File-Generation.md b/docs/6.-Report-File-Generation.md index a251c2a5c..27f8178c7 100644 --- a/docs/6.-Report-File-Generation.md +++ b/docs/6.-Report-File-Generation.md @@ -59,7 +59,7 @@ The report zip contains - For each submission pair submission1 submission2 with ids submissionId1 and submissionId2, the report contains either submissionId1-submissionId2.json or submissionId2-submissionId1.json. This file contains information the comparison between the two submissions, such as the similarity and concrete matches. Corresponds to the Java record `ComparisonReport`. - base code - - Each JSON file in the `basecode` folder contains the data where the provided basecode was found in each submission. Each submission has its own file. If no basecode was provided, each file contains an empty array of matches. Each JSON file corresponds to an array the Java record `BaseCodeMatch`. + - Each JSON file in the `basecode` folder contains the data where the provided basecode was found in each submission. Each submission has its own file. If no basecode was provided, each file contains an empty array of matches. Each JSON file corresponds to an array of the Java record `BaseCodeMatch`. ## Submission ids