On a SonarQube server, rule key is displayed on the top right corner of the rule description. For example, you can look for squid:S109 in this rule description
SonarQube rule key is composed of repository id : rule id
repository id
Each language analyser create several rule repositories with ids that usually contain the language name, except for the java analyser that oddly use "squid".
For example, this is the list of repository keys existing on sonarcloud.io (source)
LANGUAGE_ID : REPOSITORY_KEY_LIST
abap : abap, common-abap
c : c, common-c
cpp : cpp, common-cpp
cs : csharpsquid, common-cs
css : css, common-css, external_stylelint
flex : flex, common-flex
go : go, common-go, external_golint, external_govet
java : squid, common-java, external_checkstyle, external_findsecbugs, external_pmd, external_spotbugs
js : javascript, common-js, external_eslint_repo
kotlin : kotlin, common-kotlin, external_android-lint, external_detekt
objc : objc, common-objc
php : php, common-php
plsql : plsql, common-plsql
py : python, common-py, Pylint
ruby : ruby, common-ruby, external_rubocop
swift : swift, common-swift, external_swiftlint
ts : typescript, common-ts, external_tslint
tsql : tsql, common-tsql
vbnet : vbnet, common-vbnet
web : Web, common-web
xml : xml, common-xml
rule id
Former rules could have a Pascal Case id like "NoSonar", but now, majority of rules have an id stating by 'S' following by the jira number of the rule from this repository jira.sonarsource.com/browse/RSPEC/
For example, rule id S109 matches with RSPEC-109
Note: rules.sonarsource.com/ also use the RSPEC-109 format in the URL, you could easily convert it to S109.