|
| 1 | +--- |
| 2 | +title: Settings |
| 3 | +description: General and project settings in SonarQube. |
| 4 | +sidebar: |
| 5 | + order: 20 |
| 6 | +--- |
| 7 | + |
| 8 | +## Scope |
| 9 | + |
| 10 | +The dbLinter settings in SonarQube have a global scope and a project scope. |
| 11 | +This means that global settings can be overridden at project level via the SonarQube web interface and via property file or paramters for SonarScanner runs. |
| 12 | + |
| 13 | +import { Tabs, TabItem } from '@astrojs/starlight/components'; |
| 14 | + |
| 15 | +<Tabs> |
| 16 | +<TabItem label="Global"> |
| 17 | +Administration -> Configuration -> General Settings -> dbLinter |
| 18 | + |
| 19 | + |
| 20 | +</TabItem> |
| 21 | +<TabItem label="Project"> |
| 22 | +Projects -> "Project" -> Project Settings -> General Settings -> dbLinter |
| 23 | + |
| 24 | + |
| 25 | +</TabItem> |
| 26 | +<TabItem label="Property"> |
| 27 | +Example in `sonar-project.properties` to override global/project setting: |
| 28 | + |
| 29 | +``` |
| 30 | +sonar.dblinter.access.token=IGsLxJQLnfZPFAkbMCaJntBjIaKtmYSOjnYiRTIlfYJYRggZgG |
| 31 | +``` |
| 32 | +</TabItem> |
| 33 | +<TabItem label="Parameter"> |
| 34 | +Example as parameter of `sonar-scanner` call to override global/project/property file setting: |
| 35 | + |
| 36 | +``` |
| 37 | +-Dsonar.dblinter.access.token=IGsLxJQLnfZPFAkbMCaJntBjIaKtmYSOjnYiRTIlfYJYRggZgG |
| 38 | +``` |
| 39 | +</TabItem> |
| 40 | +</Tabs> |
| 41 | + |
| 42 | +## 1) General |
| 43 | + |
| 44 | +- **Language Key** `sonar.dblinter.language.key`<br/> |
| 45 | + Language to use. |
| 46 | + - Select `dblinter` if you do not want to use the checks provided by other PL/SQL plugins. |
| 47 | + In other words, use dbLinter as primary plugin. |
| 48 | + - Select `plsql` to also use the included checks in the Developer, Enterprise and Data Center editions. |
| 49 | + - Use `plsqlopen` to also use the checks provided by the ZPA plugin. |
| 50 | + |
| 51 | + Requires the dbLinter plugin to be reinstalled to take effect. |
| 52 | + |
| 53 | +- **File Suffixes** `sonar.dblinter.file.suffixes`<br/> |
| 54 | + List of file suffixes containing code to be analysed with dbLinter. |
| 55 | + These file extensions are only relevant for the `dblinter` language key. |
| 56 | + Set the file suffixes for other languages in the associated plugins. |
| 57 | + This filter is applied before the include and exclude file patterns of a configuration. |
| 58 | + Use a comma separated list when defined as property or parameter. |
| 59 | + |
| 60 | +## 2) Remote Access |
| 61 | + |
| 62 | +- **Repo URL** `sonar.dblinter.repo.url`<br/> |
| 63 | + This is the URL of the dbLinter REST API. The default is https://api.dblinter.app/. |
| 64 | + You only need to set this URL when developing and testing custom rules. |
| 65 | + |
| 66 | +- **Tenant Name** `sonar.dblinter.tenant.name`<br/> |
| 67 | + dbLinter tenant for authentication. |
| 68 | + SonarScanner uses this for checks, while the SonarQube server uses it to register all applicable rules when the plugin is installed. |
| 69 | + |
| 70 | +- **User Name** `sonar.dblinter.user.name`<br/> |
| 71 | + dbLinter user (e-mail address) for authentication. |
| 72 | + SonarScanner uses this for checks, while the SonarQube server uses it to register all applicable rules when the plugin is installed. |
| 73 | + |
| 74 | +- **Access Token** `sonar.dblinter.access.token`<br/> |
| 75 | + dbLinter access token for authentication. |
| 76 | + SonarScanner uses this for checks, while the SonarQube server uses it to register all applicable rules when the plugin is installed. |
| 77 | + |
| 78 | +- **Config Name** `sonar.dblinter.config.name`<br/> |
| 79 | + Name of the dbLinter configuration for checks. |
| 80 | + SonarScanner uses this for checks. |
| 81 | + This configuration determines which rules are enabled and, consequently, checked. |
| 82 | + Therefore, you should ensure that all rules are enabled in the active quality profiles. |
| 83 | + |
| 84 | +## 3) Read-only DB Access |
| 85 | + |
| 86 | +Read-only access is recommended to achieve the best check results. |
| 87 | + |
| 88 | +To enable read-only access, you will need to create a database user with the following permissions: |
| 89 | + |
| 90 | +```sql |
| 91 | +create user if not exists dbl_read identified by "(...)"; |
| 92 | +grant connect to dbl_read; |
| 93 | +grant select any dictionary to dbl_read; |
| 94 | +``` |
| 95 | + |
| 96 | +- **JDBC URL** `sonar.dblinter.conn.jdbc.url`<br/> |
| 97 | + Override JDBC URL for read-only database access within checks. |
| 98 | + E.g. jdbc:oracle:thin:@localhost:1521/FREEPDB1 or jdbc:postgresql://localhost:5432/postgres. |
| 99 | + The default is configured in the dbLinter repository. |
| 100 | + |
| 101 | +- **Username** `sonar.dblinter.conn.user.name`<br/> |
| 102 | + Override username for read-only database access within checks. |
| 103 | + The default is configured in the dbLinter repository. |
| 104 | + |
| 105 | +- **Password** `sonar.dblinter.conn.password`<br/> |
| 106 | + Override connection password for read-only database access within checks. |
| 107 | + The default is configured in the dbLinter repository. |
| 108 | + |
| 109 | +## 4) Language Server |
| 110 | + |
| 111 | +- **Parallel Files** `sonar.dblinter.ls.parallel.files`<br/> |
| 112 | + Number of files analysed in parallel when using the command line interface. |
| 113 | + The default is 1. |
| 114 | + To achieve better performance with higher values, you need enough free system resources. |
| 115 | + |
| 116 | +- **Clear Cache Threshold** `sonar.dblinter.ls.clear.cache.threshold`<br/> |
| 117 | + Memory threshold in megabytes. |
| 118 | + This clears the ANTLR caches once the heap size used by the language server exceeds the threshold. |
| 119 | + This frees memory, but subsequent parsing is slower. |
| 120 | + Set the threshold to a value below zero to keep the cache. |
| 121 | + Leave empty for default behaviour. |
| 122 | + |
| 123 | +- **Log Format** `sonar.dblinter.ls.log.format`<br/> |
| 124 | + Log format for log messages. |
| 125 | + Log messages from the language server will only be displayed if the `sonar.log.level` property is set to `DEBUG` or `TRACE`. |
0 commit comments