Skip to content

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

@nus-se-bot

Description

@nus-se-bot

@Xingchen722 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/lars/task/Task.java lines 8-8:

    protected boolean status;

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

Example from src/main/java/lars/Exceptions/LarsException.java lines 1-1:

package lars.Exceptions;

Suggestion: Follow the package naming convention specified by the coding standard.

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/lars/ui/Ui.java lines 24-26:

    /**
     * welcome to string.
     */

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

possible problems in commit f127c3d:


Merge pull request #2 from Xingchen722/branch-A-CodeQuality

A-CodeQuality: Refactor Parser and Task for readability and maintainability

  • body not wrapped at 72 characters: e.g., A-CodeQuality: Refactor Parser and Task for readability and maintainability

possible problems in commit 7e9a1b6:


A-CodeQuality: Refactor Parser and Task for readability and maintainability

The Parser class previously had inconsistent switch-case formatting, which
made reading and extending the code harder. The Task class also had
unclear function names that reduced clarity.

Improvements:
- Reformatted switch-case statements in Parser to standard style
- Renamed Task functions to better describe their behavior
- Ensures code style consistency across classes
- Makes future maintenance and feature extension easier

These changes improve code readability, maintainability, and align with
project coding standards without altering existing functionality.


  • Longer than 72 characters
  • body not wrapped at 72 characters: e.g., The Parser class previously had inconsistent switch-case formatting, which

possible problems in commit c190fcd:


A-Streams: Refactor findTasks to use Streams

Previously, findTasks used a for-loop to collect matching tasks, which was
verbose and imperative. By using Arrays.stream() + filter() + toArray(),
the logic becomes more declarative and easier to read.

Changes:
- Replaced for-loop with Arrays.stream().filter().toArray()
- Ensures functionality remains unchanged
- Improves readability and maintainability


  • body not wrapped at 72 characters: e.g., Previously, findTasks used a for-loop to collect matching tasks, which was

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