Skip to content

Commit

Permalink
Merge branch 'master' into 944-merge-conflict
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/main/java/reposense/model/CliArguments.java
  • Loading branch information
SkyBlaise99 committed Mar 3, 2024
2 parents 7290b07 + bbb2f69 commit ef320c0
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 107 deletions.
Binary file modified frontend/public/favicon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions frontend/src/components/c-segment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export default defineComponent({

<style lang="scss" scoped>
@import '../styles/hightlight-js-style.css';
@import '../styles/_colors.scss';
.segment {
border-left: .25rem solid mui-color('green');
Expand Down
168 changes: 61 additions & 107 deletions src/main/java/reposense/model/CliArguments.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,24 @@
public class CliArguments {
private static final Path EMPTY_PATH = Paths.get("");

private final Path outputFilePath;
private final Path assetsFilePath;
private final LocalDateTime sinceDate;
private final LocalDateTime untilDate;
private final boolean isSinceDateProvided;
private final boolean isUntilDateProvided;
private final List<FileType> formats;
private final boolean isLastModifiedDateIncluded;
private final boolean isShallowCloningPerformed;
private final boolean isAutomaticallyLaunching;
private final boolean isStandaloneConfigIgnored;
private final boolean isFileSizeLimitIgnored;
private final int numCloningThreads;
private final int numAnalysisThreads;
private final ZoneId zoneId;
private final boolean isFindingPreviousAuthorsPerformed;
private final boolean isAuthorshipAnalyzed;
private final double originalityThreshold;
private Path outputFilePath;
private Path assetsFilePath;
private LocalDateTime sinceDate;
private LocalDateTime untilDate;
private boolean isSinceDateProvided;
private boolean isUntilDateProvided;
private List<FileType> formats;
private boolean isLastModifiedDateIncluded;
private boolean isShallowCloningPerformed;
private boolean isAutomaticallyLaunching;
private boolean isStandaloneConfigIgnored;
private boolean isFileSizeLimitIgnored;
private int numCloningThreads;
private int numAnalysisThreads;
private ZoneId zoneId;
private boolean isFindingPreviousAuthorsPerformed;
private boolean isAuthorshipAnalyzed;
private double originalityThreshold;

private boolean isTestMode = ArgsParser.DEFAULT_IS_TEST_MODE;
private boolean isFreshClonePerformed = ArgsParser.DEFAULT_SHOULD_FRESH_CLONE;
Expand All @@ -53,36 +53,10 @@ public class CliArguments {
private Path reportConfigFilePath;
private ReportConfiguration reportConfiguration;

private CliArguments(Builder builder) {
this.outputFilePath = builder.outputFilePath;
this.assetsFilePath = builder.assetsFilePath;
this.sinceDate = builder.sinceDate;
this.untilDate = builder.untilDate;
this.isSinceDateProvided = builder.isSinceDateProvided;
this.isUntilDateProvided = builder.isUntilDateProvided;
this.formats = builder.formats;
this.isLastModifiedDateIncluded = builder.isLastModifiedDateIncluded;
this.isShallowCloningPerformed = builder.isShallowCloningPerformed;
this.isAutomaticallyLaunching = builder.isAutomaticallyLaunching;
this.isStandaloneConfigIgnored = builder.isStandaloneConfigIgnored;
this.isFileSizeLimitIgnored = builder.isFileSizeLimitIgnored;
this.numCloningThreads = builder.numCloningThreads;
this.numAnalysisThreads = builder.numAnalysisThreads;
this.zoneId = builder.zoneId;
this.isFindingPreviousAuthorsPerformed = builder.isFindingPreviousAuthorsPerformed;
this.isTestMode = builder.isTestMode;
this.isFreshClonePerformed = builder.isFreshClonePerformed;
this.locations = builder.locations;
this.isViewModeOnly = builder.isViewModeOnly;
this.reportDirectoryPath = builder.reportDirectoryPath;
this.configFolderPath = builder.configFolderPath;
this.repoConfigFilePath = builder.repoConfigFilePath;
this.authorConfigFilePath = builder.authorConfigFilePath;
this.groupConfigFilePath = builder.groupConfigFilePath;
this.reportConfigFilePath = builder.reportConfigFilePath;
this.reportConfiguration = builder.reportConfiguration;
this.isAuthorshipAnalyzed = builder.isAuthorshipAnalyzed;
this.originalityThreshold = builder.originalityThreshold;
/**
* Constructs a {@code CliArguments} object without any parameters.
*/
private CliArguments() {
}

public ZoneId getZoneId() {
Expand Down Expand Up @@ -247,37 +221,10 @@ public boolean equals(Object other) {
* Builder used to build CliArguments.
*/
public static final class Builder {
private Path outputFilePath;
private Path assetsFilePath;
private LocalDateTime sinceDate;
private LocalDateTime untilDate;
private boolean isSinceDateProvided;
private boolean isUntilDateProvided;
private List<FileType> formats;
private boolean isLastModifiedDateIncluded;
private boolean isShallowCloningPerformed;
private boolean isAutomaticallyLaunching;
private boolean isStandaloneConfigIgnored;
private boolean isFileSizeLimitIgnored;
private int numCloningThreads;
private int numAnalysisThreads;
private ZoneId zoneId;
private boolean isFindingPreviousAuthorsPerformed;
private boolean isTestMode;
private boolean isFreshClonePerformed;
private List<String> locations;
private boolean isViewModeOnly;
private Path reportDirectoryPath;
private Path configFolderPath;
private Path repoConfigFilePath;
private Path authorConfigFilePath;
private Path groupConfigFilePath;
private Path reportConfigFilePath;
private ReportConfiguration reportConfiguration;
private boolean isAuthorshipAnalyzed;
private double originalityThreshold;
private CliArguments cliArguments;

public Builder() {
this.cliArguments = new CliArguments();
}

/**
Expand All @@ -286,7 +233,7 @@ public Builder() {
* @param outputFilePath The output file path.
*/
public Builder outputFilePath(Path outputFilePath) {
this.outputFilePath = outputFilePath;
this.cliArguments.outputFilePath = outputFilePath;
return this;
}

Expand All @@ -296,7 +243,7 @@ public Builder outputFilePath(Path outputFilePath) {
* @param assetsFilePath The assets file path.
*/
public Builder assetsFilePath(Path assetsFilePath) {
this.assetsFilePath = assetsFilePath;
this.cliArguments.assetsFilePath = assetsFilePath;
return this;
}

Expand All @@ -306,7 +253,7 @@ public Builder assetsFilePath(Path assetsFilePath) {
* @param sinceDate The since date.
*/
public Builder sinceDate(LocalDateTime sinceDate) {
this.sinceDate = sinceDate;
this.cliArguments.sinceDate = sinceDate;
return this;
}

Expand All @@ -316,7 +263,7 @@ public Builder sinceDate(LocalDateTime sinceDate) {
* @param untilDate The until date.
*/
public Builder untilDate(LocalDateTime untilDate) {
this.untilDate = untilDate;
this.cliArguments.untilDate = untilDate;
return this;
}

Expand All @@ -326,7 +273,7 @@ public Builder untilDate(LocalDateTime untilDate) {
* @param isSinceDateProvided Is the since date provided.
*/
public Builder isSinceDateProvided(boolean isSinceDateProvided) {
this.isSinceDateProvided = isSinceDateProvided;
this.cliArguments.isSinceDateProvided = isSinceDateProvided;
return this;
}

Expand All @@ -336,7 +283,7 @@ public Builder isSinceDateProvided(boolean isSinceDateProvided) {
* @param isUntilDateProvided Is the until date provided.
*/
public Builder isUntilDateProvided(boolean isUntilDateProvided) {
this.isUntilDateProvided = isUntilDateProvided;
this.cliArguments.isUntilDateProvided = isUntilDateProvided;
return this;
}

Expand All @@ -346,7 +293,7 @@ public Builder isUntilDateProvided(boolean isUntilDateProvided) {
* @param formats The list of {@link FileType}.
*/
public Builder formats(List<FileType> formats) {
this.formats = formats;
this.cliArguments.formats = formats;
return this;
}

Expand All @@ -356,7 +303,7 @@ public Builder formats(List<FileType> formats) {
* @param isLastModifiedDateIncluded Is the last modified date included.
*/
public Builder isLastModifiedDateIncluded(boolean isLastModifiedDateIncluded) {
this.isLastModifiedDateIncluded = isLastModifiedDateIncluded;
this.cliArguments.isLastModifiedDateIncluded = isLastModifiedDateIncluded;
return this;
}

Expand All @@ -366,7 +313,7 @@ public Builder isLastModifiedDateIncluded(boolean isLastModifiedDateIncluded) {
* @param isShallowCloningPerformed Is shallow cloning performed.
*/
public Builder isShallowCloningPerformed(boolean isShallowCloningPerformed) {
this.isShallowCloningPerformed = isShallowCloningPerformed;
this.cliArguments.isShallowCloningPerformed = isShallowCloningPerformed;
return this;
}

Expand All @@ -376,7 +323,7 @@ public Builder isShallowCloningPerformed(boolean isShallowCloningPerformed) {
* @param isAutomaticallyLaunching Is automatically launching.
*/
public Builder isAutomaticallyLaunching(boolean isAutomaticallyLaunching) {
this.isAutomaticallyLaunching = isAutomaticallyLaunching;
this.cliArguments.isAutomaticallyLaunching = isAutomaticallyLaunching;
return this;
}

Expand All @@ -386,7 +333,7 @@ public Builder isAutomaticallyLaunching(boolean isAutomaticallyLaunching) {
* @param isStandaloneConfigIgnored Is standalone config ignored.
*/
public Builder isStandaloneConfigIgnored(boolean isStandaloneConfigIgnored) {
this.isStandaloneConfigIgnored = isStandaloneConfigIgnored;
this.cliArguments.isStandaloneConfigIgnored = isStandaloneConfigIgnored;
return this;
}

Expand All @@ -396,7 +343,7 @@ public Builder isStandaloneConfigIgnored(boolean isStandaloneConfigIgnored) {
* @param isFileSizeLimitIgnored Is file size limit ignored.
*/
public Builder isFileSizeLimitIgnored(boolean isFileSizeLimitIgnored) {
this.isFileSizeLimitIgnored = isFileSizeLimitIgnored;
this.cliArguments.isFileSizeLimitIgnored = isFileSizeLimitIgnored;
return this;
}

Expand All @@ -406,7 +353,7 @@ public Builder isFileSizeLimitIgnored(boolean isFileSizeLimitIgnored) {
* @param numCloningThreads The number of cloning threads.
*/
public Builder numCloningThreads(int numCloningThreads) {
this.numCloningThreads = numCloningThreads;
this.cliArguments.numCloningThreads = numCloningThreads;
return this;
}

Expand All @@ -416,7 +363,7 @@ public Builder numCloningThreads(int numCloningThreads) {
* @param numAnalysisThreads The number of analysis threads.
*/
public Builder numAnalysisThreads(int numAnalysisThreads) {
this.numAnalysisThreads = numAnalysisThreads;
this.cliArguments.numAnalysisThreads = numAnalysisThreads;
return this;
}

Expand All @@ -426,7 +373,7 @@ public Builder numAnalysisThreads(int numAnalysisThreads) {
* @param zoneId The timezone Id.
*/
public Builder zoneId(ZoneId zoneId) {
this.zoneId = zoneId;
this.cliArguments.zoneId = zoneId;
return this;
}

Expand All @@ -436,7 +383,7 @@ public Builder zoneId(ZoneId zoneId) {
* @param isFindingPreviousAuthorsPerformed Is finding previous authors performed.
*/
public Builder isFindingPreviousAuthorsPerformed(boolean isFindingPreviousAuthorsPerformed) {
this.isFindingPreviousAuthorsPerformed = isFindingPreviousAuthorsPerformed;
this.cliArguments.isFindingPreviousAuthorsPerformed = isFindingPreviousAuthorsPerformed;
return this;
}

Expand All @@ -446,7 +393,7 @@ public Builder isFindingPreviousAuthorsPerformed(boolean isFindingPreviousAuthor
* @param isTestMode Is test mode.
*/
public Builder isTestMode(boolean isTestMode) {
this.isTestMode = isTestMode;
this.cliArguments.isTestMode = isTestMode;
return this;
}

Expand All @@ -456,7 +403,7 @@ public Builder isTestMode(boolean isTestMode) {
* @param isFreshClonePerformed Is fresh clone performed.
*/
public Builder isFreshClonePerformed(boolean isFreshClonePerformed) {
this.isFreshClonePerformed = isFreshClonePerformed;
this.cliArguments.isFreshClonePerformed = isFreshClonePerformed;
return this;
}

Expand All @@ -466,7 +413,7 @@ public Builder isFreshClonePerformed(boolean isFreshClonePerformed) {
* @param locations The list of locations.
*/
public Builder locations(List<String> locations) {
this.locations = locations;
this.cliArguments.locations = locations;
return this;
}

Expand All @@ -476,7 +423,7 @@ public Builder locations(List<String> locations) {
* @param isViewModeOnly Is view mode only.
*/
public Builder isViewModeOnly(boolean isViewModeOnly) {
this.isViewModeOnly = isViewModeOnly;
this.cliArguments.isViewModeOnly = isViewModeOnly;
return this;
}

Expand All @@ -486,7 +433,7 @@ public Builder isViewModeOnly(boolean isViewModeOnly) {
* @param reportDirectoryPath The report directory path.
*/
public Builder reportDirectoryPath(Path reportDirectoryPath) {
this.reportDirectoryPath = reportDirectoryPath;
this.cliArguments.reportDirectoryPath = reportDirectoryPath;
return this;
}

Expand All @@ -498,13 +445,18 @@ public Builder reportDirectoryPath(Path reportDirectoryPath) {
* @param configFolderPath The config folder path.
*/
public Builder configFolderPath(Path configFolderPath) {
this.configFolderPath = configFolderPath.equals(EMPTY_PATH)
this.cliArguments.configFolderPath = configFolderPath.equals(EMPTY_PATH)
? configFolderPath.toAbsolutePath()
: configFolderPath;
this.repoConfigFilePath = configFolderPath.resolve(RepoConfigCsvParser.REPO_CONFIG_FILENAME);
this.authorConfigFilePath = configFolderPath.resolve(AuthorConfigCsvParser.AUTHOR_CONFIG_FILENAME);
this.groupConfigFilePath = configFolderPath.resolve(GroupConfigCsvParser.GROUP_CONFIG_FILENAME);
this.reportConfigFilePath = configFolderPath.resolve(ReportConfigJsonParser.REPORT_CONFIG_FILENAME);
this.cliArguments.repoConfigFilePath = configFolderPath.resolve(
RepoConfigCsvParser.REPO_CONFIG_FILENAME);
this.cliArguments.authorConfigFilePath = configFolderPath.resolve(
AuthorConfigCsvParser.AUTHOR_CONFIG_FILENAME);
this.cliArguments.groupConfigFilePath = configFolderPath.resolve(
GroupConfigCsvParser.GROUP_CONFIG_FILENAME);
this.cliArguments.reportConfigFilePath = configFolderPath.resolve(
ReportConfigJsonParser.REPORT_CONFIG_FILENAME);

return this;
}

Expand All @@ -514,7 +466,7 @@ public Builder configFolderPath(Path configFolderPath) {
* @param reportConfiguration The report configuration.
*/
public Builder reportConfiguration(ReportConfiguration reportConfiguration) {
this.reportConfiguration = reportConfiguration;
this.cliArguments.reportConfiguration = reportConfiguration;
return this;
}

Expand All @@ -524,7 +476,7 @@ public Builder reportConfiguration(ReportConfiguration reportConfiguration) {
* @param isAuthorshipAnalyzed Is authorship analyzed.
*/
public Builder isAuthorshipAnalyzed(boolean isAuthorshipAnalyzed) {
this.isAuthorshipAnalyzed = isAuthorshipAnalyzed;
this.cliArguments.isAuthorshipAnalyzed = isAuthorshipAnalyzed;
return this;
}

Expand All @@ -534,7 +486,7 @@ public Builder isAuthorshipAnalyzed(boolean isAuthorshipAnalyzed) {
* @param originalityThreshold the originality threshold.
*/
public Builder originalityThreshold(double originalityThreshold) {
this.originalityThreshold = originalityThreshold;
this.cliArguments.originalityThreshold = originalityThreshold;
return this;
}

Expand All @@ -544,7 +496,9 @@ public Builder originalityThreshold(double originalityThreshold) {
* @return CliArguments
*/
public CliArguments build() {
return new CliArguments(this);
CliArguments built = this.cliArguments;
this.cliArguments = new CliArguments();
return built;
}
}
}

0 comments on commit ef320c0

Please sign in to comment.