Skip to content

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

Description

@soc-se-script

@ashmitahaldar 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/mayobot/commands/UnmarkCommand.java lines 53-53:

        boolean success = false;

Example from src/main/java/mayobot/commands/MarkCommand.java lines 51-51:

        boolean success = 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/mayobot/UiTest.java lines 72-72:

    //    public void ui_readCommand_readsEmptyInput() {

Example from src/test/java/mayobot/UiTest.java lines 73-73:

    //        String testInput = "";

Example from src/test/java/mayobot/UiTest.java lines 74-74:

    //        System.setIn(new ByteArrayInputStream(testInput.getBytes()));

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

No easy-to-detect issues 👍

Aspect: Recent Git Commit Messages

possible problems in commit 70fb680:


Fix MayoBotTest.java tests to work on Windows

The mayoBot_loadTaskList_ioException() JUnit test for Ubuntu/MacOS passes but fails for Windows due to the invalid file path actually being valid in Windows.

This causes inconsistency in the CI workflow results.

Let's fix the test method to account for Windows OS running the test.


  • body not wrapped at 72 characters: e.g., The mayoBot_loadTaskList_ioException() JUnit test for Ubuntu/MacOS passes but fails for Windows due to the invalid file path actually being valid in Windows.

possible problems in commit 602a756:


Remove IO redirection test in CI workflow

The CI workflow still includes the IO redirection test, despite it becoming obsolete in the current implementation of MayoBot with a GUI and JUnit tests.

Keeping this outdated test will cause issues with the workflow.

Let's therefore remove this job from the CI workflow gradle.yml file.


  • body not wrapped at 72 characters: e.g., The CI workflow still includes the IO redirection test, despite it becoming obsolete in the current implementation of MayoBot with a GUI and JUnit tests.

possible problems in commit 51a6841:


Fix wildcard issue in runtest.sh

The CI workflow fails due to runtest.sh not finding ../src/main/java/*.java .

Resolving this error is crucial to get the CI workflow running.

Let's fix this wildcard issue in runtest.sh and see if that fixes the error.


  • body not wrapped at 72 characters: e.g., The CI workflow fails due to runtest.sh not finding ../src/main/java/*.java .

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 👍


❗ 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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