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.

CodeSonar Plugin

codesonar: CodeSonar

  • conditions
    Choose the condition you want CodeSonar to use for build verification
      Array / List of Nested Choice of Objects
    • warningCountIncreaseNewOnly

      Condition will trigger the warranted result if the amount of warnings that did not exist until the current analysis is exceeded by more than the designated percentage.

      Maximum percentage increase - if the percentage of warnings exceed this amount it will mark build with the desired result [default 5.0]

      Mark build as - the desired result if the condition is triggered.

      • percentage : String (optional)
      • warrantedResult : String (optional)
    • cyclomaticComplexity

      Condition will change the result of the build if the cyclomatic complexity of procedures exceeds the preset value.

      Cyclomatic complexity limit - The procedures with cyclomatic complexity that exceeds this value will change the build result. [default 30]

      Mark build as - the desired result if the condition is triggered.

      • maxCyclomaticComplexity : int (optional)
      • warrantedResult : String (optional)
    • redAlerts

      Condition will change the result of the build if the amount of red alerts exceed the predefined value.

      Maximum amount of alerts - the maximum allowed amount of red alerts [default 1]

      Mark build as - the desired result if the condition is triggered.

      • alertLimit : int (optional)
      • warrantedResult : String (optional)
    • warningCountAbsoluteSpecifiedScoreAndHigher

      Condition will change the result of the build if the number of warnings above the predefined rank is greater then the maximum allowable.

      Rank of warnings - only warnings that are at or above this rank will be checked. [default 56]

      Maximum warnings - if the number of warnings at or above the specified score exceed this amount it will mark build with the desired result [default 20]

      Mark build as - the desired result if the condition is triggered.

      • rankOfWarnings : int
      • warningCountThreshold : int
      • warrantedResult : String (optional)
    • warningCountIncreaseOverall

      Condition will change the result of the build if the amount of warnings the analysis produces is greater than the preset percentage.

      Maximum percentage increase - if the percentage of warnings exceed this amount it will mark build with the desired result [default 5.0]

      Mark build as - the desired result if the condition is triggered.

      • percentage : String
      • warrantedResult : String (optional)
    • warningCountIncreaseSpecifiedScoreAndHigher

      Condition will change the result of the build if the percentage of warnings bellow the predefined rank increases above a certain percentage.

      Rank of warnings - Only warnings that are bellow this rank will be checked. [default 30]

      Maximum percentage increase - if the percentage of warnings exceed this amount it will mark build with the desired result [default 5.0]

      Mark build as - the desired result if the condition is triggered.

      • rankOfWarnings : int
      • warningPercentage : String
      • warrantedResult : String (optional)
    • yellowAlerts

      Condition will change the result of the build if the amount of yellow alerts exceed the predefined value.

      Maximum amount of alerts - the maximum allowed amount of yellow alerts [default 1]

      Mark build as - the desired result if the condition is triggered.

      • alertLimit : int (optional)
      • warrantedResult : String (optional)
  • protocol : String
    Choose http or https
  • hubAddress : String
    Your hub location as host:port without protocol. For example, myhub.example.com:7340
  • projectName : String
    The CodeSonar project path.
    This is used to identify analysis results for previous, related Jenkins builds. It should be set to the same CodeSonar hub project path used in your codesonar build and codesonar anaylze commands. The project path is determined by the codesonar -project option if present, or the base name of the CodeSonar project file. This field is required.
  • credentialId : String
    CodeSonar Hub user account credentials.
    Credentials used to authenticate the CodeSonar operations that you will be invoking within Jenkins.
    Provide one of the following.
    • A Credentials parameter of type Username with password, containing the hub user account username and password.
    • A Credentials parameter of type Certificate, containing the user certificate and its private key in PKCS#12 format.

    This account must have sufficient permissions to:
    • Sign into the hub.
    • Analyze the project you are interested in.
    • Create a launch daemon.
    • Browse analysis results.

    With factory settings, it is sufficient for the hub user account to have the built-in Enabled and User roles.
  • visibilityFilter : String (optional)

    A CodeSonar warning visibility filter.
    CodeSonar conditions based on "number of warnings" are evaluated with respect to this filter.

    • You can specify a warning visibility filter by name or by numeric ID.

    • By default, the active filter is used.

    • To view the list of available warning visibility filters, including their names, IDs, and search definitions, see the Warnings tab of the Saved Searches page in the CodeSonar GUI.

      MANUAL: Using CodeSonar > GUI Reference > Searching > GUI: Saved Searches

  • aid : String (optional)
    The analysis ID of the CodeSonar analysis results to use.
    If this field is not specified, the plugin will use the analysis results associated with your CodeSonar Project File.
    NOTE: This attribute is intended to be used in scripted pipeline projects. It is not typically useful for freestyle projects, and should be left blank.
  • newWarningsFilter : String (optional)

    A CodeSonar warning visibility filter.
    CodeSonar conditions based on "number of new warnings" are evaluated with respect to this filter.

    • You can specify a warning visibility filter by name or by numeric ID.

    • By default, the new filter is used.

    • To view the list of available warning visibility filters, including their names, IDs, and search definitions, see the Warnings tab of the Saved Searches page in the CodeSonar GUI.

      MANUAL: Using CodeSonar > GUI Reference > Searching > GUI: Saved Searches

  • projectFile : String (optional)
    CodeSonar project file path.
    This should match the project file path you specified in your codesonar build and codesonar analyze command lines.
    Relative paths are interpreted with respect to the Jenkins build working directory.
  • serverCertificateCredentialId : String (optional)
    CodeSonar Hub server certificate.
    [Optional, HTTPS hubs only]
    A Credentials parameter of type secret file, where the file contains the hub server certificate in PEM format (Base-64 encoded ASCII).
    This setting is useful if your hub is not automatically trusted by your Jenkins server, for example, if your hub uses a self-signed certificate.
  • socketTimeoutMS : int (optional)
    Use this attribute to override default connection timeout.

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.