title: SonarQube扫描UniApp项目
tags:

  • SonarQube
    categories:
  • 工具
    date: 2019-08-13 00:00:00

SonarQube® is an automatic code review tool to detect bugs, vulnerabilities and code smells in your code. It can integrate with your existing workflow to enable continuous code inspection across your project branches and pull requests.
SonarQube是一个自动代码审查工具,用于检测代码中的错误、漏洞和代码气味。它可以与您现有的工作流集成,以支持跨项目分支的连续代码检查和拉取请求。

SonarQube平台由4个组件组成:

SonarQube扫描UniApp项目 - 图1

  1. 一个SonarQube服务器启动3个主要流程:
  • Web服务器,供开发人员,管理人员浏览高质量快照并配置SonarQube实例
  • 基于Elasticsearch的Search Server从UI返回搜索
  • 计算引擎服务器负责处理代码分析报告并将其保存在SonarQube数据库中
  1. 一个SonarQube数据库存储:
  • SonarQube实例的配置(安全性,插件设置等)
  • 项目,视图等的质量快照
  1. 服务器上安装了多个SonarQube插件,可能包括语言,SCM,集成,身份验证和治理插件
  2. 在构建/持续集成服务器上运行一个或多个SonarScanner来分析项目

SonarQube扫描UniApp项目 - 图2

🌞准备工作

  • 🌞创建扫描项目

🌞配置

🌞分析

https://docs.sonarqube.org/latest/