Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java API for JPlag #89

Merged
merged 93 commits into from
May 27, 2021
Merged

Java API for JPlag #89

merged 93 commits into from
May 27, 2021

Conversation

krusche
Copy link

@krusche krusche commented Dec 10, 2020

In this pull request, @philippbauch has implemented a Java API for JPlag that allow other tools (e.g. Artemis) to invoke JPlag in a more object oriented way instead of using command line options.

We also added new objects (shown in the README file in a UML class diagram) to improve the result reporting so that other tools can interpret the results more easily.

Example

JPlagOptions options = new JPlagOptions("/path/to/rootDir", LanguageOption.JAVA_1_9);
options.setBaseCodeSubmissionName("template");

JPlag jplag = new JPlag(options);
JPlagResult result = jplag.run();

List<JPlagComparison> comparisons = result.getComparisons();

// Optional
File outputDir = new File("/path/to/output");
Report report = new Report(outputDir);

report.writeResult(result);

Class Diagram

UMLClassDiagram.png

This PR also updates the JPlag version to 3.0.0, but tries to stay compatible with 2.x versions and previous workflows.

We are happy to discuss any changes or improvements.

Please note: Some folders have been deleted to simplify the project structure, but we can also add them again in case they are still needed

@krusche krusche marked this pull request as ready for review May 17, 2021 06:46
Copy link
Member

@tsaglam tsaglam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the comprehensive contribution! I reviewed the changes and they look great. When @sebinside had a chance to look at them as well we will merge them.

@sebinside sebinside self-requested a review May 21, 2021 13:39
@dfuchss
Copy link
Member

dfuchss commented May 22, 2021

@krusche @philippbauch is the version of the PR the version of JPlag you are currently using for Artemis ?

@krusche
Copy link
Author

krusche commented May 23, 2021

@krusche @philippbauch is the version of the PR the version of JPlag you are currently using for Artemis ?

yes, except some smaller changes done by @philippbauch in the meantime and some smaller changes done by @tsaglam and @sebinside

As soon as this PR is merged, it would be awesome if the JPlag library can be published to Maven Central (we have done this before and can help with it), then we could integrate the dependency more easily into Artemis.

@dfuchss
Copy link
Member

dfuchss commented May 25, 2021

Ok. Thanks for the information:
Then we should address two points (in this or a follow-up PR):

  1. The order of the similarities is broken (the image is from a JPlag Run in Artemis 4.12.2)

image

  1. The details web view hasn't two scroll bars as usual to scroll each submissions independent:

image

Copy link
Member

@sebinside sebinside left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are several bugs remaining in the CLI, but these can be fixed afterward.

@tsaglam tsaglam merged commit ec430f6 into jplag:master May 27, 2021
@tsaglam tsaglam added this to the v3.0.0 milestone Aug 19, 2021
@SimDing SimDing mentioned this pull request Jan 28, 2022
tsaglam added a commit that referenced this pull request Feb 24, 2022
Concerning issue #116. This adds the clustering that was removed in #89 again, not including any user interfaces.
The clustering is implemented in the de.jplag.clustering package. It includes two clustering algorithms (spectral and agglomerative), preprocessing, decoupling logic, clustering options and a factory class which can be used to run the clustering in just two statements.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for 3rd party integration
5 participants