# \#new\_code

**URL:** https://community.sonarsource.com/tag/new-code/114.md

[Latest](https://community.sonarsource.com/latest.md) · [Categories](https://community.sonarsource.com/categories.md) · [Tags](https://community.sonarsource.com/tags.md)

---

## [All New code not detected when using Previous version](https://community.sonarsource.com/t/all-new-code-not-detected-when-using-previous-version/179655)

<div class="topic-metadata">

**Author:** [@Kennet](https://community.sonarsource.com/u/Kennet)\
**Replies:** 35\
**Last updated:** [October 5, 2026, 12:47pm UTC](https://community.sonarsource.com/t/all-new-code-not-detected-when-using-previous-version/179655 "2026-10-05T12:47:11Z")

</div>

Must-share information: SonarQube Server Enterprise Edition v2025.4.2 and Visual studio IDE Version: 9.1.0.15828. Make numbers for new code on main branch correct. setting sonar.projectVersion to $(Build.SourceVersion)…

---

## [Synchronising new code definition with the server](https://community.sonarsource.com/t/synchronising-new-code-definition-with-the-server/188899)

<div class="topic-metadata">

**Author:** [@peter-lyon1\_LSEG](https://community.sonarsource.com/u/peter-lyon1_LSEG)\
**Replies:** 2\
**Last updated:** [September 25, 2026, 11:34am UTC](https://community.sonarsource.com/t/synchronising-new-code-definition-with-the-server/188899 "2026-09-25T11:34:44Z")

</div>

Hi, I’m connected to a corporate sonarqube server. I have updated the new code defintion on my project to be reference\_branch(main). I have validated through the sonarqube API that this gets returned from the server wi…

---

## [New issue raised on unchanged code after PR merge](https://community.sonarsource.com/t/new-issue-raised-on-unchanged-code-after-pr-merge/184431)

<div class="topic-metadata">

**Author:** [@jvillalpando](https://community.sonarsource.com/u/jvillalpando)\
**Replies:** 2\
**Last updated:** [July 2, 2026, 6:12pm UTC](https://community.sonarsource.com/t/new-issue-raised-on-unchanged-code-after-pr-merge/184431 "2026-07-02T18:12:47Z")

</div>

ALM used: GitLab CI system used: TeamCity SonarQube edition: Developer Edition Scanner used: SonarScanner for .NET 11.2 Languages: Mostly C# Error observed: Hi, The develop branch was analyzed twice on the same da…

---

## [SonarQube Quality gate on new code. Fails on first attempt. Succeeds on second attempt](https://community.sonarsource.com/t/sonarqube-quality-gate-on-new-code-fails-on-first-attempt-succeeds-on-second-attempt/152423)

<div class="topic-metadata">

**Author:** [@BeBetter](https://community.sonarsource.com/u/BeBetter)\
**Replies:** 21\
**Last updated:** [January 13, 2026, 11:45am UTC](https://community.sonarsource.com/t/sonarqube-quality-gate-on-new-code-fails-on-first-attempt-succeeds-on-second-attempt/152423 "2026-01-13T11:45:19Z")

</div>

Must-share information (formatted with Markdown): SonarQube Server v2025.4.2 (112048) deployed as zip expected consistent quality gate result Our quality gate is for New-Code only. Our project has multiple branches. …

---

## [Some rules do not work in MRs/PRs decoration because of NewCode focus](https://community.sonarsource.com/t/some-rules-do-not-work-in-mrs-prs-decoration-because-of-newcode-focus/152734)

<div class="topic-metadata">

**Author:** [@aigel](https://community.sonarsource.com/u/aigel)\
**Replies:** 1\
**Last updated:** [December 22, 2025, 1:46pm UTC](https://community.sonarsource.com/t/some-rules-do-not-work-in-mrs-prs-decoration-because-of-newcode-focus/152734 "2025-12-22T13:46:02Z")

</div>

Hello everyone, I hope this message finds you all well. I wanted to bring up an important issue regarding coding rules, specifically those that apply to the entire class—such as java:S104, which states “Files should not…

---

## [New Code Analysis Scope for unusual branching](https://community.sonarsource.com/t/new-code-analysis-scope-for-unusual-branching/152403)

<div class="topic-metadata">

**Author:** [@rhartinger](https://community.sonarsource.com/u/rhartinger)\
**Replies:** 1\
**Last updated:** [November 17, 2025, 2:52pm UTC](https://community.sonarsource.com/t/new-code-analysis-scope-for-unusual-branching/152403 "2025-11-17T14:52:42Z")

</div>

We are using SonarQube Server Developer Edition (2025.1.4 LTA) and trying to analyse “New Code” of one of our projects. Our branching/versioning is a bit unusual in this project: We use Maven and set the revision dur…

---

## [SonarQube New Code Still report issues after merge to reference branch](https://community.sonarsource.com/t/sonarqube-new-code-still-report-issues-after-merge-to-reference-branch/73756)

<div class="topic-metadata">

**Author:** [@slindqvist](https://community.sonarsource.com/u/slindqvist)\
**Replies:** 5\
**Last updated:** [August 7, 2025, 2:12am UTC](https://community.sonarsource.com/t/sonarqube-new-code-still-report-issues-after-merge-to-reference-branch/73756 "2025-08-07T02:12:07Z")

</div>

Must-share information (formatted with Markdown): SonarQube version 9.5 Setup New code in the format “reference: develop”. Merged feature branch into the develop branch. Did not expect to see issues in new code that al…

---

## [New code analysis not working in both VSCode and Eclipse sonarqube for IDE](https://community.sonarsource.com/t/new-code-analysis-not-working-in-both-vscode-and-eclipse-sonarqube-for-ide/144037)

<div class="topic-metadata">

**Author:** [@Madhubalan-p](https://community.sonarsource.com/u/Madhubalan-p)\
**Replies:** 1\
**Last updated:** [July 17, 2025, 1:49pm UTC](https://community.sonarsource.com/t/new-code-analysis-not-working-in-both-vscode-and-eclipse-sonarqube-for-ide/144037 "2025-07-17T13:49:36Z")

</div>

Operating system: Windows 11 IDE name and version: Eclipse, IBm developer for zOS 17.0.2 SonarQube for Eclipse plugin version: 11.11 sonarsource.sonarlint-vscode: 4.26.0 Programming language you’re coding in: COBOL Is c…

---

## [Feature Request: New Color Scheme with More Contrast in PR Analysis](https://community.sonarsource.com/t/feature-request-new-color-scheme-with-more-contrast-in-pr-analysis/112968)

<div class="topic-metadata">

**Author:** [@lorant-csonka](https://community.sonarsource.com/u/lorant-csonka)\
**Replies:** 4\
**Last updated:** [July 8, 2025, 3:01pm UTC](https://community.sonarsource.com/t/feature-request-new-color-scheme-with-more-contrast-in-pr-analysis/112968 "2025-07-08T15:01:38Z")

</div>

Dear SonarCloud Community, I am writing to request a new color scheme with more contrast for PR analysis. I have noticed that on some external displays the colors used to mark “new code” are not contrasted enough agains…

---

## [How does SonarQube Community Edition determine “New Code” when scanning different SVN branches with](https://community.sonarsource.com/t/how-does-sonarqube-community-edition-determine-new-code-when-scanning-different-svn-branches-with/143770)

<div class="topic-metadata">

**Author:** [@MandarK](https://community.sonarsource.com/u/MandarK)\
**Replies:** 1\
**Last updated:** [July 3, 2025, 8:26am UTC](https://community.sonarsource.com/t/how-does-sonarqube-community-edition-determine-new-code-when-scanning-different-svn-branches-with/143770 "2025-07-03T08:26:11Z")

</div>

Hi Team, I’m using SonarQube Community Edition, and I’d like to clarify how it determines and tracks “New Code” in the following setup: • I run an initial scan on SVN trunk using a fixed sonar.projectKey (e.g., my-app)…

---

## [New code modification not effective](https://community.sonarsource.com/t/new-code-modification-not-effective/142177)

<div class="topic-metadata">

**Author:** [@haoran23](https://community.sonarsource.com/u/haoran23)\
**Replies:** 1\
**Last updated:** [June 4, 2025, 3:12pm UTC](https://community.sonarsource.com/t/new-code-modification-not-effective/142177 "2025-06-04T15:12:18Z")

</div>

Version: Community Build ( \* v25.5.0.107428) how is SonarQube deployed: Docker Application: jacoco + gitlab cicd, for unit test coverage info Problem: I tried to set \[New Code\] to ‘Previous version’ or 'Number of Days"…

---

## [New Code with a Maven multimodule project in SonarLint for Eclipse - Module parent paths missing](https://community.sonarsource.com/t/new-code-with-a-maven-multimodule-project-in-sonarlint-for-eclipse-module-parent-paths-missing/135155)

<div class="topic-metadata">

**Author:** [@xavilopez](https://community.sonarsource.com/u/xavilopez)\
**Replies:** 1\
**Last updated:** [February 14, 2025, 10:02am UTC](https://community.sonarsource.com/t/new-code-with-a-maven-multimodule-project-in-sonarlint-for-eclipse-module-parent-paths-missing/135155 "2025-02-14T10:02:59Z")

</div>

Please provide Operating system: Windows 11 23H2 IDE name and version: Eclipse IDE 2024-06 (4.32.0) SonarQube for Eclipse plugin version: 10.2.0.78029 Programming language you’re coding in: Java Is connected mode used:…

---

## [How to set New Code to be difference since last merge to dev branch?](https://community.sonarsource.com/t/how-to-set-new-code-to-be-difference-since-last-merge-to-dev-branch/134617)

<div class="topic-metadata">

**Author:** [@eaboyle57](https://community.sonarsource.com/u/eaboyle57)\
**Replies:** 1\
**Last updated:** [February 6, 2025, 4:09pm UTC](https://community.sonarsource.com/t/how-to-set-new-code-to-be-difference-since-last-merge-to-dev-branch/134617 "2025-02-06T16:09:18Z")

</div>

Hi there, our current branching strategy boils down to creating a branch off of dev for feature work, completing that work, then creating a PR to merge back to dev. Then, when we are preparing for a release, we merge dev…

---

## [New code definitions](https://community.sonarsource.com/t/new-code-definitions/133578)

<div class="topic-metadata">

**Author:** [@Ricardo\_Emilio\_Borto](https://community.sonarsource.com/u/Ricardo_Emilio_Borto)\
**Replies:** 2\
**Last updated:** [January 22, 2025, 2:39pm UTC](https://community.sonarsource.com/t/new-code-definitions/133578 "2025-01-22T14:39:18Z")

</div>

I use “Enterprise Edition 10.7” and In the new code, when I want an option for the definition of the new code, globally, I cannot choose the reference branch option (it does not appear among the options). I would like t…

---

## [How to identify "Condition Coverage on New Code"?](https://community.sonarsource.com/t/how-to-identify-condition-coverage-on-new-code/130628)

<div class="topic-metadata">

**Author:** [@Diego\_Froes](https://community.sonarsource.com/u/Diego_Froes)\
**Replies:** 3\
**Last updated:** [November 19, 2024, 4:58pm UTC](https://community.sonarsource.com/t/how-to-identify-condition-coverage-on-new-code/130628 "2024-11-19T16:58:51Z")

</div>

Hello everyone, good morning. When releasing a new Pull Request, submitting new code, Sonar is counting coverage of 99.7%, however, it does not inform which line of code is missing a test. Uncovered Conditions on New C…

---

## [How to get Start and end Date of applied new code period](https://community.sonarsource.com/t/how-to-get-start-and-end-date-of-applied-new-code-period/130050)

<div class="topic-metadata">

**Author:** [@suganya\_kuppusamy](https://community.sonarsource.com/u/suganya_kuppusamy)\
**Replies:** 1\
**Last updated:** [November 11, 2024, 2:10am UTC](https://community.sonarsource.com/t/how-to-get-start-and-end-date-of-applied-new-code-period/130050 "2024-11-11T02:10:14Z")

</div>

Hi Problem: I’am having many sonar projects in self hosted sonar server. I could able to get what setting applied for new code period using API (api/new\_code\_periods/show?project=name). But I want to get exact start a…

---

## [Sonar consider changed file names as "new code" and how to handle legacy code](https://community.sonarsource.com/t/sonar-consider-changed-file-names-as-new-code-and-how-to-handle-legacy-code/46884)

<div class="topic-metadata">

**Author:** [@delcorny](https://community.sonarsource.com/u/delcorny)\
**Replies:** 3\
**Last updated:** [October 23, 2024, 12:15pm UTC](https://community.sonarsource.com/t/sonar-consider-changed-file-names-as-new-code-and-how-to-handle-legacy-code/46884 "2024-10-23T12:15:37Z")

</div>

Template for a good bug report, formatted with Markdown: versions used (SonarQube, Scanner, Plugin, and any relevant extension) EE Version 8.9.1 (build 44547) error observed (wrap logs/code around triple quote \`\`\`…

---

## [Global setting override - Ignore duplication and coverage on small changes](https://community.sonarsource.com/t/global-setting-override-ignore-duplication-and-coverage-on-small-changes/127369)

<div class="topic-metadata">

**Author:** [@suganya\_kuppusamy](https://community.sonarsource.com/u/suganya_kuppusamy)\
**Replies:** 1\
**Last updated:** [October 7, 2024, 8:44am UTC](https://community.sonarsource.com/t/global-setting-override-ignore-duplication-and-coverage-on-small-changes/127369 "2024-10-07T08:44:11Z")

</div>

Hi, We have setting to ON/OFF for Ignore duplication and coverage on small changes We can do this in 2 ways: global settings: Administration \> General \>Ignore duplication and coverage on small changes project setting…

---

## [Sonarqube is not detecting new-code correctly](https://community.sonarsource.com/t/sonarqube-is-not-detecting-new-code-correctly/120263)

<div class="topic-metadata">

**Author:** [@LakeWorthB](https://community.sonarsource.com/u/LakeWorthB)\
**Replies:** 33\
**Last updated:** [August 26, 2024, 12:45pm UTC](https://community.sonarsource.com/t/sonarqube-is-not-detecting-new-code-correctly/120263 "2024-08-26T12:45:12Z")

</div>

Must-share information (formatted with Markdown): which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension) v9.9.6 (build 92038) how is SonarQube deployed: Docker I have new code as specif…

---

## [Sonarqube quality gate new code passes if re-run failed build](https://community.sonarsource.com/t/sonarqube-quality-gate-new-code-passes-if-re-run-failed-build/112662)

<div class="topic-metadata">

**Author:** [@Rupesh\_Bovalekar](https://community.sonarsource.com/u/Rupesh_Bovalekar)\
**Replies:** 3\
**Last updated:** [August 6, 2024, 12:16pm UTC](https://community.sonarsource.com/t/sonarqube-quality-gate-new-code-passes-if-re-run-failed-build/112662 "2024-08-06T12:16:08Z")

</div>

I have a Jenkins pipeline set up to trigger a SonarQube analysis for every build. The pipeline works as expected, failing the build if the quality gate is not passed. However, I noticed that if I rerun the build without …

---

## [Code Smell on user branch gets flagged as a bug on main branch once merged](https://community.sonarsource.com/t/code-smell-on-user-branch-gets-flagged-as-a-bug-on-main-branch-once-merged/118167)

<div class="topic-metadata">

**Author:** [@Priyanka-Kotturi](https://community.sonarsource.com/u/Priyanka-Kotturi)\
**Replies:** 9\
**Last updated:** [July 30, 2024, 8:08am UTC](https://community.sonarsource.com/t/code-smell-on-user-branch-gets-flagged-as-a-bug-on-main-branch-once-merged/118167 "2024-07-30T08:08:04Z")

</div>

Hi Sometimes code smell on a user branch gets flagged as a bug on the main branch after the user branch gets merged into main. We want to understand what is the reason for this. Could you please help to understand the p…

---

## [New code analysis keeps showing errors in old code](https://community.sonarsource.com/t/new-code-analysis-keeps-showing-errors-in-old-code/119359)

<div class="topic-metadata">

**Author:** [@bmarotta-ease](https://community.sonarsource.com/u/bmarotta-ease)\
**Replies:** 1\
**Last updated:** [July 22, 2024, 11:57am UTC](https://community.sonarsource.com/t/new-code-analysis-keeps-showing-errors-in-old-code/119359 "2024-07-22T11:57:38Z")

</div>

Must-share information: SonarQube Developer Edition Version 10.3 (build 82913), deployed via zip what are you trying to achieve? That only errors in the new code are detected in the build process what have you tried s…

---

## [Detect file rename as old code in branch analysis](https://community.sonarsource.com/t/detect-file-rename-as-old-code-in-branch-analysis/111221)

<div class="topic-metadata">

**Author:** [@zhaovi3](https://community.sonarsource.com/u/zhaovi3)\
**Replies:** 3\
**Last updated:** [July 16, 2024, 2:30pm UTC](https://community.sonarsource.com/t/detect-file-rename-as-old-code-in-branch-analysis/111221 "2024-07-16T14:30:01Z")

</div>

Hi, I need assistance with branch analysis in detecting a renamed file as old code. We have SCM enabled and are using jGit by default. During our branch analysis for differences and coverage between two branches, we enc…

---

## [Soanrqube Lines of code discrepency](https://community.sonarsource.com/t/soanrqube-lines-of-code-discrepency/118177)

<div class="topic-metadata">

**Author:** [@Badhri\_Chandru](https://community.sonarsource.com/u/Badhri_Chandru)\
**Replies:** 1\
**Last updated:** [July 2, 2024, 1:44pm UTC](https://community.sonarsource.com/t/soanrqube-lines-of-code-discrepency/118177 "2024-07-02T13:44:38Z")

</div>

Hi , Im using sonarqube enterprise edition 9.9 LTA . I’m running static scans twice a month using sonarube github actions workflow.My project is ant based Java project, and Im not setting any sonar. projectVersion proper…

---

## [New issues in old code after Visual Studio upgrade](https://community.sonarsource.com/t/new-issues-in-old-code-after-visual-studio-upgrade/117120)

<div class="topic-metadata">

**Author:** [@jsinge](https://community.sonarsource.com/u/jsinge)\
**Replies:** 6\
**Last updated:** [June 27, 2024, 10:19am UTC](https://community.sonarsource.com/t/new-issues-in-old-code-after-visual-studio-upgrade/117120 "2024-06-27T10:19:26Z")

</div>

Hi, We are observing a problem with the new code detection after chaning the Visual Studio version in our c++ projects from 2019 to 2022. For one project, there are in total 54 issues reported on “new code” although th…

---

## [Missing Code Smells in New Code](https://community.sonarsource.com/t/missing-code-smells-in-new-code/117649)

<div class="topic-metadata">

**Author:** [@Stef](https://community.sonarsource.com/u/Stef)\
**Replies:** 1\
**Last updated:** [June 21, 2024, 1:08pm UTC](https://community.sonarsource.com/t/missing-code-smells-in-new-code/117649 "2024-06-21T13:08:03Z")

</div>

Hello, We using SonarQube Data Center Edition Version 9.9 We intend to use the “Clean as You Code” strategy for PRs and would expect any code smells created by my new code to be displayed. Unfortunately, there are many…

---

## [Is there a plan to detect folder name changes?](https://community.sonarsource.com/t/is-there-a-plan-to-detect-folder-name-changes/117202)

<div class="topic-metadata">

**Author:** [@skiryazov](https://community.sonarsource.com/u/skiryazov)\
**Replies:** 7\
**Last updated:** [June 20, 2024, 2:38pm UTC](https://community.sonarsource.com/t/is-there-a-plan-to-detect-folder-name-changes/117202 "2024-06-20T14:38:33Z")

</div>

Currently, renamed folders light up as new code, which breaks the quality gate on new code approach. This has been asked in the past and the answer was “we’ll see”. Are there any news? Should we get a Jira issue to trac…

---

## [Reference branch for New Code in SonarCloud](https://community.sonarsource.com/t/reference-branch-for-new-code-in-sonarcloud/116564)

<div class="topic-metadata">

**Author:** [@hilari0n](https://community.sonarsource.com/u/hilari0n)\
**Replies:** 5\
**Last updated:** [June 14, 2024, 4:07pm UTC](https://community.sonarsource.com/t/reference-branch-for-new-code-in-sonarcloud/116564 "2024-06-14T16:07:48Z")

</div>

I’ve looked all over the SonarCloud documentation and in the Sonar Community, but have not found any references in the context of SonarCloud. What I found was an old thread related to SonarQube: So it would seem, that …

---

## [How are "accepted" and "false positive" issues counted in quality gate conditions?](https://community.sonarsource.com/t/how-are-accepted-and-false-positive-issues-counted-in-quality-gate-conditions/114612)

<div class="topic-metadata">

**Author:** [@Egon\_Kidmose](https://community.sonarsource.com/u/Egon_Kidmose)\
**Replies:** 2\
**Last updated:** [May 6, 2024, 7:25am UTC](https://community.sonarsource.com/t/how-are-accepted-and-false-positive-issues-counted-in-quality-gate-conditions/114612 "2024-05-06T07:25:09Z")

</div>

Hi all, With SonarQube Enterprise v10 running in docker, I am trying to understand how issues that are marked as “false positive” or “accepted” are counted towards the “total issues” and “new issues” metrics in a quali…

---

## [How to get new ncloc for new code period](https://community.sonarsource.com/t/how-to-get-new-ncloc-for-new-code-period/114501)

<div class="topic-metadata">

**Author:** [@suganya\_kuppusamy](https://community.sonarsource.com/u/suganya_kuppusamy)\
**Replies:** 2\
**Last updated:** [May 1, 2024, 9:16am UTC](https://community.sonarsource.com/t/how-to-get-new-ncloc-for-new-code-period/114501 "2024-05-01T09:16:59Z")

</div>

Im using community edition version 9.9 I can take following metrics from new code period analysis New lines New Technical Debt New Coverage Can I get New LOC count for new code(new\_ncloc)? Is it possible ?

[Next page](https://community.sonarsource.com/tag/new-code/114.md?match_all_tags=true&page=1&tags%5B%5D=new_code)
