Skip to content
This repository has been archived by the owner on Apr 11, 2021. It is now read-only.

Release v0.4.0 #27

Merged
merged 8 commits into from
Dec 10, 2018
Merged

Release v0.4.0 #27

merged 8 commits into from
Dec 10, 2018

Conversation

stachu540
Copy link
Collaborator

No description provided.


public class VideoService extends AbstractHttpService {
public VideoService(GlitchHelix helix) {
super(helix.getClient(), helix.getHttpClient());
}

public VideoRequest getVideos(Long... id) {
HttpRequest<Videos> request = get("/videos", Videos.class);
Copy link

Choose a reason for hiding this comment

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

Define a constant instead of duplicating this literal "/videos" 3 times.


// TODO
public void createStreamMarker() {
throw new UnsupportedOperationException("Stream Markers is not supported yet");
Copy link

Choose a reason for hiding this comment

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

Define a constant instead of duplicating this literal "Stream Markers is not supported yet" 3 times.

}

@Override
protected HttpResponse<Clips> exchange() {
Copy link

Choose a reason for hiding this comment

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

Refactor this method to reduce its Cognitive Complexity from 17 to the 15 allowed.


public class UserService extends AbstractHttpService {
public UserService(GlitchHelix helix) {
super(helix.getClient(), helix.getHttpClient());
}

public Flux<User> getUsersById(@Nullable Credential credential, Long... id) {
HttpRequest<UserList> users = get("/users", UserList.class);
Copy link

Choose a reason for hiding this comment

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

Define a constant instead of duplicating this literal "/users" 3 times.


if (credential != null) {
if (checkRequiredScope(credential.getScopes(), Scope.USER_READ_EMAIL)) {
users.header("Authorization", "Bearer " + credential.getAccessToken());
Copy link

Choose a reason for hiding this comment

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

Define a constant instead of duplicating this literal "Authorization" 5 times.

@codeclimate
Copy link

codeclimate bot commented Dec 10, 2018

Code Climate has analyzed commit 21f21a4 and detected 24 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 9
Duplication 10
Clarity 5

Note: there are 6 critical issues.

View more on Code Climate.

@stachu540 stachu540 merged commit c6b6c26 into master Dec 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant