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

Review Task 1 #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Review Task 1 #1

wants to merge 1 commit into from

Conversation

fracz
Copy link

@fracz fracz commented Mar 27, 2020

Find as many defects and problems as possible!

}

/**
* Adds a text comment.
Copy link
Owner

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 {
Copy link
Owner

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() {
Copy link
Owner

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() {
Copy link
Owner

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 {
Copy link
Owner

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) {
Copy link
Owner

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;
Copy link
Owner

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))
Copy link
Owner

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.

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.

2 participants