Skip to content

Improve code quality #134

Description

@forgedhallpass
  • 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:
    • try-with-resources
    • stream API
    • collapsible catch blocks
  • etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions