gaelcolas / gaelcolas/Sampler

`Merge-JaCoCoReport`: Calculates hit count correctly?

Open
#392 0 comments 0 reactions 0 assignees View on GitHub
discussion
Dominant language
PowerShell
Stars
243
Forks
46
Avg merge
1h 41m
Merged PRs (30d)
1

Description

### Problem description

Currently the hit count is overwritten when the merge document's `` has a hit count higher than the original document's ``:

https://github.com/gaelcolas/Sampler/blob/02cc8da49a8d837f48c167db56c1ace18fdb5bef/Sampler/Public/Merge-JaCoCoReport.ps1#L89-L96

But shouldn't the hit count of the merge document be added to the count of the original document?

Example:
```
Original ci = 1
Merge ci = 2

Result: 3
```
And shouldn't it always add to the hit count, not just when original line is less than the merge line?

Example:
```
Original ci = 1
Merge ci = 1

Result: 2
```

This is also true for missed hit count that can be more than 1.

Example from the project SqlServerDsc and the DSC resource SqlAg (DSC_SqlAg.psm1):

```

```

### Verbose logs

```text
n/a
```

### How to reproduce

I possible to create a unit tests that shows that hit count is overwritten.

### Expected behavior

Uncertain how hit count should be calculated so I opened this issue for future improvement.

### Current behavior

Current behavior could be correct, but feels wrong.

### Suggested solution

Uncertain how hit count should be calculated so I opened this issue for future improvement.

### Operating system the target node is running

```text
n/a
```

### PowerShell version and build the target node is running

```text
n/a
```

### Module version used

```text
0.115.0
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.