Skip to content

Commit

Permalink
refactor: . Simplify an if statement, to finish reducing of complexity
Browse files Browse the repository at this point in the history
SonarCloud pointed out that in obsidian-tasks-group#3003 I had increased the complexity in
Task.identicalTo() from 15 to 16.

By this change, and extracting Task.recurrenceIdenticalTo() it should have dropped
to below 15 now.
  • Loading branch information
claremacrae committed Aug 2, 2024
1 parent d0c518b commit 54cc3c7
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/Task/Task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -868,11 +868,7 @@ export class Task extends ListItem {
return false;
}

if (!this.file.rawFrontmatterIdenticalTo(other.file)) {
return false;
}

return true;
return this.file.rawFrontmatterIdenticalTo(other.file);
}

private recurrenceIdenticalTo(other: Task) {
Expand Down

0 comments on commit 54cc3c7

Please sign in to comment.