[groovy-user] [ANN] Announcing CodeNarc 0.9

3 views
Skip to first unread message

chris...@wachovia.com

unread,
May 13, 2010, 8:22:06 AM5/13/10
to us...@groovy.codehaus.org

CodeNarc is a static analysis tool for Groovy source code.
 
Version 0.9 includes:
 
Bug Fixes
  • Fix bug #2985592: “MissingPropertyException: No such property: W3C_XML_SCHEMA_NS_URI”.
  • XML RuleSet: Allow wildcards (*) in <include> and <exclude>.
  • NestedBlockDepthRule: Ignore first level of closure for Closure Fields (since they are really equivalent to methods).

New Size/Complexity Rules
  • AbcComplexityRule - Check ABC size/complexity score against threshold for method and class average (size)
  • CyclomaticComplexityRule - Check Cyclomatic Complexity against threshold for method and class average (size)

New Concurrency Rules (from Hamlet D’Arcy)
  • NestedSynchronizationRule (concurrency - Hamlet D’Arcy)
  • RunFinalizersOnExitRule (concurrency - Hamlet D’Arcy)
  • SynchronizedMethodRule (concurrency - Hamlet D’Arcy)  
  • SynchronizedOnThisRule (concurrency - Hamlet D’Arcy)
  • ThreadLocalNotStaticFinalRule (concurrency - Hamlet D’Arcy)
  • ThreadYieldRule: (concurrency - Hamlet D’Arcy)
  • VolatileLongOrDoubleFieldRule: (concurrency - Hamlet D’Arcy)

New Basic Rules
  • CloneableWithoutCloneRule (basic - Hamlet D'Arcy & René Gröschke)
  • ConstantIfExpressionRule (basic)
  • ConstantTernaryExpressionRule (basic)
  • UnnecessaryTernaryExpressionRule (basic)

New Features and Infrastructure
  • Deprecate GrailsSessionReferenceRule. Default enabled to false.
  • StatelessClassRule: Add setAddToIgnoreFieldNames() method (adds to ignoreFieldNames).
  • Potential BREAKAGE: Add new <rule>.description.html property for each rule. If you have overridden the “<rule>.description” message for a predefined rule in a “codenarc-messages.properties” file, you will have to change those message keys to “<rule>.description.html”.
  • Do not include disabled rules in list of rules at bottom of HTML/XML report.
  • UnusedVariableRule: Fix limitation: Does not recognize variable references on the same line as the variable declaration.
  • CodeNarcRunner: Add System.out println of summary counts.
  • MethodSizeRule: Apply to constructors as well.

http://codenarc.sourceforge.net
ForwardSourceID:NT000B9B42    

--
You received this message because you are subscribed to the Google Groups "Groovy Users" group.
To post to this group, send email to groov...@googlegroups.com.
To unsubscribe from this group, send email to groovy-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/groovy-user?hl=en.

Mick Knutson

unread,
May 13, 2010, 10:22:03 AM5/13/10
to us...@groovy.codehaus.org
I have this issue running:

Running CodeNarc ...
Error executing script Codenarc: : java.lang.VerifyError: (class: org/apache/xerces/impl/xs/XMLSchemaLoader, method: xsdToXMLInputSource signatur
e: (Ljava/lang/Object;)Lorg/apache/xerces/xni/parser/XMLInputSource;) Incompatible object argument for function call
gant.TargetExecutionException: : java.lang.VerifyError: (class: org/apache/xerces/impl/xs/XMLSchemaLoader, method: xsdToXMLInputSource signature:
 (Ljava/lang/Object;)Lorg/apache/xerces/xni/parser/XMLInputSource;) Incompatible object argument for function call
        at gant.Gant$_dispatch_closure4.doCall(Gant.groovy:331)
        at gant.Gant$_dispatch_closure6.doCall(Gant.groovy:334)
        at gant.Gant$_dispatch_closure6.doCall(Gant.groovy)
        at gant.Gant.withBuildListeners(Gant.groovy:344)
        at gant.Gant.this$2$withBuildListeners(Gant.groovy)
        at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
        at gant.Gant.dispatch(Gant.groovy:334)
        at gant.Gant.this$2$dispatch(Gant.groovy)
        at gant.Gant.invokeMethod(Gant.groovy)
        at gant.Gant.processTargets(Gant.groovy:495)
        at gant.Gant.processTargets(Gant.groovy:480)
Caused by: : java.lang.VerifyError: (class: org/apache/xerces/impl/xs/XMLSchemaLoader, method: xsdToXMLInputSource signature: (Ljava/lang/Object;
)Lorg/apache/xerces/xni/parser/XMLInputSource;) Incompatible object argument for function call
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:116)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at Codenarc.runCodenarc(Codenarc:43)
        at Codenarc.this$4$runCodenarc(Codenarc)
        at Codenarc$_run_closure1.doCall(Codenarc:23)
        at gant.Gant$_dispatch_closure4.doCall(Gant.groovy:324)
        ... 10 more
Caused by: java.lang.VerifyError: (class: org/apache/xerces/impl/xs/XMLSchemaLoader, method: xsdToXMLInputSource signature: (Ljava/lang/Object;)L
org/apache/xerces/xni/parser/XMLInputSource;) Incompatible object argument for function call
        at org.apache.xerces.jaxp.validation.XMLSchemaFactory.<init>(Unknown Source)
        at java.lang.Class.newInstance0(Class.java:355)
        at java.lang.Class.newInstance(Class.java:308)
        at javax.xml.validation.SchemaFactoryFinder.loadFromService(SchemaFactoryFinder.java:431)
        at javax.xml.validation.SchemaFactoryFinder._newFactory(SchemaFactoryFinder.java:246)
        at javax.xml.validation.SchemaFactoryFinder.newFactory(SchemaFactoryFinder.java:145)
        at javax.xml.validation.SchemaFactory.newInstance(SchemaFactory.java:205)
        at org.codenarc.ruleset.XmlReaderRuleSet.validateXml(XmlReaderRuleSet.groovy:123)
        at org.codenarc.ruleset.XmlReaderRuleSet.this$2$validateXml(XmlReaderRuleSet.groovy)
        at org.codenarc.ruleset.XmlReaderRuleSet.<init>(XmlReaderRuleSet.groovy:46)
        at org.codenarc.ruleset.XmlFileRuleSet$_closure1.doCall(XmlFileRuleSet.groovy:50)
        at org.codenarc.ruleset.XmlFileRuleSet.<init>(XmlFileRuleSet.groovy:49)
        at org.codenarc.ruleset.RuleSetUtil.loadRuleSetFile(RuleSetUtil.groovy:39)
        at org.codenarc.CodeNarcRunner$_createRuleSet_closure2.doCall(CodeNarcRunner.groovy:94)
        at org.codenarc.CodeNarcRunner.createRuleSet(CodeNarcRunner.groovy:93)
        at org.codenarc.CodeNarcRunner.execute(CodeNarcRunner.groovy:66)
        at org.codenarc.ant.CodeNarcTask.execute(CodeNarcTask.groovy:86)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        ... 15 more
Error executing script Codenarc: : java.lang.VerifyError: (class: org/apache/xerces/impl/xs/XMLSchemaLoader, method: xsdToXMLInputSource signatur
e: (Ljava/lang/Object;)Lorg/apache/xerces/xni/parser/XMLInputSource;) Incompatible object argument for function call



---
Thank You…

Mick Knutson, President

BASE Logic, Inc.
Enterprise Architecture, Design, Mentoring & Agile Consulting
p. (866) BLiNC-411: (254-6241-1)
f. (415) 685-4233

Website: http://www.baselogic.com
Blog: http://www.baselogic.com/blog/
Linked IN: http://linkedin.com/in/mickknutson
Twitter: http://twitter.com/mickknutson
Vacation Rental: http://tahoe.baselogic.com
---

chris...@wachovia.com

unread,
May 14, 2010, 7:29:21 AM5/14/10
to us...@groovy.codehaus.org, codena...@lists.sourceforge.net

** Moving this over to the codenarc-user list. **

Perhaps this is an inconsistency between Java, Groovy or Xerces? Which versions of each of those are you using?

There is a new (insufficiently documented) dependency in CodeNarc on Groovy 1.6 or later (and Java 1.5 or later) and GMetrics if you use the new ABC or Cyclomatic Complexity rules.

Chris

Mick Knutson <mknu...@baselogic.com> wrote on 05/13/2010 10:22:03 AM:

> I have this issue running:

>
> Running CodeNarc ...

> Error executing script Codenarc: : java.lang.VerifyError: (class:
> org/apache/xerces/impl/xs/XMLSchemaLoader, method:
> xsdToXMLInputSource signatur

> e: (Ljava/lang/Object;)
> Lorg/apache/xerces/xni/parser/XMLInputSource;) Incompatible object
> argument for function call
> argument for function call
>
>
> ---
> Thank You…
>
> Mick Knutson, President
>
> BASE Logic, Inc.
> Enterprise Architecture, Design, Mentoring & Agile Consulting
> p. (866) BLiNC-411: (254-6241-1)
> f. (415) 685-4233
>
> Website: http://www.baselogic.com
> Blog: http://www.baselogic.com/blog/
> Linked IN: http://linkedin.com/in/mickknutson
> Twitter: http://twitter.com/mickknutson
> Vacation Rental: http://tahoe.baselogic.com

--

Mick Knutson

unread,
May 14, 2010, 7:32:46 AM5/14/10
to us...@groovy.codehaus.org, codena...@lists.sourceforge.net
I am using the following:

app.grails.version=1.2.2
app.servlet.version=2.4
app.version=10.4.2
plugins.code-coverage=1.1.8
plugins.hibernate=1.2.2
plugins.springcache=1.2
plugins.tomcat=1.2.2
plugins.webtest=2.0.4


There are no additional XML libraries I am using in my application.



---
Thank You…

Mick Knutson, President

BASE Logic, Inc.
Enterprise Architecture, Design, Mentoring & Agile Consulting
p. (866) BLiNC-411: (254-6241-1)
f. (415) 685-4233

Website: http://www.baselogic.com
Blog: http://www.baselogic.com/blog/
Linked IN: http://linkedin.com/in/mickknutson
Twitter: http://twitter.com/mickknutson
Vacation Rental: http://tahoe.baselogic.com
---
Reply all
Reply to author
Forward
0 new messages