Skip to content

roryclaasen/sonar-vcsparser-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sonar Vcsparser Plugin

Build status (main) CodeQL (main) Codecov (main) Quality Gate Status (main) GitHub tag (latest)

Vcsparser Extensions for SonarQube

Metrics

  • Lines Fixed Over Lines Changed (vcsparser_linesfixedoverchanged_xx)
  • Number of authors (vcsparser_numauthors_xx)
  • Number of authors over 10% contribution (vcsparser_numauthors10perc_xx)

Metric Requirements

Lines Fixed Over Lines Changed

  • vcsparser_lineschanged_xx
  • vcsparser_lineschanged_fixes_xx

Number of authors

  • vcsparser_authors_data

Number of authors over 10% contribution

  • vcsparser_authors_data
  • vcsparser_numchanges_xx

Time Period

Metrics in the list above may be suffixed with _xx, this represents that there is a metric for each time period. For instance vcsparser_linesfixedoverchanged_3m or vcsparser_linesfixedoverchanged_1d.

Period Suffix
1 Year _1y
6 Months _6m
3 Months _3m
30 Days _30d
7 Days _7d
1 Day _1d

Metric Customisation

Options are available to customise the name, description or domain of a metric.

To do so first create a json file in a similar format to bellow. (example measures.example.json)

{
    "metrics": [
        {
            "key": "key_of_metric_to_change",
            "name": "The new Name of the metric",
            "description": "The new Description of the metric",
            "domain": "The new Domain of the metric"
        }
    ]
}

Now set up an environment variable called SONAR_VCSPARSER_JSONDATA that points to this file.

Any changes to the json file will require a restart of SonarQube.

Prerequisites

Installation

  1. Download the latest build from GitHub release.
  2. Move the plugin into plugins folder (~\extensions\plugins). Make sure to remove any old versions

vcsparser setup

To publish the metrics from vcsparser you may also need sonar-generic-metrics. View the documentation on vcsparser and sonar-generic-metrics to lean how.

License

This project is licensed under the MIT License - see the license file for details