Re: [Codenarc-user] Question about Using New Size Features
Brought to you by:
chrismair
From: Corum, M. <mc...@rg...> - 2010-11-15 21:11:10
|
Please ignore this question. It was a GString rather than a java string. Once I put that in, this one worked. I'm still interested in the question of how to get the new features that were added in 0.11 to work properly. For instance, I put MethodSize.maxLines=8 in my codenarc.properties file and it isn't catching any long methods. Thanks, Mike Corum From: Corum, Michael [mailto:mc...@rg...] Sent: Monday, November 15, 2010 2:56 PM To: cod...@li... Subject: Re: [Codenarc-user] Question about Using New Size Features Since upgrading from 0.6.1 to 0.11, I'm seeing lots of new violations. Many of them don't really make sense. One example is the use of the "multiply" method on a string. The idea that this is a violation makes no sense. Here is some example code from a test where I was testing a long string: def longString = "Long String!".multiply(201) CodeNarc flags this with ExplicitCallToMultiplyMethod. Since using multiply is correct in this case (in fact, the recommended Groovy way of doing it), I wanted to turn this one off. So, I added the following line to codenarc.properties: ExplicitCallToMultiplyMethod.doNotApplyToClassNames=java.lang.String However, after running codenarc again, it still flags that line of code with ExplicitCallToMultiplyMethod. What can I do to make this work correctly? Michael Corum Consultant Software Architect RGA Reinsurance Company 1370 Timerlake Manor Parkway Saint Louis, MO 63017 T 636.736.7066 www.rgare.com _____________________________ This message is intended only for the use of the individual or entity to which it is addressed, and may contain information that is privileged, confidential, and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by telephone and return the original message to its sender. Thank you for your cooperation and assistance. |