# Two files flagged up in scan results and coverage not being reported

**URL:** <https://community.sonarsource.com/t/two-files-flagged-up-in-scan-results-and-coverage-not-being-reported/69161>\
**Category:** SonarQube Cloud\
**Tags:** coverage\
**Created:** [August 2, 2022, 6:56pm UTC](https://community.sonarsource.com/t/two-files-flagged-up-in-scan-results-and-coverage-not-being-reported/69161 "2022-08-02T18:56:06Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![RCheesley](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/rcheesley/32/29722_2.png) [@RCheesley](https://community.sonarsource.com/u/RCheesley)\
**Post date:** [August 2, 2022, 6:56pm UTC](https://community.sonarsource.com/t/two-files-flagged-up-in-scan-results-and-coverage-not-being-reported/69161/1 "2022-08-02T18:56:06Z")

</div>

- **ALM used** GitHub
- **CI system used** GitHub Actions
- **Scanner command used when applicable** See [mautic/sonar.yml at 4.x · RCheesley/mautic · GitHub](https://github.com/RCheesley/mautic/blob/4.x/.github/workflows/sonar.yml#L82)
- **Languages of the repository** PHP
- **Only if the SonarCloud project is public, the URL** [https://sonarcloud.io/summary/new\_code?id=RCheesley\_mautic&pullRequest=13](https://sonarcloud.io/summary/new_code?id=RCheesley_mautic&pullRequest=13)
  - **And if you need help with pull request decoration, then the URL to the PR too** [Sonarcloud scan · RCheesley/mautic@eef7501 · GitHub](https://github.com/RCheesley/mautic/runs/7638207286?check_suite_focus=true)

- Error observed (wrap logs/code around with triple quotes ``` for proper formatting)

```auto
INFO: Importing /github/workspace/clover.xml

[141](https://github.com/RCheesley/mautic/runs/7638207286?check_suite_focus=true#step:12:142)WARN: Failed to resolve 2 file path(s) in PHPUnit coverage clover.xml report. Nothing is imported related to file(s): /github/workspace//app/bundles/CoreBundle/Helper/EmojiMap/UnicodeToHtmlEmojiMap.php;/github/workspace//app/bundles/CoreBundle/Templating/Helper/MautibotHelper.php

```

Hi folks!

Struggling to get the code coverage report (from Codecov) to be used in the SonarCloud scan correctly - this error is being thrown in the logs (check the actions log: [Sonarcloud scan · RCheesley/mautic@eef7501 · GitHub](https://github.com/RCheesley/mautic/runs/7638207286?check_suite_focus=true)).

The PR is here: [Mautic sonar by RCheesley · Pull Request #13 · RCheesley/mautic · GitHub](https://github.com/RCheesley/mautic/pull/13/files)

Working on the guidance in this post: [How to use SonarCloud with a forked repository on GitHub? - #34 by RCheesley](https://community.sonarsource.com/t/how-to-use-sonarcloud-with-a-forked-repository-on-github/7363/34) to get it working on forked PRs.

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [August 3, 2022, 5:50am UTC](https://community.sonarsource.com/t/two-files-flagged-up-in-scan-results-and-coverage-not-being-reported/69161/2 "2022-08-03T05:50:57Z")

</div>

I’m going to take a guess (without seeing the actual coverage report) and say that SonarCloud doesn’t like the double `/` in the file paths (`//app/`). Do other files in the coverage report have this as well?

---

<div class="post-metadata">

**Author:** ![RCheesley](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/rcheesley/32/29722_2.png) [@RCheesley](https://community.sonarsource.com/u/RCheesley)\
**Post date:** [August 3, 2022, 8:15am UTC](https://community.sonarsource.com/t/two-files-flagged-up-in-scan-results-and-coverage-not-being-reported/69161/3 "2022-08-03T08:15:22Z")

</div>

It’s a bit strange because the log literally just highlights those two files - nothing else. I would have expected to have a giant list of every PHP file if there was a syntax error?

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [August 3, 2022, 8:29am UTC](https://community.sonarsource.com/t/two-files-flagged-up-in-scan-results-and-coverage-not-being-reported/69161/4 "2022-08-03T08:29:39Z")

</div>

Which is why I would check this:

> [@Colin](#):
>
> Do other files in the coverage report have this as well?

---

<div class="post-metadata">

**Author:** ![RCheesley](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/rcheesley/32/29722_2.png) [@RCheesley](https://community.sonarsource.com/u/RCheesley)\
**Post date:** [August 3, 2022, 8:53am UTC](https://community.sonarsource.com/t/two-files-flagged-up-in-scan-results-and-coverage-not-being-reported/69161/5 "2022-08-03T08:53:46Z")

</div>

Sorry I thought I had explained that it only seems to be affecting these two files, from what I can tell from the output:

 ![Sonarcloud scan · RCheesley_mautic@eef7501](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/a/2/a2a97334b0952ba21fd655a39e930a6dfc384516.png)

however I am very new to Sonar and relatively new to creating GitHub Actions!

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [August 3, 2022, 9:21am UTC](https://community.sonarsource.com/t/two-files-flagged-up-in-scan-results-and-coverage-not-being-reported/69161/6 "2022-08-03T09:21:54Z")

</div>

My point is really the coverage report that is being produced in previous steps (the _clover.xml_ file ultimately being imported). Does that file contain the odd file paths (with the `//` oddity) or only those two files?

---

<div class="post-metadata">

**Author:** ![RCheesley](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/rcheesley/32/29722_2.png) [@RCheesley](https://community.sonarsource.com/u/RCheesley)\
**Post date:** [August 3, 2022, 9:36am UTC](https://community.sonarsource.com/t/two-files-flagged-up-in-scan-results-and-coverage-not-being-reported/69161/7 "2022-08-03T09:36:35Z")

</div>

Ahh, gotcha!

Here is the file:

[code-coverage-report (1).zip](https://community.sonarsource.com/uploads/short-url/dxXGLTR9N20BZMGPuzIHZuVNvvS.zip) (544.6 KB)

Seems to be as expected, cannot see any reference to the //app path in the file?

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [August 3, 2022, 9:49am UTC](https://community.sonarsource.com/t/two-files-flagged-up-in-scan-results-and-coverage-not-being-reported/69161/8 "2022-08-03T09:49:54Z")

</div>

Is that file from before or after the `sed` command in your action manipulates it?

 ![Screenshot 2022-08-03 at 11.49.40](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/0/d/0d86381efa228f2791c461978fcdf0453abb1853.png)

---

<div class="post-metadata">

**Author:** ![RCheesley](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/rcheesley/32/29722_2.png) [@RCheesley](https://community.sonarsource.com/u/RCheesley)\
**Post date:** [August 3, 2022, 10:01am UTC](https://community.sonarsource.com/t/two-files-flagged-up-in-scan-results-and-coverage-not-being-reported/69161/9 "2022-08-03T10:01:55Z")

</div>

I downloaded that file from the GitHub Actions workflow where it is generated. The sed command moves it into the container as otherwise it was not getting picked up at all (ref this thread: [Code coverage doesn't work with GitHub action - #7 by sylfabre](https://community.sonarsource.com/t/code-coverage-doesnt-work-with-github-action/16747/7))

I am not sure how to grab the actual file from that stage in the workflow - it was working in a run I did before:

![Re_ RCheesley_mautic Mautic sonar (PR #13) - ruth.cheesley@acquia.com - Acquia, Inc. Mail](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/9/0/90344a596bf4f80c7c99a03aeef4c19f8f3c1304.png)

However that was covering the whole repo rather than just the changes in this PR - when I fixed the scm setting (ref: [How to start the scanner from now and not pick up all existing issues? - #8 by RCheesley](https://community.sonarsource.com/t/how-to-start-the-scanner-from-now-and-not-pick-up-all-existing-issues/68166/8)) it seemed to stop working (can’t seem to find historical runs in the SonarCloud IU).

---

<div class="post-metadata">

**Author:** ![RCheesley](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/rcheesley/32/29722_2.png) [@RCheesley](https://community.sonarsource.com/u/RCheesley)\
**Post date:** [September 19, 2022, 1:04pm UTC](https://community.sonarsource.com/t/two-files-flagged-up-in-scan-results-and-coverage-not-being-reported/69161/10 "2022-09-19T13:04:24Z")

</div>

Any ideas on this @Colin ? Would be awesome to get it up and running!
