Magic numbers false positive? (C#)

15 views
Skip to first unread message

jose....@nielsen.com

unread,
Mar 19, 2018, 6:01:27 AM3/19/18
to SonarQube
Hello,

I'm using this new rule in my C# project, but is giving me too many code smells that from my point of view, are false positives. The rule is detecting the enum as codesmells, is this the expected behaviour?

Example:
public enum AppScreen
{
   
Main = 1,
   
Faq = 2,
   
Contact = 3
}

Faq = 2 and Contact = 3 are detected are code smells

Amaury Leve

unread,
Mar 19, 2018, 6:05:33 AM3/19/18
to jose....@nielsen.com, SonarQube
Hi Jose,

You are right those are FP. I have created a ticket in the analyzer repository (https://github.com/SonarSource/sonar-csharp/issues/1244).

Cheers,
Amaury

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/dc8597e0-cf68-4502-a94d-63c9486fe048%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

Amaury Levé | SonarSource

Software Developer - .Net Team

http://sonarsource.com


Are you using SonarLint in your IDE? 
Reply all
Reply to author
Forward
0 new messages