Skip to content

Sharing iP code quality feedback [for @StanleyLG] #1

Description

@nus-se-bot

@StanleyLG We did an automated analysis of your code to detect potential areas to improve the code quality. We are sharing the results below, to help you improve the iP code further.

IMPORTANT: Note that the script looked for just a few easy-to-detect problems only, and at-most three example are given i.e., there can be other areas/places to improve.

Aspect: Tab Usage

No easy-to-detect issues 👍

Aspect: Naming boolean variables/methods

Example from src/main/java/Duke/parser/CMD_Deadline.java lines 37-37:

        boolean success = true;

Example from src/main/java/Duke/parser/CMD_Event.java lines 36-36:

        boolean success = true;

Example from src/main/java/Duke/parser/CMD_TODO.java lines 29-29:

        boolean success = true;

Suggestion: Follow the given naming convention for boolean variables/methods (e.g., use a boolean-sounding prefix).You may ignore the above if you think the name already follows the convention (the script can report false positives in some cases)

Aspect: Brace Style

Example from src/main/java/Duke/parser/CMD.java lines 47-48:

            }
            catch(ArrayIndexOutOfBoundsException aio) {

Example from src/main/java/Duke/parser/CMD.java lines 51-52:

                }
                else {

Example from src/main/java/Duke/parser/CMD.java lines 92-93:

            }
            catch(NumberFormatException nf){

Suggestion: As specified by the coding standard, use egyptian style braces.

Aspect: Package Name Style

Example from src/main/java/Duke/Duke.java lines 1-1:

package Duke;

Example from src/main/java/Duke/DukeTest.java lines 1-1:

package Duke;

Example from src/main/java/Duke/exception/DukeException.java lines 1-1:

package Duke.exception;

Suggestion: Follow the package naming convention specified by the coding standard.

Aspect: Class Name Style

Example from src/main/java/Duke/parser/CMD_Add.java lines 3-3:

public class CMD_Add extends CMD {

Example from src/main/java/Duke/parser/CMD_Bye.java lines 7-7:

public class CMD_Bye extends CMD {

Example from src/main/java/Duke/parser/CMD_Delete.java lines 7-7:

public class CMD_Delete extends CMD{

Suggestion: Follow the class naming convention specified by the coding standard.

Aspect: Dead Code

Example from src/main/java/Duke/parser/CMD.java lines 87-87:

                //taskList[Integer.parseInt(doneCmd[1]) - 1].setDone();

Example from src/main/java/Duke/parser/CMD_Deadline.java lines 83-83:

            //LocalDateTime.of(,,);

Suggestion: Remove dead code from the codebase.

Aspect: Method Length

No easy-to-detect issues 👍

Aspect: Class size

No easy-to-detect issues 👍

Aspect: Header Comments

Example from src/main/java/Duke/Duke.java lines 16-20:

    /**
     * Beginning function taking in filepath
     *
     * @param filePath - filepath to storage
     */

Example from src/main/java/Duke/exception/DukeException.java lines 4-9:

    /**
     * A base class for self-defined exceptions
     *
     * @param message   the pre-defined message
     *
     */

Example from src/main/java/Duke/exception/EmptyDescriptionException.java lines 5-15:

    /**
     * Thrown when user did not give a description for the task
     *
     * Prints the following
     *         printer.separator();
     *         System.out.printf("      OOPS!!! The description of a %s cannot be empty.\n", taskType);
     *         printer.separator();
     *
     * @param message   the pre-defined message
     *
     */

Suggestion: Ensure method/class header comments follow the format specified in the coding standard, in particular, the phrasing of the overview statement

ℹ️ The bot account @nus-se-bot used to post this issue is un-manned. Do not reply to this post (as those replies will not be read). Instead, contact tic2002@comp.nus.edu.sg if you want to follow up on this post.

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