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

[#2073] Refactor RepoConfigCsvParser::processLine method to avoid arrowhead style code #2080

Merged
merged 3 commits into from
Jan 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions src/main/java/reposense/parser/RepoConfigCsvParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,20 +114,19 @@ protected void processLine(List<RepoConfiguration> results, CSVRecord record) th

// If file diff limit is specified
if (fileSizeLimitStringList.size() > 0) {
String fileSizeLimitString = fileSizeLimitStringList.get(0).trim();
int parseValue;

if (isFileSizeLimitIgnored) {
logger.warning("Ignoring file size limit column since file size limit is ignored");
isFileSizeLimitOverriding = false;
} else if (!StringsUtil.isNumeric(fileSizeLimitString)
|| (parseValue = Integer.parseInt(fileSizeLimitString)) <= 0) {
logger.warning(String.format("Values in \"%s\" column should be positive integers.",
FILESIZE_LIMIT_HEADER[0]));
isFileSizeLimitOverriding = false;
} else {
String fileSizeLimitString = fileSizeLimitStringList.get(0).trim();
int parseValue;
if (!StringsUtil.isNumeric(fileSizeLimitString)
|| (parseValue = Integer.parseInt(fileSizeLimitString)) <= 0) {
logger.warning(String.format("Values in \"%s\" column should be positive integers.",
FILESIZE_LIMIT_HEADER[0]));
isFileSizeLimitOverriding = false;
} else {
fileSizeLimit = parseValue;
}
fileSizeLimit = parseValue;
}
}

Expand Down
Loading