我将尝试使用SonarQube SonarTS插件来分析我的项目中的TypeScript文件。
它包含一个子模块,其中包含一些图像,一些xmls和几个.ts文件。我在SonarQube中安装了SonarTS(https://docs.sonarqube.org/display/PLUG/SonarTS)。该项目使用typescript 2.4.2作为devDependency,并使用Node 6.13.1构建。
当我打电话给mvn sonar:sonar -Dsonar.branch=<BRANCHNAME>
时(我知道sonar.branch已被弃用,我很快就会修好:)),最后会扫描sum-module,这就是日志:
[INFO] ------------- Scan MyProject
[INFO] Base dir: /home/jenkins/workspace/my-project/my-project-config-model
[INFO] Working dir: /home/jenkins/workspace/my-project/my-project-config-model/target/sonar
[INFO] Source paths: pom.xml
[INFO] Source encoding: UTF-8, default locale: en_US
[INFO] Index files
[INFO] 1 file indexed
[INFO] Quality profile for xml: Sonar way
[INFO] Sensor Embedded CSS Analyzer Sensor [css]
[INFO] 0 source files to be analyzed
[INFO] Sensor Embedded CSS Analyzer Sensor [css] (done) | time=1ms
[INFO] Sensor SonarJavaXmlFileSensor [java]
[INFO] 0/0 source files have been analyzed
[INFO] 1 source files to be analyzed
[INFO] Sensor SonarJavaXmlFileSensor [java] (done) | time=31ms
[INFO] 1/1 source files have been analyzed
[INFO] Sensor XML Sensor [xml]
[INFO] Sensor XML Sensor [xml] (done) | time=8ms
[INFO] SCM provider for this project is: git
[INFO] 1 files to be analyzed
[INFO] 0/1 files analyzed
扫描的唯一文件是pom.xml
它可能与子模块的结构有关吗? xmls和ts文件不在src/main/{ts|resources}
,而在src/models
和src/scripts
。
提前致谢!