Skip to content

Commit

Permalink
Merge branch 'develop' into feature/documentationCore
Browse files Browse the repository at this point in the history
  • Loading branch information
tsaglam authored Sep 22, 2024
2 parents c0298d9 + 96c5119 commit 82a6dc4
Show file tree
Hide file tree
Showing 9 changed files with 185 additions and 108 deletions.
23 changes: 17 additions & 6 deletions docs/3.-Contributing-to-JPlag.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -17,12 +21,19 @@ 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 -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.

7 changes: 7 additions & 0 deletions docs/5.-End-to-End-Testing.md
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
JPlag has two different types of end-to-end tests.

# Maven end-to-end-tests
There is a module inside the maven project, that runs e2e tests on the core of Jplag.
The basic structure of the end-to-end testing module is discussed in the [corresponding readme file](https://github.com/jplag/JPlag/blob/master/endtoend-testing/README.md).

# Complete end-to-end-tests
The complete end-to-end tests are executed by the [complete e2e tests workflow](../../../.github/workflows/complete-e2e.yml) and are meant to check the entire process from building and executing JPlag to viewing the report in the report viewer. Details are specified in the [corresponding readme file](../report-viewer/tests/e2e/README.md).
18 changes: 12 additions & 6 deletions docs/6.-Report-File-Generation.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ result.zip
│ submission2-submission....json
│ submission2-submissionN.json
│ ...
└───basecode
│ └───submissionId1.json
│ └───submissionId2.json
│ ...
```

The report zip contains
Expand All @@ -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 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.
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 of the Java record `BaseCodeMatch`.

## Submission ids

### Report Viewer
Expand Down Expand Up @@ -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`.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
<emf.version>2.37.0</emf.version>
<emf.ecore.version>2.31.0</emf.ecore.version>
<emf.ecore.xmi.version>2.38.0</emf.ecore.xmi.version>
<eclipse.core.version>3.20.200</eclipse.core.version>
<eclipse.core.version>3.21.0</eclipse.core.version>
<emfatic.version>1.1.0</emfatic.version>

<!-- The Revision of JPlag -->
Expand Down Expand Up @@ -269,7 +269,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.5</version>
<version>3.2.6</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
Loading

0 comments on commit 82a6dc4

Please sign in to comment.