-
Notifications
You must be signed in to change notification settings - Fork 2.2k
FINERACT-2346: Minor SonarQube fixes #4979
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
FINERACT-2346: Minor SonarQube fixes #4979
Conversation
|
Re Raised with squash commits |
|
@galovics Please run workflow and review. |
| final boolean active = command.booleanPrimitiveValueOfParameterNamed("active"); | ||
| final MonthDay feeOnMonthDay = command.extractMonthDayNamed("feeOnMonthDay"); | ||
| final Integer feeInterval = command.integerValueOfParameterNamed("feeInterval"); | ||
| final MonthDay feeOnMonthDay = command.extractMonthDayNamed(FEE_ON_MONTH_DAT_PARAM_NAME); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FEE_ON_MONTH_DAT_PARAM_NAME typo in the name. It should be FEE_ON_MONTH_DAY_PARAM_NAME, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed now
| } | ||
|
|
||
| public static final String CHARGE_TIME_PARAM_NAME = "chargeTimeType"; | ||
| public static final String CHARGE_CALCULATION_TIME_PARAM_NAME = "chargeCalculationType"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For chargeCalculationType param this should be rather named to CHARGE_CALCULATION_TYPE_PARAM_NAME, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| humanReadable = "Daily"; | ||
| } else { | ||
| humanReadable = "Every " + recur.getInterval() + " days"; | ||
| humanReadable = every + recur.getInterval() + " days"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary change... does not help on the readability...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted this change
908a70e to
d8a8e2f
Compare
9fe8151 to
f68c48f
Compare
f68c48f to
b649334
Compare
|
Need to update the kafka image tag as current image pull will not work Run docker compose -f docker-compose-postgresql-kafka.yml up --scale fineract-worker=1 -d according to website Important Notice: Upcoming changes to the Bitnami Catalog Beginning August 28th, 2025, Bitnami will evolve its public catalog to offer a curated set of hardened, security-focused images under the new Bitnami Secure Images initiative. As part of this transition: Bitnami will begin deprecating support for non-hardened, Debian-based software images in its free tier and will gradually remove tags from the public catalog. As a result, community users will have access to a reduced number of hardened images. These images are published only under the “latest” tag and are intended for development purposes for rest you can run the workflow again |
|
I have ran the workflow in my fork aside from kafka all checks are passing accept kafka |
|
LGTM |
| @Operation(summary = "Retrieve an Accounting Closure", description = """ | ||
| Example Requests: | ||
| glclosures/1 | ||
| /glclosures/1?fields=officeName,closingDate""") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing one place the description to use textblock, but left the others unchanged is not an improvement. Please either undo it or change everywhere!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done as suggested replaced all description Types to textbox that i can find.
|
|
||
| public static final String CHARGE_TIME_PARAM_NAME = "chargeTimeType"; | ||
| public static final String CHARGE_CALCULATION_TYPE_PARAM_NAME = "chargeCalculationType"; | ||
| public static final String FEE_ON_MONTH_DAY_PARAM_NAME = "feeOnMonthDay"; | ||
| public static final String FEE_INTERVAL_PARAM_NAME = "feeInterval"; | ||
| public static final String LOCALE_PARAM_NAME = "locale"; | ||
| public static final String FEE_FREQUENCY_PARAM_NAME = "feeFrequency"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be on the top of the class, not at the bottom.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
adamsaghy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please kindly see my review!
b649334 to
440b7f0
Compare
440b7f0 to
b478abc
Compare
|
@adamsaghy Please rerun workflow and review my changes again. Workflow run crosschecked at my forked branch |
Description
This PR introduces a series of code improvements across multiple modules of the Fineract codebase, focusing on the following:
Consistent Usage of Constants: Replaces hard-coded parameter strings with static final constants for maintainability and to reduce typos, especially in charge-related domain logic.
Refactoring for Readability and Conciseness: Refactors lambda expressions, string handling, and API annotations for improved readability and conciseness.
API and Enum String Improvements: Simplifies and standardizes the use of replaceAll("", " ") with replace("", " ") in enums' toString() methods for better performance and clarity.
Annotation and Parameter Handling Enhancements: Refactors repeated annotation arrays into single annotations when only one response is present, and utilizes parameter constants in APIs for uniformity.
Minor Logic Improvements: Streamlines logic checks and improves predicate usage to leverage Java language features more effectively.
Detailed Changes
fineract-charge:
Introduces constants for frequently used parameter names in the Charge domain class.
Refactors code to use these constants instead of string literals.
Improves validation, update logic, and makes locale handling more explicit.
fineract-accounting/closure/api:
Refactors OpenAPI annotations for clarity and removes unnecessary arrays where only one response is used.
Uses multi-line string for improved documentation readability.
fineract-core:
Updates enums to use replace("", " ") instead of replaceAll("", " ") for the toString method.
Refactors parameter name handling in API helpers for consistency.
fineract-investor:
Streamlines branch closure checks in accounting helpers.
Uses parameter constants in API resources for command handling, improving code maintainability and reducing duplication.
fineract-loan:
Updates enum string conversion as above for consistency.
fineract-progressive-loan:
Refactors predicates in the advanced payment schedule transaction processor to use concise lambda syntax.
Other Minor Updates:
Cleans up test step definitions in Acme modules for better clarity and removes commented-out code.
Adds missing constants and improves readability in calendar recurrence utilities.
Motivation
Reduce duplication and risk of typos by centralizing parameter names.
Improve code readability and maintainability.
Standardize how string replacements are performed in enums.
Ensure OpenAPI annotations are concise and maintainable.
Leverage Java language features for more concise lambda and predicate definitions.
Impact
No functional changes or breaking API modifications.
Internal refactoring to aid future development and reduce maintenance overhead.
Improved clarity for contributors and API consumers.
Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
FYI our guidelines for code reviews are at https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide.