Giter Site home page Giter Site logo

ip's Introduction

Duke project template

This is a project template for a greenfield Java project. It's named after the Java mascot Duke. Given below are instructions on how to use it.

Setting up in Intellij

Prerequisites: JDK 11, update Intellij to the most recent version.

  1. Open Intellij (if you are not in the welcome screen, click File > Close Project to close the existing project first)
  2. Open the project into Intellij as follows:
    1. Click Open.
    2. Select the project directory, and click OK.
    3. If there are any further prompts, accept the defaults.
  3. Configure the project to use JDK 11 (not other versions) as explained in here.
    In the same dialog, set the Project language level field to the SDK default option.
  4. After that, locate the src/main/java/Duke.java file, right-click it, and choose Run Duke.main() (if the code editor is showing compile errors, try restarting the IDE). If the setup is correct, you should see something like the below as the output:
    Hello from
     ____        _        
    |  _ \ _   _| | _____ 
    | | | | | | | |/ / _ \
    | |_| | |_| |   <  __/
    |____/ \__,_|_|\_\___|
    

ip's People

Contributors

swxk19 avatar j-lum avatar damithc avatar seanleong339 avatar jiachen247 avatar

ip's Issues

Sharing iP code quality feedback [for @swxk19] - Round 2

@swxk19 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/duke/tasks/TaskList.java lines 25-25:

            boolean addNewLine = index != 0;

Example from src/main/java/duke/tasks/TaskList.java lines 39-39:

            boolean addNewLine = index != 0;

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/Duke.java lines 35-40:

    /**
     * Evaluate if command execution was successful.
     *
     * @param response command input from user
     * @return whether command execution was succesful
     */

Example from src/main/java/duke/commands/CommandInput.java lines 44-51:

    /**
     * From a given string command input from the user,
     * get its corresponding "Command" object.
     *
     * @param commandLine command input from user
     * @param tasks task list to perform command on
     * @return corresponding Command object
     */

Example from src/main/java/duke/parsing/Parser.java lines 32-37:

    /**
     * Used by 'Deadline' & 'Event' class to get string dates as LocalDate objects.
     *
     * @param timeInput Command line input that user entered
     * @return CommandInput type
     */

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 (Subject Only)

No easy-to-detect issues ๐Ÿ‘

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 [email protected] if you want to follow up on this post.

Main method needs to be refactored to follow Week 3's example

Should look like this:

    public class Duke {
    
        private Storage storage;
        private TaskList tasks;
        private Ui ui;
    
        public Duke(String filePath) {
            ui = new Ui();
            storage = new Storage(filePath);
            try {
                tasks = new TaskList(storage.load());
            } catch (DukeException e) {
                ui.showLoadingError();
                tasks = new TaskList();
            }
        }
    
        public void run() {
            //...
        }
    
        public static void main(String[] args) {
            new Duke("data/tasks.txt").run();
        }
    }

Improve reply for list if list is empty

If task list is empty, show a message that it acknowledging it is empty instead of displaying an empty list.
e.g: "There are no tasks to show." instead of "Here are your tasks: "

Exception messages can be specific to type of command

  1. ListIndexMissing error message is the same for mark/unmark/delete command.
  2. TaskNameMissing error message can be specific to task type, and show appropriate command format accordingly.

Need to look for other instances of such cases as well.

Date parsing needs to be more flexible

Currently, user has to strictly follow date format "yyyy/mm/dd" in order to be recognized as LocalDate object.
Can accept variants like "yyyy/m/d" (for single digit months/days), or reverse format "dd/mm/yyyy".

Sharing iP code quality feedback [for @swxk19]

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

Example from src/main/java/duke/Duke.java lines 22-22:

            // Ui.showLoadingError();

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

Example from src/main/java/duke/Ui.java lines 24-28:

    /**
     * Craft string output for showing number of tasks in a list.
     * @param numTask Number of tasks in the list
     * @return Crafted message
     */

Example from src/main/java/duke/parsing/Parser.java lines 22-26:

    /**
     * Used by 'CommandInput' class to get CommandInput type from command input.
     * @param lineInput Command line input that user entered
     * @return CommandInput type
     */

Example from src/main/java/duke/parsing/Parser.java lines 31-35:

    /**
     * Used by 'Deadline' & 'Event' class to get string dates as LocalDate objects.
     * @param timeInput Command line input that user entered
     * @return CommandInput type
     */

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 (Subject Only)

No easy-to-detect issues ๐Ÿ‘

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.