Giter VIP home page Giter VIP logo

ip's Introduction

ramapriyan912001

Java MicroServices training exercises and projects

ip's People

ip's Issues

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

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

Example from src/main/java/duke/Storage/Storage.java lines 1-1:

package duke.Storage;

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/duke/Command.java lines 11-15:

    /**
     * Add a task to the list.
     * @param task The string of the task.
     * @param type The type of the task: event, deadline, or other type.
     */

Example from src/main/java/duke/Command.java lines 26-29:

    /**
     * Check task off as done in the list.
     * @param taskNumber index of task in list.
     */

Example from src/main/java/duke/Command.java lines 40-43:

    /**
     * Delete task from the list.
     * @param taskNumber index of task in list.
     */

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

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

Automated-testing issue - Test output cut off and "dos2unix command not found" error

Hi,
I followed all the instructions provided in the docs.
I have tried manually inputting the test commands, and see no issue in the outputs.
As such, I copied these outputs directly from the terminal and pasted them in my EXPECTED.txt file.
The corresponding inputs are in my input.txt file.

However, when I run the .sh script, I see the tests fail and the actual.txt file only shows a fraction of the output that should be seen.
I also see some kind of error "dos2unix command not found" pertaining to a command in the .sh file, in the terminal window.
I have included screenshots of my actual.txt, input.txt, expected.txt, and my terminal upon running the script.
Kindly help me resolve this issue.

Screenshot 2021-08-15 at 5 27 17 PM

Screenshot 2021-08-15 at 5 27 32 PM

Screenshot 2021-08-15 at 5 27 37 PM

Screenshot 2021-08-15 at 5 28 32 PM

Sharing iP code quality feedback [for @ramapriyan912001]

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 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/Parser.java lines 30-30:

            Boolean done = false;

Example from src/main/java/duke/Parser.java lines 83-83:

        Boolean valid = true;

Example from src/main/java/duke/Task.java lines 12-12:

    private Boolean done;

Suggestion: Follow the given naming convention for boolean variables/methods

Aspect: Brace Style

No easy-to-detect issues ๐Ÿ‘

Aspect: Package Name Style

Example from src/main/java/duke/Storage/Storage.java lines 1-1:

package duke.Storage;

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

Example from src/main/java/duke/Parser.java lines 21-59:

    public static ArrayList<Task> loadTasks(List<String> tasks) throws FileParseErrorException {
        ArrayList<Task> finalTasks = new ArrayList<>();
        for (int i = 0; i < tasks.size(); i++) {
            String taskString = tasks.get(i);
            String[] tokens = taskString.split(",");
            if (tokens.length < 3) {
                throw new FileParseErrorException();
            }
            String interpretedString = "";
            Boolean done = false;
            if (tokens[1].equals("0")) {
                done = false;
            } else if (tokens[1].equals("1")) {
                done = true;
            } else {
                throw new FileParseErrorException();
            }
            LocalDateTime localDateTime = LocalDateTime.now();
            Type type;
            if (tokens[0].equals("D") && tokens.length == 4) {
                type = Type.DEADLINE;
                interpretedString = tokens[2];
                localDateTime = parseDate(tokens[3]);
            } else if (tokens[0].equals("E") && tokens.length == 4) {
                type = Type.EVENT;
                interpretedString = tokens[2];
                localDateTime = parseDate(tokens[3]);
            } else if (tokens[0].equals("T") && tokens.length == 3) {
                type = Type.TODO;
                interpretedString = tokens[2];
                localDateTime = null;
            } else {
                throw new FileParseErrorException();
            }
            Task task = TaskList.initialiseByType(interpretedString, type, done, localDateTime);
            finalTasks.add(task);
        }
        return finalTasks;
    }

Example from src/main/java/duke/Parser.java lines 80-113:

    public static String interpretInput(String input, List<Task> tasks) throws DukeException {
        String response = "";
        // Use Java Assertions to check for unacceptable commands
        Boolean valid = true;
        if (input.equals("bye")) {
            response = BYE_STRING;
        } else if (input.equals("list")) {
            response = listResponse(tasks);
        } else if (input.equals("hello")) {
            response = helloResponse();
        } else if (input.startsWith("done ")) {
            response = doneResponse(input, tasks);
        } else if (input.startsWith("todo ")) {
            response = todoResponse(input, tasks);
        } else if (input.startsWith("deadline ")) {
            response = deadlineResponse(input, tasks);
        } else if (input.startsWith("event ")) {
            response = eventResponse(input, tasks);
        } else if (input.startsWith("delete ")) {
            response = deleteResponse(input, tasks);
        } else if (input.startsWith("find ")) {
            response = findResponse(input, tasks);
        } else if (input.startsWith("sort events and deadlines")
                || input.startsWith("sort deadlines and events")) {
            response = sortResponse(tasks);
        } else {
            valid = false;
        }

        assert valid : "COMMAND NOT FOUND";
        writeToStorage(tasks);
        System.out.println(response);
        return response;
    }

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: Header Comments

Example from src/main/java/duke/Command.java lines 11-15:

    /**
     * Method to add a task to our list.
     * @param task The string of the task.
     * @param type The type of the task: event, deadline, or other type.
     */

Example from src/main/java/duke/Command.java lines 26-29:

    /**
     * Method to check the task off as done in the list.
     * @param taskNumber The number of the task in our list.
     */

Example from src/main/java/duke/Command.java lines 40-43:

    /**
     * Method to delete the task from the list.
     * @param taskNumber The number of the task in our list.
     */

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