Skip to content

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

@nus-se-script

Description

@nus-se-script

@hweinian 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/gravitas/storage/Storage.java lines 45-50:

    /**
     * Load the tasks from the storage to the task list.
     *
     * @return ArrayList of tasks
     * @throws DukeException If there is an error in loading the tasks
     */

Example from src/main/java/gravitas/storage/Storage.java lines 70-75:

    /**
     * Save the tasks from the task list to the storage.
     *
     * @param tasklist TaskList object that contains the list of tasks
     * @throws DukeException If there is an error in saving the 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 351e343:


Add help command to improve user guidance

The app lacks a dedicated help command, which makes it difficult for users to understand how to use the GUI

To address this, a help command displays the possible feature that could be done by the app.

It is implemented in the GUI as users may want to know what command is available for them at any point in time


  • body not wrapped at 72 characters: e.g., The app lacks a dedicated help command, which makes it difficult for users to understand how to use the GUI

possible problems in commit 8f2d056:


Improve code quality

Methods and variable names are not representative of what the actual method and variables do
which may lead to bug inducing code due to misunderstanding of what the variable actually do.

Method names and variable names are renamed to better reflect their functionality and purpose.
Group static variable together with common prefixes

Changes was done to ensure anyone working on the project is able to understand what is written with little to no ambiguity


  • body not wrapped at 72 characters: e.g., Methods and variable names are not representative of what the actual method and variables do

possible problems in commit fe3f610:


Add java assertion feature to validate assumptions within code

The codebase lacks checks to ensure assumptions and invariants to hold during runtime.
Runtime issues can be flagged and debugging runtime bugs will be easier.

Assertions is added throughout the code to verify assumptions and to flag issues.

These assumptions can be enabled during developement, and disabled during production to avoid performance overhead.

Assertions should be enabled during developement and testing but disabled for production builds to avoid runtime cost.


  • body not wrapped at 72 characters: e.g., The codebase lacks checks to ensure assumptions and invariants to hold during runtime.

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

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 [email protected] 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