codenarc-user Mailing List for CodeNarc (Page 13)
Brought to you by:
chrismair
This list is closed, nobody may subscribe to it.
2010 |
Jan
|
Feb
|
Mar
|
Apr
(14) |
May
(9) |
Jun
|
Jul
|
Aug
|
Sep
(3) |
Oct
(11) |
Nov
(29) |
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2011 |
Jan
(27) |
Feb
(8) |
Mar
(26) |
Apr
(9) |
May
(27) |
Jun
(8) |
Jul
(24) |
Aug
(27) |
Sep
|
Oct
(4) |
Nov
(7) |
Dec
(19) |
2012 |
Jan
|
Feb
(7) |
Mar
(2) |
Apr
(1) |
May
|
Jun
|
Jul
(3) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(4) |
2013 |
Jan
(2) |
Feb
(3) |
Mar
|
Apr
(3) |
May
(1) |
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2014 |
Jan
|
Feb
|
Mar
|
Apr
(4) |
May
|
Jun
|
Jul
(3) |
Aug
|
Sep
(1) |
Oct
(1) |
Nov
(2) |
Dec
|
2015 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
(10) |
Oct
(1) |
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(10) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2018 |
Jan
(1) |
Feb
(1) |
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
From: Hamlet D'A. <ham...@gm...> - 2010-10-21 14:12:40
|
Hi everyone, Just wanted to let the list know that CodeNarc will be covered in some depth at the "Code Generation" talk at SpringOne2GX conference today. See you there! -- Hamlet D'Arcy ham...@gm... |
From: Chris M. <chr...@ea...> - 2010-10-04 01:48:34
|
CodeNarc <http://codenarc.sourceforge.net/> is a static analysis tool for Groovy source code. Version 0.10 includes: Bug Fixes * Fix Bug #3071531: "Unused rules don't recognized method closures" (e.g. return this.&bar;). https://sourceforge.net/tracker/?func=detail <https://sourceforge.net/tracker/?func=detail&atid=1126573&aid=3071531&group _id=250145> &atid=1126573&aid=3071531&group_id=250145. * Fix: UnusedPrivateField: Don't produce violation if field is a Closure field and is invoked. * Fix: ImportFromSamePackage: Causes violations for alias imports within same package. New Rules * New UnnecessaryIfStatementRule (basic): Checks for if statements where the if and else blocks are only returning true and false constants. if(x) { return true } else { return false }. * New UnnecessaryBooleanExpressionRule (basic): Check for unnecessary boolean expressions, including ANDing (&&) or ORing (||) with true, false, null, or Map/List/String/Number literal. Also checks for negation of true, false, null, or Map/List/String/Number literal. * New BigDecimalInstantiationRule (basic): Avoid creating BigDecimal with a decimal (float/double) literal; use a String literal instead. * New UnusedObjectRule (unused): Checks for object allocations that are not assigned or used. * New UnusedArrayRule (unused): Checks for array allocations that are not assigned or used. * New ImplementationAsTypeRule (design): Checks that particular classes are never used as types in variable declarations, return values or parameters, such as ArrayList, HashSet, Hashtable, PriorityQueue, etc. (design) * New JUnitUnnecessaryTearDownRule (junit). Checks for tearDown() methods that only call super.tearDown(). * New JUnitUnnecessarySetUpRule (junit). Checks for setUp() methods that only call super.setUp(). New Features and Infrastructure * CodeNarc now requires Groovy 1.6 or later to run. Keep in mind that it can still run against (analyze) older Groovy code. * New InlineXmlReportWriter (from Robin Bramley) for improved integration with the Hudson Violations plugin. See http://wiki.hudson-ci.org/display/HUDSON/Violations. * Upgrade to GMetrics 0.3 for AbcComplexityRule and CyclomaticComplexityRule. Violations now include line number and source line. * All JUnit rules (JUnit*Rule): Also apply to classes with names ending in *TestCase. * Add codenarc create-rule script to create a new rule and associated classes/tests (from Hamlet D'Arcy). * ConstantTernaryExpressionRule and ConstantIfExpressionRule: Also flag constant Map and List expressions. * GrailsPublicControllerMethod: add ignoreMethodNames property. Grails CodeNarc Plugin Updated * The Grails CodeNarc Plugin ( <http://grails.org/plugin/codenarc> http://grails.org/plugin/codenarc ) has also been updated to version 0. 7, to upgrade to CodeNarc 0. 10. Plugin changes include: * Add support in "Config.groovy" for using a custom "codenarc.properties". Set an optional property: e.g. codenarc.propertiesFile = "file:grails-app/conf/codenarc.properties". <http://codenarc.sourceforge.net/> http://codenarc.sourceforge.net <http://grails.org/plugin/codenarc> http://grails.org/plugin/codenarc |
From: Chris M. <chr...@ea...> - 2010-09-26 21:02:19
|
CodeNarc <http://codenarc.sourceforge.net/> is a static analysis tool for Groovy source code. Version 0.10 includes: Bug Fixes * Fix Bug #3071531: "Unused rules don't recognized method closures" (e.g. return this.&bar;). https://sourceforge.net/tracker/?func=detail <https://sourceforge.net/tracker/?func=detail&atid=1126573&aid=3071531&group _id=250145> &atid=1126573&aid=3071531&group_id=250145. * Fix: UnusedPrivateField: Don't produce violation if field is a Closure field and is invoked. * Fix: ImportFromSamePackage: Causes violations for alias imports within same package. New Rules * New UnnecessaryIfStatementRule (basic): Checks for if statements where the if and else blocks are only returning true and false constants. if(x) { return true } else { return false }. * New UnnecessaryBooleanExpressionRule (basic): Check for unnecessary boolean expressions, including ANDing (&&) or ORing (||) with true, false, null, or Map/List/String/Number literal. Also checks for negation of true, false, null, or Map/List/String/Number literal. * New BigDecimalInstantiationRule (basic): Avoid creating BigDecimal with a decimal (float/double) literal; use a String literal instead. * New UnusedObjectRule (unused): Checks for object allocations that are not assigned or used. * New UnusedArrayRule (unused): Checks for array allocations that are not assigned or used. * New ImplementationAsTypeRule (design): Checks that particular classes are never used as types in variable declarations, return values or parameters, such as ArrayList, HashSet, Hashtable, PriorityQueue, etc. (design) * New JUnitUnnecessaryTearDownRule (junit). Checks for tearDown() methods that only call super.tearDown(). * New JUnitUnnecessarySetUpRule (junit). Checks for setUp() methods that only call super.setUp(). New Features and Infrastructure * CodeNarc now requires Groovy 1.6 or later to run. Keep in mind that it can still run against (analyze) older Groovy code. * New InlineXmlReportWriter (from Robin Bramley) for improved integration with the Hudson Violations plugin. See http://wiki.hudson-ci.org/display/HUDSON/Violations. * Upgrade to GMetrics 0.3 for AbcComplexityRule and CyclomaticComplexityRule. Violations now include line number and source line. * All JUnit rules (JUnit*Rule): Also apply to classes with names ending in *TestCase. * Add codenarc create-rule script to create a new rule and associated classes/tests (from Hamlet D'Arcy). * ConstantTernaryExpressionRule and ConstantIfExpressionRule: Also flag constant Map and List expressions. * GrailsPublicControllerMethod: add ignoreMethodNames property. <http://codenarc.sourceforge.net/> http://codenarc.sourceforge.net |
From: Chris M. <chr...@ea...> - 2010-09-06 01:01:20
|
I am considering working on a CodeNarc rule for detecting the Double-Checked Locking pattern. It would probably have to be pretty narrow/specific, along the lines of the DCL rules in both PMD <http://pmd.sourceforge.net/rules/basic.html#DoubleCheckedLocking> and Checkstyle, essentially only flagging code that follows the pattern: private Helper helper = null; public Helper getHelper() { if (helper == null) { synchronized(this) { if (helper == null) helper = new Helper(); } } return helper; } I realize that the memory model in Java 1.5 means that if you declare helper as volatile, that this idiom will actually work, as discussed in http://www.cs.umd.edu/~pugh/java/memoryModel/jsr-133-faq.html and other places. So, I may be able to craft the rule so that it only flags DCL if the variable is NOT volatile. Then again, some have argued that even so, that idiom is usually unnecessary and confusing, preferring the Initialization On Demand Holder idiom or just plain synchronization, so there might be value in a rule that always flags DCL (or makes that configurable). I was just wondering whether anyone had any opinion on that, one way or the other. Thanks. Chris |
From: Chris M. <chr...@ea...> - 2010-09-05 19:27:15
|
Robin Bramley has written a great blog post about the upcoming CodeNarc support within the Violations plugin for Hudson. http://leanjavaengineering.wordpress.com/2010/08/25/grails-codenarc-hudson/ Robin also submitted a patch to CodeNarc to improve that integration, and that will be included in the next release. Chris |
From: Hamlet D'A. <ham...@gm...> - 2010-05-24 09:29:12
|
Is anyone from the CodeNarc community going to JavaOne or 2GX? I'll be at both. -- Hamlet D'Arcy ham...@gm... |
From: Chris M. <chr...@ea...> - 2010-05-22 20:25:22
|
Mick, I just released version 0.6 of the Grails CodeNarc plugin, which includes CodeNarc 0.9. I created a new Grails 1.2.2 application and installed the plugins that you seem to have installed as well, along with CodeNarc plugin 0.6, and was able to successfully perform a grails codenarc. It looks like you were using the Grails CodeNarc plugin, but obviously an earlier version (though I am curious why it did not show up in the "application.properties" you showed). If you get a chance, please install the latest CodeNarc plugin version (uninstall the older version first) and let me know if you still have an issue. Chris -----Original Message----- From: Mick Knutson [mailto:mkn...@ba...] Sent: Friday, May 14, 2010 7:33 AM To: us...@gr... Cc: cod...@li... Subject: Re: [Codenarc-user] [groovy-user] [ANN] Announcing CodeNarc 0.9 I am using the following: app.grails.version=1.2.2 app.name=divr 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 --- On Fri, May 14, 2010 at 7:29 AM, <chr...@wa...> wrote: ** 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 <mkn...@ba...> 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 > 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 |
From: Chris M. <chr...@ea...> - 2010-05-22 20:22:50
|
I just released version 0.6 of the Grails CodeNarc plugin, which includes CodeNarc 0.9. See <http://grails.org/plugin/codenarc> http://grails.org/plugin/codenarc Changes include: * Fix bug #1941: "Getting error trying grails codenarc using 0.4 in grails 1.2.1". http://jira.codehaus.org/browse/GRAILSPLUGINS-1941. Modify "CodeNarc.groovy" to not crash id the "Config.groovy" file is missing. * Show the results (# of priority 1/2/3 violations) of a grails codenarc execution. CodeNarcRunner fixed to also println() summary in addition to LOG.info(). [Fixed in CodeNarc v0.9] * Fix "Error executing script Codenarc: groovy.lang.MissingPropertyException: No such property: W3C_XML_SCHEMA_NS_URI for class: javax.xml.XMLConstants gant.TargetExecutionException: groovy.lang.MissingPropertyException: No such property: W3C_XML_SCHEMA_NS_URI for class". [Fixed in CodeNarc v0.9] Chris |
From: Mick K. <mkn...@ba...> - 2010-05-14 12:01:01
|
I am using the following: app.grails.version=1.2.2 app.name=divr 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 --- On Fri, May 14, 2010 at 7:29 AM, <chr...@wa...> wrote: > > ** 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 <mkn...@ba...> 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 > > 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 > |
From: <chr...@wa...> - 2010-05-14 11:29:37
|
** 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 <mkn...@ba...> 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 > 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 |
From: Hamlet D'A. <ham...@gm...> - 2010-05-12 06:42:42
|
Thanks for the CodeNarc release and announcement Chris. I wrote a few of the new concurrency related CodeNarc rules for this release, and I have to say that writing a rule is quite easy and the testing support is great. If you are interested in AST Transformations then I recommend downloading the source and trying to write a new rule. The framework itself works great... we just need a whole ton more rules to make CodeNarc better. If you want some ideas about new rules to write then try porting some from FindBugs: http://findbugs.sourceforge.net/bugDescriptions.html And if you need help then email the CodeNarc mailing list. -- Hamlet D'Arcy ham...@gm... On Wed, May 12, 2010 at 3:33 AM, Chris Mair <chr...@ea...> wrote: > 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 > > ------------------------------------------------------------------------------ > > > _______________________________________________ > Codenarc-user mailing list > Cod...@li... > https://lists.sourceforge.net/lists/listinfo/codenarc-user > > |
From: Chris M. <chr...@ea...> - 2010-05-12 01:41:56
|
<http://codenarc.sourceforge.net/> 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 DArcy) * NestedSynchronizationRule (concurrency - Hamlet DArcy) * RunFinalizersOnExitRule (concurrency - Hamlet DArcy) * SynchronizedMethodRule (concurrency - Hamlet DArcy) * SynchronizedOnThisRule (concurrency - Hamlet DArcy) * ThreadLocalNotStaticFinalRule (concurrency - Hamlet DArcy) * ThreadYieldRule: (concurrency - Hamlet DArcy) * VolatileLongOrDoubleFieldRule: (concurrency - Hamlet DArcy) 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> http://codenarc.sourceforge.net |
From: Chris M. <chr...@ea...> - 2010-05-09 12:05:52
|
I am considering deprecating the GrailsSessionReference rule as part of the upcoming CodeNarc 0.9 release. That rule seems to end up being more trouble than it's worth. It was intended as a "governance" rule -- to allow some level of control and oversight over where state was stored in the session. This might be useful in a team environment where you have developers at different skill levels, and you just want to make sure a (relatively) inexperienced developer does not store things in the session that do not belong there. But in practice, that has not been very helpful on my projects, and just makes extra work. I've also heard from one other CodeNarc user who thought this was "bad" rule as well. I guess "deprecating" a rule means setting its "enabled" property to "false" and documenting it as deprecated.. Let me know if there are any opinions, one way or the other. Chris |
From: Hamlet D'A. <ham...@gm...> - 2010-05-01 19:12:58
|
Hi everyone, I want to let everyone know that I'm going to be talking about codenarc at Jax.de next week and GR8 Conf in mid May. My presentation is about AST Transformations in Groovy, and CodeNarc will get a few slides. Also, at GR8 we are planning a hacking night Wednesday night where we come together to write and contribute code. I am interested in writing more rules for CodeNarc if anyone else would like to join me. Thanks! -- Hamlet D'Arcy ham...@gm... |
From: Hamlet D'A. <ham...@gm...> - 2010-04-29 13:10:45
|
Can you attach your 4 files? On Thu, Apr 29, 2010 at 3:11 PM, Ramanan Kumaravelu <ra...@ju...> wrote: > Hi , > > > > I have added a new rule under basic.xml to flag the presence of ‘console’ > statements in groovy codebase as a Priority 2 violation. I have built the > modified codebase successfully using “mvn install”. > > > > Later, when I try generating the html report using the newly generated > CodeNarc-0.9-SNAPSHOT.jar by running RunAntTask.bat, I get the html report > output, but it doesn’t report the presence of console statements in the > codebase that is analyzed. > > > > I have done the following things in trying to add the new rule. > > · I have created the following two files: > > 1. ConsoleStatementPresenceRule.groovy > > 2. ConsoleStatementPresenceRuleTest.groovy > > > > · I have updated basic.xml (this is the place where I am adding my > new rule) and codenarc-rules-basic.apt > > > > · Also, I have updated codenarc-base-messages.properties file > > > > I must be missing something here… Can anyone through some light on this? > > > > Many thanks in advance… > > -Ramanan > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Codenarc-user mailing list > Cod...@li... > https://lists.sourceforge.net/lists/listinfo/codenarc-user > > -- Hamlet D'Arcy ham...@gm... |
From: Ramanan K. <ra...@ju...> - 2010-04-29 13:07:32
|
Hi , I have added a new rule under basic.xml to flag the presence of 'console' statements in groovy codebase as a Priority 2 violation. I have built the modified codebase successfully using "mvn install". Later, when I try generating the html report using the newly generated CodeNarc-0.9-SNAPSHOT.jar by running RunAntTask.bat, I get the html report output, but it doesn't report the presence of console statements in the codebase that is analyzed. I have done the following things in trying to add the new rule. * I have created the following two files: 1. ConsoleStatementPresenceRule.groovy 2. ConsoleStatementPresenceRuleTest.groovy * I have updated basic.xml (this is the place where I am adding my new rule) and codenarc-rules-basic.apt * Also, I have updated codenarc-base-messages.properties file I must be missing something here... Can anyone through some light on this? Many thanks in advance... -Ramanan |
From: Ramanan K. <ra...@ju...> - 2010-04-28 15:22:30
|
I used the "mvn install" method and it worked just fine in building the modified codenarc codebase Thanks a ton! -Ramanan -----Original Message----- From: Hamlet D'Arcy [mailto:ham...@gm...] Sent: Wednesday, April 28, 2010 7:40 PM To: Ramanan Kumaravelu Cc: Cod...@li... Subject: Re: [Codenarc-user] How can i build codenarc source code using eclipse? Pls help As an alternative, I believe you can create an Eclipse project off of the pom.xml that sits in the root directory. I would try that. On Wed, Apr 28, 2010 at 4:09 PM, Hamlet D'Arcy <ham...@gm...> wrote: > You can build it from the command line with : > > mvn install > > You just need to install Maven. > > However, you are right that an IDE greatly simplifies debugging and > devlopment cycle. > > I can offer you a 60 day trial license of IntelliJ IDEA Ultimate if you wish :) > > -- > Hamlet D'Arcy > ham...@gm... > > > > On Wed, Apr 28, 2010 at 3:59 PM, Ramanan Kumaravelu > <ra...@ju...> wrote: >> Hi, >> >> >> >> I downloaded codenarc source code from the following site using a SVN client >> on my machine (windows XP): >> >> https://codenarc.svn.sourceforge.net/svnroot/codenarc/trunk >> >> >> >> Now after making a small modification to one of the groovy source files viz. >> EmptyIfStatementRule.groovy, I am trying to build the whole codenarc code >> base in eclipse. Please help... >> >> >> >> Thanks, >> >> Ramanan >> >> ------------------------------------------------------------------------ ------ >> >> _______________________________________________ >> Codenarc-user mailing list >> Cod...@li... >> https://lists.sourceforge.net/lists/listinfo/codenarc-user >> >> > -- Hamlet D'Arcy ham...@gm... |
From: Hamlet D'A. <ham...@gm...> - 2010-04-28 14:09:59
|
As an alternative, I believe you can create an Eclipse project off of the pom.xml that sits in the root directory. I would try that. On Wed, Apr 28, 2010 at 4:09 PM, Hamlet D'Arcy <ham...@gm...> wrote: > You can build it from the command line with : > > mvn install > > You just need to install Maven. > > However, you are right that an IDE greatly simplifies debugging and > devlopment cycle. > > I can offer you a 60 day trial license of IntelliJ IDEA Ultimate if you wish :) > > -- > Hamlet D'Arcy > ham...@gm... > > > > On Wed, Apr 28, 2010 at 3:59 PM, Ramanan Kumaravelu > <ra...@ju...> wrote: >> Hi, >> >> >> >> I downloaded codenarc source code from the following site using a SVN client >> on my machine (windows XP): >> >> https://codenarc.svn.sourceforge.net/svnroot/codenarc/trunk >> >> >> >> Now after making a small modification to one of the groovy source files viz. >> EmptyIfStatementRule.groovy, I am trying to build the whole codenarc code >> base in eclipse. Please help… >> >> >> >> Thanks, >> >> Ramanan >> >> ------------------------------------------------------------------------------ >> >> _______________________________________________ >> Codenarc-user mailing list >> Cod...@li... >> https://lists.sourceforge.net/lists/listinfo/codenarc-user >> >> > -- Hamlet D'Arcy ham...@gm... |
From: Hamlet D'A. <ham...@gm...> - 2010-04-28 14:09:16
|
You can build it from the command line with : mvn install You just need to install Maven. However, you are right that an IDE greatly simplifies debugging and devlopment cycle. I can offer you a 60 day trial license of IntelliJ IDEA Ultimate if you wish :) -- Hamlet D'Arcy ham...@gm... On Wed, Apr 28, 2010 at 3:59 PM, Ramanan Kumaravelu <ra...@ju...> wrote: > Hi, > > > > I downloaded codenarc source code from the following site using a SVN client > on my machine (windows XP): > > https://codenarc.svn.sourceforge.net/svnroot/codenarc/trunk > > > > Now after making a small modification to one of the groovy source files viz. > EmptyIfStatementRule.groovy, I am trying to build the whole codenarc code > base in eclipse. Please help… > > > > Thanks, > > Ramanan > > ------------------------------------------------------------------------------ > > _______________________________________________ > Codenarc-user mailing list > Cod...@li... > https://lists.sourceforge.net/lists/listinfo/codenarc-user > > |
From: Ramanan K. <ra...@ju...> - 2010-04-28 14:07:21
|
Hi, I downloaded codenarc source code from the following site using a SVN client on my machine (windows XP): https://codenarc.svn.sourceforge.net/svnroot/codenarc/trunk Now after making a small modification to one of the groovy source files viz. EmptyIfStatementRule.groovy, I am trying to build the whole codenarc code base in eclipse. Please help... Thanks, Ramanan |
From: <chr...@wa...> - 2010-04-28 12:44:27
|
> If I email a list of potential rules, can you add them to the roadmap > with my name next to them? Absolutely. |
From: Hamlet D'A. <ham...@gm...> - 2010-04-28 11:54:23
|
It would be a nice feature to have that, because then there is at least the possibility of users to get out-of-release rule updates. I guess the biggest issue right now that needs to be solved is writing more rules. If I email a list of potential rules, can you add them to the roadmap with my name next to them? -- Hamlet D'Arcy ham...@gm... On Wed, Apr 28, 2010 at 1:36 PM, <chr...@wa...> wrote: > > Hmmm. No, nothing like that is available. I was hoping to put out the next > version within a couple weeks. I guess in the meantime you'd need to build > and install it locally yourself. > > Chris > > "Hamlet D'Arcy" <ham...@gm...> wrote on 04/28/2010 02:53:58 AM: > >> Is there a snapshot build available from Maven? >> >> I'd like to always have access to the latest rulesets. >> >> -- >> Hamlet D'Arcy |
From: <chr...@wa...> - 2010-04-28 11:50:56
|
There is no formal distinction between a warning or error. You can, however, configure the priority level for each rule, and then configure the CodeNarc Ant task (e.g., maxPriority1Violations="xxx") to fail the build based on priority level. For instance, you can fail the build for all priority level 1and 2 violations, but not for priority 3. You can also configure rules to priority 4. Violations of such rules are included in the report but do not fail the build. I don't think this is documented anywhere explicitly right now. Suggestions are welcome for a good way to handle or document this requirement/behavior. Chris "Hamlet D'Arcy" <ham...@gm...> wrote on 04/28/2010 06:16:42 AM: > Can I make a rule a warning and not an error? > > -- > Hamlet D'Arcy > ham...@gm... > > ------------------------------------------------------------------------------ > _______________________________________________ > Codenarc-user mailing list > Cod...@li... > https://lists.sourceforge.net/lists/listinfo/codenarc-user |
From: <chr...@wa...> - 2010-04-28 11:36:56
|
Hmmm. No, nothing like that is available. I was hoping to put out the next version within a couple weeks. I guess in the meantime you'd need to build and install it locally yourself. Chris "Hamlet D'Arcy" <ham...@gm...> wrote on 04/28/2010 02:53:58 AM: > Is there a snapshot build available from Maven? > > I'd like to always have access to the latest rulesets. > > -- > Hamlet D'Arcy |
From: Hamlet D'A. <ham...@gm...> - 2010-04-28 10:16:52
|
Can I make a rule a warning and not an error? -- Hamlet D'Arcy ham...@gm... |