From 4d8d0f4fdad150a49ccbd7428022e489ee1562e6 Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Wed, 22 Jan 2020 19:37:28 +0100 Subject: [PATCH] Made a code review. --- build.num | 2 +- src/org/april/agirstatool/cli/SQLUtils.java | 30 +++++++++++++---- .../april/agirstatool/core/AgirStatool.java | 16 +++------- .../agirstatool/core/AgirStatoolUtils.java | 6 +++- src/org/april/agirstatool/core/Project.java | 4 ++- .../agirstatool/core/ProjectComparator.java | 32 ++++++++++++++----- .../agirstatool/core/pages/ChartBarView.java | 10 ++++-- .../core/pages/ChartPolarView.java | 10 ++++-- .../pages/CreatedConcludedCountChartView.java | 15 ++++++--- .../core/pages/IssueStatChartView.java | 12 ++++--- .../agirstatool/core/pages/ProjectPage.java | 4 +-- .../core/pages/ProjectsGroupedView.java | 4 +-- .../core/pages/ProjectsRawView.java | 4 +-- .../core/pages/UnassignedPolarChartView.java | 16 ++++++---- 14 files changed, 113 insertions(+), 52 deletions(-) diff --git a/build.num b/build.num index 1c4d2e7..ac759bf 100644 --- a/build.num +++ b/build.num @@ -1,3 +1,3 @@ #Build Number for ANT. Do not edit! -#Wed Jan 22 19:29:14 CET 2020 +#Wed Jan 22 19:36:44 CET 2020 build.number=4 diff --git a/src/org/april/agirstatool/cli/SQLUtils.java b/src/org/april/agirstatool/cli/SQLUtils.java index 0a4e870..da40f3d 100644 --- a/src/org/april/agirstatool/cli/SQLUtils.java +++ b/src/org/april/agirstatool/cli/SQLUtils.java @@ -38,7 +38,7 @@ public final class SQLUtils private static Logger logger = LoggerFactory.getLogger(SQLUtils.class); /** - * Instantiates a new connector. + * Instantiates a new SQL utils. */ private SQLUtils() { @@ -155,12 +155,19 @@ public final class SQLUtils } /** - * - * This method launch CLI. - * - * @param args - * necessary arguments + * Gets the connexion. + * + * @param serverUrl + * the server url + * @param databaseName + * the database name + * @param login + * the login + * @param password + * the password + * @return the connexion * @throws AgirStatoolException + * the agir statool exception */ public static Connection getConnexion(final String serverUrl, final String databaseName, final String login, final String password) throws AgirStatoolException { @@ -207,6 +214,17 @@ public final class SQLUtils return result; } + /** + * Gets the nullable long. + * + * @param resultSet + * the result set + * @param index + * the index + * @return the nullable long + * @throws SQLException + * the SQL exception + */ public static Long getNullableLong(final ResultSet resultSet, final int index) throws SQLException { Long result; diff --git a/src/org/april/agirstatool/core/AgirStatool.java b/src/org/april/agirstatool/core/AgirStatool.java index 6d924e9..5d5ab52 100644 --- a/src/org/april/agirstatool/core/AgirStatool.java +++ b/src/org/april/agirstatool/core/AgirStatool.java @@ -224,13 +224,9 @@ public class AgirStatool /** * Fetch week concluded count. - * - * In Redmine database: closed_on when resolved, rejected or closed. * * @param project * the project - * @param consolidated - * the consolidated * @return the date count map * @throws AgirStatoolException * the agir statool exception @@ -311,8 +307,6 @@ public class AgirStatool * * @param project * the project - * @param consolidated - * the consolidated * @return the date count map * @throws AgirStatoolException * the agir statool exception @@ -389,9 +383,9 @@ public class AgirStatool } /** - * Gets the project all. + * Gets the root project. * - * @return the project all + * @return the root project * @throws AgirStatoolException * the agir statool exception */ @@ -693,10 +687,10 @@ public class AgirStatool } /** - * List projects. + * List projects with stats. * - * @param consolidated - * the consolidated + * @param type + * the type * @return the projects * @throws AgirStatoolException * the agir statool exception diff --git a/src/org/april/agirstatool/core/AgirStatoolUtils.java b/src/org/april/agirstatool/core/AgirStatoolUtils.java index 8eebc65..d8d0ad0 100644 --- a/src/org/april/agirstatool/core/AgirStatoolUtils.java +++ b/src/org/april/agirstatool/core/AgirStatoolUtils.java @@ -286,9 +286,13 @@ public class AgirStatoolUtils } /** + * To human short. + * * @param value + * the value * @param defaultValue - * @return + * the default value + * @return the string */ public static String toHumanShort(final LocalDateTime value, final String defaultValue) { diff --git a/src/org/april/agirstatool/core/Project.java b/src/org/april/agirstatool/core/Project.java index 1e3d22d..2b091b5 100644 --- a/src/org/april/agirstatool/core/Project.java +++ b/src/org/april/agirstatool/core/Project.java @@ -141,7 +141,9 @@ public class Project } /** - * @return + * Checks for issue. + * + * @return true, if successful */ public boolean hasIssue() { diff --git a/src/org/april/agirstatool/core/ProjectComparator.java b/src/org/april/agirstatool/core/ProjectComparator.java index 7eca4a6..9127d56 100644 --- a/src/org/april/agirstatool/core/ProjectComparator.java +++ b/src/org/april/agirstatool/core/ProjectComparator.java @@ -17,8 +17,10 @@ public class ProjectComparator implements Comparator private Sorting sorting; /** - * + * Instantiates a new project comparator. + * * @param sorting + * the sorting */ public ProjectComparator(final Sorting sorting) { @@ -41,7 +43,15 @@ public class ProjectComparator implements Comparator } /** - * + * Compare. + * + * @param alpha + * the alpha + * @param bravo + * the bravo + * @param sorting + * the sorting + * @return the int */ public static int compare(final Project alpha, final Project bravo, final Sorting sorting) { @@ -74,9 +84,11 @@ public class ProjectComparator implements Comparator } /** - * + * Gets the id. + * * @param source - * @return + * the source + * @return the id */ public static Long getId(final Project source) { @@ -96,9 +108,11 @@ public class ProjectComparator implements Comparator } /** - * + * Gets the identifier. + * * @param source - * @return + * the source + * @return the identifier */ public static String getIdentifier(final Project source) { @@ -118,9 +132,11 @@ public class ProjectComparator implements Comparator } /** - * + * Gets the name. + * * @param source - * @return + * the source + * @return the name */ public static String getName(final Project source) { diff --git a/src/org/april/agirstatool/core/pages/ChartBarView.java b/src/org/april/agirstatool/core/pages/ChartBarView.java index b873c98..562bd33 100644 --- a/src/org/april/agirstatool/core/pages/ChartBarView.java +++ b/src/org/april/agirstatool/core/pages/ChartBarView.java @@ -40,8 +40,14 @@ public class ChartBarView /** * Builds the. * - * @param projects - * the projects + * @param title + * the title + * @param labelTitle + * the label title + * @param labels + * the labels + * @param values + * the values * @return the string * @throws AgirStatoolException * the agir statool exception diff --git a/src/org/april/agirstatool/core/pages/ChartPolarView.java b/src/org/april/agirstatool/core/pages/ChartPolarView.java index aea5778..cbead1a 100644 --- a/src/org/april/agirstatool/core/pages/ChartPolarView.java +++ b/src/org/april/agirstatool/core/pages/ChartPolarView.java @@ -40,8 +40,14 @@ public class ChartPolarView /** * Builds the. * - * @param projects - * the projects + * @param title + * the title + * @param labelTitle + * the label title + * @param labels + * the labels + * @param values + * the values * @return the string * @throws AgirStatoolException * the agir statool exception diff --git a/src/org/april/agirstatool/core/pages/CreatedConcludedCountChartView.java b/src/org/april/agirstatool/core/pages/CreatedConcludedCountChartView.java index cf5ff8a..427f18a 100644 --- a/src/org/april/agirstatool/core/pages/CreatedConcludedCountChartView.java +++ b/src/org/april/agirstatool/core/pages/CreatedConcludedCountChartView.java @@ -97,10 +97,12 @@ public class CreatedConcludedCountChartView } /** - * Builds the. + * Builds the full. * - * @param projects - * the projects + * @param title + * the title + * @param project + * the project * @return the string * @throws AgirStatoolException * the agir statool exception @@ -167,10 +169,15 @@ public class CreatedConcludedCountChartView } /** + * Builds the previous year. + * * @param title + * the title * @param project - * @return + * the project + * @return the string * @throws AgirStatoolException + * the agir statool exception */ public static String buildPreviousYear(final String title, final Project project) throws AgirStatoolException { diff --git a/src/org/april/agirstatool/core/pages/IssueStatChartView.java b/src/org/april/agirstatool/core/pages/IssueStatChartView.java index e1d311c..540509e 100644 --- a/src/org/april/agirstatool/core/pages/IssueStatChartView.java +++ b/src/org/april/agirstatool/core/pages/IssueStatChartView.java @@ -35,8 +35,10 @@ public class IssueStatChartView /** * Builds the. * - * @param projects - * the projects + * @param title + * the title + * @param project + * the project * @return the string * @throws AgirStatoolException * the agir statool exception @@ -64,8 +66,10 @@ public class IssueStatChartView /** * Builds the grouped. * - * @param stats - * the stats + * @param title + * the title + * @param project + * the project * @return the string * @throws AgirStatoolException * the agir statool exception diff --git a/src/org/april/agirstatool/core/pages/ProjectPage.java b/src/org/april/agirstatool/core/pages/ProjectPage.java index 2fe1418..5500fbf 100644 --- a/src/org/april/agirstatool/core/pages/ProjectPage.java +++ b/src/org/april/agirstatool/core/pages/ProjectPage.java @@ -39,8 +39,8 @@ public class ProjectPage /** * Builds the. * - * @param projects - * the projects + * @param project + * the project * @return the string * @throws AgirStatoolException * the agir statool exception diff --git a/src/org/april/agirstatool/core/pages/ProjectsGroupedView.java b/src/org/april/agirstatool/core/pages/ProjectsGroupedView.java index f04265c..84b3bd3 100644 --- a/src/org/april/agirstatool/core/pages/ProjectsGroupedView.java +++ b/src/org/april/agirstatool/core/pages/ProjectsGroupedView.java @@ -42,8 +42,8 @@ public class ProjectsGroupedView /** * Builds the. * - * @param projects - * the projects + * @param project + * the project * @return the string * @throws AgirStatoolException * the agir statool exception diff --git a/src/org/april/agirstatool/core/pages/ProjectsRawView.java b/src/org/april/agirstatool/core/pages/ProjectsRawView.java index 499733b..58b20b9 100644 --- a/src/org/april/agirstatool/core/pages/ProjectsRawView.java +++ b/src/org/april/agirstatool/core/pages/ProjectsRawView.java @@ -40,8 +40,8 @@ public class ProjectsRawView /** * Builds the. * - * @param projects - * the projects + * @param project + * the project * @return the string * @throws AgirStatoolException * the agir statool exception diff --git a/src/org/april/agirstatool/core/pages/UnassignedPolarChartView.java b/src/org/april/agirstatool/core/pages/UnassignedPolarChartView.java index 41bf0ee..7e44316 100644 --- a/src/org/april/agirstatool/core/pages/UnassignedPolarChartView.java +++ b/src/org/april/agirstatool/core/pages/UnassignedPolarChartView.java @@ -34,10 +34,12 @@ public class UnassignedPolarChartView private static Logger logger = LoggerFactory.getLogger(UnassignedPolarChartView.class); /** - * Builds the grouped. + * Builds the. * - * @param stats - * the stats + * @param title + * the title + * @param project + * the project * @return the string * @throws AgirStatoolException * the agir statool exception @@ -64,10 +66,12 @@ public class UnassignedPolarChartView } /** - * Builds the. + * Builds the grouped. * - * @param projects - * the projects + * @param title + * the title + * @param project + * the project * @return the string * @throws AgirStatoolException * the agir statool exception