# Codacy

Codacy is an automated code review tool that gives static analysis, cyclomatic complexity, duplication and code unit test coverage changes in every commit and pull request.&#x20;

### Usage of Codacy in Delivery Shield

* Delivery Shield integrates with Codacy to gather source code scan results.&#x20;
* The results are evaluated against secure software delivery policies and are factored into the application’s overall security score.

### To Integrate Codacy:

1. Navigate to **Setup** > **Integrations**.
2. In the **Source** panel, click **Codacy**.

<figure><img src="https://2047464521-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MBEa1hoX6SqpDj-ymNs%2Fuploads%2Fvax2zNnUXnc5BjiA2JL9%2Fcodacy%201.png?alt=media&#x26;token=95610829-3d67-4bfc-aefa-dc71d3c23eac" alt=""><figcaption></figcaption></figure>

3. The Codacy integration page is displayed. Click **+New Account**.&#x20;
4. In the popup that appears, enter the values for the fields as shown below:

<figure><img src="https://2047464521-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MBEa1hoX6SqpDj-ymNs%2Fuploads%2FXPQZKVFGFcTd80xBzxlE%2Fcodacy%202.png?alt=media&#x26;token=bfe203ac-7ac7-4b99-b8ed-4b2b37187bbf" alt=""><figcaption></figcaption></figure>

5. Enter the account name.
6. Select the **Mode :** Local or Cloud.&#x20;
   1. If **Local Mode** is selected, Codacy is run as a CLI tool.
   2. If **Cloud Mode** is selected, SaaS version of Codacy is run.&#x20;
7. Enter the token to access your Codacy account in the **Token** field. (See [Generating API Token](https://docs.snyk.io/getting-started/how-to-obtain-and-authenticate-with-your-snyk-api-token) for details on how to generate API token). &#x20;
8. Select the **Teams** and the corresponding **Environments** from the dropdown for which you want the integration to be available. The integration will be available for the selected teams and environment only.&#x20;

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>You can select up to 5 teams for the integration to be displayed. </p></div>

   * An example is given below for reference:

   <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeuMZQzZsZQuulVdW9B9OuffNPoEXqbcpcAkYtKVyb7YiTQxbVIt1L4Gh-zshqX2J9MFKIat8x4oWFIGxdg3j1XVagyUNhUAlD_52soyMyd1cy53p6XiYi0LsTjIBfHcybRWl61?key=D9EXoOdGF7oYOBvYaW2GnRWJ" alt=""><figcaption></figcaption></figure>

   * In the example above,&#x20;
     * if **Team 1**, **Team 2**, and **Team 3** are selected, only applications associated with these teams can access the integration. Any applications belonging to other teams, such as **Team 4**, will not have access to this account.
     * Even if the user who created this account is also an admin for **Team 4**, the integration account remains restricted and is not available for **Team 4**.&#x20;
     * Access to the account is strictly limited to the specified **Teams** and **Environments** selected during account creation.
   * **For Organization Admins:**
     * When an **Organization Admin** creates an account without selecting specific **Teams** and **Environments**, the account will be universally applicable, granting access to **all teams** and **all environments** by default.
   * **For Team Admins with Multiple Teams:**<br>
     * If a **Team Admin** who manages multiple teams creates an account without specifying particular **Teams** and **Environments**, the account will only be accessible to the teams for which the logged-in user holds admin privileges.
9. Click **Save**. The Codacy account gets integrated in the source stage.&#x20;
10. Click **Edit** to edit the entered values as shown:
11. Enter the new values and click **Update**.&#x20;

The new values get updated.&#x20;

<br>
