# Coverage report for file is not showing a few select lines as code, even though they are in the gcov data

**URL:** <https://community.codecov.com/t/coverage-report-for-file-is-not-showing-a-few-select-lines-as-code-even-though-they-are-in-the-gcov-data/2686>\
**Category:** Support\
**Created:** [March 26, 2021, 11:10am UTC](https://community.codecov.com/t/coverage-report-for-file-is-not-showing-a-few-select-lines-as-code-even-though-they-are-in-the-gcov-data/2686 "2021-03-26T11:10:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fingolfin](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/fingolfin/32/274_2.png) [@fingolfin](https://community.codecov.com/u/fingolfin)\
**Post date:** [March 26, 2021, 11:10am UTC](https://community.codecov.com/t/coverage-report-for-file-is-not-showing-a-few-select-lines-as-code-even-though-they-are-in-the-gcov-data/2686/1 "2021-03-26T11:10:30Z")

</div>

### Description

A coverage report for a C file shows mostly reasonable results. However, a few lines which are clearly code that must have been executed are shown in white, not in green. Yet the gcov data includes them. Soo Codecov seemingly randomly skips some lines in its display.

### Commit SHAs

E.g. ff4358f9ab0d01e8e194b2651d62ee6bbd985fed

### Repository

> **[GitHub - gap-system/gap: Main development repository for GAP - Groups,...](https://github.com/gap-system/gap/)**
>
> Main development repository for GAP - Groups, Algorithms, Programming, a System for Computational Discrete Algebra

### CI/CD or Build URL

> <https://github.com/gap-system/gap/pull/4346/checks>
>
> See the discussion at https://github.com/gap-system/gap/pull/4342 for details.
> …
> Not sure if this will work, we'll see.

### Uploader

We are using the bash uploader, i.e., [https://codecov.io/bash](https://codecov.io/bash)

### Codecov Output

If you really need this, I guess we can extract it from the GitHub Action CI logs above (but there are like … 18 or so ?)

### Expected Results

For [file src/io.c, line 859](https://codecov.io/gh/gap-system/gap/src/ff4358f9ab0d01e8e194b2651d62ee6bbd985fed/src/io.c#L859) should be shown in green.

### Actual Results

It is shown in white, i.e. not even as uncovered code. Moreover, inspecting the gcov uploads for that commit, e.g. [this](https://codecov.io/api/gh/gap-system/gap/download/build?path=v4/raw/2021-03-26/712259976B241FD8DBFC5D3156298643/ff4358f9ab0d01e8e194b2651d62ee6bbd985fed/9a1a50fc-0f1a-42fb-a23c-61e08449f27f.txt), the line is clearly reported as being covered. Here is an excerpt of the relevant part, I marked the relevant line

```auto
...
# path=src#io.c.gcov.reduced
        -: 0:Source:src/io.c
func
#####:105:
73289723:107:
func
#####:110:
...
34:836:
34:839:
func
#####:851:
#####:853:
branch 0 never executed::
branch 1 never executed::
call 2 never executed::
#####:856:
#####:857:
#####:858:
#####:859: <--- this is the line, reported as covered code like all before and after
#####:860:
#####:861:
#####:862:
#####:863:
#####:864:
#####:867:
#####:870:
func
29:891:
...

```

There are more examples in that file, e.g. line 1133, 1196, 1197, 1220

### Additional Information

None.

---

<div class="post-metadata">

**Author:** ![tom](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/tom/32/8_2.png) [@tom](https://community.codecov.com/u/tom)\
**Post date:** [March 29, 2021, 9:57pm UTC](https://community.codecov.com/t/coverage-report-for-file-is-not-showing-a-few-select-lines-as-code-even-though-they-are-in-the-gcov-data/2686/2 "2021-03-29T21:57:20Z")

</div>

@fingolfin I think there might be a file name collision happening. What happens if you run with `-X fix`?

---

<div class="post-metadata">

**Author:** ![fingolfin](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/fingolfin/32/274_2.png) [@fingolfin](https://community.codecov.com/u/fingolfin)\
**Post date:** [March 30, 2021, 10:35am UTC](https://community.codecov.com/t/coverage-report-for-file-is-not-showing-a-few-select-lines-as-code-even-though-they-are-in-the-gcov-data/2686/3 "2021-03-30T10:35:35Z")

</div>

There definitely is a filename collision; there are several files called `io.c` involved, but we only care about one. We’ve been fighting with this over the years, and in the end the only way I found to get Codecov to ignore all those other files was to make sure they are built without coverage tracking turned on (which requires quite some hacking on our side).

Among the things we tried was to add exclude the directories with the “bad” files via `.codecov.yml`, like this:

```auto
ignore:
 - "extern"
 - "hpcgap/extern"
 - "tst"
 - "pkg"
 - "grp/*.grp"

```

But that didn’t work. We also invoke `codecov.sh` like this, but it doesn’t seem to do anything either: `./codecov.sh -f '!./pkg/*' -f '!./extern/*' -f '!./build/*'`.

I’ll try the `-X fix` you suggest, though I wonder what it does? The description on [Fixing Reports](https://docs.codecov.io/docs/fixing-reports) is … not helpful. It lists some factoids about various languages, but doesn’t actually say what it “fixes” about them. Also, there seem to be some markdown and/or rendering issues on that page.

---

<div class="post-metadata">

**Author:** ![tom](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/tom/32/8_2.png) [@tom](https://community.codecov.com/u/tom)\
**Post date:** [April 6, 2021, 8:37pm UTC](https://community.codecov.com/t/coverage-report-for-file-is-not-showing-a-few-select-lines-as-code-even-though-they-are-in-the-gcov-data/2686/4 "2021-04-06T20:37:30Z")

</div>

Apologies, I meant `-X network`. Sorry for the confusion, your instincts were right.
