Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Name

Scala Plugin

Latest version

Trunk

Requires SonarQube version

2.9 or higher

License

GNU LGPL v3

Developers

Felix Müller

Issue Tracker

http://jira.codehaus.org/browse/SONARPLUGINS/component/14772

Sources

http://www.github.com/SonarCommunity/sonar-scala

Description / Features

This plugin enables the analysis of Scala projects.

The following metrics are supported:

  • Lines
  • Lines of code
  • Comment lines
  • Classes
  • Functions
  • Statements
  • Public API
  • Cyclomatic Complexity

Roadmap

The version 0.1 of this plugin will cover calculation of base metrics.

The next versions will cover the following features:

  • integration of Scalastyle for violation checks
  • more metrics like lcom4, response for class, depth in tree
  • measuring code coverage

Installation

  1. Copy the jar into /extensions/plugins/ directory
  2. Restart SonarQube Web server

Usage

Maven projects

If your project is built with maven, you should add:

Code Block
<sourceDirectory>src/main/scala</sourceDirectory>

to the build section in your pom and:

Code Block
<properties>
  <sonar.language>scala</sonar.language>
</properties>

Non-maven projects

If your project does not use maven as a build engine, you should create a small pom.xml file at the root of your project containing the following content:

Code Block
titlepom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>my.group.id</groupId>
  <artifactId>arifactId</artifactId>
  <version>1.0</version>
  <packaging>pom</packaging>
  <name>The Name of My Project</name>
  <build>
    <sourceDirectory>src/main/scala</sourceDirectory>
  </build>
  <properties>
    <sonar.language>scala</sonar.language>
  </properties>
</project>

Running analysis

To kick-off the analysis, run mvn sonar:sonar.

Contribution

Everybody with an interest in developing Scala SonarQubesupport is invited to contribute.

Project Setup

Project setup with Eclipse Indigo:

  • install Scala IDE plugin and m2eclipse plugin in Eclipse
  • checkout the source code
  • in Eclipse:
    • import maven project
    • add Scala nature to the project (right click on project name -> configure or so...)
    • add manually src/main/scala and src/test/scala as source folder to the build path
    • to finish: run 'mvn package' and a clean in Eclipse
  • Done.

General Advice

If you start developing, you should respect the forge guidelines.

Change Log

JIRA Issues
anonymoustrue
titleVersion 0.1
height180
renderModestatic
width900
columnstype;key;summary;priority;status;resolution
urlhttp://jira.codehaus.org/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?fixfor=17497&pid=11911&sorter/field=status&sorter/order=DESC&tempMax=1000