Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Tip

The plugin also adds a project dashboard under the name SCM Stats that contains all four widgets.

Usage, Installation and Configuration

...

Requirements

If you plan to use this plugin with non-maven projects, or SCM access is available only with username/password or no SCM information is included in project's pom.xml you have to also install

...

the SCM Activity plugin

...

.

Compatibility Matrix:

Plugin version

0.10.20.3.1
Source Control   

Subversion

(tick)

(tick)(tick)
Git(tick)(tick)(tick)
Mercurial(error)

(tick) (Authors activity not supported
see SONARPLUGINS-3108 )

(tick) (Authors activity not supported
see SONARPLUGINS-3108 )
CVS(error)(tick) (Authors activity not supported
see SONARPLUGINS-3104 )
(tick) (Authors activity not supported
see SONARPLUGINS-3104 )
Perforce(error)(error)(tick)
Jazz(error)(error)(question)

(tick) - supported

(star) - tested by users

(question) - not tested

(error) - not implemented

Include Page
Include - Plugin Installation
Include - Plugin Installation

Usage and Configuration

  1. Set the SCM URL of your project (see SCM URL Format) by setting the sonar.scm.url property of SCM Activity plugin. For Maven projects this is automatically discovered if it's already set in pom.xml

  2. Set the SCM user / password (if needed) by setting the sonar.scm.user.secured and sonar.scm.password.secured properties of SCM Activity plugin
  3. Launch a new quality analysis and the metrics will be fed

    The sonar.scm.user.secured and sonar.scm.password.secured properties end with secured which means that we need to authenticate the analyzer to use them. So you have two possible solutions.
    A: If you've set these properties at project or global settings then use/set the sonar.login and sonar.password properties in your analyzer to authenticate it.
    B: You can set sonar.scm.user.secured and sonar.scm.password.secured properties directly in your analyzer wihtout specifying the  sonar.login and sonar.password properties.
    For example if you use maven then in case A (scm properties set in project/global settings) the maven cmd could be like this 

     

    Warningnote
    titleImportant notice
    No Format
    nopaneltrue
    mvn sonar:sonar -Dsonar.login=admin -Dsonar.password=admin  

    and in case B (scm properties set directly to analyzer) like this 

 

No Format
nopaneltrue
mvn sonar:sonar -Dsonar.scm.user.secured=<SCM_USER> -Dsonar.scm.passoword.secured=<SCM_PWD>
Security note for SonarQube 3.4.0 to 3.6.3 included

For the *.secured properties to be read during the project analysis, it is necessary to set the sonar.login and sonar.password properties to the credentials of a user that is:

  • System administrator
  • And project administrator on the project that is being analyzed
Example:
sonar-runner -Dsonar.login=admin -Dsonar.password=admin

Grabbing stats for multiple periods

Since version 0.2, the plugin allows the collection of SCM stats for multiple (1-3) periods. By default the plugin collects stats for the whole history (sonar.scm-stats.period1 = 0 days).
You can have different periods on a global or project level by setting the number of days prior to the current date that the plugin will collect scm stats.

For example to collect scm stats for the last month, enter a value of 30, for the last week a value of 7, etc.

The properties for period 2 ( sonar.scm-stats.period2 period2) and period 3 ( sonar.scm-stats.period3 period3) can have the value of zero(0) but the plugin will ignore it. In other words, whole history stats, will be collected only if sonar.scm-stats.period1property is set to zero(0). Negative values are ignored for all periods.

You can edit widget properties by setting the period number (acceptable value are 1-3). By default each widget shows stats for period 1.


Ignoring / merging authors

Since 0.3 the plugin allows you to set an list of authors to ignore (sonar.scm-stats.authors.ignore) and a list of synonyms to merge author names (sonar.scm-stats.authors.merge).
If you want to set them using the project / global settings then add one author (ignored or merged) in each value.
If you want to pass them as analysis arguments then you have to add the comma (,) between authors.
Example for ignored authors : -Dsonar.scm-stats.authors.ignore=author1,author2,author3
Example for ignored authors : -Dsonar.scm-stats.authors.merge="author1=author;AUTHOR1,author2=author22;Author2;authOr2"

 

Perforce Configuration

 

Perforce is supported since version 0.3 and you need to set the Client Spec name property (sonar.scm-stats.perforce.clientspec) in order to be able to get scm stats  

Compatibility Matrix

Plugin version

0.10.20.3.1
Source Control   

Subversion

(tick)

(tick)(tick)
Git(tick)(tick)(tick)
Mercurial(error)

(tick) (Authors activity not supported
see SONARPLUGINS-3108 )

(tick) (Authors activity not supported
see SONARPLUGINS-3108 )
CVS(error)(tick) (Authors activity not supported
see SONARPLUGINS-3104 )
(tick) (Authors activity not supported
see SONARPLUGINS-3104 )
Perforce(error)(error)(tick)
Jazz(error)(error)(question)

(tick) - supported

(star) - tested by users

(question) - not tested

(error) - not implemented

Metrics Definitions

Name

Key

Qualitative

Description

Commits Per Author

scm-commits-per-user

no

Reports on the number of commits per author.

Commits Per Clock Hour

scm-commits-per-clockhour

no

Reports on the number of commits per clock hour.

Commits Per Week Dayscm-commits-per-weekdaynoReports on the number of commits per week day.
Commits Per Monthscm-commits-per-monthnoReports on the number of commits per month.

...

JIRA Issues
anonymoustrue
titleRelease 0.3.1 (bug-fix release)
renderModestatic
width900
columnstype;key;summary;priority;status
urlhttp://jira.codehaus.org/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?fixfor=19580&pid=11911&sorter/field=priority&sorter/order=DESC&tempMax=1000

 

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

 

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

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