SonarQube
静的解析を利用してコードの品質検査やレビューをするソフトウェア
Code Quality, Security & Static Analysis Tool with SonarQube | Sonar
多くのメジャーな言語をサポートしており、各言語に対する Lint が定義されている
https://rules.sonarsource.com/
SaaS 版がある
というか売り出し方としてはこっち使って GitHub と連携するのがメイン
SonarQube Cloud Online Code Review as a Service Tool | Sonar
SonarSource 社
LGPL-3.0
一例として Rust のルールを見てみる
https://rules.sonarsource.com/rust/
これ Clippy と被ってるやつとかないのかな
Bug, Code Smell みたいにルールのカテゴリがついてる
中身
repo: https://github.com/SonarSource/sonarqube
LGPL-3.0
Java 製
sarif って名前のパッケージがあるから、セルフホストの場合は sarif で GitHub 連携みたいな感じになるのかな
各言語のパースに何使ってるか知りたい(以下は Codex 調べ、ちゃんと精査できてませんlemonadern.icon)
コミュニティ版
Java
SonarSource 製の SSLR ベース前処理系
JavaScript / TypeScript
tsserver, TypeScript Compiler API
Python
CPython 標準の ast/typed-ast
astroid
https://github.com/pylint-dev/astroid
PHP
https://github.com/nikic/php-parser
C/C++/Objective-C
Clang
C# / VB.NET
Microsoft Roslyn Compiler API
https://github.com/dotnet/roslyn
Kotlin
JetBrains の kotlin-compiler-embeddable
https://github.com/JetBrains/kotlin
Go
Go 標準の go/parser と go/types
Ruby / Scala
SonarSource の Slang フレームワーク(ANTLR ベース)
https://github.com/SonarSource/slang
Rust
tree-sitter
https://github.com/tree-sitter/tree-sitter-rust
Swift
Apple SourceKit/SwiftSyntax
https://github.com/swiftlang/swift-syntax
HTML
jsoup
https://github.com/jhy/jsoup
XML
SAX/DOM parser, JDK 同梱?
Text
独自トークナイザ
エンタープライズ限定フロントエンド(不明?)
ABAP, COBOL, PL/I, PL/SQL, RPG, T-SQL, Flex, VB6
Dart, Apex, Jasmin (Armor), Architecture, IaC
参考
GitHub ActionsのCI/CDパイプラインに静的コード解析Sonar Qubeを組み込んでみた | フューチャー技術ブログ