{"id":15038807,"url":"https://github.com/jplag/jplag","last_synced_at":"2025-04-29T18:48:13.201Z","repository":{"id":29118472,"uuid":"32648170","full_name":"jplag/JPlag","owner":"jplag","description":"State-of-the-Art Source Code Plagiarism \u0026 Collusion Detection. Check for plagiarism in a set of programs.","archived":false,"fork":false,"pushed_at":"2025-04-25T07:04:04.000Z","size":65444,"stargazers_count":1566,"open_issues_count":52,"forks_count":341,"subscribers_count":25,"default_branch":"main","last_synced_at":"2025-04-25T07:33:12.105Z","etag":null,"topics":["academic-dishonesty","code-similarity","collusion-detection","computer-science","cs-education","education","learn-to-code","online-learning","plagiarism","plagiarism-check","plagiarism-checker","plagiarism-checking","plagiarism-detection","plagiarism-detector","plagiarism-prevention","program-analysis","programming-education","software-plagiarism","source-code-analysis","source-code-plagiarism"],"latest_commit_sha":null,"homepage":"https://jplag.de","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jplag.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-03-21T20:06:19.000Z","updated_at":"2025-04-25T03:21:47.000Z","dependencies_parsed_at":"2023-10-01T16:11:20.286Z","dependency_job_id":"321a4580-33d2-4fba-affa-15007989e02e","html_url":"https://github.com/jplag/JPlag","commit_stats":{"total_commits":3284,"total_committers":48,"mean_commits":68.41666666666667,"dds":0.7457369062119367,"last_synced_commit":"3fb0b8fd8d289a7f78bc21e5074d372eea164987"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jplag%2FJPlag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jplag%2FJPlag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jplag%2FJPlag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jplag%2FJPlag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jplag","download_url":"https://codeload.github.com/jplag/JPlag/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251563574,"owners_count":21609754,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["academic-dishonesty","code-similarity","collusion-detection","computer-science","cs-education","education","learn-to-code","online-learning","plagiarism","plagiarism-check","plagiarism-checker","plagiarism-checking","plagiarism-detection","plagiarism-detector","plagiarism-prevention","program-analysis","programming-education","software-plagiarism","source-code-analysis","source-code-plagiarism"],"created_at":"2024-09-24T20:40:17.303Z","updated_at":"2025-04-29T18:48:13.188Z","avatar_url":"https://github.com/jplag.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e \n\t\u003cimg alt=\"JPlag logo\" src=\"core/src/main/resources/de/jplag/logo-dark.png\" width=\"350\"\u003e\n\u003c/p\u003e\n\n# JPlag - Detecting Source Code Plagiarism\n[![CI Build](https://github.com/jplag/jplag/actions/workflows/maven.yml/badge.svg)](https://github.com/jplag/jplag/actions/workflows/maven.yml)\n[![Latest Release](https://img.shields.io/github/release/jplag/jplag.svg)](https://github.com/jplag/jplag/releases/latest)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/de.jplag/jplag/badge.svg)](https://maven-badges.herokuapp.com/maven-central/de.jplag/jplag)\n[![License](https://img.shields.io/github/license/jplag/jplag.svg)](https://github.com/jplag/jplag/blob/main/LICENSE)\n[![GitHub commit activity](https://img.shields.io/github/commit-activity/y/jplag/JPlag)](https://github.com/jplag/JPlag/pulse)\n[![SonarCloud Coverage](https://sonarcloud.io/api/project_badges/measure?project=jplag_JPlag\u0026metric=coverage)](https://sonarcloud.io/component_measures?metric=Coverage\u0026view=list\u0026id=jplag_JPlag)\n[![Java Version](https://img.shields.io/badge/java-SE%2021-yellowgreen)](#download-and-installation)\n\n\nJPlag finds pairwise similarities among a set of multiple programs. It can reliably detect software plagiarism and collusion in software development, even when obfuscated. All similarities are calculated locally; no source code or plagiarism results are ever uploaded online. JPlag supports a large number of programming and modeling languages.\n\n* 📈 [JPlag Demo](https://jplag.github.io/Demo/)\n\n* 🏛️ [JPlag on Helmholtz RSD](https://helmholtz.software/software/jplag)\n\n* 🤩 [Give us Feedback in a **short (\u003c5 min) survey**](https://docs.google.com/forms/d/e/1FAIpQLSckqUlXhIlJ-H2jtu2VmGf_mJt4hcnHXaDlwhpUL3XG1I8UYw/viewform?usp=sf_link)\n\n\n## Supported Languages\n\nAll supported languages and their supported versions are listed below.\n\n| Language                                               |                                                                                Version | CLI Argument Name | [state](https://github.com/jplag/JPlag/wiki/2.-Supported-Languages) |  parser   |\n|--------------------------------------------------------|---------------------------------------------------------------------------------------:|-------------------|:-------------------------------------------------------------------:|:---------:|\n| [Java](https://www.java.com)                           |                                                                                     21 | java              |                               mature                                |   JavaC   |\n| [C](https://isocpp.org)                                |                                                                                     11 | c                 |                               legacy                                |  JavaCC   |\n| [C++](https://isocpp.org)                              |                                                                                     14 | cpp               |                               mature                                |  ANTLR 4  |\n| [C#](https://docs.microsoft.com/en-us/dotnet/csharp/)  |                                                                                      6 | csharp            |                               mature                                |  ANTLR 4  |\n| [Python](https://www.python.org)                       |                                                                                    3.6 | python3           |                               mature                                |  ANTLR 4  |\n| [JavaScript](https://www.javascript.com/)              |                                                                                    ES6 | javascript        |                                beta                                 |  ANTLR 4  |\n| [TypeScript](https://www.typescriptlang.org/)          | [~5](https://github.com/antlr/grammars-v4/tree/master/javascript/typescript/README.md) | typescript        |                                beta                                 |  ANTLR 4  |\n| [Go](https://go.dev)                                   |                                                                                   1.17 | golang            |                                beta                                 |  ANTLR 4  |\n| [Kotlin](https://kotlinlang.org)                       |                                                                                    1.3 | kotlin            |                               mature                                |  ANTLR 4  |\n| [R](https://www.r-project.org/)                        |                                                                                  3.5.0 | rlang             |                               mature                                |  ANTLR 4  |\n| [Rust](https://www.rust-lang.org/)                     |                                                                                 1.60.0 | rust              |                               mature                                |  ANTLR 4  |\n| [Swift](https://www.swift.org)                         |                                                                                    5.4 | swift             |                                beta                                 |  ANTLR 4  |\n| [Scala](https://www.scala-lang.org)                    |                                                                                 2.13.8 | scala             |                               mature                                | Scalameta |\n| [LLVM IR](https://llvm.org)                            |                                                                                     15 | llvmir            |                                beta                                 |  ANTLR 4  |\n| [Scheme](http://www.scheme-reports.org)                |                                                                                      ? | scheme            |                               legacy                                |  JavaCC   |\n| [EMF Metamodel](https://www.eclipse.org/modeling/emf/) |                                                                                 2.25.0 | emf               |                                beta                                 |    EMF    |\n| [EMF Model](https://www.eclipse.org/modeling/emf/)     |                                                                                 2.25.0 | emf-model         |                                alpha                                |    EMF    |\n| [SCXML](https://www.w3.org/TR/scxml/)                  |                                                                                    1.0 | scxml             |                                alpha                                |    XML    |\n| Text (naive, use with caution)                         |                                                                                      - | text              |                               legacy                                |  CoreNLP  |\n\n## Download and Installation\nYou need Java SE 21 to run or build JPlag.\n\n### Downloading a release\n* Download a [released version](https://github.com/jplag/jplag/releases).\n* In case you depend on the legacy version of JPlag, we refer to the [legacy release v2.12.1](https://github.com/jplag/jplag/releases/tag/v2.12.1-SNAPSHOT) and the [legacy branch](https://github.com/jplag/jplag/tree/legacy).\n\n### Via Maven\nJPlag is released on [Maven Central](https://search.maven.org/search?q=de.jplag), it can be included as follows:\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ede.jplag\u003c/groupId\u003e\n  \u003cartifactId\u003ejplag\u003c/artifactId\u003e\n  \u003cversion\u003e\u003c!--desired version--\u003e\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Building from sources \n1. Download or clone the code from this repository.\n2. Run `mvn clean package` from the root of the repository to compile and build all submodules.\n   Run `mvn clean package assembly:single` instead if you need the full jar, which includes all dependencies.\n   Run `mvn -P with-report-viewer clean package assembly:single` to build the full jar with the report viewer. In this case, you'll need [Node.js](https://nodejs.org/en/download) installed.\n3. You will find the generated JARs in the subdirectory `cli/target`.\n\n## Usage\nJPlag can either be used via the CLI or directly via its Java API. For more information, see the [usage information in the wiki](https://github.com/jplag/JPlag/wiki/1.-How-to-Use-JPlag). If you are using the CLI, the report viewer UI will launch automatically. No data will leave your computer!\n\n### CLI\n*Note that the [legacy CLI](https://github.com/jplag/jplag/blob/legacy/README.md) is varying slightly.*\nThe language can either be set with the -l parameter or as a subcommand (`jplag [jplag options] -l \u003clanguage name\u003e [language options]`). A subcommand takes priority over the -l option.\nLanguage-specific arguments can be set when using the subcommand. A list of language-specific options can be obtained by requesting the help page of a subcommand (e.g., `jplag java —h`).\n\n```\nParameter descriptions: \n      [root-dirs[,root-dirs...]...]\n                        Root-directory with submissions to check for\n                          plagiarism. If mode is set to VIEW, this parameter\n                          can be used to specify a report file to open. In that\n                          case only a single file may be specified.\n      -bc, --bc, --base-code=\u003cbaseCode\u003e\n                        Path to the base code directory (common framework used\n                          in all submissions).\n      -l, --language=\u003clanguage\u003e\n                        Select the language of the submissions (default: java).\n                          See subcommands below.\n      -M, --mode=\u003c{RUN, VIEW, RUN_AND_VIEW, AUTO}\u003e\n                        The mode of JPlag. One of: RUN, VIEW, RUN_AND_VIEW,\n                          AUTO (default: null). If VIEW is chosen, you can\n                          optionally specify a path to an existing report.\n      -n, --shown-comparisons=\u003cshownComparisons\u003e\n                        The maximum number of comparisons that will be shown in\n                          the generated report, if set to -1 all comparisons\n                          will be shown (default: 2500)\n      -new, --new=\u003cnewDirectories\u003e[,\u003cnewDirectories\u003e...]\n                        Root-directories with submissions to check for\n                          plagiarism (same as root).\n      --normalize       Activate the normalization of tokens. Supported for\n                          languages: Java, C++.\n      -old, --old=\u003coldDirectories\u003e[,\u003coldDirectories\u003e...]\n                        Root-directories with prior submissions to compare\n                          against.\n      -r, --result-file=\u003cresultFile\u003e\n                        Name of the file in which the comparison results will\n                          be stored (default: results). Missing .jplag endings\n                          will be automatically added.\n      -t, --min-tokens=\u003cminTokenMatch\u003e\n                        Tunes the comparison sensitivity by adjusting the\n                          minimum token required to be counted as a matching\n                          section. A smaller value increases the sensitivity\n                          but might lead to more false-positives.\n\nAdvanced\n      --csv-export      Export pairwise similarity values as a CSV file.\n      -d, --debug           Store on-parsable files in error folder.\n      --log-level=\u003c{ERROR, WARN, INFO, DEBUG, TRACE}\u003e\n                        Set the log level for the cli.\n      -m, --similarity-threshold=\u003csimilarityThreshold\u003e\n                        Comparison similarity threshold [0.0-1.0]: All\n                          comparisons above this threshold will be saved\n                          (default: 0.0).\n      --overwrite       Existing result files will be overwritten.\n      -p, --suffixes=\u003csuffixes\u003e[,\u003csuffixes\u003e...]\n                        comma-separated list of all filename suffixes that are\n                          included.\n      -P, --port=\u003cport\u003e     The port used for the internal report viewer (default:\n                          1996).\n      -s, --subdirectory=\u003csubdirectory\u003e\n                        Look in directories \u003croot-dir\u003e/*/\u003cdir\u003e for programs.\n      -x, --exclusion-file=\u003cexclusionFileName\u003e\n                        All files named in this file will be ignored in the\n                          comparison (line-separated list).\n\nClustering\n      --cluster-alg, --cluster-algorithm=\u003c{AGGLOMERATIVE, SPECTRAL}\u003e\n                        Specifies the clustering algorithm. Available\n                          algorithms: agglomerative, spectral (default:\n                          spectral).\n      --cluster-metric=\u003c{AVG, MIN, MAX, INTERSECTION}\u003e\n                        The similarity metric used for clustering. Available\n                          metrics: average similarity, minimum similarity,\n                          maximal similarity, matched tokens (default: average\n                          similarity).\n      --cluster-skip    Skips the cluster calculation.\n\nSubsequence Match Merging\n      --gap-size=\u003cmaximumGapSize\u003e\n                        Maximal gap between neighboring matches to be merged\n                          (between 1 and minTokenMatch, default: 6).\n      --match-merging   Enables merging of neighboring matches to counteract\n                          obfuscation attempts.\n      --neighbor-length=\u003cminimumNeighborLength\u003e\n                        Minimal length of neighboring matches to be merged\n                          (between 1 and minTokenMatch, default: 2).\n      --required-merges=\u003cminimumRequiredMerges\u003e\n                        Minimal required merges for the merging to be applied\n                          (between 1 and 50, default: 6).\nLanguages:\n  c\n  cpp\n  csharp\n  emf\n  emf-model\n  go\n  java\n  javascript\n  kotlin\n  llvmir\n  multi\n  python3\n  rlang\n  rust\n  scala\n  scheme\n  scxml\n  swift\n  text\n  typescript\n```\n\n### Java API\n\nThe new API makes it easy to integrate JPlag's plagiarism detection into external Java projects:\n\n\u003c!-- To assure that the code example is always correct, it must be kept in sync\nwith [`ReadmeCodeExampleTest#testReadmeCodeExample`](core/src/test/java/de/jplag/special/ReadmeCodeExampleTest.java). --\u003e\n```java\nLanguage language = new JavaLanguage();\nSet\u003cFile\u003e submissionDirectories = Set.of(new File(\"/path/to/rootDir\"));\nFile baseCode = new File(\"/path/to/baseCode\");\nJPlagOptions options = new JPlagOptions(language, submissionDirectories, Set.of()).withBaseCodeSubmissionDirectory(baseCode);\n\ntry {\n    JPlagResult result = JPlag.run(options);\n\n    // Optional\n    ReportObjectFactory reportObjectFactory = new ReportObjectFactory(new File(\"/path/to/output\"));\n    reportObjectFactory.createAndSaveReport(result);\n} catch (ExitException e) {\n    // error handling here\n} catch (FileNotFoundException e) {\n    // handle IO exception here\n}\n```\n\n## Contributing\nWe're happy to incorporate all improvements to JPlag into this codebase. Feel free to fork the project and send pull requests.\nPlease consider our [guidelines for contributions](https://github.com/jplag/JPlag/wiki/3.-Contributing-to-JPlag).\n\n## Contact\nIf you encounter bugs or other issues, please report them [here](https://github.com/jplag/jplag/issues).\nFor other purposes, you can contact us at jplag@ipd.kit.edu.\nWe would love to hear about your research related to JPlag. Feel free to contact us!\n\n### More information can be found in our [Wiki](https://github.com/jplag/JPlag/wiki)!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjplag%2Fjplag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjplag%2Fjplag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjplag%2Fjplag/lists"}