Giter Club home page Giter Club logo

ip's Introduction

Hi, I'm Tan Yu Tao


I'm a student at National University of Singapore studying for a degree in Computer Science. I'm currently studying and learning new technologies to better my understanding of web development, in the hopes of being a better fullstack developer.

๐Ÿ”จ Tech Stack

Java React HTML CSS Python C SQL Django-Rest-Framework Adobe Xd Figma

ip's People

Contributors

damithc avatar j-lum avatar jiachen247 avatar tanyutao544 avatar

ip's Issues

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

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

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

Example from src/main/java/duke/commands/AddCommand.java lines 66-114:

    public String execute(TaskList tasks, Ui ui, Storage storage) throws DukeException {
        assert tasks != null;
        this.tasks = tasks;
        String[] processedInput;
        String time = null;
        String details;
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("d/M/yyyy HHmm");
        try {
            switch (type) {
            case "todo":
                added = new ToDo(input);
                break;
            case "event":
                processedInput = input.split("/at", 2);
                if(processedInput.length != 2) {
                    throw new IncorrectFormatException();
                }
                details = processedInput[0];
                if(details.isEmpty()){
                    throw new EmptyDescriptionException(type);
                }
                time = processedInput[1].trim();
                LocalDateTime date = LocalDateTime.parse(time, formatter);
                added = new Event(details, date);
                break;
            case "deadline":
                processedInput = input.split("/by", 2);
                if(processedInput.length != 2) {
                    throw new IncorrectFormatException();
                }
                details = processedInput[0];
                if(details.isEmpty()){
                    throw new EmptyDescriptionException(type);
                }
                time = processedInput[1].trim();
                LocalDateTime deadline = LocalDateTime.parse(time, formatter);
                added = new Deadline(details, deadline);
                break;
            default:
                break;
            }
        } catch (DateTimeParseException e) {
            throw new WrongDateFormatException(time);
        }
        this.tasks.add(added);
        storage.saveFile(tasks);

        return ui.addMessage(added, tasks.size());
    }

Example from src/main/java/duke/storage/Storage.java lines 34-88:

    public TaskList load() throws IOException {
        //load files
        File directory = new File("data");
        if (!directory.exists()) {
            directory.mkdir();
        }

        File file = new File(filePath);
        if (!file.exists()) {
            file.createNewFile();
        } else {
            Scanner s = new Scanner(file);
            String type;
            String mark;
            String detail;
            String date;
            Task toAdd = null;
            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("d/M/yyyy HHmm");
            LocalDateTime parsedDate;
            while (s.hasNext()) {
                String input = s.nextLine();
                String[] inputSplit = input.split(" \\| ", 3);
                type = inputSplit[0];
                mark = inputSplit[1];
                switch (type) {
                case "T":
                    detail = inputSplit[2];
                    toAdd = new ToDo(detail);
                    break;
                case "E":
                    inputSplit = inputSplit[2].split(" \\| ");
                    detail = inputSplit[0];
                    date = inputSplit[1];
                    parsedDate = LocalDateTime.parse(date, formatter);
                    toAdd = new Event(detail, parsedDate);
                    break;
                case "D":
                    inputSplit = inputSplit[2].split(" \\| ");
                    detail = inputSplit[0];
                    date = inputSplit[1];
                    parsedDate = LocalDateTime.parse(date, formatter);
                    toAdd = new Deadline(detail, parsedDate);
                    break;
                default:
                    break;
                }
                System.out.println(mark);
                if (mark.equals("1")) {
                    toAdd.mark();
                }
                tasks.add(toAdd);
            }
        }
        return tasks;
    }

Suggestion: Consider applying SLAP (and other abstraction mechanisms) to shorten methods. You may ignore this suggestion if you think a longer method is justified in a particular case.

Aspect: Class size

No easy-to-detect issues ๐Ÿ‘

Aspect: Header Comments

Example from src/main/java/duke/commands/Command.java lines 14-20:

    /**
     * Abstract method for the execution of command
     *
     * @param tasks   tasks list to be modified
     * @param ui      to help with printing of messages
     * @param storage To deal with saving of task list
     */

Example from src/main/java/duke/tasks/Task.java lines 35-37:

    /**
     * Abstract method to update Date of the task
     */

Example from src/main/java/duke/tasks/Task.java lines 40-42:

    /**
     * Abstract method to update Detail of the task
     */

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)

possible problems in commit 46f9232:

Renamed Ui.png to resolve issue with product site

  • Not in imperative mood (?)

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 ๐Ÿ‘

โ— 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.

Sharing iP code quality feedback [for @tanyutao544]

@tanyutao544 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/tasks/Task.java lines 10-10:

    protected boolean marked;

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/commands/Command.java lines 14-20:

    /**
     * Abstract method for the execution of command
     *
     * @param tasks   tasks list to be modified
     * @param ui      to help with printing of messages
     * @param storage To deal with saving of task list
     */

Example from src/main/java/duke/parser/Parser.java lines 24-29:

    /**
     * Method to process the users input into respective command
     * @param input Users input to be processed
     * @return Corresponding command if valid input
     * @throws DukeException if input is invalid or missing details
     */

Example from src/main/java/duke/parser/Parser.java lines 89-93:

    /**
     * Method to check input string is a valid string of integers
     * @param input String input to be checked
     * @return true if input is all integers false is not
     */

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 ๐Ÿ‘

โ„น๏ธ The bot account @nus-se-bot 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.