# Branch analysis bringing existing issues as New

**URL:** <https://community.sonarsource.com/t/branch-analysis-bringing-existing-issues-as-new/29212>\
**Category:** SonarQube Server / Community Build\
**Tags:** sonarqube\
**Created:** [August 6, 2020, 3:43pm UTC](https://community.sonarsource.com/t/branch-analysis-bringing-existing-issues-as-new/29212 "2020-08-06T15:43:34Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ankurja](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@ankurja](https://community.sonarsource.com/u/ankurja)\
**Post date:** [August 6, 2020, 3:43pm UTC](https://community.sonarsource.com/t/branch-analysis-bringing-existing-issues-as-new/29212/1 "2020-08-06T15:43:34Z")

</div>

SonarQube 7.9.1 LTS Enterprise

I am facing issues with branch analysis. There are two branches - master and dev.  
master was created by default at the start of project and after first complete scan, dev branch was created and upon creation of dev branch all existing issues from master branch were synced to dev branch (as expected).

Master branch first analysis:

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

Dev branch first analysis (after master):

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

Both branches were working fine, when suddenly dev branch started showing existing issues (which existed in master branch since day one already) as NEW and failing the Quality Gate.

Existing issues in master branch:

 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/2X/5/54854cad9f9c87960b46ffe0318b29d324f05e03.png)

Same issues reported as new in dev branch (note that this did not happen for 4 months since this branch was created and multiple scans were run, but it suddenly started showing them as NEW yesterday).

 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/2X/2/295a20d91b3135c1bc861243f87fb84dfdd03215.png)

And this of course, failed the Quality Gate on dev branch.

Can someone explain what’s going on ?

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [August 6, 2020, 5:19pm UTC](https://community.sonarsource.com/t/branch-analysis-bringing-existing-issues-as-new/29212/2 "2020-08-06T17:19:25Z")

</div>

Hi,

Your issue selection is narrowed to show only bugs. Do multiple issues exist on the lines in question? If so, this bug fixed in 7.9.2 is probably relevant, and an upgrade (to 7.9.4 😃) would fix it for you: [SONAR-12449](https://jira.sonarsource.com/browse/SONAR-12449)

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![ankurja](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@ankurja](https://community.sonarsource.com/u/ankurja)\
**Post date:** [August 6, 2020, 7:11pm UTC](https://community.sonarsource.com/t/branch-analysis-bringing-existing-issues-as-new/29212/3 "2020-08-06T19:11:01Z")

</div>

> [@ganncamp](#):
>
> Do multiple issues exist on the lines in question?

No, those 3 lines only have 1 bug each.

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

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [August 7, 2020, 2:09pm UTC](https://community.sonarsource.com/t/branch-analysis-bringing-existing-issues-as-new/29212/4 "2020-08-07T14:09:06Z")

</div>

Hi,

To be clear: one _bug_ each or one _issue_ - of any type - each? Sorry to be pedantic, but it could make a difference.

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![ankurja](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@ankurja](https://community.sonarsource.com/u/ankurja)\
**Post date:** [August 7, 2020, 3:07pm UTC](https://community.sonarsource.com/t/branch-analysis-bringing-existing-issues-as-new/29212/5 "2020-08-07T15:07:41Z")

</div>

One issue of any type. As you can see from screenshot there is no filter applied. Previous lines have code smells but the lines 996, 999, 1002 only have bugs.

---

<div class="post-metadata">

**Author:** ![dmeneses](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/dmeneses/32/2933_2.png) [@dmeneses](https://community.sonarsource.com/u/dmeneses)\
**Post date:** [August 10, 2020, 6:08pm UTC](https://community.sonarsource.com/t/branch-analysis-bringing-existing-issues-as-new/29212/7 "2020-08-10T18:08:30Z")

</div>

Were those 3 issues present in the previous analysis of the branch?  
If they were introduced into the branch as some point, it’s expected that they’ll show up as new. The fact that they exist in master doesn’t matter. The branch ‘inherits’ all issues from master in its first analysis, what happens from then on is independent from master.

---

<div class="post-metadata">

**Author:** ![ankurja](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@ankurja](https://community.sonarsource.com/u/ankurja)\
**Post date:** [August 27, 2020, 6:32pm UTC](https://community.sonarsource.com/t/branch-analysis-bringing-existing-issues-as-new/29212/8 "2020-08-27T18:32:36Z")

</div>

Found the reason for this and created a new issue [here](https://community.sonarsource.com/t/parse-error-closes-all-open-issues/30216).

The issues were always there in master branch and when develop branch was created, those issues were copied over. Later develop branch reported a parsing error due to code changes made in that file and because of parse error, SonarQube closed all existing issues from that file in develop branch. Later when the parsing error was fixed, those issues were reported as New.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/system/32/31083_2.png) [@system](https://community.sonarsource.com/u/system)\
**Post date:** [September 3, 2020, 6:32pm UTC](https://community.sonarsource.com/t/branch-analysis-bringing-existing-issues-as-new/29212/9 "2020-09-03T18:32:38Z")

</div>

Closed on September 3, 2020, 6:32pm UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
