Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Chen Jiehan] Duke Increments #362

Open
wants to merge 131 commits into
base: master
Choose a base branch
from

Conversation

ChenJiehan318
Copy link

No description provided.

Copy link

@1nefootstep 1nefootstep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, I like the splitting of commands into different classes, would definitely help when expanding on the list of commands to use. One thing I have difficulties understanding is the isExit method for all commands. Could the same be accomplished by return false/true without the isExit boolean? Also, I noticed that the ByeCommand isExit method seems to return false, which would let the loop on Duke continue. Is that intended or did I misinterpret the code?

Nice job on the date formatting too!

Copy link

@OneArmyj OneArmyj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, nice work, code is easy to read and follow through. OOP was done well. However, just take note of package naming, and complete your JavaDocs.

}

/**
* execute the command of adding task
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incomplete JavaDocs, should give clearer description.

@@ -0,0 +1,41 @@
package Command;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Package naming should begin with small letter to avoid conflict with names of classes or interfaces.

private Storage storage;
private TaskList tasks;
private Ui ui;

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fields pertaining to Duke such as Storage, TaskList and Ui should be declared outside the main method block.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is due to the incorrect indentation level

}
}

public static void main(String[] args) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

File path should be one that is accessible with reference to duke as the root file, rather than your C: Drive

public static Command parse(String fullCommand) {
int i = fullCommand.indexOf(' ');
String first = getFirstWord(fullCommand);
switch (first) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

switch case indentation is off. Case should be aligned with switch, according to Java Coding Standard documentation.

String aa;
int time;

switch (Integer.parseInt(str[0])) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong indentation for case.

Copy link

@dcshzj dcshzj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly indentation level issues and certain design implementation can be made better. Thank you for your work!

}

/**
*
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing method description


public abstract void execute(TaskList t, Ui ui, Storage storage) throws IOException;

public abstract boolean isExit();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, the name of the method should not be the same as the variable name


public Command() {}

public abstract void execute(TaskList t, Ui ui, Storage storage) throws IOException;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One suggestion is to allow this method to be overloaded, since not every command will require all 3 parameters to be used.


public class DeleteCommand extends Command {

private int taskNo;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable naming could be clearer, something like taskNumber

@@ -1,10 +1,59 @@
import Command.Command;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file has incorrect indentation level, plus multiple lines of unnecessary newlines.


@Override
public String toString() {

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra newline

public class Deadlines extends Task {

public Deadlines(String description) {

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra newline

showToUser(error);
}

public void showToUser (String... message) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra space between showToUser and (


public class DeleteCommandTest {
@Test
public void executeTest() throws IOException {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method name should be clear on what this test case is about


public class TaskTest {
@Test
public void getStatusNumberTest() {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect naming convention for test method name

@ChenJiehan318 ChenJiehan318 changed the title [Jiehan] Duke Increments [Chen Jiehan] Duke Increments Sep 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants