You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@zzkzzzz 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.
publicvoidstart(Stagestage) {
//Step 1. Setting up required components//The container for the content of the chat to scroll.scrollPane = newScrollPane();
dialogContainer = newVBox();
scrollPane.setContent(dialogContainer);
userInput = newTextField();
sendButton = newButton();
AnchorPanemainLayout = newAnchorPane();
mainLayout.getChildren().addAll(scrollPane, userInput, sendButton);
scene = newScene(mainLayout);
stage.setScene(scene);
stage.show();
//Step 2. Formatting the window to look as expectedstage.setTitle("Meep");
stage.setResizable(false);
stage.setMinHeight(6000.0);
stage.setMinWidth(400.0);
mainLayout.setPrefSize(400.0, 600.0);
scrollPane.setPrefSize(385, 535);
scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.ALWAYS);
scrollPane.setVvalue(1.0);
scrollPane.setFitToWidth(true);
// You will need to import `javafx.scene.layout.Region` for this.dialogContainer.setPrefHeight(Region.USE_COMPUTED_SIZE);
userInput.setPrefWidth(325.0);
sendButton.setPrefWidth(55.0);
AnchorPane.setTopAnchor(scrollPane, 1.0);
AnchorPane.setBottomAnchor(sendButton, 1.0);
AnchorPane.setRightAnchor(sendButton, 1.0);
AnchorPane.setLeftAnchor(userInput, 1.0);
AnchorPane.setBottomAnchor(userInput, 1.0);
//Step 3. Add functionality to handle user input.sendButton.setOnMouseClicked((event) -> {
dialogContainer.getChildren().add(getDialogLabel(userInput.getText()));
userInput.clear();
});
userInput.setOnAction((event) -> {
dialogContainer.getChildren().add(getDialogLabel(userInput.getText()));
userInput.clear();
});
//Scroll down to the end every time dialogContainer's height changes.dialogContainer.heightProperty().addListener((observable) -> scrollPane.setVvalue(1.0));
//Part 3. Add functionality to handle user input.sendButton.setOnMouseClicked((event) -> {
handleUserInput();
});
userInput.setOnAction((event) -> {
handleUserInput();
});
}
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.
/** * Read task date file. * * @param path the path of the file. * @return the list of tasks. * @throws IOException If the file path is invalid. * @throws InvalidInputException If the datetime format is invalid. */
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 cs2103@comp.nus.edu.sg if you want to follow up on this post.
The text was updated successfully, but these errors were encountered:
@zzkzzzz 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/test/java/meep/storage/StorageTest.java
lines37-37
://String filePath = "/src/test/java/Meep/test.txt";
Example from
src/test/java/meep/storage/StorageTest.java
lines38-38
://String home = System.getProperty("user.dir");
Example from
src/test/java/meep/storage/StorageTest.java
lines39-39
://String path = home + filePath;
Suggestion: Remove dead code from the codebase.
Aspect: Method Length
Example from
src/main/java/meep/parser/Parser.java
lines136-217
:Example from
src/main/java/meep/ui/Gui.java
lines54-129
: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/meep/commands/Command.java
lines18-23
:Example from
src/main/java/meep/storage/Storage.java
lines72-79
:Example from
src/main/java/meep/task/Task.java
lines52-54
: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
cs2103@comp.nus.edu.sg
if you want to follow up on this post.The text was updated successfully, but these errors were encountered: