Skip to content

Commit

Permalink
Merge pull request #18 from nomoixyz/fix-issues-sorting
Browse files Browse the repository at this point in the history
fix: fix issues sorting
  • Loading branch information
gnkz authored Jan 11, 2023
2 parents 37d2d45 + a6dfab7 commit c47e4d8
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,36 +121,36 @@ export class Formatter {
}

private sortIssues(issueA: ParsedIssue, issueB: ParsedIssue): number {
if (!issueA.impact) {
if (issueA.impact == undefined) {
return -1;
}

if (!issueB.impact) {
if (issueB.impact == undefined) {
return 1;
}

if (issueA.impact > issueB.impact) {
return 1;
return -1;
}

if (issueB.impact > issueA.impact) {
return -1;
return 1;
}

if (!issueA.likelihood) {
if (issueA.likelihood == undefined) {
return -1;
}

if (!issueB.likelihood) {
if (issueB.likelihood == undefined) {
return 1;
}

if (issueA.likelihood > issueB.likelihood) {
return 1;
return -1;
}

if (issueB.likelihood > issueA.likelihood) {
return -1;
return 1;
}

return 0;
Expand Down

0 comments on commit c47e4d8

Please sign in to comment.