Sonar Scalastyle Plugin



VNGRS Tech Talk

25 July 2014




Han Tuzun

Scalastyle




The style checker for Scala
Highly configurable


scalastyle.org

Implemented Rules

  • simplify.boolean.expression
  • file.size.limit
  • line.size.limit
  • line.contains.tab
  • not.implemented.error.usage
  • magic.number
  • spaces.after.plus
  • whitespace.end.of.line
  • class.name
  • object.name
  • equals.hash.code
  • illegal.imports
  • no.whitespace.before.left.bracket
  • no.finalize
  • covariant.equals
  • structural.type
  • number.of.types
  • cyclomatic.complexity
  • if.brace
  • method.length
  • number.of.methods
  • public.methods.have.type
  • var.local
  • if.redundant
  • token
  • deprecated.java
  • empty.class
  • class.type.parameter.name
  • lowercase.pattern.match
  • multiple.string.literals
  • import.grouping
  • procedure.declaration
  • space.after.comment.start

SonarQube



A platform to manage code quality

A web application

Saves past reports


sonarqube.org



The Plugin!



Creates rules for SonarQube

Creates the default quality profile

Exports Scalastyle config xml files

Creates SonarQube issues


github.com/emrehan/sonar-scalastyle

Development



SonarQube API 4.1 used

Abstract SonarPlugin extended

Extensions are plugged in

Written in Scala

Challenges



        Poor API Documentation

      ⇩  Feedback from SonarQube

      ⇩  Dependency to the Scala Plugin

         A small problem we faced while testing

Poor API Documentation


Dev Mail Group


Feedback from SonarQube



Dependency to the Scala Plugin





Instructions on GitHub


Thanks




Get ฿0.001  per bug!



slides.com/emrehan/sonar-scalastyle

emrehan@vngrs.com

erol@vngrs.com

@EmrehanTuzun

Made with Slides.com