Targets
Required role | Campaign Management |
Access | CodeChecker Server → Campaign Configuration → Targets |
Targets identify the applications and the specific source members to analyze during a code review process. A target must be associated with a code review to create a campaign. When this campaign is launched, the rule sets defined in the code review are all executed on the associated target.
There are different types of targets:
- IBM i targets, which connect to IBM i and specify the libraries, objects and members to include in the code review process.
- ARCAD targets, which connect to an ARCAD server and specify the application, environment and version to include in the code review process.
- Git targets, which connect to a Git repository, clone it to include its content in the code review process.
- External targets, that are generated when using Jenkins to upload source and run code review campaigns.
For more information about code reviews, refer to Code reviews.
For more information about campaigns, refer to Campaigns.
The Targets view is accessed from the Campaign Configuration node in the Navigator.
Enter any combination of the above search criteria, then click the Search button to display the results. To display the complete list, click the Search button without entering any search criteria.
Follow the subsequent steps to create a new target.
Step 1 To access the Create Target wizard, either click the Create icon in the toolbar of the Targets search view, or right-click anywhere in the list of the view and select Create Target.
Step 2 Define the target's Code and Name. These values are required to create a new target but can be edited later.
Step 3 Enter a Description for the target.
Step 4 Select the target's Type from the drop-down list. This value is required and cannot be edited once the target is created.
- Select IBM i Target if the target is an IBM i program.
- Select ARCAD Target if the target is an ARCAD application.
- Select Git Target if the target is a Git repository.
- Select External Target if the sources and execution will be managed by Jenkins.
Step 5 Tick the Upload to SonarQube box if your code quality results are managed via SonarQube. This option is enabled only if the ARCAD CodeChecker for SonarQube solution is set up.
Click Finish.
Result The new target is created and its editor opens automatically. It is displayed in the list in the Targets search view.
It is required to edit new targets before using them.
To open a target's editor, locate the target in the Targets search view, then either:
- double-click on the item in the view,
- right-click on the item in the view and select Edit, or
- select the item in the view and click the Edit icon in the toolbar.
The editable values are all located in the Target tab in the target's editor. The Schedules tab displays the list of schedules that are using this target. Double-click on a schedule to access its editor.
For more information about the schedules linked to the targets, refer to Schedules.
Save the changes (, Ctrl+S
or File > Save).
There are four types of targets, and each type requires different parameters for the target to be used.
- Name
- The target's name should reflect the application to analyze during a code review process to be easily identified.
- Description
- Use this description to give as many details as possible about the application and the source members that will be analyzed during a code review process.
- Upload to SonarQube
- If ticked, the issues raised for this target are managed via SonarQube.This option is only available if the ARCAD CodeChecker for SonarQube solution is set up.
Select the IBM i server from the drop-down list. If the connection does not exist, click the link to Create a new IBM i server.
IBM i connections are managed from the IBM i Servers view. For more information, refer to IBM i servers.
Declare a Reference target to manage the delta between issues raises when executing a campaign.
A campaign for an IBM i target with a reference will be comprised of two executions:
- One execution to list the issues from the source members from the reference (if it exists). These issues will be marked as Ignored by default.
- One execution to list the issues from the target's library members. Issues already found in the reference will still be Ignored, and new issues (ie. not found in the reference) will be marked as Opened.
The members from the target will simply be looked up in the reference based, by looking for the couple file/member in the reference target's libraries.
Leave the reference target blank if you do not want to compute delta for the target. The campaign execution will act as before, counting every issue as an Open issue.
When a target is used as a reference, it cannot define a reference for itself (the selection drop-down list will be disabled). Also, a target using a reference cannot be used as a reference (it will not appear in the drop-down list of reference target).
Specify the sources to include in the code review process. Follow the subsequent steps to add sources to a target.
Step 1 Select the IASP (independent axillary storage pool) from the drop-down list, if the IBM i objects linked to this project are located on an iASP. The list shows all the available IASP on the selected IBM i server. The list is refreshed when the server selection is changed.
Step 2 In the Sources tab, click the Add button.
Step 3 Select the source path type in the dialog.
Tick the Library button to add sources from a library.
Tick the IFS path button to add sources from the integrated file system.
Click OK.
Step 4 Define the source path according to its type:
Library: Define the pattern for the libraries, files, and members you wish to add.
IFS Path: Define an IFS pattern path, using wildcards in any part of the path to make multiple selections.
Each definition is a "Path pattern", whether it is a Library path or an IFS path. Each pattern supports two types of wildcards:
- ***: one or many character of any type
- ?: one character of any type
A blank field is equivalent to ***, which means "everything".
Click OK.
Result The source is added to the target. It is displayed in the Sources tab in the target's editor.
To delete sources from a target, select the path in the list and click the Remove button.
Use the Library list tab to indicate where /COPY and /INCLUDE sources can be found.
- Library list
- List the additional libraries in which to search for the sources called by the /COPY and /INCLUDE.
- IFS path
- Specify the path in the IFS (Integrated File System) where the sources called by the /COPY and /INCLUDE are.
Reorder the lists as the sources will be processed in the order in the list.
- Name
- The target's name should reflect the application to analyze during a code review process to be easily identified.
- Description
- Use this description to give as many details as possible about the application and the source members that will be analyzed during a code review process.
- Upload to SonarQube
- If ticked, the issues raised for this target are managed via SonarQube.This option is only available if the ARCAD CodeChecker for SonarQube solution is set up.
Select the IBM i server from the drop-down list. If the connection does not exist, click the link to Create a new IBM i server.
IBM i connections are managed from the IBM i Servers view. For more information, refer to IBM i servers.
- Instance
- Select the name of the ARCAD instance from the drop-down list.
- Language
- Enter the language defined for the ARCAD instance manually, or select it from the drop-down list.
- Application
- Enter the code of the ARCAD application manually, or select it from the drop-down list.
- Environment
- Enter the code of the environment where the ARCAD application is located manually, or select it from the drop-down list. Set this option to *NONE to define the ARCAD target for an entire environment.
- Version
- Enter the version number of the ARCAD application manually, or select it from the drop-down list. Set this option to *NONE to define the ARCAD target for an entire environment.
- Name
- The target's name should reflect the application to analyze during a code review process to be easily identified.
- Description
- Use this description to give as many details as possible about the application and the source members that will be analyzed during a code review process.
- Upload to SonarQube
- If ticked, the issues raised for this target are managed via SonarQube.This option is only available if the ARCAD CodeChecker for SonarQube solution is set up.
Select the IBM i server from the drop-down list. If the connection does not exist, click the link to Create a new IBM i server.
IBM i connections are managed from the IBM i Servers view. For more information, refer to IBM i servers.
Define the remote Git repository to clone and the branch to pull. Click on a branch to select it.
- URL
- Enter URL to the Git repository. Depending on the protocol used to clone the repository (HTTP or SSH), the other fields of the editor will be enabled or disabled.
- Branch
- Enter the name of the branch to clone or click the Branch link to select the branch from a dialog.
- IASP
- Select the IASP (independent axillary storage pool) from the drop-down list, if the IBM i objects linked to this project are located on an iASP. The list shows all the available IASP on the selected IBM i server. The list is refreshed when the server selection is changed.
Depending on the connection protocol you choose (SSH or HTTP), define the credentials used to connect to the remote git repository.
- SSH key
- Select the SSH key in the drop-down list. The SSH keys available are the one configured in the SSH Keys view.
- HTTP auth method
-
When connecting through HTTP, an authentication method must be selected. Available methods are:
- Basic auth: requires a user name and a password
- Personal token: requires a user name; the token must be put in the password field.
- OAuth: the OAuth token must be put in the connection URL as well as in the password field. (Example URL: https://my_token@github.com/user/repo.git).
- SAML: the access token must be put in the password field. It will be used as a user credential.
- SAML (header): the access token must be put in the password field. It will be put in the HTTP header with each request.
- User & Password
- Enter the user and password to connect to the Git repository.
This section is only enabled when connecting through HTTP. Define the proxy server's URL and the credentials to use to connect to it.
There are two possible ways to use a Git target in a campaign: full mode or delta mode.
Full mode: When the Use Delta option is disabled on a target, the remote branch is checked out entirely and all the source files are analyzed during a campaign.
Delta mode: When the Use Delta option is enabled on a target, only the files that have been modified on that branch are analyzed. First, the repository is checked out and only the modified files are analyzed. Then, the repository is checked out again using the initial commit id (i.e. the root of the branch) and the modified files get analyzed again. Issues found in both the tip and the root of the branch are ignored by default.
Tick the Use delta box to enable the delta mode. You can set the name of the Parent Branch or click its hyperlink to open a selection dialog to pick an existing branch. If no parent branch is provided, ARCAD CodeChecker tries to find it.
The Initial Commit ID field is read only and filled after the target has been used in a campaign at least once. It contains the ID of the commit detected by ARCAD CodeChecker as the commit on which the branch was created.
- Name
- The target's name should reflect the application to analyze during a code review process to be easily identified.
- Description
- Use this description to give as many details as possible about the application and the source members that will be analyzed during a code review process.
- Upload to SonarQube
- If ticked, the issues raised for this target are managed via SonarQube.This option is only available if the ARCAD CodeChecker for SonarQube solution is set up.
Select the IBM i server from the drop-down list. If the connection does not exist, click the link to Create a new IBM i server.
IBM i connections are managed from the IBM i Servers view. For more information, refer to IBM i servers.
External target are managed outside of the CodeChecker Studio. Information about the target are uploaded from the external source.
The Reset Target option makes it possible to delete all the issues and measures linked to the target. You can reset several targets at once.
Deleted related issues and measures cannot be recovered.
To reset a target, either right-click on the target in the Targets search view and click Reset Target, or select the target in the Targets search view and click the Reset Target icon in the toolbar.
A confirmation dialog then pops up, click Yes to confirm or click No to cancel.
Deleted targets cannot be recovered.
To delete a target, either right-click on it in the Targets search view and select Delete, or select it and click the Delete icon in the toolbar. Click OK to confirm or click Cancel to keep the target.