Sonar cloud code coverage saying partially covered by tests, however there are no conditions on that line

Viewed 791

In sonar cloud code coverage, the sonar is displaying the following error on the highlighted code line

Partially covered by tests (8 of 10 conditions).

deleteCostGroupInternal(cost: CostItemViewModel){
    this.itemsValue.splice(this.itemsValue.indexOf(cost), 1);
    if (!this.itemsValue.find(c => c.costType.id === cost.costType.id)) {
        **cost.costGroup.deleteCostType(cost.costType.id);**
    }
    if (!this.itemsValue.find(c => c.costGroup.id === cost.costGroup.id)) {
        this.costGroupsValue.delete(cost.costGroup.id);
    }
    this.changeSubject.next();
}

As can be seen in the code there are no conditions on that line. Can somebody please tell which conditions sonar cloud might referring to? I have scratched my head for too much time already and found no solution. My pull request is blocked due to this silly issue.

0 Answers
Related