# Test the Snyk Broker Code Agent setup

{% hint style="warning" %}
**Deprecated**

The Code Agent is deprecated and is no longer maintained.

The preferred method of running Snyk Code analysis using Snyk Broker is through [Brokered Code](https://docs.snyk.io/enterprise-setup/snyk-broker/install-and-configure-snyk-broker/advanced-configuration-for-snyk-broker-docker-installation/snyk-code-clone-capability-with-broker-for-docker). The Code Agent is an alternative method without advantages. For details, contact your Snyk Integration Consultant or Technical Success Manager or contact [Snyk Support](https://support.snyk.io).

The automatic [PR Checks](https://docs.snyk.io/scan-with-snyk/pull-requests/pull-request-checks) feature is not supported for Snyk Broker - Code Agent.
{% endhint %}

To test the Code Agent with Snyk Broker setup, import a repository to Snyk and verify that you receive the Code Analysis Project and results. When the selected repositories are imported to Snyk, and the Snyk Code results are displayed, the Code Agent with Snyk Broker setup is operating successfully.

To test the setup, follow these steps:

1\. On the Snyk Web UI, open the Organization where you want to test the Code Agent.

2\. When the required Organization is open, select **Add project**. Then select the SCM for which you set the Code Agent:

<figure><img src="https://2533899886-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdwVZ6HOZriajCf5nXH%2Fuploads%2Fj0DUfC0x8nvi9aDpMqVO%2FCode%20Agent%20-%20Test%20-%20Selecting%20SCM%20for%20import.png?alt=media&#x26;token=1d585276-6b7c-4dc5-8dea-ed50004d80b3" alt="Select Add Project and the SCM"><figcaption><p>Select Add Project and the SCM</p></figcaption></figure>

3\. On the **Personal and Organization repositories** page, select the repositories you want Snyk Code to analyze, and click the **Add selected repositories** button:

<figure><img src="https://2533899886-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdwVZ6HOZriajCf5nXH%2Fuploads%2Fk1j7kn3TfdchxkV5A2TC%2FCode%20Agent%20-%20Test%20-%20Selecting%20repos%20for%20import.png?alt=media&#x26;token=8c05cc7b-faef-43e3-884f-7229b5dbb438" alt="Select repositories for Snyk Code to analyze"><figcaption><p>Select repositories for Snyk Code to analyze</p></figcaption></figure>

The selected repositories are imported to Snyk Code, and a progress bar appears on the **Projects** page. When the import is completed, a message appears on the **Projects** page confirming the success of the import. Your imported repositories appear as Target folders, each containing the **Code analysis** Project that includes the findings of the Snyk Code test:

<figure><img src="https://2533899886-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdwVZ6HOZriajCf5nXH%2Fuploads%2FsFSqxMv3ZodXF59V0eGe%2FCode%20Agent%20-%20Test%20-%20Code%20Analysis%20Project.png?alt=media&#x26;token=34b9c9b0-51f9-45f9-b442-7324ee14daac" alt="Confirmation message and target folders"><figcaption><p>Confirmation message and target folders</p></figcaption></figure>

4\. To view the Snyk Code results, select the **Code analysis** Project.

The **Code Analysis** page opens, displaying the list and details of the vulnerability issues that were discovered in the selected repository:

<figure><img src="https://2533899886-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdwVZ6HOZriajCf5nXH%2Fuploads%2FmdU0D43VzD62IqeicF8c%2FCode%20Agent%20-%20Test%20-%20Code%20Analysis%20page.png?alt=media&#x26;token=5a9b2941-4a0a-49c7-ab98-cc5607c5cde5" alt="Code Analysis page showing issues"><figcaption><p>Code Analysis page showing issues</p></figcaption></figure>

5\. To view the details of a vulnerability issue, select **Full details**.

The details of the issue appear, and depending on the way you set up the Broker client, the code snippets either appear in the **Data flow** tab or not:

This example shows Snyk Code results with code snippets.

<figure><img src="https://2533899886-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdwVZ6HOZriajCf5nXH%2Fuploads%2FarerukRHyQnx9xKiziLs%2FBroker%20-%20Results%20-%20with%20code%20snippets.png?alt=media&#x26;token=fd7841b2-87f6-48ed-ac56-f7b4323d166e" alt="Broker Client run with display of code snippets"><figcaption><p>Broker Client run with display of code snippets</p></figcaption></figure>

This example shows Snyk Code results without code snippets:

<figure><img src="https://2533899886-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdwVZ6HOZriajCf5nXH%2Fuploads%2Fgit-blob-e2c525468bba44e785a121f0d93416f52fa84e8d%2FBroker%20-%20Results%20-%20without%20code%20snippets%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(4).png?alt=media" alt="Broker Client run with no display of code snippets"><figcaption><p>Broker Client run with no display of code snippets</p></figcaption></figure>

For more information on how to troubleshoot the Snyk Broker Code Agent setup, see [Troubleshooting Broker](../../troubleshooting-broker).
