Skip to content

[Goh Jin Yuan] iP#673

Open
farbutnear wants to merge 40 commits into
nus-cs2103-AY2526S1:masterfrom
farbutnear:master
Open

[Goh Jin Yuan] iP#673
farbutnear wants to merge 40 commits into
nus-cs2103-AY2526S1:masterfrom
farbutnear:master

Conversation

@farbutnear

@farbutnear farbutnear commented Sep 4, 2025

Copy link
Copy Markdown

Farquaad 🤖

“Some of you may die, but it's a sacrifice I am willing to make.” – Lord Farquaad (Shrek)

Farquaad is your loyal text-based chatbot that helps you keep track of tasks, deadlines, and events —
so you don’t have to!

It is:

  • 📝 Text-based
  • 🎯 Easy to learn
  • Fast. Super Fast

All you need to do is:

  1. Download it from releases.
  2. Double-click it.
  3. Add your tasks.
  4. Let Farquaad handle the rest 😉

And best of all — it’s FREE!


✨ Features

  • ✅ Manage tasks (to-dos, deadlines, events)
  • 🔍 Find tasks by keyword (Level-9)
  • 💾 Save & load tasks automatically (Level-7)
  • 📅 Support for dates & times (Level-8)
  • ⏰ Reminders (coming soon!)

🛠️ For Java Programmers

If you’re a Java programmer, Farquaad is also a great way to practice OOP principles, JavaFX (if you extend it), and working with file I/O.

Here’s the main method to launch it:

public class Main {
    public static void main(String[] args) {
        new Farquaad("data/farquaad.txt").run();
    }
}

damithc and others added 10 commits July 11, 2024 16:52
In build.gradle, the dependencies on distZip and/or distTar causes
the shadowJar task to generate a second JAR file for which the
mainClass.set("seedu.duke.Duke") does not take effect.
Hence, this additional JAR file cannot be run.
For this product, there is no need to generate a second JAR file
to begin with.

Let's remove this dependency from the build.gradle to prevent the
shadowJar task from generating the extra JAR file.

@SanguineChameleon SanguineChameleon left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks great overall! Just a few small adjustments needed to align with the coding standard. Don't forget to include Javadoc as well :)

Comment thread src/main/java/Exceptions.java Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks like this class declaration is empty. Was this intentional, or is this still in progress?

Comment thread src/main/java/farquaad.java Outdated
Comment on lines +4 to +24
class farquaadException extends Exception {
farquaadException(String msg) { super(msg); }
}

class unknownCommandException extends farquaadException {
unknownCommandException() {
super("I apologise, but I don't know what that means LOL");
}
}

class emptyDescriptionException extends farquaadException {
emptyDescriptionException(String task) {
super("lmao the description of a " + task + " cannot be empty.");
}
}

class invalidIndexException extends farquaadException {
invalidIndexException() {
super("the task number is invalid.");
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Class names should follow PascalCase, so you may want to update these.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I second the point @SanguineChameleon made about following naming conventions

@makis4n makis4n left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM 👍 . But there are definitely some points for improvement (e.g. including Javadocs and adding access modifiers to your classes).

Comment thread src/main/java/Task.java Outdated
System.out.println("Nice! I've marked this task as done:");
}

public void unmarkAsNotDone() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Perhaps consider changing the method name to something a bit less confusing (e.g. markAsNotDone)?

Comment thread src/main/java/farquaad.java Outdated
Comment on lines +4 to +24
class farquaadException extends Exception {
farquaadException(String msg) { super(msg); }
}

class unknownCommandException extends farquaadException {
unknownCommandException() {
super("I apologise, but I don't know what that means LOL");
}
}

class emptyDescriptionException extends farquaadException {
emptyDescriptionException(String task) {
super("lmao the description of a " + task + " cannot be empty.");
}
}

class invalidIndexException extends farquaadException {
invalidIndexException() {
super("the task number is invalid.");
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I second the point @SanguineChameleon made about following naming conventions

Comment thread src/main/java/farquaad.java Outdated
}
}

class invalidIndexException extends farquaadException {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

PascalCase class name is preferred.

Comment thread src/main/java/farquaad.java Outdated

class EmptyDescriptionException extends farquaadException {
EmptyDescriptionException(String task) {
class emptyDescriptionException extends farquaadException {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

PascalCase class name is preferred.

Comment thread src/main/java/farquaad.java Outdated
}
}

public class farquaad {

@Butanol Butanol Sep 5, 2025

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

PascalCase class name is preferred.

@Butanol Butanol left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Overall readable code other than a few coding standard violations. Maybe split the classes into different files.

@aliensarefake aliensarefake left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review - Coding Standards and Quality

Coding Standard Violations:

  1. Variable Naming Convention

    • static final SaveFunction savefunction should use camelCase
    • Should be: static final SaveFunction saveFunction
  2. Method Naming Issues

    • unmarkAsNotDone() contains a confusing double negative
    • Consider markAsNotDone() or simply unmark() for clarity
    • getIsDone() should follow boolean getter convention: isDone()
  3. Static Members in Main Class

    • Using static ArrayList<Task> tasks in the main class reduces testability
    • Consider encapsulating in an instance-based TaskManager class for better design

Code Quality Observations:

  • Good exception hierarchy with custom FarquaadException extending base Exception
  • Nested static classes (ToDo, Deadline, Event) work but may benefit from separate files as complexity grows
  • Consider using primitive boolean return type instead of Boolean wrapper in getIsDone()

@FZFZFZZ

FZFZFZZ commented Sep 17, 2025

Copy link
Copy Markdown

Good in-code comment written

farbutnear and others added 14 commits September 22, 2025 16:09
…es and storage

Currently, invalid inputs or broken invariants can pass silently,
making defects harder to diagnose (e.g., null/empty user input,
out-of-bounds indices, or malformed storage loads).

This reduces debuggability and can allow incorrect program states
to propagate before failing elsewhere.

Let's add Java assertions at critical points to guard assumptions
about inputs and state transitions.

Specifically:
* Parser: assert non-null input, non-empty command word, and valid
  non-negative indices after parsing where applicable.
* TaskList:
  - add(): assert size increases by exactly one.
  - remove(): assert index is within bounds and size decreases by one.
  - get(): assert index is within bounds.
* Storage.load(): assert the loaded task collection is non-null.
* Command classes (e.g., Deadline, Event, Delete): assert required
  arguments are non-null/non-empty and constructed Task objects are
  non-null before mutation and save.

These assertions improve fault localization during development and
test runs when assertions are enabled, without changing runtime
behavior in production (assertions are disabled by default).

How to run with assertions:
`java -ea -jar build/libs/<app>.jar`

No functional changes when assertions are disabled.
The Ui class currently contains duplicated logic for  repeated
task list formatting in displayTaskList and displayMatchingTasks.

This makes the code harder to read and more error-prone when extending
or updating output formatting.

Let's refactor Ui to improve code quality by:
* Extracting a private helper formatTaskList() to eliminate duplication
  between displayTaskList and displayMatchingTasks.
* Declaring the scanner field as final to enforce immutability.

These changes improve code readability, reduce duplication, and make
Ui easier to maintain and extend in the future without changing
program behavior.
Add assertions to ensure program correctness
Merge branch 'master' into branch-A-CodeQuality
Improve code quality for readability and maintainability
Users may forget deadlines as the app does not proactively surface
tasks due soon.

Let's implement a `remind` command and also display reminders at app
startup for tasks with deadlines within the next 3 days.

Specifically:
* Add RemindCommand to list deadlines due within N days (default 3).
* Wire Parser to recognize the `remind` keyword.
* Add Ui.displayMessage to standardize print-and-return outputs.
* Update Farquaad to compute and display startup reminders in CLI
  and GUI (via MainWindow.setFarquaad).

This improves usability by surfacing upcoming deadlines without the
user having to remember to query them.
be ignored, and an empty message aborts the commit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants