The following plugin provides functionality available through Pipeline-compatible steps. Read more about how to integrate steps into your Pipeline in the Steps section of the Pipeline Syntax page.

For a list of other such plugins, see the Pipeline Steps Reference page.

SLOCCount Plug-in

sloccountPublish: Publish Sloccount reports

  • pattern : String (optional)
  • encoding : String (optional)
  • commentIsCode : boolean (optional)
  • numBuildsInGraph : int (optional)
  • ignoreBuildFailure : boolean (optional)

step([$class: 'SloccountPublisher']): Publish SLOCCount analysis results

  • pattern : String

    Fileset 'includes' setting that specifies the generated raw SLOCCount or cloc report files, such as '**/' or '**/cloc.xml'. Basedir of the fileset is the workspace root. If no value is set, then the default '**/' is used. Be sure not to include any non-report files into this pattern.

    The report files must have been generated by sloccount tool using the "--wide --details" options, e.g.

        sloccount --duplicates --wide --details SOURCE_DIRECTORY >

    or by cloc tool using the "--by-file --xml" options, e.g.

        cloc --by-file --xml --out=cloc.xml SOURCE_DIRECTORY

    If you are not sure which type to use, prefer cloc. It is able to detect more programming languages than SLOCCount (Scala, Ant, CSS, ...) and is able to count also lines with comments that often contain Javadoc or Doxygen documentation. Cloc is also better portable, SLOCCount requires cygwin or similar environment under MS Windows.

    Never switch between SLOCCount and cloc inside one job. You would end up with messy trend graph because they name programming languages differently. Delete all affected builds and rebuild the job in such case to fix the issue.

  • encoding : String
    The character encoding of SLOCCount result files. If no value is set, default 'UTF-8' will be used. This option is considered only in the SLOCCount report parser and is ignored in the cloc one.
  • commentIsCode : boolean
  • numBuildsInGraph : int
    Maximal number of last successful builds, that are displayed in the trend graphs. Use 1 or less for unlimited.
  • ignoreBuildFailure : boolean

Was this page helpful?

Please submit your feedback about this page through this quick form.

Alternatively, if you don't wish to complete the quick form, you can simply indicate if you found this page helpful?


See existing feedback here.