# Code coverage is calculated after exclusion for web projects (javascript/typscript) in sonar cloud

**URL:** <https://community.sonarsource.com/t/code-coverage-is-calculated-after-exclusion-for-web-projects-javascript-typscript-in-sonar-cloud/104523>\
**Category:** SonarQube Cloud\
**Tags:** typescript, javascript, sonarqube-cloud, coverage\
**Created:** [November 16, 2023, 4:18pm UTC](https://community.sonarsource.com/t/code-coverage-is-calculated-after-exclusion-for-web-projects-javascript-typscript-in-sonar-cloud/104523 "2023-11-16T16:18:12Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rohith0003](https://avatars.discourse-cdn.com/v4/letter/r/8e8cbc/32.png) [@rohith0003](https://community.sonarsource.com/u/rohith0003)\
**Post date:** [November 16, 2023, 4:18pm UTC](https://community.sonarsource.com/t/code-coverage-is-calculated-after-exclusion-for-web-projects-javascript-typscript-in-sonar-cloud/104523/1 "2023-11-16T16:18:12Z")

</div>

Hi,

We have configured some of the files and folders in the sonar cloud code coverage exclusions after exclusion also we are seeing the % is being calculated from those files and folders.

Any help on this existing issue would surge the code coverage % on sonar.

Thanks.

---

<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:** [November 20, 2023, 3:03pm UTC](https://community.sonarsource.com/t/code-coverage-is-calculated-after-exclusion-for-web-projects-javascript-typscript-in-sonar-cloud/104523/2 "2023-11-20T15:03:20Z")

</div>

Hey there.

I think you’ll need to provide some file paths you expect to be excluded, and the exclusions settings you tried setting (that don’t have the desired effect)

---

<div class="post-metadata">

**Author:** ![rohith0003](https://avatars.discourse-cdn.com/v4/letter/r/8e8cbc/32.png) [@rohith0003](https://community.sonarsource.com/u/rohith0003)\
**Post date:** [November 21, 2023, 1:11pm UTC](https://community.sonarsource.com/t/code-coverage-is-calculated-after-exclusion-for-web-projects-javascript-typscript-in-sonar-cloud/104523/3 "2023-11-21T13:11:24Z")

</div>

Hi @Colin ,

You are correct we have added those exclusions in the sonar.coverage.exclusions manually as we using standalone scanner for analysis via azure pipeline we are configuring all of them manually.

Let me know if you need additional information.

Thanks.

---

<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:** [November 22, 2023, 2:55pm UTC](https://community.sonarsource.com/t/code-coverage-is-calculated-after-exclusion-for-web-projects-javascript-typscript-in-sonar-cloud/104523/4 "2023-11-22T14:55:34Z")

</div>

Uh… right here! 😃

> [@Colin](#):
>
> I think you’ll need to provide **some file paths you expect to be excluded** , and the exclusions settings you tried setting (that don’t have the desired effect)

I’m talking about the sepcific values of the exclusion settings.

---

<div class="post-metadata">

**Author:** ![rohith0003](https://avatars.discourse-cdn.com/v4/letter/r/8e8cbc/32.png) [@rohith0003](https://community.sonarsource.com/u/rohith0003)\
**Post date:** [November 22, 2023, 3:55pm UTC](https://community.sonarsource.com/t/code-coverage-is-calculated-after-exclusion-for-web-projects-javascript-typscript-in-sonar-cloud/104523/5 "2023-11-22T15:55:34Z")

</div>

![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/a/d/ad218d8cdb12aa3150d5f0360e974539a1e0cb3d.png)

 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/f/a/fa46967077dfeae8f4450a63b8bdc99b071f8c09.png)  
 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/c/b/cb495666a4f357faa61917a31a66f9fff6737257.png)  
 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/2/6/2695c34cc00858736c04955009f7651c1101afa4.png)

@Colin , please find the exclusions list and screenshots above

Let me know if you need more information…

---

<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:** [November 22, 2023, 4:03pm UTC](https://community.sonarsource.com/t/code-coverage-is-calculated-after-exclusion-for-web-projects-javascript-typscript-in-sonar-cloud/104523/6 "2023-11-22T16:03:45Z")

</div>

I still can’t still your full filepaths.

Have you tried putting a folder wildcard before your exclusion? Like: ` **/src/guards/** /*`?

Remember you need to trigger a new analysis for the exclusions to take effect.

---

<div class="post-metadata">

**Author:** ![rohith0003](https://avatars.discourse-cdn.com/v4/letter/r/8e8cbc/32.png) [@rohith0003](https://community.sonarsource.com/u/rohith0003)\
**Post date:** [November 22, 2023, 5:33pm UTC](https://community.sonarsource.com/t/code-coverage-is-calculated-after-exclusion-for-web-projects-javascript-typscript-in-sonar-cloud/104523/7 "2023-11-22T17:33:52Z")

</div>

Yes i tried in multiple ways but the result is same , please find on the screenshot below with clear path, let me know if you need additional information.

 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/a/c/aca1941a8e40082f0b4cdba7cd9e151ce4197ef9.png)
