iOS-OCLint 静态代码分析

本文介绍了OClint工具的安装、更新和使用方法。安装可通过brew和gem命令,更新用brew upgrade。使用时需设置工作区和目标,通过一系列xcodebuild和oclint命令进行代码分析并生成报告。还提供了多个参考链接及其他工具链接。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一.安装:

brew tap oclint/formulae

brew install oclint

gem install xcpretty

 

二.更新:

brew upgrade oclint

 

三.使用:

workspace=aaa.xcworkspace

target=bb

xcodebuild -workspace $workspace -scheme $target clean&&

xcodebuild -workspace $workspace -scheme $target analyze \

-configuration Debug \

COMPILER_INDEX_STORE_ENABLE=NO \

| xcpretty -r json-compilation-database -o compile_commands.json&&

oclint-json-compilation-database -e Pods -- \

-report-type html -o oclint_result.html \

-rule UnusedLocalVariable \

-max-priority-1=100000 \

-max-priority-2=100000 \

-max-priority-3=100000; \

rm compile_commands.json;

 

三.参考:

1.https://www.jianshu.com/p/4f505e92d557?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

2.OClint学习笔记:

https://blog.csdn.net/hdwhappy/article/details/60767412

https://github.com/hdw09/CIHexoBlog/blob/master/source/_posts/OClint学习笔记.md

 

3.OCLint代码扫描工具详解:

https://www.jianshu.com/p/5eb91c7348b1

 

4.官网文档:

http://docs.oclint.org/en/stable/index.html

 

5.扫描规则size解释:

https://blog.csdn.net/liqinghuiyx/article/details/52437772

6.添加例外:

https://oclint-docs.readthedocs.io/en/stable/howto/suppress.html

7.规则列表:

https://oclint-docs.readthedocs.io/en/stable/rules/index.html

8.规则自定义及调试:

https://blog.csdn.net/hdwhappy/article/details/61924772

 

四.其他工具:

1.Infer bug types

https://infer.liaohuqiu.net/docs/infer-bug-types.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值