|
Just upgraded to the new version of the Flex plugin & analyzed our (single!) Flex project.
We went from 0 violations to 1173, which I take as a good thing! (I was really suspicious of that 100% compliance score.)
But in browsing through the new-found violations, I'm seeing a lot of instances of this: ![]() And interestingly, only some of those violations are coupled with instances of the "Only one return rule." It looks like in a long switch, the first few cases only get one violation and the rest get both. I can investigate more thoroughly if needed...
I'm also seeing this: ![]() On the plus side, I'm also seeing instances of "Do not use more than one statement per line"
I find that coding habit a particularly nasty one & want to thank Evgeny for this rule! And also want to apologize for not participating in testing. :-( Ann G. Ann Campbell Sr. Systems Engineer, IS Production Systems - Shop Floor Systems Shaw Industries Inc, 201 S. Hamilton St. Dalton Ga 30720
****************************** Privileged and/or confidential information may be contained in this message. If you are not the addressee indicated in this message (or are not responsible for delivery of this message to that person) , you may not copy or deliver this message to anyone. In such case, you should destroy this message and notify the sender by reply e-mail. If you or your employer do not consent to Internet e-mail for messages of this kind, please advise the sender. Shaw Industries does not provide or endorse any opinions, conclusions or other information in this message that do not relate to the official business of the company or its subsidiaries. ****************************** |
|
Hi Ann,
See my comments below :
On Tue, Jun 26, 2012 at 7:55 PM, Ann Campbell <[hidden email]> wrote: Just upgraded to the new version of the Flex plugin & analyzed our (single!) Flex project. This rule currently is out of our control , because it comes from third-party tool - FlexPMD. However we plan to fully get rid of FlexPMD and replace it by our own rules, so I created http://jira.codehaus.org/browse/SONARPLUGINS-1998
It would be valuable, if you could provide bigger snippet of code to show what you got and explain what you expected.
Ticket already exists - http://jira.codehaus.org/browse/SONARPLUGINS-1956
You're welcome.
You can do this in next time ;)
Best regards, Evgeny Mandrikov aka Godin <http://godin.net.ru> http://twitter.com/_godin_ |
|
Somehow I was under the (clearly mistaken) impression that you'd already fully replaced FlexPMD.
The longer snipped is below. On a second look, it seems that every case but the first gets the "Only one return" rule. I might have thought that every return in a multi-return method would be flagged, or every return except the last one. But I see the case for it the way it is.
switch (state) { # Avoid switch statement without a "default" clause case A:
return boldGreen; # Non breakable switch case rule case B:
return boldGreen; # Non breakable switch case rule; Only one return rule case C:
return boldRed; # Non breakable switch case rule; Only one return rule case D:
return purple; # Non breakable switch case rule; Only one return rule case E:
return boldRed; # Non breakable switch case rule; Only one return rule case F:
return boldYellow; # Non breakable switch case rule; Only one return rule case G:
return yellow; # Non breakable switch case rule; Only one return rule case H:
return boldYellow; # Non breakable switch case rule; Only one return rule case I:
return boldGreen; # Non breakable switch case rule; Only one return rule case J:
return boldGreen; # Non breakable switch case rule; Only one return rule }
return yellow; # Only one return rule G. Ann Campbell Sr. Systems Engineer, IS Production Systems - Shop Floor Systems Shaw Industries Inc,
201 S. Hamilton St. Dalton Ga 30720 ****************************** Privileged and/or confidential information may be contained in this message. If you are not the addressee indicated in this message (or are not responsible for delivery of this message to that person) , you may not copy or deliver this message to anyone. In such case, you should destroy this message and notify the sender by reply e-mail. If you or your employer do not consent to Internet e-mail for messages of this kind, please advise the sender. Shaw Industries does not provide or endorse any opinions, conclusions or other information in this message that do not relate to the official business of the company or its subsidiaries. ****************************** |
|
Here is my thoughts :
On Tue, Jun 26, 2012 at 11:16 PM, Ann Campbell <[hidden email]> wrote: Somehow I was under the (clearly mistaken) impression that you'd already fully replaced FlexPMD. Best regards, Evgeny Mandrikov aka Godin <http://godin.net.ru> http://twitter.com/_godin_ |
|
Below...
On Tue, Jun 26, 2012 at 1:41 PM, Evgeny Mandrikov <[hidden email]> wrote:
included only for completeness
cool
I like it! :-)
G. Ann Campbell Sr. Systems Engineer, IS Production Systems - Shop Floor Systems Shaw Industries Inc, 201 S. Hamilton St.
Dalton Ga 30720 ****************************** Privileged and/or confidential information may be contained in this message. If you are not the addressee indicated in this message (or are not responsible for delivery of this message to that person) , you may not copy or deliver this message to anyone. In such case, you should destroy this message and notify the sender by reply e-mail. If you or your employer do not consent to Internet e-mail for messages of this kind, please advise the sender. Shaw Industries does not provide or endorse any opinions, conclusions or other information in this message that do not relate to the official business of the company or its subsidiaries. ****************************** |
|
BTW, Ann, feel free to report more rules for migration as most probably we will do this in several release steps ;)
On Wed, Jun 27, 2012 at 2:03 AM, Ann Campbell <[hidden email]> wrote: Below... Best regards, Evgeny Mandrikov aka Godin <http://godin.net.ru> http://twitter.com/_godin_ |
| Powered by Nabble | Edit this page |
