# False Negative for rule RSPEC-2184

**URL:** <https://community.sonarsource.com/t/false-negative-for-rule-rspec-2184/142033>\
**Category:** Report False-positive / False-negative...\
**Tags:** sonarqube, scanner, java\
**Created:** [May 29, 2025, 9:36pm UTC](https://community.sonarsource.com/t/false-negative-for-rule-rspec-2184/142033 "2025-05-29T21:36:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![engmscyorku](https://avatars.discourse-cdn.com/v4/letter/e/22d042/32.png) [@engmscyorku](https://community.sonarsource.com/u/engmscyorku)\
**Post date:** [May 29, 2025, 9:36pm UTC](https://community.sonarsource.com/t/false-negative-for-rule-rspec-2184/142033/1 "2025-05-29T21:36:52Z")

</div>

Hi, Looking at those snippets labelled image 1 and image 2 below. By referencing RSPEC-2184, image 1 correctly shows bugs in line 3, 8 and 12. However, in image 2, which is a variant from the original code, the bug is not flagged in lines 3,4 or 9.

The rule is that mathematical operations performed on integers and then assigned to a long, double, or float exhibit inconsistent behaviour. From the images below it can be seen that this rule has been violated in both snippets.

Sonarqube version: 9.9.0.65466  
SonarScanner version: 5.0.1.3006  
SonarQube Community Edition  
Related language: Java

 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/6/2/62a048192ea7443a0bb8028a00d20feb9c1a7ed0.png)  
Image 1

 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/b/1/b142643b8eb2d3d3436997400be06174d97296e3.png)  
Image 2

---

<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:** [May 30, 2025, 6:30am UTC](https://community.sonarsource.com/t/false-negative-for-rule-rspec-2184/142033/2 "2025-05-30T06:30:10Z")

</div>

Hey there.

Please take a look at this post on reporting false-positives.

> **[Report False-positive / False-negative...](https://community.sonarsource.com/c/rules-and-languages/fp/7)**
>
> Should a rule be adjusted for False-Positives, False-Negatives, or just a better description? Should analysis scope be broadened for a new framework, or language version? Let us know! \[Resources: How to Report a False-positive / False-negative\]

You’ll need to provide a text-based snippet of code, **and** make sure the issue can be reproduced on the latest version of SonarQube’s Community Build.

Only the latest version of SonarQube Community Build is considered active, so you’ll need to upgrade and see if the false-negative can still be produced!

Your upgrade path is:

> 9.9.0 → 24.12 → 25.5

You may find these resources helpful:

- [Upgrade Guide](https://docs.sonarsource.com/sonarqube-community-build/server-upgrade-and-maintenance/upgrade/upgrade-the-server/roadmap/)
- [Upgrade notes for 9.9 to 10.7](https://docs.sonarsource.com/sonarqube-server/10.7/server-upgrade-and-maintenance/release-notes-and-notices/release-upgrade-notes/) (when SonarQube Community Edition switched to SonarQube Community Bulid)
- [SonarQube Community Build Upgrade Notes](https://docs.sonarsource.com/sonarqube-community-build/server-upgrade-and-maintenance/release-notes-and-notices/release-upgrade-notes/) (all upgrade notes since the switch)
