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

Commit

Permalink
fix(repository): #1493 formating
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiejaoude committed Sep 12, 2019
1 parent 1da7874 commit ba98e83
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions functions/src/mappers/github/repository.mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ export interface GitHubRepositoryModel {
milestones?: GitHubMilestoneModel[];
updatedAt: firestore.Timestamp;
webhook?: GitHubRepositoryWebhookModel;
forksCount: number,
stargazersCount: number,
watchersCount: number,
forksCount: number;
stargazersCount: number;
watchersCount: number;
}

export class GitHubRepositoryMapper {
Expand Down
2 changes: 2 additions & 0 deletions web/src/app/core/services/repository.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export class RepositoryService {

public getRating(repo: RepositoryModel): number {
const checks: number[] = [];

checks.push(repo.issues.length > 0 ? this.getPoints(repo.issues[0].createdOn.toDate()) : 0);
checks.push(repo.releases.length > 0 ? this.getPoints(repo.releases[0].createdOn.toDate()) : 0);
checks.push(repo.milestones.length > 0 ? this.getPoints(new Date(repo.milestones[0].updatedAt)) : 0);
Expand All @@ -63,6 +64,7 @@ export class RepositoryService {
checks.push(repo.forksCount ? this.getPointsByCount(repo.forksCount, 50) : 0);
checks.push(repo.stargazersCount ? this.getPointsByCount(repo.stargazersCount, 100) : 0);
checks.push(repo.watchersCount ? this.getPointsByCount(repo.watchersCount, 25) : 0);

return checks.reduce((total: number, current: number) => total + current, 0) / checks.length;
}

Expand Down

0 comments on commit ba98e83

Please sign in to comment.