背景概述
随着 IT 行业中软件产品的推陈出新,客户对于软件产品的要求也越来越高,因此如何高质量的管理软件代码,及时地对代码质量进行分析并给出合理的解决方案就成为了当下必须要解决的一个问题。与当今众多的代码质量管理工具相比,SonarQube 更具有特色和竞争力,其优势主要体现为:它是一个开源的代码质量管理系统,支持 25+ 种语言,可以通过使用插件机制与 eclipse 和 JIRA 等其他外部工具集成,从而实现了对代码的质量的全面自动化分析和管理。
SonarQube 介绍
- SonarQube 可以支持 25+ 种编程语言,针对不同的编程语言其所提供的分析方式也有所不同:
- 对于所有支持的编程语言,SonarQube 都提供源了代码的静态分析功能;
- 对于某些特定的编程语言,SonarQube 提供了对编译后代码的静态分析功能,比如 java 中的 class file 和 jar 和 C# 中的 dll file 等;
- 对于某些特定的编程语言,SonarQube 还可以提供对于代码的动态分析功能,比如 java 和 C# 中的单元测试的执行等。
SonarQube 的服务架构

SonarQube 的安装
SonarQube 的运行
启动 SonarQube 控制台

启动 Sonar-scanner 执行代码扫描


打开控制台查看扫描结果



资料参考:
报错问题集合


最终解决方法
https://stackoverflow.com/questions/21204350/sonar-setup-undefined-mandatory-properties
https://stackoverflow.com/questions/26092773/sonar-you-must-define-the-following-mandatory-properties-for-unknown-not-resolv
https://stackoverflow.com/questions/30237547/sonarqube-typescript-plugin-you-must-install-a-plugin-that-supports-the-langua
↙↙↙阅读原文可查看相关链接,并与作者交流