You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The configuration properties should be stored in a common place in the code, together with their default values to allow readability and easy access
Follow general code conventions in the code (e.g. code style: missing spaces around operators, ordering of fields/methods based on visibility etc.)
Differentiate between JavaDoc and block comments
Reduce code duplication (e.g. org.owasp.csrfguard.util.CsrfGuardUtils contains a lot of unnecessary copied code from org.owasp.csrfguard.config.overlay.ConfigPropertiesCascadeCommonUtils)
Remove unnecessary files and dead code
Use a well tested library for common logic instead of writing own/copying implementation (e.g. org.apache.commons.lang3)
Extract common libraries to the root dependency management section
Add missing @Override annotations
Prefer final variables instead of re-using them, to make the logic easier to follow and to benefit from the compiler errors in case of missing conditional initialization statements
Add this prefix for class fields to make the code more readable (clear differentiation between local variables and class fields)
Make use of Java 8 to make the code more elegant/less verbose:
org.owasp.csrfguard.util.CsrfGuardUtilscontains a lot of unnecessary copied code fromorg.owasp.csrfguard.config.overlay.ConfigPropertiesCascadeCommonUtils)org.apache.commons.lang3)@Overrideannotationsfinalvariables instead of re-using them, to make the logic easier to follow and to benefit from the compiler errors in case of missing conditional initialization statementsthisprefix for class fields to make the code more readable (clear differentiation between local variables and class fields)