Skip to content

Refactoring of existing code, part 1 #218

@romani

Description

@romani

All code like LOGGER.warn("Skipping invalid line in projects.properties: " + trimmedLine); should be LOGGER.warn("Skipping invalid line in projects.properties: {}", trimmedLine);

api of logger do concatenation, let use compact mode

LOGGER.error("Error in application state or arguments: " + ex.getMessage(), ex); ==> LOGGER.error("Error in application state or arguments: ", ex);

no need to print message and exception stackatrace, just print whole excpetion it will print all.

Lets move all methods that do git commands to class GitCommands.java and keep all of them as static to make it clear they are stateless util methods.

final boolean isRegressionTesting =
                cfg.get("branch") != null && cfg.get("localGitRepo") != null;

should be moved to main() method and provided to launchCheckstyleReport as argument.

            if (checkstylePatchReportInfo != null) {
                deleteDir(cfg.getReportsDir());

should be:

            if (isRegressionTesting) {
                deleteDir(cfg.getReportsDir());

lets move parsers from Yml and Properties to their own classes.

  1. generateCheckstyleReport and is also candidate for separate class to own all logic.

Please send each item as separate PR to ease review and acceptance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions