> For the complete documentation index, see [llms.txt](https://docs.sonarsource.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sonarsource.com/sonarqube-cloud/analyzing-source-code/languages/mulesoft.md).

# MuleSoft

## Analysis overview

The MuleSoft analyzer analyzes Mule 4 applications. It examines Mule XML configuration files and DataWeave source code to provide code-quality and security insights.

## Project detection

The analyzer identifies a Mule 4 application from its `mule-artifact.json` file.

For a standalone project, the file must be at the repository root:

```
repository/
└── mule-artifact.json
```

For a monorepo, the analyzer also searches the direct children of the repository root:

```
repository/
├── application-a/
│   └── mule-artifact.json
└── application-b/
    └── mule-artifact.json
```

If the artifact file is deeper in the repository structure, specify its path explicitly with the `sonar.dre.mulesoft.muleArtifactPath` property. For example:

```
sonar.dre.mulesoft.muleArtifactPath=path/to/mule-artifact.json
```

## Embedded DataWeave in Mule XML

The analyzer examines embedded DataWeave code in the following Mule XML locations:

* `<set-variable>` `value` attributes containing an expression (`#[...]`), for example:

```xml
<set-variable value="#[payload]" />
```

* `<ee:set-variable>` CDATA bodies, for example:

```xml
<ee:set-variable><![CDATA[%dw 2.0
---
payload]]></ee:set-variable>
```

* `<set-payload>` `value` attributes containing an expression (`#[...]`), for example:

```xml
<set-payload value="#[payload]" />
```

* `<ee:set-payload>` CDATA bodies, for example:

```xml
<ee:set-payload><![CDATA[%dw 2.0
---
payload]]></ee:set-payload>
```

> **Note:** Embedded DataWeave code in other Mule XML locations is not currently analyzed.

## Mule configuration measures

For Mule XML configuration files, the analyzer computes these custom measures:

* **Mule configuration file count**: number of Mule XML configuration files analyzed.
* **Mule DataWeave transformation count** (`<ee:transform>`): number of DataWeave transformations in the analyzed Mule XML configuration files.
* **Mule flow count** (`<flow>`): number of Mule flows in the analyzed Mule XML configuration files.
* **Mule sub-flow count** (`<sub-flow>`): number of Mule sub-flows in the analyzed Mule XML configuration files.
* **Mule configuration complexity rating**: computed by adding the number of flows and sub-flows together, then mapping the result as follows:
  * A (simple): total <= 7
  * B (medium): 7 < total <= 15
  * C (complex): total > 15

## Language-specific properties

Discover and update the MuleSoft-specific properties in *Your project* > **Administration** > **General Settings** > **Languages** > **MuleSoft**. See [Configuration overview](/sonarqube-cloud/analyzing-source-code/analysis-parameters/configuration-overview.md) for more information about setting properties.

## Test coverage parameters

See [Test coverage parameters](/sonarqube-cloud/analyzing-source-code/test-coverage/test-coverage-parameters.md#mulesoft).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sonarsource.com/sonarqube-cloud/analyzing-source-code/languages/mulesoft.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
