Skip to content

Sharing iP code quality feedback [for @Eilyss] - Round 2 #2

@soc-se-script

Description

@soc-se-script

@Eilyss We did an automated analysis of your code to detect potential areas to improve the code quality. We are sharing the results below, so that you can avoid similar problems in your tP code (which will be graded more strictly for code quality).

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/com/elsria/Elsria.java lines 57-57:

        boolean running = true;

Example from src/main/java/com/elsria/time/dateparser/FullDateParser.java lines 32-32:

        boolean error = false;

Example from src/main/java/com/elsria/time/dateparser/FullDateMonthFirstParser.java lines 30-30:

        boolean error = false;

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

No easy-to-detect issues 👍

Aspect: Package Name Style

No easy-to-detect issues 👍

Aspect: Class Name Style

No easy-to-detect issues 👍

Aspect: Dead Code

Example from src/test/java/com/elsria/time/dateparser/CompositeDateParserTest.java lines 1-1:

//package com.elsria.time.dateparser;

Example from src/test/java/com/elsria/time/dateparser/CompositeDateParserTest.java lines 3-3:

//import org.junit.jupiter.api.Test;

Example from src/test/java/com/elsria/time/dateparser/CompositeDateParserTest.java lines 5-5:

//import java.time.LocalDate;

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/com/elsria/Chatbot.java lines 96-100:

    /**
     * todo
     * @param input
     * @return
     */

Example from src/main/java/com/elsria/time/Time.java lines 122-142:

    /**
     * TODO: Convert return value to Optional
     * Extracts the date and/or time from a string input. It is capable or processing
     * (relatively) natural language.
     * <p>
     * This method uses a composite parser to extract both date and time components
     * from the input. If no date is found, the current date is used. If no time is found,
     * 23:59pm is used as default.
     * </p>
     * <p></p>
     * Returns an empty {@link Optional} if neither date nor time can be parsed from the input.
     * </p>
     *
     * @param input the string to parse for date and time information.
     * @return an {@link Optional} containing a {@code Time} object representing the parsed
     *         date and time, or an empty {@code Optional} if the input string does not contain a
     *         parsable time.
     *
     * @see CompositeDateParser
     * @see CompositeTimeParser
     */

Example from src/main/java/com/elsria/task/TaskType.java lines 64-72:

    /**
     * TODO: Scrap this
     * Checks if the given character represents a valid task type.
     *
     * @param taskType the character to validate
     * @return true if the character corresponds to a registered task type, false otherwise
     *
     * @see #getTaskType(char)
     */

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

Aspect: Recent Git Commit Messages

No easy-to-detect issues 👍

Aspect: Binary files in repo

No easy-to-detect issues 👍


❗ You are not required to (but you are welcome to) fix the above problems in your iP, unless you have been separately asked to resubmit the iP due to code quality issues.

ℹ️ The bot account used to post this issue is un-manned. Do not reply to this post (as those replies will not be read). Instead, contact cs2103@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