- success (green)
- info (blue)
-You can also put icons inside messages:
-
-```
-[[danger]]
-| ![](/images/cross.svg) This is a **danger** message.
-```
-
#### Iframes
_Note: at this time, iframes are only supported for the static documentation, and will be stripped from the embedded documentation._
margin: 0 -1em 1.5rem;
padding: 1em;
border: 1px solid #3e7fb7;
+ background-image: url(../images/info.svg);
background-color: #edf6fc;
+ background-position: 10px 15px;
+ background-repeat: no-repeat;
+ background-size: 24px;
+ padding-left: 40px;
color: #000;
border-radius: 3px;
}
.alert-danger {
border-color: #d75a4a;
background-color: #fcedec;
+ background-image: url(../images/cross.svg);
}
.alert-danger a {
.alert-warning {
border-color: #c99916;
- background: #ffefbc url(../images/alerts/danger.svg) no-repeat;
- background-position: 10px 15px;
- background-size: 24px;
- padding-left: 40px;
-}
-
-.page-sidebar .alert-warning {
- background-position: 10px 10px;
+ background-color: #ffefbc;
+ background-image: url(../images/alerts/danger.svg);
}
.alert-warning a {
.alert-success {
border-color: #3ec92c;
background-color: #ecfcf2;
+ background-image: url(../images/check.svg);
}
.alert-success a {
<!-- sonarqube -->
### Deprecated
[[danger]]
-| ![](/images/cross.svg) These parameters are listed for completeness, but are deprecated and should not be used in new analyses.
+| These parameters are listed for completeness, but are deprecated and should not be used in new analyses.
Key | Description
---|----|---
`sonar.java.test.libraries` | Comma-separated paths to files with third-party libraries (JAR or Zip files) used by your tests. (For example, this should include the junit jar). Wildcards can be used: `sonar.java.test.libraries=directory/**/*.jar`
[[warning]]
-| ![](/images/exclamation.svg) Android users, Jack doesn't provide the required `.class` files.
+| Android users, Jack doesn't provide the required `.class` files.
## Turning issues off
<!-- sonarqube -->
## Custom rules
[[warning]]
-| ![](/images/exclamation.svg) This feature is deprecated
+| This feature is deprecated
### Overview
The JavaScript Analyzer parses the source code, creates an Abstract Syntax Tree (AST) and then walks through the entire tree. A coding rule is a visitor that is able to visit nodes from this AST.
#### Using DoubleDispatchVisitorCheck
`DoubleDispatchVisitorCheck` extends `DoubleDispatchVisitor` which provide a set of methods to visit specific tree nodes (these methods' names start with `visit`). To explore a part of the AST, override the required method(s). For example, if you want to explore `if` statement nodes, override the `DoubleDispatchVisitor#visitIfStatement` method that will be called each time an `IfStatementTree` node is encountered in the AST.
-![](/images/exclamation.svg) When overriding a visit method, you must call the `super` method in order to allow the visitor to visit the rest of the tree.
+[[warning]]
+| When overriding a visit method, you must call the `super` method in order to allow the visitor to visit the rest of the tree.
#### Using SubscriptionVisitorCheck
`SubscriptionVisitorCheck` extends `SubscriptionVisitor`. To explore a part of the AST, override `SubscribtionVisitor#nodesToVisit()` by returning the list of the `Tree#Kind` of node you want to visit. For example, if you want to explore `if` statement nodes the method will return a list containing the element `Tree#Kind#IF_STATEMENT`.
To explore a part of the AST, override a method from the PHPVisitorCheck. For example, if you want to explore "if statement" nodes, override [PHPVisitorCheck#visitIfStatement](https://github.com/SonarSource/sonar-php/blob/master/php-frontend/src/main/java/org/sonar/plugins/php/api/visitors/PHPVisitorCheck.java#L265) method that will be called each time an [ifStatementTree](https://github.com/SonarSource/sonar-php/blob/master/php-frontend/src/main/java/org/sonar/plugins/php/api/tree/statement/IfStatementTree.java) node is encountered in the AST.
-![](/images/exclamation.svg) When overriding a visit method, you must call the super method in order to allow the visitor to visit the children the node.
+[[warning]]
+| When overriding a visit method, you must call the super method in order to allow the visitor to visit the children the node.
**Using `PHPSubscriptionCheck`**
To explore a part of the AST, override a method from the PythonCheckTree. For example, if you want to explore "if statement" nodes, override [PythonCheckTree#visitIfStatement](https://github.com/SonarSource/sonar-python/blob/39b6126e9fdef42b93004cf6cc5818e861051334/python-frontend/src/main/java/org/sonar/plugins/python/api/tree/BaseTreeVisitor.java#L56) method that will be called each time an [ifStatement](https://github.com/SonarSource/sonar-python/blob/master/python-frontend/src/main/java/org/sonar/plugins/python/api/tree/IfStatement.java) node is encountered in the AST.
-![](/images/exclamation.svg) When overriding a visit method, you must call the super method in order to allow the visitor to visit the children the node.
+[[warning]]
+| When overriding a visit method, you must call the super method in order to allow the visitor to visit the children the node.
**Using `PythonSubscriptionCheck`**
After creating a project, the tutorial available on its homepage will guide you to find how to trigger an analysis.
-![Info](/images/info.svg) Remember that depending on which cloud solution you are using for your developments, you can rely on dedicated integrations to help you:
+[[info]]
+| Remember that depending on which cloud solution you are using for your developments, you can rely on dedicated integrations to help you:
* [GitHub](/integrations/github/)
* [Bitbucket Cloud](/integrations/bitbucketcloud/)
For detailed information about all available parameters, see [Analysis Parameters](/analysis/analysis-parameters/).
[[warning]]
-| ![](/images/exclamation.svg) The "begin" step will modify your build like this:
+| The "begin" step will modify your build like this:
| * the active `CodeAnalysisRuleSet` will be updated to match the SonarQube quality profile
| * `WarningsAsErrors` will be turned off
|
* [S2091](https://rules.sonarsource.com/csharp/RSPEC-2091): XPath Injection
[[info]]
-| ![](/images/info.svg) The configuration works per rule. There is no way to share configuration between rules.
+| The configuration works per rule. There is no way to share configuration between rules.
## File Format
If both are available, the Java API will be more fully-featured than what's available for XPath, and is generally preferable.
[[info]]
-| ![](/images/info.svg) Before implementing a new coding rule, you should consider whether it is specific to your own context or might benefit others. If it might benefit others, you can propose it on the [Community Forum](https://community.sonarsource.com/). If there is shared interest, then it might be implemented for you directly in the related language plugin. It means less maintenance for you, and benefit to others.
+| Before implementing a new coding rule, you should consider whether it is specific to your own context or might benefit others. If it might benefit others, you can propose it on the [Community Forum](https://community.sonarsource.com/). If there is shared interest, then it might be implemented for you directly in the related language plugin. It means less maintenance for you, and benefit to others.
## Custom rule support by language
Languages not listed here don't support custom rules
* the link to a PR adding a file for your plugin to the sonar-update-center-properties repo, and the elements of a "new release" email listed below.
[[info]]
-| ![](/images/info.svg) We reserve the right to exclude from the Marketplace plugins that we feel would be a dis-service to the community.
+| We reserve the right to exclude from the Marketplace plugins that we feel would be a dis-service to the community.
## Announcing new releases
When you've got a new release that should be published in the Marketplace, please:
It is recommended not to call other components in constructors. Indeed, they may not be initialized at that time. Constructors should only be used for dependency injection.
[[warning]]
-| ![](/images/exclamation.svg) Compilation does not fail if incorrect dependencies are defined, such as a scanner extension trying to call a web server extension. Still it will fail at runtime when plugin is loaded.
+| Compilation does not fail if incorrect dependencies are defined, such as a scanner extension trying to call a web server extension. Still it will fail at runtime when plugin is loaded.
### Third-party Libraries
Plugins are executed in their own isolated classloaders. That allows the packaging and use of 3rd-party libraries without runtime conflicts with core internal libraries or other plugins. Note that since version 5.2, the SonarQube API does not bring transitive dependencies, except SLF4J. The libraries just have to be declared in the pom.xml with default scope "compile":
Technically the libraries are packaged in the directory META-INF/lib of the generated JAR file. An alternative is to shade libraries, for example with maven-shade-plugin. That minimizes the size of the plugin .jar file by copying only the effective used classes.
[[info]]
-| ![](/images/info.svg) The command `mvn dependency:tree` gives the list of all dependencies, including transitive ones.
+| The command `mvn dependency:tree` gives the list of all dependencies, including transitive ones.
### Configuration
The core component [`org.sonar.api.config.Configuration`](http://javadocs.sonarsource.org/latest/apidocs/index.html?org/sonar/api/config/Configuration.html) provides access to configuration. It deals with default values and decryption of values. It is available in all stacks (scanner, web server, Compute Engine). As recommended earlier, it must not be called from constructors.
```
[[info]]
-| ![](/images/info.svg) Values of the properties suffixed with `.secured` are not available to non-authorized users (anonymous and users without project or global administration rights). `.secured` is needed for passwords, for instance.
+| Values of the properties suffixed with `.secured` are not available to non-authorized users (anonymous and users without project or global administration rights). `.secured` is needed for passwords, for instance.
The annotation [`@org.sonar.api.Property`](http://javadocs.sonarsource.org/latest/apidocs/index.html?org/sonar/api/Property.html) can also be used on an extension to declare a property, but org.sonar.api.config.PropertyDefinition is preferred.
```
You can ignore issues on certain components and for certain coding rules. To list a specific rule, use the fully qualified rule ID.
[[info]]
-| ![](/images/info.svg) You can find the fully qualified rule ID on the Rule definition.
+| You can find the fully qualified rule ID on the Rule definition.
Examples:
## Prerequisite
The only prerequisite for running SonarQube is to have Java (Oracle JRE 11 or OpenJDK 11) installed on your machine.
-![](/images/exclamation.svg) **Note:** _On Mac OS X it is highly recommended to install Oracle JDK 11 instead of the corresponding Oracle JRE since the JRE installation does not fully set up your Java environment properly. See [this post](http://stackoverflow.com/questions/15624667/mac-osx-java-terminal-version-incorrect) for more information._
+[[warning]]
+| **Note:** _On Mac OS X it is highly recommended to install Oracle JDK 11 instead of the corresponding Oracle JRE since the JRE installation does not fully set up your Java environment properly. See [this post](http://stackoverflow.com/questions/15624667/mac-osx-java-terminal-version-incorrect) for more information._
## Hardware Requirements
1. A small-scale (individual or small team) instance of the SonarQube server requires at least 2GB of RAM to run efficiently and 1GB of free RAM for the OS. If you are installing an instance for a large teams or Enterprise, please consider the additional recommendations below.
### Microsoft SQL Server
-![](/images/exclamation.svg) Collation **MUST** be case-sensitive (CS) and accent-sensitive (AS).
-
-![](/images/exclamation.svg) `READ_COMMITED_SNAPSHOT` **MUST** be set on the SonarQube database.
+[[warning]]
+| Collation **MUST** be case-sensitive (CS) and accent-sensitive (AS).
+| `READ_COMMITED_SNAPSHOT` **MUST** be set on the SonarQube database.
MS SQL database's shared lock strategy may impact SonarQube runtime. Making sure that `is_read_committed_snapshot_on` is set to `true` to prevent SonarQube from facing potential deadlocks under heavy loads.
This is a generic upgrade guide. Carefully read the [Release Upgrade Notes](/setup/upgrade-notes/) of your target version and of any intermediate version(s).
-![](/images/info.svg) **Planning to Upgrade to a Commercial Edition?**
-If you are moving to 6.7 LTS and installing a Commercial Edition, please read this [documentation](https://docs.sonarqube.org/display/SONARQUBE67/SonarSource+Editions).
+[[info]]
+| **Planning to Upgrade to a Commercial Edition?**
+| If you are moving to 6.7 LTS and installing a Commercial Edition, please read this [documentation](https://docs.sonarqube.org/display/SONARQUBE67/SonarSource+Editions).
[[warning]]
-| ![](/images/exclamation.svg) Before you start, back up your SonarQube Database. Upgrade problems are rare, but you'll want the backup if anything does happen.
+| Before you start, back up your SonarQube Database. Upgrade problems are rare, but you'll want the backup if anything does happen.
1. Download and unzip the SonarQube distribution of your edition in a fresh directory, let's say `$NEW_SONARQUBE_HOME`
2. Manually install the non-default plugins that are compatible with your version of SonarQube. Use the [Compatibility Matrix](https://docs.sonarqube.org/display/PLUG/Plugin+Version+Matrix) to ensure that the versions you install are compatible with your server version. Note that the most recent versions of all SonarSource code analyzers available in your edition are installed by default. Simply copying plugins from the old server to the new is not recommended; incompatible or duplicate plugins could cause startup errors.
With AutoScan, SonarCloud will autonomously pull your code and scan your default branch and your pull requests.
Please read the ["AutoScan Beta Feature"](/autoscan/) documentation page to get the details.
-![](/images/exclamation.svg) This is currently a Beta feature which does not work for all languages and comes with limitations.
+[[warning]]
+| This is currently a Beta feature which does not work for all languages and comes with limitations.
### ... using your CI service
You can connect to SonarCloud using your Azure DevOps account. On the [login page](/#sonarcloud#/sessions/new), just click on the "Log in with Azure DevOps" button.
[[warning]]
-| ![Warning](/images/exclamation.svg) Only work and school Azure DevOps accounts are authorized to login on SonarCloud.
+| Only work and school Azure DevOps accounts are authorized to login on SonarCloud.
## Install the SonarCloud Azure DevOps extension
padding: var(--gridSize) calc(2 * var(--gridSize));
}
+.documentation-content.markdown .alert .custom-block-body {
+ padding-left: 24px;
+ background-position: left 6px;
+ background-repeat: no-repeat;
+}
+
+.documentation-content.markdown .alert-success .custom-block-body {
+ background-image: url(/images/check.svg);
+}
+
+.documentation-content.markdown .alert-info .custom-block-body {
+ background-image: url(/images/info.svg);
+}
+
+.documentation-content.markdown .alert-warning .custom-block-body {
+ background-image: url(/images/exclamation.svg);
+}
+
+.documentation-content.markdown .alert-error .custom-block-body,
+.documentation-content.markdown .alert-danger .custom-block-body {
+ background-image: url(/images/cross.svg);
+}
+
.documentation-content.markdown .collapse-container {
border: 1px solid var(--barBorderColor);
border-radius: 2px;
display: none;
}
-.markdown-content .alert-error {
+.markdown-content .alert-error,
+.markdown-content .alert-danger {
border-color: var(--alertBorderError);
background-color: var(--alertBackgroundError);
color: var(--alertTextError);
}
-.markdown-content .alert-error .alert-icon {
+.markdown-content .alert-error .alert-icon,
+.markdown-content .alert-danger .alert-icon {
border-color: var(--alertBorderError);
}