Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sharing iP code quality feedback [for @wesho1107] #4

Open
soc-se-script opened this issue Sep 16, 2023 · 0 comments
Open

Sharing iP code quality feedback [for @wesho1107] #4

soc-se-script opened this issue Sep 16, 2023 · 0 comments

Comments

@soc-se-script
Copy link

@wesho1107 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/task/Task.java lines 5-5:

    private boolean markedStatus;

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

    private boolean reminderStatus = 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

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/main/Storage.java lines 83-88:

    /**
     * Update the file with a list of tasks, for when deleting or marking.
     *
     * @param tasks The list of tasks to be saved to the file.
     * @throws IOException If there's an error while writing to the file.
     */

Example from src/main/java/duke/main/TaskList.java lines 72-76:

    /**
     * Retrieve the number of tasks in the TaskList.
     *
     * @return The number of tasks in the TaskList.
     */

Example from src/main/java/duke/main/Ui.java lines 187-191:

    /**
     * Display tasks in the filtered list.
     *
     * @param filteredTasks The filtered list of tasks
     */

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 3c585f3:


Improve code quality (named constants, dead code, complicated expressions)

Adding named constants, removing dead code and reducing complicated expressions promotes readability and maintainability of code

Constants are declared private static final, unused functions are removed and complicated conditional expressions are made into a separate function for checking

Shorten the length of code and reduce confusion when reading code


  • Longer than 72 characters
  • body not wrapped at 72 characters: e.g., Adding named constants, removing dead code and reducing complicated expressions promotes readability and maintainability of code

possible problems in commit b8f3f3e:


Import statements with wildcard

Importing classes with wildcard uses larger space when some classes are not used from a library/package.

Importing classes more explicitly by specifying classes that are being used in each subclasses.

Importing classes explicitly makes the class easier to comprehend and maintain.


  • body not wrapped at 72 characters: e.g., Importing classes with wildcard uses larger space when some classes are not used from a library/package.

Suggestion: Follow the given conventions for Git commit messages for future commits (no need to modify past commit messages).

Aspect: Binary files in repo

No easy-to-detect 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant