iOS Developer自动化测试/CI测试

iOS利用OCLint进行静态代码分析环境配置及使用(含自定义规

2019-05-05  本文已影响14326人  洋子总

说明:如果只是使用 OCLint 进行静态代码检测, 只需要看到本文的第四点即可; 如果需要通过 OCLint 创建自定义规则, 则请继续往后看, 实现自定义规则还是有些难度的。

一、前序

  1. 为了提高代码质量和代码检查的效率,软件开发过程中一般会使用静态代码分析工具来对程序正确性和稳定性进行检查。静态代码分析利用词法分析、语法分析、抽象语法树以及语义分析等手段检查代码中潜在的错误过程。该过程与动态分析相对应,不需要执行应用程序,直接通过对代码扫描发现隐含的程序问题,并给出一定的修改建议。
  2. OCLint is a static code analysis tool for improving quality and reducing defects by inspecting C, C++ and Objective-C code and looking for potential problems.
    OCLint 是一种静态代码分析工具,通过检查 CC ++Objective-C 代码并查找潜在问题来提高质量并减少缺陷。
  3. Relying on the abstract syntax tree of the source code for better accuracy and efficiency.
    依靠源代码的抽象语法树,以获得更好的准确性和效率。如:

  1. OCLint GitHub地址
  2. OCLint官网地址

二、安装步骤

  1. 首先安装 Homebrew,将以下代码复制到终端,如果已安装请忽略, Homebrew官网
# 终端运行
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  1. 安装xcpretty
# 安装xcpretty
gem install xcpretty
  1. 安装OCLint
# 安装`OCLint`
brew tap oclint/formulae
brew install oclint
  1. 更新OCLint
# 以后可能需要更新
brew update
brew upgrade oclint

三、如何使用

  1. 前往 GitHub下载脚本,将脚本中最下面的 Test 位置替换为自己项目工程的名字,然后将该脚本拷贝到工程的根目录下,并自定义脚本名称,如 test.sh
#!/bin/bash

# 指定编码
export LANG="zh_CN.UTF-8"
export LC_COLLATE="zh_CN.UTF-8"
export LC_CTYPE="zh_CN.UTF-8"
export LC_MESSAGES="zh_CN.UTF-8"
export LC_MONETARY="zh_CN.UTF-8"
export LC_NUMERIC="zh_CN.UTF-8"
export LC_TIME="zh_CN.UTF-8"
export LC_ALL=

function checkDepend () {
    command -v xcpretty >/dev/null 2>&1 || { 
        echo >&2 "I require xcpretty but it's not installed.  Install:gem install xcpretty"; 
        exit
        }
    command -v oclint-json-compilation-database >/dev/null 2>&1 || { 
        echo >&2 "I require oclint-json-compilation-database but it's not installed.  Install:brew install oclint"; 
        exit
        }
}

function oclintForProject () {

    # 检测依赖
    checkDepend

    projectName=$1
    scheme=$2
    reportType=$3

    REPORT_PMD="pmd"
    REPORT_XCODE="xcode"
    REPORT_HTML="html"
    
    myworkspace=${projectName}
    myscheme=${scheme} 
    echo "myworkspace是:${myworkspace}"
    echo "myscheme是:${myscheme}"
    echo "reportType为:${reportType}"

    # 清除上次编译数据
    if [ -d ./build/derivedData ]; then
        echo '-----清除上次编译数据derivedData-----'
        rm -rf ./build/derivedData
    fi

    # xcodebuild -workspace $myworkspace -scheme $myscheme clean
    xcodebuild clean

    echo '-----开始编译-----'

    # 生成编译数据
    xcodebuild -workspace ${myworkspace} -scheme ${myscheme} -sdk iphonesimulator -derivedDataPath ./build/derivedData -configuration Debug COMPILER_INDEX_STORE_ENABLE=NO | xcpretty -r json-compilation-database -o compile_commands.json
    

    if [ -f ./compile_commands.json ]
        then
        echo '-----编译数据生成完毕-----'
    else
        echo "-----生成编译数据失败-----"
        return -1
    fi

    echo '-----分析中-----'

    # 自定义排除警告的目录,将目录字符串加到数组里面
    # 转化为:-e Debug.m -e Port.m -e Test
    exclude_files=("cardloan_js" "Pods")

    exclude=""
    for i in ${exclude_files[@]}; do
        exclude=${exclude}"-e "${i}" "
    done
    echo "排除目录:${exclude}"

    # 分析reportType
    if [[ ${reportType} =~ ${REPORT_PMD} ]]  
    then
        nowReportType="-report-type pmd -o pmd.xml"
    elif [[ ${reportType} =~ ${REPORT_HTML} ]] 
    then
        nowReportType="-report-type html -o oclint_result.html" 
    else
        nowReportType="-report-type xcode"
    fi

    # 自定义report 如:
    # nowReportType="-report-type html -o oclint_result.html"

    # 生成报表
    oclint-json-compilation-database ${exclude} -- \
    ${nowReportType} \
    -rc LONG_LINE=200 \
    -disable-rule ShortVariableName \
    -disable-rule ObjCAssignIvarOutsideAccessors \
    -disable-rule AssignIvarOutsideAccessors \
    -max-priority-1=100000 \
    -max-priority-2=100000 \
    -max-priority-3=100000

    rm compile_commands.json
    if [[ ${reportType} =~ ${REPORT_PMD} ]] && [ ! -f ./pmd.xml ]
    then
        echo "-----分析失败-----"
        return -1
    else
        echo '-----分析完毕-----'
        return 0
    fi
}

# 替换workspace的名字
myworkspace="Test.xcworkspace" 
# 替换scheme的名字
myscheme="Test" 
# 输出方式 xcode/pmd
reportType="xcode"

oclintForProject ${myworkspace} ${myscheme} ${reportType}
  1. 执行脚本
# 终端执行
bash Test.sh

/* 中间可能会在Build Succeeded后面等待一段时间,这是因为OCLint在分析文件
等待命令执行完成,终端会打印出-----分析完毕-----字样,
打开项目目录,会看到目录下会多出一个** oclint_result.html **的文件
如果没有使用cocoapods,则去掉myworkspace=Test.xcworkspace、-workspace $myworkspace、-workspace $myworkspace,然后再在终端执行。
*/

# 最后输出的结果
▸ Running script '[CP] Copy Pods Resources'
▸ Touching Test.app (in target: Test)
▸ Build Succeeded
-----编译数据生成完毕-----
-----分析中-----
排除目录:-e cardloan_js -e Pods
-----分析完毕-----

四、查看

点击查看报告 OCLint Report

双击打开oclint_result.html文件,样式如下
OCLint的分析结果:
优先级的级别是从Priority 1, Priority 2, Priority 3 依次降低的
Total Files 总文件数
Files with Violations 违规文件数
Compiler Warnings 表示项目中的警告⚠️
Compiler Errors 表示编译错误
Location 表示警告的位置
报告中的描述其实非常清晰,一般找到代码位置,结合代码理解下,自己基本都能明白了
可以直接复制路径到Chrome打开查看,右击查看源码就有行号

五、自定义规则(制定规则的人)

OCLint 命令手册
OCLint 规则索引
OCLint 自定义规则

# --命名
# 变量名字最长字节
#-rc=LONG_VARIABLE_NAME=20 \
# 变量名字最短字节
#-disable-rule ShortVariableName \
# --size
# 圈复杂度
#-re=CYCLOMATIC_COMPLEXITY=10 \
# 每个类最行数
#-rc=LONG_CLASS=700 \
# 每行字节数量
#-rc=LONG_LINE=200 \
# 每个方法行数
#-rc=LONG_METHOD=80 \
# 忽略注释后括号后的有效代码行数
#-rc=NCSS_METHOD=40 \
# 嵌套深度
#-rc=NESTED_BLOCK_DEPTH=5 \
# 字段数量
#-rc=TOO_MANY_FIELDS=20 \
# 方法数量
#-rc=TOO_MANY_METHODS=30 \
# 方法参数
#-rc=TOO_MANY_PARAMETERS=6

六、OCLint 安装包安装

  1. 进入 OCLint官网GitHub网站, 选择最新安装包, 现最新为 oclint-0.13-x86_64-darwin-17.7.0.tar.gz
  2. 解压刚刚下载的压缩包, 得到 oclint-0.13 文件,将文件放在某个目录下, 如我放的目录为 /usr/local/oclint-0.13
  3. 终端输入 vim ~/.bash_profile ,将 OCLint 添加到环境变量中, 如下:
OCLINT_HOME=/usr/local/oclint-0.13
export PATH=$OCLINT_HOME/bin:$PATH
  1. 重启终端,之后执行 oclint 命令,得到以下内容则证明安装成功:
➜  ~ oclint
oclint: Not enough positional command line arguments specified!
Must specify at least 1 positional argument: See: oclint -help

七. 编译 OCLint 源码

  1. 使用 Homebrew 安装 CMakeNinja,这两个工具为代码编译工具:
brew install cmake ninja
  1. 使用终端进入到如下目录:
➜  ~ cd  /usr/local/oclint-0.13/oclint-scripts
  1. 执行 make 脚本,后就是下载 oclint-json-compilation-databaseoclint-xcodebuildllvm 源码以及 clang 源码,并进行相关编译得到 oclint,此阶段需科学上网,且编译时间较长,大概40分钟左右:
➜  oclint-scripts git:(master) ✗ ./make
  1. 编译过程可能会遇到如下错误:
make[2]: *** [projets/complier-rt/lib/tsan/CMakeFiles/clane_rt.tsan_ios_dynamic.dir/rtl/tsan+libdispath_mac.cc.o] Error 1
make[1]: *** [projets/complier-rt/lib/tsan/CMakeFiles/clane_rt.tsan_ios_dynamic.dir/all] Error 2
[ 61%] Building CXX object projects/compiler-rt/lib/asan/CMakeFiles/RTAsan_dynamic.ios.dir/asan_thread.cc.o
[ 61%] Building CXX object projects/compiler-rt/lib/asan/CMakeFiles/RTAsan_dynamic.ios.dir/asan_win.cc.o
[ 61%] Building CXX object projects/compiler-rt/lib/asan/CMakeFiles/RTAsan_dynamic.ios.dir/asan_new_delete.cc.o
[ 61%] Built target RTAsan_dynamic.ios
make: *** [all] Error 2

不要慌,问题根本原因我已找到,导致该问题的原因是,make脚本下载的llvmclang以及compiler-rt都是从svn上进行下载,而svntsan_libdispatch_mac.cc该文件有错误,所以编译会报错,我们可以采用以下步骤去解决:

  1. 安装 xcodebuild, 当然这个工具在安装 Xcode 后就会默认安装了。

八、创建自定义规则

  1. /usr/local/oclint-0.13/oclint-scripts 目录下,OCLint 提供了一个叫 scaffoldReporter 的脚本程序, 可以通过该脚本传入要生成的规则名、级别、类型, 脚本就会在目录 /usr/local/oclint-0.13/oclint-rules/rules/custom 中自动生成一个模板代码,并且加入编译路径中, 在终端执行如下命令:
# 生成一个名为Test类型是ASTVisitor的规则模板
➜  oclint-scripts git:(master) ✗ ./scaffoldRule Test -t ASTVisitor
  1. 执行上面命令后,就会在 /usr/local/oclint-0.13/oclint-rules/rules/custom 文件夹下多出两个文件:
|-- custom
|   |-- CMakeLists.txt
|   |-- Test.cpp
  1. 编译自定义的规则生成动态库
➜  ~ cd  /usr/local/oclint-0.13/oclint-scripts
➜  oclint-scripts git:(master) ✗ cd ~
➜  ~ cd /usr/local/oclint-0.13/
➜  oclint-0.13 git:(master) ✗ mkdir oclint-xcodeproject
➜  oclint-0.13 git:(master) ✗ cd oclint-xcodeproject
➜  oclint-xcodeproject git:(master) ✗ touch xcode-debug.sh
#! /bin/sh -e

cmake -G Xcode -D CMAKE_CXX_COMPILER=../build/llvm-install/bin/clang++  -D CMAKE_C_COMPILER=../build/llvm-install/bin/clang -D OCLINT_BUILD_DIR=../build/oclint-core -D OCLINT_SOURCE_DIR=../oclint-core -D OCLINT_METRICS_SOURCE_DIR=../oclint-metrics -D OCLINT_METRICS_BUILD_DIR=../build/oclint-metrics -D LLVM_ROOT=../build/llvm-install/ ../oclint-rules
bash xcode-debug.sh
|-- oclint-xcodeproject
    |-- .DS_Store
    |-- CMakeCache.txt
    |-- cmake_install.cmake
    |-- directoryList.md
    |-- xcode-debug.sh
    |-- CMakeFiles
    |   |-- CMakeOutput.log
    |   |-- TargetDirectories.txt
    |   |-- cmake.check_cache
    |   |-- feature_tests.bin
    |   |-- feature_tests.c
    |   |-- feature_tests.cxx
    |   |-- 3.14.2
    |   |   |-- CMakeCCompiler.cmake
    |   |   |-- CMakeCXXCompiler.cmake
    |   |   |-- CMakeDetermineCompilerABI_C.bin
    |   |   |-- CMakeDetermineCompilerABI_CXX.bin
    |   |   |-- CMakeSystem.cmake
    |   |   |-- CompilerIdC
    |   |   |   |-- CompilerIdC.xcodeproj
    |   |   |   |   |-- project.pbxproj
    |   |   |   |-- XCBuildData
    |   |   |   |   |-- 5301af156eaa310ed80da5155f43d6d4-desc.xcbuild
    |   |   |   |   |-- 5301af156eaa310ed80da5155f43d6d4-manifest.xcbuild
    |   |   |   |   |-- BuildDescriptionCacheIndex-29c992275f3afb90f5057d3c3ecd92d5
    |   |   |   |   |-- build.db
    |   |   |   |-- tmp
    |   |   |-- CompilerIdCXX
    |   |       |-- CMakeCXXCompilerId.cpp
    |   |       |-- CompilerIdCXX
    |   |       |-- CompilerIdCXX.build
    |   |       |   |-- Debug
    |   |       |       |-- CompilerIdCXX.build
    |   |       |           |-- CompilerIdCXX-all-non-framework-target-headers.hmap
    |   |       |           |-- CompilerIdCXX-all-target-headers.hmap
    |   |       |           |-- CompilerIdCXX-generated-files.hmap
    |   |       |           |-- CompilerIdCXX-own-target-headers.hmap
    |   |       |           |-- CompilerIdCXX-project-headers.hmap
    |   |       |           |-- CompilerIdCXX.hmap
    |   |       |           |-- Script-2C8FEB8E15DC1A1A00E56A5D.sh
    |   |       |           |-- all-product-headers.yaml
    |   |       |           |-- Objects-normal
    |   |       |               |-- x86_64
    |   |       |                   |-- CMakeCXXCompilerId.d
    |   |       |                   |-- CMakeCXXCompilerId.dia
    |   |       |                   |-- CMakeCXXCompilerId.o
    |   |       |                   |-- CompilerIdCXX.LinkFileList
    |   |       |                   |-- CompilerIdCXX_dependency_info.dat
    |   |       |-- CompilerIdCXX.xcodeproj
    |   |       |   |-- project.pbxproj
    |   |       |-- XCBuildData
    |   |       |   |-- 05c3e9588b4f579e2c3b6566d1ceee27-desc.xcbuild
    |   |       |   |-- 05c3e9588b4f579e2c3b6566d1ceee27-manifest.xcbuild
    |   |       |   |-- BuildDescriptionCacheIndex-1d00653ec753e83c2b60f5fae8756530
    |   |       |   |-- build.db
    |   |       |-- tmp
    |   |-- CMakeTmp
    |-- CMakeScripts
    |   |-- ALL_BUILD_cmakeRulesBuildPhase.makeDebug
    |   |-- ALL_BUILD_cmakeRulesBuildPhase.makeMinSizeRel
    |   |-- ALL_BUILD_cmakeRulesBuildPhase.makeRelWithDebInfo
    |   |-- ALL_BUILD_cmakeRulesBuildPhase.makeRelease
    |   |-- ReRunCMake.make
    |   |-- XCODE_DEPEND_HELPER.make
    |   |-- ZERO_CHECK_cmakeRulesBuildPhase.makeDebug
    |   |-- ZERO_CHECK_cmakeRulesBuildPhase.makeMinSizeRel
    |   |-- ZERO_CHECK_cmakeRulesBuildPhase.makeRelWithDebInfo
    |   |-- ZERO_CHECK_cmakeRulesBuildPhase.makeRelease
    |-- OCLINT_RULES.build
    |   |-- Debug
    |       |-- ALL_BUILD.build
    |       |   |-- Script-00A170C92FC14DAFB73E80CC.sh
    |       |   |-- dgph
    |       |   |-- dgph~
    |       |-- ZERO_CHECK.build
    |           |-- Script-CA11F1BA5B9E457D9EB2E497.sh
    |           |-- dgph
    |           |-- dgph~
    |-- OCLINT_RULES.xcodeproj
    |   |-- project.pbxproj
    |   |-- project.xcworkspace
    |   |   |-- xcshareddata
    |   |   |   |-- IDEWorkspaceChecks.plist
    |   |   |   |-- WorkspaceSettings.xcsettings
    |   |   |-- xcuserdata
    |   |       |-- zhangyang.xcuserdatad
    |   |           |-- UserInterfaceState.xcuserstate
    |   |           |-- WorkspaceSettings.xcsettings
    |   |-- xcuserdata
    |       |-- zhangyang.xcuserdatad
    |           |-- xcschemes
    |               |-- xcschememanagement.plist
    |-- lib
    |   |-- cmake_install.cmake
    |   |-- CMakeFiles
    |   |-- Debug
    |   |   |-- libOCLintAbstractRule.a
    |   |-- OCLINT_RULES.build
    |   |   |-- Debug
    |   |       |-- OCLintAbstractRule.build
    |   |           |-- dgph
    |   |           |-- dgph~
    |   |           |-- Objects-normal
    |   |               |-- x86_64
    |   |                   |-- AbstractASTMatcherRule.d
    |   |                   |-- AbstractASTMatcherRule.dia
    |   |                   |-- AbstractASTMatcherRule.o
    |   |                   |-- AbstractASTRuleBase.d
    |   |                   |-- AbstractASTRuleBase.dia
    |   |                   |-- AbstractASTRuleBase.o
    |   |                   |-- AbstractSourceCodeReaderRule.d
    |   |                   |-- AbstractSourceCodeReaderRule.dia
    |   |                   |-- AbstractSourceCodeReaderRule.o
    |   |                   |-- OCLintAbstractRule.LinkFileList
    |   |-- helper
    |   |   |-- cmake_install.cmake
    |   |   |-- CMakeFiles
    |   |   |-- Debug
    |   |   |   |-- libOCLintHelper.a
    |   |   |-- OCLINT_RULES.build
    |   |-- util
    |       |-- cmake_install.cmake
    |       |-- CMakeFiles
    |       |-- Debug
    |       |   |-- libOCLintUtil.a
    |       |-- OCLINT_RULES.build
    |           |-- Debug
    |               |-- OCLintUtil.build
    |                   |-- dgph
    |                   |-- dgph~
    |                   |-- Objects-normal
    |                       |-- x86_64
    |                           |-- ASTUtil.d
    |                           |-- ASTUtil.dia
    |                           |-- ASTUtil.o
    |                           |-- OCLintUtil.LinkFileList
    |                           |-- StdUtil.d
    |                           |-- StdUtil.dia
    |                           |-- StdUtil.o
    |-- rules
    |   |-- cmake_install.cmake
    |   |-- CMakeFiles
    |   |-- basic
    |   |   |-- cmake_install.cmake
    |   |   |-- CMakeFiles
    |   |   |-- CMakeScripts
    |   |   |-- OCLINT_RULES.build
    |   |       |-- Debug
    |   |           |-- BitwiseOperatorInConditionalRule.build
    |   |           |   |-- Script-22812074E8DE451ABC9325B0.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- BitwiseOperatorInConditionalRule.LinkFileList
    |   |           |-- BrokenNullCheckRule.build
    |   |           |   |-- Script-D1F9F417B3F047A5807CB4D1.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- BrokenNullCheckRule.LinkFileList
    |   |           |-- BrokenOddnessCheckRule.build
    |   |           |   |-- Script-6553D7C13E5D4BDE99E6BF8D.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- BrokenOddnessCheckRule.LinkFileList
    |   |           |-- CollapsibleIfStatementsRule.build
    |   |           |   |-- Script-8E0D07CF0E0C4C8CB1CA394B.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- CollapsibleIfStatementsRule.LinkFileList
    |   |           |-- ConstantConditionalOperatorRule.build
    |   |           |   |-- Script-9FA9EE1D09C8419FAA983B56.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- ConstantConditionalOperatorRule.LinkFileList
    |   |           |-- ConstantIfExpressionRule.build
    |   |           |   |-- Script-47565E28DB834E59B20617F2.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- ConstantIfExpressionRule.LinkFileList
    |   |           |-- DeadCodeRule.build
    |   |           |   |-- Script-E0DB1DB0C78A40E6869CDDE4.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- DeadCodeRule.LinkFileList
    |   |           |-- DoubleNegativeRule.build
    |   |           |   |-- Script-3693B708CFD24C7084C10ECD.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- DoubleNegativeRule.LinkFileList
    |   |           |-- ForLoopShouldBeWhileLoopRule.build
    |   |           |   |-- Script-FA767C93CC894BE3941E0BD1.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- ForLoopShouldBeWhileLoopRule.LinkFileList
    |   |           |-- GotoStatementRule.build
    |   |           |   |-- Script-CA2E0CCC9A3C46C8A52C45C8.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- GotoStatementRule.LinkFileList
    |   |           |-- JumbledIncrementerRule.build
    |   |           |   |-- Script-4667857D79ED48F9A7E84185.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- JumbledIncrementerRule.LinkFileList
    |   |           |-- MisplacedNullCheckRule.build
    |   |           |   |-- Script-FEDB954950A64E47A594931B.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- MisplacedNullCheckRule.LinkFileList
    |   |           |-- MultipleUnaryOperatorRule.build
    |   |           |   |-- Script-41B882AB6E1E472284F67F1A.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- MultipleUnaryOperatorRule.LinkFileList
    |   |           |-- ReturnFromFinallyBlockRule.build
    |   |           |   |-- Script-666E3713F41E4873871824F8.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- ReturnFromFinallyBlockRule.LinkFileList
    |   |           |-- ThrowExceptionFromFinallyBlockRule.build
    |   |               |-- Script-F77C837305F9493288521B9D.sh
    |   |               |-- dgph
    |   |               |-- dgph~
    |   |               |-- Objects-normal
    |   |                   |-- x86_64
    |   |                       |-- ThrowExceptionFromFinallyBlockRule.LinkFileList
    |   |-- cocoa
    |   |   |-- cmake_install.cmake
    |   |   |-- CMakeFiles
    |   |   |-- CMakeScripts
    |   |   |   |-- ObjCVerifyIsEqualHashRule_postBuildPhase.makeDebug
    |   |   |   |-- ObjCVerifyIsEqualHashRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- ObjCVerifyIsEqualHashRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- ObjCVerifyIsEqualHashRule_postBuildPhase.makeRelease
    |   |   |   |-- ObjCVerifyMustCallSuperRule_postBuildPhase.makeDebug
    |   |   |   |-- ObjCVerifyMustCallSuperRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- ObjCVerifyMustCallSuperRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- ObjCVerifyMustCallSuperRule_postBuildPhase.makeRelease
    |   |   |   |-- ObjCVerifyProhibitedCallRule_postBuildPhase.makeDebug
    |   |   |   |-- ObjCVerifyProhibitedCallRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- ObjCVerifyProhibitedCallRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- ObjCVerifyProhibitedCallRule_postBuildPhase.makeRelease
    |   |   |   |-- ObjCVerifyProtectedMethodRule_postBuildPhase.makeDebug
    |   |   |   |-- ObjCVerifyProtectedMethodRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- ObjCVerifyProtectedMethodRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- ObjCVerifyProtectedMethodRule_postBuildPhase.makeRelease
    |   |   |   |-- ObjCVerifySubclassMustImplementRule_postBuildPhase.makeDebug
    |   |   |   |-- ObjCVerifySubclassMustImplementRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- ObjCVerifySubclassMustImplementRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- ObjCVerifySubclassMustImplementRule_postBuildPhase.makeRelease
    |   |   |-- OCLINT_RULES.build
    |   |       |-- Debug
    |   |           |-- ObjCVerifyIsEqualHashRule.build
    |   |           |   |-- Script-09C5DE7147FB420ABF2CF92C.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- ObjCVerifyIsEqualHashRule.LinkFileList
    |   |           |-- ObjCVerifyMustCallSuperRule.build
    |   |           |   |-- Script-F248EE7571FB47F8B36C8957.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- ObjCVerifyMustCallSuperRule.LinkFileList
    |   |           |-- ObjCVerifyProhibitedCallRule.build
    |   |           |   |-- Script-250B3B41C64E4710B3BBD151.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- ObjCVerifyProhibitedCallRule.LinkFileList
    |   |           |-- ObjCVerifyProtectedMethodRule.build
    |   |           |   |-- Script-755EF59261864C62B3F08ADA.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- ObjCVerifyProtectedMethodRule.LinkFileList
    |   |           |-- ObjCVerifySubclassMustImplementRule.build
    |   |               |-- Script-5FE345C6DEB64018A06E0FF2.sh
    |   |               |-- dgph
    |   |               |-- dgph~
    |   |               |-- Objects-normal
    |   |                   |-- x86_64
    |   |                       |-- ObjCVerifySubclassMustImplementRule.LinkFileList
    |   |-- convention
    |   |   |-- cmake_install.cmake
    |   |   |-- CMakeFiles
    |   |   |-- CMakeScripts
    |   |   |   |-- AvoidBranchingStatementAsLastInLoopRule_postBuildPhase.makeDebug
    |   |   |   |-- AvoidBranchingStatementAsLastInLoopRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- AvoidBranchingStatementAsLastInLoopRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- AvoidBranchingStatementAsLastInLoopRule_postBuildPhase.makeRelease
    |   |   |   |-- BaseClassDestructorShouldBeVirtualOrProtectedRule_postBuildPhase.makeDebug
    |   |   |   |-- BaseClassDestructorShouldBeVirtualOrProtectedRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- BaseClassDestructorShouldBeVirtualOrProtectedRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- BaseClassDestructorShouldBeVirtualOrProtectedRule_postBuildPhase.makeRelease
    |   |   |   |-- CoveredSwitchStatementsDontNeedDefaultRule_postBuildPhase.makeDebug
    |   |   |   |-- CoveredSwitchStatementsDontNeedDefaultRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- CoveredSwitchStatementsDontNeedDefaultRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- CoveredSwitchStatementsDontNeedDefaultRule_postBuildPhase.makeRelease
    |   |   |   |-- DefaultLabelNotLastInSwitchStatementRule_postBuildPhase.makeDebug
    |   |   |   |-- DefaultLabelNotLastInSwitchStatementRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- DefaultLabelNotLastInSwitchStatementRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- DefaultLabelNotLastInSwitchStatementRule_postBuildPhase.makeRelease
    |   |   |   |-- DestructorOfVirtualClassRule_postBuildPhase.makeDebug
    |   |   |   |-- DestructorOfVirtualClassRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- DestructorOfVirtualClassRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- DestructorOfVirtualClassRule_postBuildPhase.makeRelease
    |   |   |   |-- InvertedLogicRule_postBuildPhase.makeDebug
    |   |   |   |-- InvertedLogicRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- InvertedLogicRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- InvertedLogicRule_postBuildPhase.makeRelease
    |   |   |   |-- MissingBreakInSwitchStatementRule_postBuildPhase.makeDebug
    |   |   |   |-- MissingBreakInSwitchStatementRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- MissingBreakInSwitchStatementRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- MissingBreakInSwitchStatementRule_postBuildPhase.makeRelease
    |   |   |   |-- NonCaseLabelInSwitchStatementRule_postBuildPhase.makeDebug
    |   |   |   |-- NonCaseLabelInSwitchStatementRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- NonCaseLabelInSwitchStatementRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- NonCaseLabelInSwitchStatementRule_postBuildPhase.makeRelease
    |   |   |   |-- ObjCAssignIvarOutsideAccessorsRule_postBuildPhase.makeDebug
    |   |   |   |-- ObjCAssignIvarOutsideAccessorsRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- ObjCAssignIvarOutsideAccessorsRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- ObjCAssignIvarOutsideAccessorsRule_postBuildPhase.makeRelease
    |   |   |   |-- ParameterReassignmentRule_postBuildPhase.makeDebug
    |   |   |   |-- ParameterReassignmentRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- ParameterReassignmentRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- ParameterReassignmentRule_postBuildPhase.makeRelease
    |   |   |   |-- PreferEarlyExitRule_postBuildPhase.makeDebug
    |   |   |   |-- PreferEarlyExitRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- PreferEarlyExitRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- PreferEarlyExitRule_postBuildPhase.makeRelease
    |   |   |   |-- SwitchStatementsShouldHaveDefaultRule_postBuildPhase.makeDebug
    |   |   |   |-- SwitchStatementsShouldHaveDefaultRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- SwitchStatementsShouldHaveDefaultRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- SwitchStatementsShouldHaveDefaultRule_postBuildPhase.makeRelease
    |   |   |   |-- TooFewBranchesInSwitchStatementRule_postBuildPhase.makeDebug
    |   |   |   |-- TooFewBranchesInSwitchStatementRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- TooFewBranchesInSwitchStatementRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- TooFewBranchesInSwitchStatementRule_postBuildPhase.makeRelease
    |   |   |-- OCLINT_RULES.build
    |   |       |-- Debug
    |   |           |-- AvoidBranchingStatementAsLastInLoopRule.build
    |   |           |   |-- Script-36B952082E264B1C925003CF.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- AvoidBranchingStatementAsLastInLoopRule.LinkFileList
    |   |           |-- BaseClassDestructorShouldBeVirtualOrProtectedRule.build
    |   |           |   |-- Script-D283FCEEAF3744C1A49E4AA9.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- BaseClassDestructorShouldBeVirtualOrProtectedRule.LinkFileList
    |   |           |-- CoveredSwitchStatementsDontNeedDefaultRule.build
    |   |           |   |-- Script-6022154131CF44F7B3B9A9E9.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- CoveredSwitchStatementsDontNeedDefaultRule.LinkFileList
    |   |           |-- DefaultLabelNotLastInSwitchStatementRule.build
    |   |           |   |-- Script-876696D71C984B329F483B98.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- DefaultLabelNotLastInSwitchStatementRule.LinkFileList
    |   |           |-- DestructorOfVirtualClassRule.build
    |   |           |   |-- Script-9DC841B999DA466FAE66505A.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- DestructorOfVirtualClassRule.LinkFileList
    |   |           |-- InvertedLogicRule.build
    |   |           |   |-- Script-DD938C12C7CA4BD3AFAC1726.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- InvertedLogicRule.LinkFileList
    |   |           |-- MissingBreakInSwitchStatementRule.build
    |   |           |   |-- Script-84732B401B1E44DAB0582C72.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- MissingBreakInSwitchStatementRule.LinkFileList
    |   |           |-- NonCaseLabelInSwitchStatementRule.build
    |   |           |   |-- Script-D6FB114253FC478089B5BBAB.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- NonCaseLabelInSwitchStatementRule.LinkFileList
    |   |           |-- ObjCAssignIvarOutsideAccessorsRule.build
    |   |           |   |-- Script-9D63153D9E7547AE996D281A.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- ObjCAssignIvarOutsideAccessorsRule.LinkFileList
    |   |           |-- ParameterReassignmentRule.build
    |   |           |   |-- Script-79AD9AC6F7BA4B5CAF153871.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- ParameterReassignmentRule.LinkFileList
    |   |           |-- PreferEarlyExitRule.build
    |   |           |   |-- Script-72B6A257AA5944269B567669.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- PreferEarlyExitRule.LinkFileList
    |   |           |-- SwitchStatementsShouldHaveDefaultRule.build
    |   |           |   |-- Script-4887DAD8A1A24F238EFA89E7.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- SwitchStatementsShouldHaveDefaultRule.LinkFileList
    |   |           |-- TooFewBranchesInSwitchStatementRule.build
    |   |               |-- Script-59A6177CE81945B5B0D9D962.sh
    |   |               |-- dgph
    |   |               |-- dgph~
    |   |               |-- Objects-normal
    |   |                   |-- x86_64
    |   |                       |-- TooFewBranchesInSwitchStatementRule.LinkFileList
    |   |-- custom
    |   |   |-- cmake_install.cmake
    |   |   |-- CMakeFiles
    |   |   |-- CMakeScripts
    |   |   |   |-- TestRuleRule_postBuildPhase.makeDebug
    |   |   |   |-- TestRuleRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- TestRuleRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- TestRuleRule_postBuildPhase.makeRelease
    |   |   |-- OCLINT_RULES.build
    |   |       |-- Debug
    |   |           |-- TestRuleRule.build
    |   |               |-- Script-77E792B220C34BA2B413708C.sh
    |   |               |-- dgph
    |   |               |-- dgph~
    |   |               |-- Objects-normal
    |   |                   |-- x86_64
    |   |                       |-- TestRuleRule.LinkFileList
    |   |                       |-- TestRuleRule.d
    |   |                       |-- TestRuleRule.dia
    |   |                       |-- TestRuleRule.o
    |   |                       |-- TestRuleRule_dependency_info.dat
    |   |-- design
    |   |   |-- cmake_install.cmake
    |   |   |-- CMakeFiles
    |   |   |-- CMakeScripts
    |   |   |   |-- AvoidDefaultArgumentsOnVirtualMethodsRule_postBuildPhase.makeDebug
    |   |   |   |-- AvoidDefaultArgumentsOnVirtualMethodsRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- AvoidDefaultArgumentsOnVirtualMethodsRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- AvoidDefaultArgumentsOnVirtualMethodsRule_postBuildPhase.makeRelease
    |   |   |   |-- AvoidPrivateStaticMembersRule_postBuildPhase.makeDebug
    |   |   |   |-- AvoidPrivateStaticMembersRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- AvoidPrivateStaticMembersRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- AvoidPrivateStaticMembersRule_postBuildPhase.makeRelease
    |   |   |-- OCLINT_RULES.build
    |   |       |-- Debug
    |   |           |-- AvoidDefaultArgumentsOnVirtualMethodsRule.build
    |   |           |   |-- Script-5979F6F2B78645C4B3A68149.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- AvoidDefaultArgumentsOnVirtualMethodsRule.LinkFileList
    |   |           |-- AvoidPrivateStaticMembersRule.build
    |   |               |-- Script-83D38C8E5DCA482F93EE814C.sh
    |   |               |-- dgph
    |   |               |-- dgph~
    |   |               |-- Objects-normal
    |   |                   |-- x86_64
    |   |                       |-- AvoidPrivateStaticMembersRule.LinkFileList
    |   |-- empty
    |   |   |-- cmake_install.cmake
    |   |   |-- CMakeFiles
    |   |   |-- CMakeScripts
    |   |   |   |-- EmptyCatchStatementRule_postBuildPhase.makeDebug
    |   |   |   |-- EmptyCatchStatementRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- EmptyCatchStatementRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- EmptyCatchStatementRule_postBuildPhase.makeRelease
    |   |   |   |-- EmptyDoWhileStatementRule_postBuildPhase.makeDebug
    |   |   |   |-- EmptyDoWhileStatementRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- EmptyDoWhileStatementRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- EmptyDoWhileStatementRule_postBuildPhase.makeRelease
    |   |   |   |-- EmptyElseBlockRule_postBuildPhase.makeDebug
    |   |   |   |-- EmptyElseBlockRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- EmptyElseBlockRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- EmptyElseBlockRule_postBuildPhase.makeRelease
    |   |   |   |-- EmptyFinallyStatementRule_postBuildPhase.makeDebug
    |   |   |   |-- EmptyFinallyStatementRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- EmptyFinallyStatementRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- EmptyFinallyStatementRule_postBuildPhase.makeRelease
    |   |   |   |-- EmptyForStatementRule_postBuildPhase.makeDebug
    |   |   |   |-- EmptyForStatementRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- EmptyForStatementRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- EmptyForStatementRule_postBuildPhase.makeRelease
    |   |   |   |-- EmptyIfStatementRule_postBuildPhase.makeDebug
    |   |   |   |-- EmptyIfStatementRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- EmptyIfStatementRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- EmptyIfStatementRule_postBuildPhase.makeRelease
    |   |   |   |-- EmptySwitchStatementRule_postBuildPhase.makeDebug
    |   |   |   |-- EmptySwitchStatementRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- EmptySwitchStatementRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- EmptySwitchStatementRule_postBuildPhase.makeRelease
    |   |   |   |-- EmptyTryStatementRule_postBuildPhase.makeDebug
    |   |   |   |-- EmptyTryStatementRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- EmptyTryStatementRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- EmptyTryStatementRule_postBuildPhase.makeRelease
    |   |   |   |-- EmptyWhileStatementRule_postBuildPhase.makeDebug
    |   |   |   |-- EmptyWhileStatementRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- EmptyWhileStatementRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- EmptyWhileStatementRule_postBuildPhase.makeRelease
    |   |   |-- OCLINT_RULES.build
    |   |       |-- Debug
    |   |           |-- EmptyCatchStatementRule.build
    |   |           |   |-- Script-879E8F2433594781BB37BC64.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- EmptyCatchStatementRule.LinkFileList
    |   |           |-- EmptyDoWhileStatementRule.build
    |   |           |   |-- Script-D14D6BCE71994FB0A5EBE10B.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- EmptyDoWhileStatementRule.LinkFileList
    |   |           |-- EmptyElseBlockRule.build
    |   |           |   |-- Script-F049B8C0B7AD4675ACE0C8D0.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- EmptyElseBlockRule.LinkFileList
    |   |           |-- EmptyFinallyStatementRule.build
    |   |           |   |-- Script-ED7B376B9CEA4569A13679D8.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- EmptyFinallyStatementRule.LinkFileList
    |   |           |-- EmptyForStatementRule.build
    |   |           |   |-- Script-80F68CDC80004BDEB0220C0A.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- EmptyForStatementRule.LinkFileList
    |   |           |-- EmptyIfStatementRule.build
    |   |           |   |-- Script-6C4F9F546F614D39A5EBBDD8.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- EmptyIfStatementRule.LinkFileList
    |   |           |-- EmptySwitchStatementRule.build
    |   |           |   |-- Script-1F3AE565D8754E4E9BD13AB3.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- EmptySwitchStatementRule.LinkFileList
    |   |           |-- EmptyTryStatementRule.build
    |   |           |   |-- Script-16254BD65D3043299843F826.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- EmptyTryStatementRule.LinkFileList
    |   |           |-- EmptyWhileStatementRule.build
    |   |               |-- Script-158B8DA99F864A2485FB8C1D.sh
    |   |               |-- dgph
    |   |               |-- dgph~
    |   |               |-- Objects-normal
    |   |                   |-- x86_64
    |   |                       |-- EmptyWhileStatementRule.LinkFileList
    |   |-- migration
    |   |   |-- cmake_install.cmake
    |   |   |-- CMakeFiles
    |   |   |-- CMakeScripts
    |   |   |   |-- ObjCBoxedExpressionsRule_postBuildPhase.makeDebug
    |   |   |   |-- ObjCBoxedExpressionsRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- ObjCBoxedExpressionsRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- ObjCBoxedExpressionsRule_postBuildPhase.makeRelease
    |   |   |   |-- ObjCContainerLiteralsRule_postBuildPhase.makeDebug
    |   |   |   |-- ObjCContainerLiteralsRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- ObjCContainerLiteralsRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- ObjCContainerLiteralsRule_postBuildPhase.makeRelease
    |   |   |   |-- ObjCNSNumberLiteralsRule_postBuildPhase.makeDebug
    |   |   |   |-- ObjCNSNumberLiteralsRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- ObjCNSNumberLiteralsRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- ObjCNSNumberLiteralsRule_postBuildPhase.makeRelease
    |   |   |   |-- ObjCObjectSubscriptingRule_postBuildPhase.makeDebug
    |   |   |   |-- ObjCObjectSubscriptingRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- ObjCObjectSubscriptingRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- ObjCObjectSubscriptingRule_postBuildPhase.makeRelease
    |   |   |-- OCLINT_RULES.build
    |   |       |-- Debug
    |   |           |-- ObjCBoxedExpressionsRule.build
    |   |           |   |-- Script-CC41E32B89B942ABAD08C294.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- ObjCBoxedExpressionsRule.LinkFileList
    |   |           |-- ObjCContainerLiteralsRule.build
    |   |           |   |-- Script-72BA3F3B1D954FD18C379546.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- ObjCContainerLiteralsRule.LinkFileList
    |   |           |-- ObjCNSNumberLiteralsRule.build
    |   |           |   |-- Script-CC8F938FC56D43CFBBF686DD.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- ObjCNSNumberLiteralsRule.LinkFileList
    |   |           |-- ObjCObjectSubscriptingRule.build
    |   |               |-- Script-F4E0E9520BE044C493DB7F21.sh
    |   |               |-- dgph
    |   |               |-- dgph~
    |   |               |-- Objects-normal
    |   |                   |-- x86_64
    |   |                       |-- ObjCObjectSubscriptingRule.LinkFileList
    |   |-- naming
    |   |   |-- cmake_install.cmake
    |   |   |-- CMakeFiles
    |   |   |-- CMakeScripts
    |   |   |   |-- LongVariableNameRule_postBuildPhase.makeDebug
    |   |   |   |-- LongVariableNameRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- LongVariableNameRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- LongVariableNameRule_postBuildPhase.makeRelease
    |   |   |   |-- ShortVariableNameRule_postBuildPhase.makeDebug
    |   |   |   |-- ShortVariableNameRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- ShortVariableNameRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- ShortVariableNameRule_postBuildPhase.makeRelease
    |   |   |-- OCLINT_RULES.build
    |   |       |-- Debug
    |   |           |-- LongVariableNameRule.build
    |   |           |   |-- Script-A34EA9EB65E94CC99E228346.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- LongVariableNameRule.LinkFileList
    |   |           |-- ShortVariableNameRule.build
    |   |               |-- Script-D3B1B2FC09174D08AB6E7316.sh
    |   |               |-- dgph
    |   |               |-- dgph~
    |   |               |-- Objects-normal
    |   |                   |-- x86_64
    |   |                       |-- ShortVariableNameRule.LinkFileList
    |   |-- redundant
    |   |   |-- cmake_install.cmake
    |   |   |-- CMakeFiles
    |   |   |-- CMakeScripts
    |   |   |   |-- RedundantConditionalOperatorRule_postBuildPhase.makeDebug
    |   |   |   |-- RedundantConditionalOperatorRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- RedundantConditionalOperatorRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- RedundantConditionalOperatorRule_postBuildPhase.makeRelease
    |   |   |   |-- RedundantIfStatementRule_postBuildPhase.makeDebug
    |   |   |   |-- RedundantIfStatementRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- RedundantIfStatementRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- RedundantIfStatementRule_postBuildPhase.makeRelease
    |   |   |   |-- RedundantLocalVariableRule_postBuildPhase.makeDebug
    |   |   |   |-- RedundantLocalVariableRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- RedundantLocalVariableRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- RedundantLocalVariableRule_postBuildPhase.makeRelease
    |   |   |   |-- RedundantNilCheckRule_postBuildPhase.makeDebug
    |   |   |   |-- RedundantNilCheckRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- RedundantNilCheckRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- RedundantNilCheckRule_postBuildPhase.makeRelease
    |   |   |   |-- UnnecessaryElseStatementRule_postBuildPhase.makeDebug
    |   |   |   |-- UnnecessaryElseStatementRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- UnnecessaryElseStatementRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- UnnecessaryElseStatementRule_postBuildPhase.makeRelease
    |   |   |   |-- UnnecessaryNullCheckForCXXDeallocRule_postBuildPhase.makeDebug
    |   |   |   |-- UnnecessaryNullCheckForCXXDeallocRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- UnnecessaryNullCheckForCXXDeallocRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- UnnecessaryNullCheckForCXXDeallocRule_postBuildPhase.makeRelease
    |   |   |   |-- UselessParenthesesRule_postBuildPhase.makeDebug
    |   |   |   |-- UselessParenthesesRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- UselessParenthesesRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- UselessParenthesesRule_postBuildPhase.makeRelease
    |   |   |-- OCLINT_RULES.build
    |   |       |-- Debug
    |   |           |-- RedundantConditionalOperatorRule.build
    |   |           |   |-- Script-EB66FE15146C4739812A1B85.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- RedundantConditionalOperatorRule.LinkFileList
    |   |           |-- RedundantIfStatementRule.build
    |   |           |   |-- Script-9C2B7C4C02DB4846A001C3C9.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- RedundantIfStatementRule.LinkFileList
    |   |           |-- RedundantLocalVariableRule.build
    |   |           |   |-- Script-181F123A072B4AAE81C062E2.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- RedundantLocalVariableRule.LinkFileList
    |   |           |-- RedundantNilCheckRule.build
    |   |           |   |-- Script-BD63FBF29D6B45ECB4D31516.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- RedundantNilCheckRule.LinkFileList
    |   |           |-- UnnecessaryElseStatementRule.build
    |   |           |   |-- Script-73D8A3E6423F4B0F8C8BA9EE.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- UnnecessaryElseStatementRule.LinkFileList
    |   |           |-- UnnecessaryNullCheckForCXXDeallocRule.build
    |   |           |   |-- Script-F41B925849F54E608A1B882E.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- UnnecessaryNullCheckForCXXDeallocRule.LinkFileList
    |   |           |-- UselessParenthesesRule.build
    |   |               |-- Script-B02380B8FBA94F36BD8F8711.sh
    |   |               |-- dgph
    |   |               |-- dgph~
    |   |               |-- Objects-normal
    |   |                   |-- x86_64
    |   |                       |-- UselessParenthesesRule.LinkFileList
    |   |-- size
    |   |   |-- cmake_install.cmake
    |   |   |-- CMakeFiles
    |   |   |-- CMakeScripts
    |   |   |   |-- CyclomaticComplexityRule_postBuildPhase.makeDebug
    |   |   |   |-- CyclomaticComplexityRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- CyclomaticComplexityRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- CyclomaticComplexityRule_postBuildPhase.makeRelease
    |   |   |   |-- LongClassRule_postBuildPhase.makeDebug
    |   |   |   |-- LongClassRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- LongClassRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- LongClassRule_postBuildPhase.makeRelease
    |   |   |   |-- LongLineRule_postBuildPhase.makeDebug
    |   |   |   |-- LongLineRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- LongLineRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- LongLineRule_postBuildPhase.makeRelease
    |   |   |   |-- LongMethodRule_postBuildPhase.makeDebug
    |   |   |   |-- LongMethodRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- LongMethodRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- LongMethodRule_postBuildPhase.makeRelease
    |   |   |   |-- NPathComplexityRule_postBuildPhase.makeDebug
    |   |   |   |-- NPathComplexityRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- NPathComplexityRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- NPathComplexityRule_postBuildPhase.makeRelease
    |   |   |   |-- NcssMethodCountRule_postBuildPhase.makeDebug
    |   |   |   |-- NcssMethodCountRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- NcssMethodCountRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- NcssMethodCountRule_postBuildPhase.makeRelease
    |   |   |   |-- NestedBlockDepthRule_postBuildPhase.makeDebug
    |   |   |   |-- NestedBlockDepthRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- NestedBlockDepthRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- NestedBlockDepthRule_postBuildPhase.makeRelease
    |   |   |   |-- TooManyFieldsRule_postBuildPhase.makeDebug
    |   |   |   |-- TooManyFieldsRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- TooManyFieldsRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- TooManyFieldsRule_postBuildPhase.makeRelease
    |   |   |   |-- TooManyMethodsRule_postBuildPhase.makeDebug
    |   |   |   |-- TooManyMethodsRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- TooManyMethodsRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- TooManyMethodsRule_postBuildPhase.makeRelease
    |   |   |   |-- TooManyParametersRule_postBuildPhase.makeDebug
    |   |   |   |-- TooManyParametersRule_postBuildPhase.makeMinSizeRel
    |   |   |   |-- TooManyParametersRule_postBuildPhase.makeRelWithDebInfo
    |   |   |   |-- TooManyParametersRule_postBuildPhase.makeRelease
    |   |   |-- OCLINT_RULES.build
    |   |       |-- Debug
    |   |           |-- CyclomaticComplexityRule.build
    |   |           |   |-- Script-D9936117ACDF4223B80AB884.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- CyclomaticComplexityRule.LinkFileList
    |   |           |-- LongClassRule.build
    |   |           |   |-- Script-5FE26A036A374383B07371A0.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- LongClassRule.LinkFileList
    |   |           |-- LongLineRule.build
    |   |           |   |-- Script-C5C8F2995880419D86DE44BD.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- LongLineRule.LinkFileList
    |   |           |-- LongMethodRule.build
    |   |           |   |-- Script-0B49543D264B4286974C2E0D.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- LongMethodRule.LinkFileList
    |   |           |-- NPathComplexityRule.build
    |   |           |   |-- Script-E4F7319BC53A478982FF74BF.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- NPathComplexityRule.LinkFileList
    |   |           |-- NcssMethodCountRule.build
    |   |           |   |-- Script-43DB9BA3D6FC4A459F433282.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- NcssMethodCountRule.LinkFileList
    |   |           |-- NestedBlockDepthRule.build
    |   |           |   |-- Script-9C02BE078ADE4B359C61D905.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- NestedBlockDepthRule.LinkFileList
    |   |           |-- TooManyFieldsRule.build
    |   |           |   |-- Script-9670C39D2DBE408281ED64DE.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- TooManyFieldsRule.LinkFileList
    |   |           |-- TooManyMethodsRule.build
    |   |           |   |-- Script-9716E9AC217D48C2BC6EE69A.sh
    |   |           |   |-- dgph
    |   |           |   |-- dgph~
    |   |           |   |-- Objects-normal
    |   |           |       |-- x86_64
    |   |           |           |-- TooManyMethodsRule.LinkFileList
    |   |           |-- TooManyParametersRule.build
    |   |               |-- Script-C131B9FD52E8487DA6AB302D.sh
    |   |               |-- dgph
    |   |               |-- dgph~
    |   |               |-- Objects-normal
    |   |                   |-- x86_64
    |   |                       |-- TooManyParametersRule.LinkFileList
    |   |-- unused
    |       |-- cmake_install.cmake
    |       |-- CMakeFiles
    |       |-- CMakeScripts
    |       |   |-- UnusedLocalVariableRule_postBuildPhase.makeDebug
    |       |   |-- UnusedLocalVariableRule_postBuildPhase.makeMinSizeRel
    |       |   |-- UnusedLocalVariableRule_postBuildPhase.makeRelWithDebInfo
    |       |   |-- UnusedLocalVariableRule_postBuildPhase.makeRelease
    |       |   |-- UnusedMethodParameterRule_postBuildPhase.makeDebug
    |       |   |-- UnusedMethodParameterRule_postBuildPhase.makeMinSizeRel
    |       |   |-- UnusedMethodParameterRule_postBuildPhase.makeRelWithDebInfo
    |       |   |-- UnusedMethodParameterRule_postBuildPhase.makeRelease
    |       |-- OCLINT_RULES.build
    |           |-- Debug
    |               |-- UnusedLocalVariableRule.build
    |               |   |-- Script-6F7B3BBB64F743CF8EE264F4.sh
    |               |   |-- dgph
    |               |   |-- dgph~
    |               |   |-- Objects-normal
    |               |       |-- x86_64
    |               |           |-- UnusedLocalVariableRule.LinkFileList
    |               |-- UnusedMethodParameterRule.build
    |                   |-- Script-3E8D2856FB364FB8B8780CE3.sh
    |                   |-- dgph
    |                   |-- dgph~
    |                   |-- Objects-normal
    |                       |-- x86_64
    |                           |-- UnusedMethodParameterRule.LinkFileList
    |-- rules.dl
        |-- .DS_Store
        |-- Debug
            |-- libTestRuleRule.dylib

  1. 然后将编译好的动态库拷贝到 /usr/local/oclint-0.13/lib/oclint/rules 路径下的文件夹中;

  2. 在执行 三 步骤中的脚本,即可使用自定义的规则进行代码分析。

自定义规则

未完待续...

后面还会补充具体在代码上如何实现自定义规则, 欢迎大佬们指正, O(∩_∩)O谢谢!

上一篇下一篇

猜你喜欢

热点阅读