-
Notifications
You must be signed in to change notification settings - Fork 0
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
Review Task 1 #1
base: master
Are you sure you want to change the base?
Conversation
} | ||
|
||
/** | ||
* Adds a text comment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nadmiarowy komentarz
} | ||
} | ||
|
||
// public void addVideoComment(File videoFile) throws CommentNotAddedException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pozostałości w komentarzach
return this.comments; | ||
} | ||
|
||
public boolean hasConversation() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metoda nie tylko zwraca warunek, ale robi też coś pobocznego - "markConversation"
addLineContent(syntaxColor); | ||
} | ||
|
||
public int get() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metoda nie mówi, co właściwie pobieramy
* @param recordedFile | ||
* @throws CommentNotAddedException | ||
*/ | ||
public void createVoiceComment(File recodedFile) throws CommentNotAddedException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistency of naming - tutaj mamy create, wcześniej add.
Comment voiceComment = new Comment(AbstractComment.Type.VOICE, this); | ||
voiceComment.setFile(recodedFile); | ||
comments.add(voiceComment); | ||
if (comments.size() > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplikacja kodu - może warto wyłuskać nową metodę?
@SuppressLint("ViewConstructor") | ||
public class Line extends LinearLayout implements Serializable { | ||
private static final long serialVersionUID = 3076583280108678995L; | ||
private static final int TWO = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Brak spójności nazewnictwa zmiennych prywatnych
// } | ||
|
||
private void addLineContent(boolean syntaxColor){ | ||
if (!syntaxColor || !SyntaxHighlighter.canBeHighlighted(syntaxColor)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Warunek w ifie można uczynić bardziej czytelnym przenosząc go to osobnej metody. Dodatkowo mamy "negative condition" oraz metodę z booleanem w argumentach - można zrobić dwa osobne przypadki - addLineContentWithSyntaxColour i druga without syntax.
Find as many defects and problems as possible!