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.

Perforce Static Analysis Plugin

p4StaticAnalysis: Run Perforce Static Analysis

  • analysisConfig
      Nested Object
    • engine : String
      Select which Perforce static analysis engine you have installed and wish to run the scan with. The options are Helix QAC or Klocwork.
    • analysisType : String
      Select which type of analysis you wish to run.

      Baseline - Performs a project baseline scan using the either kwbuildproject (Klocwork) or 'qacli validate build' (Helix QAC). This scan will detect all the issues within the project and upload the full list to the validate portal.

      Delta - Performs a project scan ( optionally restricted on a source file list ), that only reports the potential new issues in difference to the last baseline scan. This uses the kwciagent (Klocwork) tool or 'qacli validate cibuild' (Helix QAC) tool. The intention of the delta analysis is to be used as part of a quality gate workflow in merge requests. Blocking acceptance of merge requests if the merge were to introduce new issues to a protected branch, which the baseline scan is run on
    • usingBuildCmd : boolean
      To generate the capture information needed for analysis the tooling can either watch a build or this can be pre-generated and provided to the analysis. Enable this to provide the build command to capture the data needed.
    • buildCmd : String
      Provide the build command to wrap and capture the compilation data from, i.e 'make'. Note in cases where environments or configuration needs to be run before the build command this field is a multi-line field. Only the last command will be captured and thus should be the build command. For example:

      ./configure
      make

      Would run ./configure followed by make, the capture of compilations would be on the make process.
    • usingBuildCaptureFile : boolean
      To generate the capture information needed for analysis the tooling can either watch a build or this can be pre-generated and provided to the analysis. Enable this to provide the location of the file containing the p re-generated capture information.

      Note, if 'Using Build Command' is also enabled it will ignore this option and use the build command.
    • buildCaptureFile : String
      The path in the workspace/agent to the pre-generated capture file.
    • scanBuildName : String
      When uploading a scan to the validate portal it will be named, these need to unique for each run as it will not overwrite scans of the same name. The default Jenkins variable of '$BUILD_TAG' has been provided which resolves to: 'jenkins-${JOB_NAME}-${BUILD_NUMBER}'.
    • validateProjectURL : String
      The url for the validate server and project i.e http://localhost:8080/MyProject
    • enableQualityGate : boolean
      Enabling the quality gate will set the Job run to Unstable, Failed or allow it to pass depending on if there are any new issues. Note this only applies to the Delta analysis type
    • restrictionFileList : String
      If performing a delta analysis with the Klocwork engine you may provide the path to text file that contains a list of files present in the build specifcation to restrict the analysis to. An example command to generate this might be: 'git diff --name-only origin/master > restriction_list.txt' The required format fo the contents being, restriction_list.txt: sourceFileA.cpp sourceFileB.cpp sourceFileC.c ... Note that files not present in the build specifcation can be included, however they will be ignored by the analysis.
    • validateProjectName : String
    • jobResult : String (optional)
      When new issues are detected choose which status to set the Job to.

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.