Skip to content

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

@soc-se-bot

Description

@soc-se-bot

@alphajae11 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

No easy-to-detect issues 👍

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

No easy-to-detect issues 👍

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/task/Deadline.java lines 12-17:

    /**
     * Return an instance of the class Deadline with description of the Task
     * and deadline date by.
     * @param description that describe what the task is about.
     * @param by that is deadline date in form of yyyy/MM/dd
     */

Example from src/main/java/duke/task/Events.java lines 14-20:

    /**
     * Create an instance of Events class which contains description of the task,
     * start date and end dates of the event
     * @param description
     * @param from
     * @param to
     */

Example from src/main/java/duke/task/Task.java lines 10-13:

    /**
     * Create instance of the Task which contains description and isDone
     * @param description
     */

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 Message

possible problems in commit 72235ad:


Parser, Storage, AddCommand class consist of many arrowheads and long functions
Therefore, there was a need to breakdown the functions to different levels of functions in order to remove long functions and arrowheads
Add new functions to Parser, Storage and AddCommand classes


  • Longer than 72 characters
  • No blank line between subject and body
  • body not wrapped at 72 characters: e.g., Therefore, there was a need to breakdown the functions to different levels of functions in order to remove long functions and arrowheads

possible problems in commit 3e06c4b:


parse in Parser is able to sort out the command based on the type of the command from the user
However, parse in Parser is unable to take care of the different possible errors in the command committed by the user.
In order to solve this issue, assert feature is used to cater for more possible specific errors commmited by the user. For example, assert feature checks if user wrongly puts todo as todos and it will return an error statement by stating that correct way of command is todo instead of todos.
Assertion can indicate a possible bug by the command from the user
Refer to this information about assertion: https://nus-cs2103-ay2324s2.github.io/website/schedule/week5/topics.html


  • Longer than 72 characters
  • No blank line between subject and body
  • body not wrapped at 72 characters: e.g., However, parse in Parser is unable to take care of the different possible errors in the command committed by the user.

possible problems in commit c5a7d0c:


Accomplished Level-10


  • Not in imperative mood (?)

Suggestion: Follow the given conventions for Git commit messages for future commits (do not modify past commit messages as doing so will change the commit timestamp that we used to detect your commit timings).

Aspect: Binary files in repo

Suggestion: Avoid committing binary files (e.g., *.class, *.jar, *.exe) or third-party library files in to the repo.


ℹ️ 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