From 3079754afd7702f61127c4fbbd4cb2fda9f256de Mon Sep 17 00:00:00 2001 From: Alexander Milster Date: Wed, 20 Nov 2024 17:55:39 +0100 Subject: [PATCH 1/5] Added the option to specify a result file with --move VIEW --- README.md | 3 ++- cli/src/main/java/de/jplag/cli/CLI.java | 2 +- .../java/de/jplag/cli/options/CliOptions.java | 3 ++- .../de/jplag/cli/picocli/CliInputHandler.java | 24 +++++++++++++++++++ 4 files changed, 29 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a1ccf587e..2ee4220b5 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,8 @@ Parameter descriptions: -l, --language= Select the language of the submissions (default: java). See subcommands below. -M, --mode=<{RUN, VIEW, RUN_AND_VIEW}> - The mode of JPlag: either only run analysis, only open the viewer, or do both (default: null) + The mode of JPlag. If VIEW is chosen, you can specify a result file to display with either the positional argument, '--new', '--old' or '-r'. Make + sure to only specify one if you do that. One of: RUN, VIEW, RUN_AND_VIEW (default: null) -n, --shown-comparisons= The maximum number of comparisons that will be shown in the generated report, if set to -1 all comparisons will be shown (default: 500) -new, --new=[,...] diff --git a/cli/src/main/java/de/jplag/cli/CLI.java b/cli/src/main/java/de/jplag/cli/CLI.java index 263a9021e..af68bd3fd 100644 --- a/cli/src/main/java/de/jplag/cli/CLI.java +++ b/cli/src/main/java/de/jplag/cli/CLI.java @@ -57,7 +57,7 @@ public void executeCli() throws ExitException, IOException { switch (this.inputHandler.getCliOptions().mode) { case RUN -> runJPlag(); - case VIEW -> runViewer(null); + case VIEW -> runViewer(this.inputHandler.getFileForViewMode()); case RUN_AND_VIEW -> runViewer(runJPlag()); } } 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 748a8f6c8..f984aa2a2 100644 --- a/cli/src/main/java/de/jplag/cli/options/CliOptions.java +++ b/cli/src/main/java/de/jplag/cli/options/CliOptions.java @@ -53,7 +53,8 @@ public class CliOptions implements Runnable { "--result-file"}, description = "Name of the file in which the comparison results will be stored (default: ${DEFAULT-VALUE}). Missing .zip endings will be automatically added.") public String resultFile = "results"; - @Option(names = {"-M", "--mode"}, description = "The mode of JPlag. One of: ${COMPLETION-CANDIDATES} (default: ${DEFAULT_VALUE})") + @Option(names = {"-M", + "--mode"}, description = "The mode of JPlag. If VIEW is chosen, you can specify a result file to display with either the positional argument, '--new', '--old' or '-r'. Make sure to only specify one if you do that. One of: ${COMPLETION-CANDIDATES} (default: ${DEFAULT_VALUE})") public JPlagMode mode = JPlagMode.RUN_AND_VIEW; @Option(names = {"--normalize"}, description = "Activate the normalization of tokens. Supported for languages: Java, C++.") 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 4bc388a35..04998bbd8 100644 --- a/cli/src/main/java/de/jplag/cli/picocli/CliInputHandler.java +++ b/cli/src/main/java/de/jplag/cli/picocli/CliInputHandler.java @@ -7,6 +7,7 @@ import java.io.File; import java.security.SecureRandom; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -29,6 +30,7 @@ public class CliInputHandler { private static final String OPTION_LIST_HEADING = "Parameter descriptions: "; + private static final String AMBIGUOUS_VIEW_FILE = "There are multiple files selected for '--mode VIEW', Please make sure to only specify one."; 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."; @@ -169,4 +171,26 @@ private String generateDescription() { var randomDescription = DESCRIPTIONS[RANDOM.nextInt(DESCRIPTIONS.length)]; return String.format(DESCRIPTION_PATTERN, randomDescription, CREDITS); } + + /** + * Returns the file to display when using --move VIEW. The result can be null, if no file was selected + * @return The file to show + * @throws CliException If multiple options would be valid + */ + public File getFileForViewMode() throws CliException { + List validOptions = new ArrayList<>(List.of(this.options.rootDirectory)); + + validOptions.addAll(List.of(this.options.newDirectories)); + validOptions.addAll(List.of(this.options.oldDirectories)); + + if (this.parseResult.hasMatchedOption('r')) { + validOptions.add(new File(this.options.resultFile)); + } + + return switch (validOptions.size()) { + case 0 -> null; + case 1 -> validOptions.getFirst(); + default -> throw new CliException(AMBIGUOUS_VIEW_FILE); + }; + } } From 2c3ac44ec799fe68560f7f05ed651c1b49c64f81 Mon Sep 17 00:00:00 2001 From: Alexander Milster Date: Thu, 28 Nov 2024 12:30:35 +0100 Subject: [PATCH 2/5] Added tests for view mode with file --- cli/src/test/java/de/jplag/cli/ModeTest.java | 59 +++++++++++++++++++ .../java/de/jplag/cli/test/CliArgument.java | 2 + .../java/de/jplag/cli/test/CliResult.java | 3 +- .../test/java/de/jplag/cli/test/CliTest.java | 2 +- 4 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 cli/src/test/java/de/jplag/cli/ModeTest.java diff --git a/cli/src/test/java/de/jplag/cli/ModeTest.java b/cli/src/test/java/de/jplag/cli/ModeTest.java new file mode 100644 index 000000000..ab6eef05f --- /dev/null +++ b/cli/src/test/java/de/jplag/cli/ModeTest.java @@ -0,0 +1,59 @@ +package de.jplag.cli; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrowsExactly; + +import java.io.File; +import java.io.IOException; + +import org.junit.jupiter.api.Test; + +import de.jplag.cli.picocli.CliInputHandler; +import de.jplag.cli.test.CliArgument; +import de.jplag.cli.test.CliTest; +import de.jplag.exceptions.ExitException; + +public class ModeTest extends CliTest { + @Test + void testViewWithPositionalFile() throws IOException, ExitException { + CliInputHandler inputHandler = this + .runCli(args -> args.with(CliArgument.MODE, "view").with(CliArgument.SUBMISSION_DIRECTORIES, new String[] {"result.zip"})) + .inputHandler(); + assertEquals(new File("result.zip"), inputHandler.getFileForViewMode()); + } + + @Test + void testViewWithOldFile() throws IOException, ExitException { + CliInputHandler inputHandler = this + .runCli(args -> args.with(CliArgument.MODE, "view").with(CliArgument.OLD_SUBMISSION_DIRECTORIES, new String[] {"result.zip"})) + .inputHandler(); + assertEquals(new File("result.zip"), inputHandler.getFileForViewMode()); + } + + @Test + void testViewWithNewFile() throws IOException, ExitException { + CliInputHandler inputHandler = this + .runCli(args -> args.with(CliArgument.MODE, "view").with(CliArgument.NEW_SUBMISSION_DIRECTORIES, new String[] {"result.zip"})) + .inputHandler(); + assertEquals(new File("result.zip"), inputHandler.getFileForViewMode()); + } + + @Test + void testViewWithResultFile() throws IOException, ExitException { + CliInputHandler inputHandler = this.runCli(args -> args.with(CliArgument.MODE, "view").with(CliArgument.RESULT_FILE, "result.zip")) + .inputHandler(); + assertEquals(new File("result.zip"), inputHandler.getFileForViewMode()); + } + + @Test + void testViewWithMultipleFiles() throws IOException, ExitException { + assertThrowsExactly(CliException.class, () -> { + this.runCli(args -> args.with(CliArgument.MODE, "view").with(CliArgument.RESULT_FILE, "result.zip") + .with(CliArgument.NEW_SUBMISSION_DIRECTORIES, new String[] {"test.zip"})).inputHandler(); + }); + } + + @Override + public void addDefaultParameters() { + } +} diff --git a/cli/src/test/java/de/jplag/cli/test/CliArgument.java b/cli/src/test/java/de/jplag/cli/test/CliArgument.java index 3b90977ab..168be61d9 100644 --- a/cli/src/test/java/de/jplag/cli/test/CliArgument.java +++ b/cli/src/test/java/de/jplag/cli/test/CliArgument.java @@ -34,4 +34,6 @@ public record CliArgument(String name, boolean isPositional) { public static CliArgument SUBDIRECTORY = new CliArgument<>("subdirectory", false); public static CliArgument EXCLUDE_FILES = new CliArgument<>("x", false); + + public static CliArgument MODE = new CliArgument<>("mode", false); } diff --git a/cli/src/test/java/de/jplag/cli/test/CliResult.java b/cli/src/test/java/de/jplag/cli/test/CliResult.java index 7051a6061..28ee465c3 100644 --- a/cli/src/test/java/de/jplag/cli/test/CliResult.java +++ b/cli/src/test/java/de/jplag/cli/test/CliResult.java @@ -2,7 +2,8 @@ import org.slf4j.event.Level; +import de.jplag.cli.picocli.CliInputHandler; import de.jplag.options.JPlagOptions; -public record CliResult(JPlagOptions jPlagOptions, String targetPath, Level logLevel) { +public record CliResult(JPlagOptions jPlagOptions, String targetPath, Level logLevel, CliInputHandler inputHandler) { } diff --git a/cli/src/test/java/de/jplag/cli/test/CliTest.java b/cli/src/test/java/de/jplag/cli/test/CliTest.java index bff7528a6..5f21da73b 100644 --- a/cli/src/test/java/de/jplag/cli/test/CliTest.java +++ b/cli/src/test/java/de/jplag/cli/test/CliTest.java @@ -154,7 +154,7 @@ protected CliResult runCli(Consumer additionalOptionsBuilder String targetPath = (String) getWritableFileMethod.invoke(cli); - return new CliResult(optionsBuilder.buildOptions(), targetPath, CollectedLogger.getLogLevel()); + return new CliResult(optionsBuilder.buildOptions(), targetPath, CollectedLogger.getLogLevel(), inputHandler); } catch (IllegalAccessException | InvocationTargetException e) { Assumptions.abort("Could not access private field in CLI for test."); return null; // will not be executed From 3263a5109625a933493e3c29ee5d24a15203e4d9 Mon Sep 17 00:00:00 2001 From: Alexander Milster Date: Wed, 15 Jan 2025 16:09:18 +0100 Subject: [PATCH 3/5] Improved code style --- cli/src/main/java/de/jplag/cli/picocli/CliInputHandler.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 04998bbd8..e7ac6a58b 100644 --- a/cli/src/main/java/de/jplag/cli/picocli/CliInputHandler.java +++ b/cli/src/main/java/de/jplag/cli/picocli/CliInputHandler.java @@ -30,7 +30,7 @@ public class CliInputHandler { private static final String OPTION_LIST_HEADING = "Parameter descriptions: "; - private static final String AMBIGUOUS_VIEW_FILE = "There are multiple files selected for '--mode VIEW', Please make sure to only specify one."; + private static final String AMBIGUOUS_VIEW_FILE = "There are multiple files specified for '--mode VIEW', please make sure only to specify one."; 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."; @@ -45,6 +45,8 @@ public class CliInputHandler { private static final String PARAMETER_SHORT_PREFIX = " -"; private static final String PARAMETER_SHORT_ADDITIONAL_INDENT = " "; + private static final char RESULT_FILE_OPTION_NAME = 'r'; + private static final Random RANDOM = new SecureRandom(); private final String[] args; @@ -183,7 +185,7 @@ public File getFileForViewMode() throws CliException { validOptions.addAll(List.of(this.options.newDirectories)); validOptions.addAll(List.of(this.options.oldDirectories)); - if (this.parseResult.hasMatchedOption('r')) { + if (this.parseResult.hasMatchedOption(RESULT_FILE_OPTION_NAME)) { validOptions.add(new File(this.options.resultFile)); } From f3662d94b7602fbfc83e0ce1e404cf6269355ea6 Mon Sep 17 00:00:00 2001 From: Alexander Milster Date: Wed, 15 Jan 2025 16:17:43 +0100 Subject: [PATCH 4/5] Fixed sonarcloud issues --- cli/src/test/java/de/jplag/cli/ModeTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cli/src/test/java/de/jplag/cli/ModeTest.java b/cli/src/test/java/de/jplag/cli/ModeTest.java index ab6eef05f..f9f33f711 100644 --- a/cli/src/test/java/de/jplag/cli/ModeTest.java +++ b/cli/src/test/java/de/jplag/cli/ModeTest.java @@ -13,7 +13,7 @@ import de.jplag.cli.test.CliTest; import de.jplag.exceptions.ExitException; -public class ModeTest extends CliTest { +class ModeTest extends CliTest { @Test void testViewWithPositionalFile() throws IOException, ExitException { CliInputHandler inputHandler = this @@ -46,7 +46,7 @@ void testViewWithResultFile() throws IOException, ExitException { } @Test - void testViewWithMultipleFiles() throws IOException, ExitException { + void testViewWithMultipleFiles() { assertThrowsExactly(CliException.class, () -> { this.runCli(args -> args.with(CliArgument.MODE, "view").with(CliArgument.RESULT_FILE, "result.zip") .with(CliArgument.NEW_SUBMISSION_DIRECTORIES, new String[] {"test.zip"})).inputHandler(); @@ -55,5 +55,6 @@ void testViewWithMultipleFiles() throws IOException, ExitException { @Override public void addDefaultParameters() { + // prevents the submission directory from being added to the parameters automatically } } From dd8961a5f941c231ec54aa3bb7ba00681f39099e Mon Sep 17 00:00:00 2001 From: Alexander Milster Date: Thu, 23 Jan 2025 12:14:17 +0100 Subject: [PATCH 5/5] Improved help text --- README.md | 93 +++++++++++------- .../java/de/jplag/cli/options/CliOptions.java | 4 +- docs/1.-How-to-Use-JPlag.md | 94 ++++++++++++------- 3 files changed, 125 insertions(+), 66 deletions(-) diff --git a/README.md b/README.md index 2ee4220b5..0aab748b0 100644 --- a/README.md +++ b/README.md @@ -83,55 +83,84 @@ When using the subcommand, language-specific arguments can be set. A list of lan ``` Parameter descriptions: [root-dirs[,root-dirs...]...] - Root-directory with submissions to check for plagiarism. + Root-directory with submissions to check for + plagiarism. If mode is set to VIEW, this parameter + can be used to specify a file to open. In that case + only a single file may be specified. -bc, --bc, --base-code= - Path to the base code directory (common framework used in all submissions). - -l, --language= - Select the language of the submissions (default: java). See subcommands below. - -M, --mode=<{RUN, VIEW, RUN_AND_VIEW}> - The mode of JPlag. If VIEW is chosen, you can specify a result file to display with either the positional argument, '--new', '--old' or '-r'. Make - sure to only specify one if you do that. One of: RUN, VIEW, RUN_AND_VIEW (default: null) - -n, --shown-comparisons= - The maximum number of comparisons that will be shown in the generated report, if set to -1 all comparisons will be shown (default: 500) + Path to the base code directory (common framework used + in all submissions). + -l, --language= + Select the language of the submissions (default: java). + See subcommands below. + -M, --mode=<{RUN, VIEW, RUN_AND_VIEW}> + The mode of JPlag. If VIEW is chosen, you can specify a + result file to display. One of: RUN, VIEW, + RUN_AND_VIEW (default: null) + -n, --shown-comparisons= + The maximum number of comparisons that will be shown in + the generated report, if set to -1 all comparisons + will be shown (default: 2500) -new, --new=[,...] - Root-directories with submissions to check for plagiarism (same as root). - --normalize Activate the normalization of tokens. Supported for languages: Java, C++. + Root-directories with submissions to check for + plagiarism (same as root). + --normalize Activate the normalization of tokens. Supported for + languages: Java, C++. -old, --old=[,...] - Root-directories with prior submissions to compare against. - -r, --result-file= - Name of the file in which the comparison results will be stored (default: results). Missing .zip endings will be automatically added. - -t, --min-tokens= - Tunes the comparison sensitivity by adjusting the minimum token required to be counted as a matching section. A smaller value increases the sensitivity but might lead to more - false-positives. + Root-directories with prior submissions to compare + against. + -r, --result-file= + Name of the file in which the comparison results will + be stored (default: results). Missing .zip endings + will be automatically added. + -t, --min-tokens= + Tunes the comparison sensitivity by adjusting the + minimum token required to be counted as a matching + section. A smaller value increases the sensitivity + but might lead to more false-positives. Advanced --csv-export Export pairwise similarity values as a CSV file. - -d, --debug Store on-parsable files in error folder. - -m, --similarity-threshold= - Comparison similarity threshold [0.0-1.0]: All comparisons above this threshold will be saved (default: 0.0). + -d, --debug Store on-parsable files in error folder. + --log-level=<{ERROR, WARN, INFO, DEBUG, TRACE}> + Set the log level for the cli. + -m, --similarity-threshold= + Comparison similarity threshold [0.0-1.0]: All + comparisons above this threshold will be saved + (default: 0.0). --overwrite Existing result files will be overwritten. - -p, --suffixes=[,...] - comma-separated list of all filename suffixes that are included. - -P, --port= The port used for the internal report viewer (default: 1996). - -s, --subdirectory= + -p, --suffixes=[,...] + comma-separated list of all filename suffixes that are + included. + -P, --port= The port used for the internal report viewer (default: + 1996). + -s, --subdirectory= Look in directories /*/ for programs. - -x, --exclusion-file= - All files named in this file will be ignored in the comparison (line-separated list). + -x, --exclusion-file= + All files named in this file will be ignored in the + comparison (line-separated list). Clustering --cluster-alg, --cluster-algorithm=<{AGGLOMERATIVE, SPECTRAL}> - Specifies the clustering algorithm (default: spectral). + Specifies the clustering algorithm. Available + algorithms: agglomerative, spectral (default: + spectral). --cluster-metric=<{AVG, MIN, MAX, INTERSECTION}> - The similarity metric used for clustering (default: average similarity). + The similarity metric used for clustering. Available + metrics: average similarity, minimum similarity, + maximal similarity, matched tokens (default: average + similarity). --cluster-skip Skips the cluster calculation. Subsequence Match Merging --gap-size= - Maximal gap between neighboring matches to be merged (between 1 and minTokenMatch, default: 6). - --match-merging Enables merging of neighboring matches to counteract obfuscation attempts. + Maximal gap between neighboring matches to be merged + (between 1 and minTokenMatch, default: 6). + --match-merging Enables merging of neighboring matches to counteract + obfuscation attempts. --neighbor-length= - Minimal length of neighboring matches to be merged (between 1 and minTokenMatch, default: 2). - + Minimal length of neighboring matches to be merged + (between 1 and minTokenMatch, default: 2). Languages: c cpp 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 f984aa2a2..372c93a37 100644 --- a/cli/src/main/java/de/jplag/cli/options/CliOptions.java +++ b/cli/src/main/java/de/jplag/cli/options/CliOptions.java @@ -22,7 +22,7 @@ public class CliOptions implements Runnable { public static final Language defaultLanguage = new JavaLanguage(); - @Parameters(paramLabel = "root-dirs", description = "Root-directory with submissions to check for plagiarism.", split = ",") + @Parameters(paramLabel = "root-dirs", description = "Root-directory with submissions to check for plagiarism. If mode is set to VIEW, this parameter can be used to specify a file to open. In that case only a single file may be specified.", split = ",") public File[] rootDirectory = new File[0]; @Option(names = {"--new", "-new"}, split = ",", description = "Root-directories with submissions to check for plagiarism (same as root).") @@ -54,7 +54,7 @@ public class CliOptions implements Runnable { public String resultFile = "results"; @Option(names = {"-M", - "--mode"}, description = "The mode of JPlag. If VIEW is chosen, you can specify a result file to display with either the positional argument, '--new', '--old' or '-r'. Make sure to only specify one if you do that. One of: ${COMPLETION-CANDIDATES} (default: ${DEFAULT_VALUE})") + "--mode"}, description = "The mode of JPlag. If VIEW is chosen, you can specify a result file to display. One of: ${COMPLETION-CANDIDATES} (default: ${DEFAULT_VALUE})") public JPlagMode mode = JPlagMode.RUN_AND_VIEW; @Option(names = {"--normalize"}, description = "Activate the normalization of tokens. Supported for languages: Java, C++.") diff --git a/docs/1.-How-to-Use-JPlag.md b/docs/1.-How-to-Use-JPlag.md index c940816d7..a7fce2e00 100644 --- a/docs/1.-How-to-Use-JPlag.md +++ b/docs/1.-How-to-Use-JPlag.md @@ -13,55 +13,85 @@ The following arguments can be used to control JPlag: ``` Parameter descriptions: [root-dirs[,root-dirs...]...] - Root-directory with submissions to check for plagiarism. + Root-directory with submissions to check for + plagiarism. If mode is set to VIEW, this parameter + can be used to specify a file to open. In that case + only a single file may be specified. -bc, --bc, --base-code= - Path to the base code directory (common framework used in all submissions). - -l, --language= - Select the language of the submissions (default: java). See subcommands below. - -M, --mode=<{RUN, VIEW, RUN_AND_VIEW}> - The mode of JPlag: either only run analysis, only open the viewer, or do both (default: null) - -n, --shown-comparisons= - The maximum number of comparisons that will be shown in the generated report, if set to -1 all comparisons will be shown (default: 500) + Path to the base code directory (common framework used + in all submissions). + -l, --language= + Select the language of the submissions (default: java). + See subcommands below. + -M, --mode=<{RUN, VIEW, RUN_AND_VIEW}> + The mode of JPlag. If VIEW is chosen, you can specify a + result file to display. One of: RUN, VIEW, + RUN_AND_VIEW (default: null) + -n, --shown-comparisons= + The maximum number of comparisons that will be shown in + the generated report, if set to -1 all comparisons + will be shown (default: 2500) -new, --new=[,...] - Root-directories with submissions to check for plagiarism (same as root). - --normalize Activate the normalization of tokens. Supported for languages: Java, C++. + Root-directories with submissions to check for + plagiarism (same as root). + --normalize Activate the normalization of tokens. Supported for + languages: Java, C++. -old, --old=[,...] - Root-directories with prior submissions to compare against. - -r, --result-file= - Name of the file in which the comparison results will be stored (default: results). Missing .zip endings will be automatically added. - -t, --min-tokens= - Tunes the comparison sensitivity by adjusting the minimum token required to be counted as a matching section. A smaller value increases the sensitivity but might lead to more - false-positives. + Root-directories with prior submissions to compare + against. + -r, --result-file= + Name of the file in which the comparison results will + be stored (default: results). Missing .zip endings + will be automatically added. + -t, --min-tokens= + Tunes the comparison sensitivity by adjusting the + minimum token required to be counted as a matching + section. A smaller value increases the sensitivity + but might lead to more false-positives. Advanced --csv-export Export pairwise similarity values as a CSV file. - -d, --debug Store on-parsable files in error folder. - -m, --similarity-threshold= - Comparison similarity threshold [0.0-1.0]: All comparisons above this threshold will be saved (default: 0.0). + -d, --debug Store on-parsable files in error folder. + --log-level=<{ERROR, WARN, INFO, DEBUG, TRACE}> + Set the log level for the cli. + -m, --similarity-threshold= + Comparison similarity threshold [0.0-1.0]: All + comparisons above this threshold will be saved + (default: 0.0). --overwrite Existing result files will be overwritten. - -p, --suffixes=[,...] - comma-separated list of all filename suffixes that are included. - -P, --port= The port used for the internal report viewer (default: 1996). - -s, --subdirectory= + -p, --suffixes=[,...] + comma-separated list of all filename suffixes that are + included. + -P, --port= The port used for the internal report viewer (default: + 1996). + -s, --subdirectory= Look in directories /*/ for programs. - -x, --exclusion-file= - All files named in this file will be ignored in the comparison (line-separated list). + -x, --exclusion-file= + All files named in this file will be ignored in the + comparison (line-separated list). Clustering --cluster-alg, --cluster-algorithm=<{AGGLOMERATIVE, SPECTRAL}> - Specifies the clustering algorithm (default: spectral). + Specifies the clustering algorithm. Available + algorithms: agglomerative, spectral (default: + spectral). --cluster-metric=<{AVG, MIN, MAX, INTERSECTION}> - The similarity metric used for clustering (default: average similarity). + The similarity metric used for clustering. Available + metrics: average similarity, minimum similarity, + maximal similarity, matched tokens (default: average + similarity). --cluster-skip Skips the cluster calculation. Subsequence Match Merging --gap-size= - Maximal gap between neighboring matches to be merged (between 1 and minTokenMatch, default: 6). - --match-merging Enables merging of neighboring matches to counteract obfuscation attempts. + Maximal gap between neighboring matches to be merged + (between 1 and minTokenMatch, default: 6). + --match-merging Enables merging of neighboring matches to counteract + obfuscation attempts. --neighbor-length= - Minimal length of neighboring matches to be merged (between 1 and minTokenMatch, default: 2). - -Subcommands (supported languages): + Minimal length of neighboring matches to be merged + (between 1 and minTokenMatch, default: 2). +Languages: c cpp csharp