itBooze Code Quality Tools for Groovy by Grygoriy Mykhalyunyo
Upcoming SlideShare
Loading in...5
×
 

itBooze Code Quality Tools for Groovy by Grygoriy Mykhalyunyo

on

  • 2,216 views

 

Statistics

Views

Total Views
2,216
Views on SlideShare
803
Embed Views
1,413

Actions

Likes
0
Downloads
2
Comments
0

10 Embeds 1,413

http://www.grygoriy.com 944
http://jujo00obo2o234ungd3t8qjfcjrs3o6k-a-sites-opensocial.googleusercontent.com 140
https://jujo00obo2o234ungd3t8qjfcjrs3o6k-a-sites-opensocial.googleusercontent.com 118
http://it-booze.blogspot.com 100
http://www.itbooze.com.ua 81
http://localhost 13
http://feeds.feedburner.com 7
http://itbooze.blogspot.com 5
http://www.linkedin.com 4
http://feedly.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as OpenOffice

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

itBooze Code Quality Tools for Groovy by Grygoriy Mykhalyunyo itBooze Code Quality Tools for Groovy by Grygoriy Mykhalyunyo Presentation Transcript

  • Groovy code quality reports by Grygoriy Mykhalyunyo [email_address] grygoriy.com @grishaster
  • Agenda CodeNarc GMetrics
  • CodeNarc http://codenarc.sourceforge.net/ CodeNarc analyzes Groovy code for defects, bad practices, inconsistencies, style issues and more. A flexible framework for rules, rulesets and custom rules means it's easy to configure CodeNarc to fit into your project. Build tool, framework support, and report generation are all enterprise ready.
  • CodeNarc Can be runed from - command line - as ant task - as maven task - as gradle task - as grails plugin
  • CodeNarc at gradle apply plugin: 'code-quality' codeNarcConfigFileName = 'config/codenarc/rules.groovy'
  • CodeNarc ruleset ruleset { description 'Rules Sample Groovy Gradle Project' ruleset('rulesets/basic.xml') ruleset('rulesets/braces.xml') ruleset('rulesets/exceptions.xml') ruleset('rulesets/imports.xml') ruleset('rulesets/logging.xml') ruleset('rulesets/naming.xml') { 'ClassName' { enabled = false } } ruleset('rulesets/unnecessary.xml') { 'UnnecessaryReturnKeyword' { enabled = false } } ruleset('rulesets/unused.xml') }
  • CodeNarc report
  • CodeNarc custome rules import org.codenarc.rule.AbstractRule import org.codenarc.source.SourceCode /** * Sample rule. Checks for static fields. */ class MyStaticFieldRule extends AbstractRule { String name = 'MyStaticField' int priority = 2 void applyTo(SourceCode sourceCode, List violations) { sourceCode.ast.classes.each { clazz -> clazz.fields.each { fieldNode -> if (fieldNode.static) { violations << createViolation(sourceCode, fieldNode) } } } } }
  • CodeNarc at Grails grails install-plugin codenarc grails codenarc
  • Gmetrics http://gmetrics.sourceforge.net/ The GMetrics project provides calculation and reporting of size and complexity metrics for Groovy source code. GMetrics scans Groovy source code, applying a set of metrics, and generates an HTML report of the results.
  • Gmetrics
    • Cyclomatic Complexity.
    • ABC Size/Complexity. Also see the C2 Wiki page.
    • Lines per method
    • Lines per class
  • Gmetrics at Grails
    • grails install-plugin gmetrics
    • grails gmetrics
  • Gmetrics sample report
  • Thank you Grygoriy Mykhalyunyo [email_address] grygoriy.com @grishaster