zoukankan      html  css  js  c++  java
  • 使用OCLint和Sonar对iOS代码分析和质量管理

    OCLint 是一个强大的静态代码分析工具,可以用来提高代码质量,查找潜在的bug,主要针对c,c++和Objective-c的静态分析。

    Sonar 是一个用于代码质量管理的开放平台。通过插件机制,Sonar 可以集成不同的测试工具,代码分析工具,以及持续集成工具。

    1.检查你的电脑有没有安装brew

      如果没有安装,会显示什么呢 -bash:brew:command not found

      该怎么办呢?

      打开终端  执行 ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

    2.SonarQube安装

      说明:此处略过java,mysql,jenkins安装配置。

      安装java : http://www.oracle.com/technetwork/java/javase/downloads/index.html

       brew install sonarqube                                                                                                       

       SonarQube汉化

        汉化插件

       https://github.com/SonarQubeCommunity/sonar-l10n-zh

       下载后放入 如下目录:

       /usr/local/Cellar/sonarqube/6.5/libexec/extensions/plugins                                                


     3.
    Mysql安装

        brew install mysql                                                                                                              

      记得启动mysql服务:mysql.server start        

    4.创建sonar数据库

    5.配置sonar连接mysql

    sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance&useSSL=false
     
    sonar.jdbc.username=root
     
    sonar.jdbc.password=root
     
    sonar.sorceEncoding=UTF-8
     
    sonar.login=admin
     
    sonar.password=admin

    6.安装xcpretty

      gem install xcpretty

    7.安装OCLint

      brew tap oclint/formulae

      brew install oclint

    8.安装sonar-scanner

      brew install sonar-scanner

    9.安装sonar-objective-c-plugin

      下载后放入如下目录:/usr/local/Cellar/sonarqube/6.5/libexec/extensions/plugins

    10.重启sonar

      sonar restart

      到此Sonar环境已经基本配置好了,打开 http://127.0.0.1:9000

  • 相关阅读:
    [转]The Machine SID Duplication Myth (and Why Sysprep Matters)
    The Machine SID Duplication Myth (and Why Sysprep Matters)
    [转]Shell(Bash) mysql数据库操作
    [转]GNU Sourcehighlight 语法高亮代码
    [原]DRBD双主模式问题
    mpstat
    DRBD试用
    drbd双主模式问题
    虚IP的添加和删除
    为什么5%的技术人员开发效率是其他95%的20倍?
  • 原文地址:https://www.cnblogs.com/KiVen2015/p/8432604.html
Copyright © 2011-2022 走看看