# Running an analysis

Now that you’ve installed the SonarQube for IDE extension in your IDE, running an analysis is straight-forward. For the most part, new analyses are automatically triggered when you open a file, as you type, or with each file save following a change in the code. Below we’ve outlined other ways to trigger a SonarQube for IDE analysis.

## Triggering an analysis <a href="#triggering-an-analysis" id="triggering-an-analysis"></a>

By default, new analyses are automatically triggered as you type, following a change in the code. You can disengage automatic analysis by going to **IntelliJ Settings** > **Tools** > **SonarQube for IDE**; in the **Settings** tab, deselect **Automatically trigger analysis**.

There are additional ways to trigger a SonarQube for IDE analysis in IntelliJ:

* **On the Fly** (default): When the file is autosaved or manually saved. Issues found during the analysis are highlighted in the SonarQube for IDE view window under the **Current file** tab.
* **On-Demand**: Single files can be analyzed by right-clicking over a file in the project tree, then selecting **SonarQube for IDE** > **Analyze with SonarQube for IDE**. You can also click the green arrow in the sidebar of the SonarQube for IDE View window or, analyze all project files by right-clicking in the explorer window and selecting **Analyze with SonarQube for IDE**. At any time you can use the keyboard shortcut Cmd+Shift+S/Ctrl+Shift+S on your Mac/Windows machine to analyze all project files.
* **By selection**: Use this method to get feedback on issues found in a set of files. Select one or more files in the Project Tree, then **right-click** > **SonarQube for IDE** > **Analyze with SonarQube for IDE**. The **Report** tab will open automatically in the SonarQube for IDE view window where you can view issues found in multiple files. Note that you can also click the **Analyze All Project Files** button from the **Findings** tab, without having to select them from the Project Tree.

To perform JavaScript or TypeScript analysis, you must set the file path to your Node.js. Go to **IntelliJ Settings** > **Tools** > **SonarQube for IDE** > **Settings**, and select the three dots to bring up a navigation window.

{% hint style="info" %}
A custom change to the configuration such as initializing [connected-mode](https://docs.sonarsource.com/sonarqube-for-intellij/connect-your-ide/connected-mode "mention") or when modifying your selected rule set using a [fixing-issues](https://docs.sonarsource.com/sonarqube-for-intellij/using/fixing-issues "mention"), a new analysis will be triggered because it could lead to different results.
{% endhint %}

### Triggering an analysis from your Findings tabs <a href="#triggering-an-analysis-from-current-file-tab" id="triggering-an-analysis-from-current-file-tab"></a>

It is possible to trigger an analysis on demand by clicking the green arrow in the sidebar of the SonarQube for IDE view window; conversely, there is a **Cancel SonarQube for IDE Analysis** button shown in red. Also, the **Findings** tab offers a shortcut to the **Project Settings** and a **Clear SonarQube for IDE Issues** button to help manage the report of issues.

SonarQube for IntelliJ also allows you to complete an analysis of all project files and an option to review issues found in other files without having to open them. From the **Findings** tab of the SonarQube for IDE view window, select the **Analyze VCS Changed Files** button to analyze files that are not yet committed but have changed since the last commit.

In addition to right-clicking on the project folder to select **SonarQube for IDE** > **Analyze with SonarQube for IDE**, you can click on the folder icon in the left toolbar of the SonarQube for IDE view window to **Analyze All Project Files**. Likewise from the explorer window, entering the keyboard shortcut Cmd+Shift+S/Ctrl+Shift+S on your Mac/Windows machine will trigger an analysis on *all project files* and automatically open a new **Reports** tab to view the report; see the [#the-report-tab](https://docs.sonarsource.com/sonarqube-for-intellij/using/investigating-issues#the-report-tab "mention") article for more details.

## File exclusions <a href="#file-exclusions" id="file-exclusions"></a>

In addition, it’s possible to limit the analysis by excluding files. Go to **IntelliJ Settings** > **Tools** > **SonarQube for IDE** > **File Exclusions** to define an exclusion pattern. More details can be found on the [file-exclusions](https://docs.sonarsource.com/sonarqube-for-intellij/using/file-exclusions "mention") page.

### Language-specific analysis

#### JavaScript and TypeScript analysis <a href="#javascript-and-typescript-analysis" id="javascript-and-typescript-analysis"></a>

If you’re experiencing issues when analyzing TypeScript or TypeScript, check this [#javascript-and-typescript-analysis](https://docs.sonarsource.com/sonarqube-for-intellij/resources/troubleshooting#javascript-and-typescript-analysis "mention") troubleshooting article about problems related to memory usage.
