FaceBook/infer-linter靜態程式碼分析

來源:互聯網
上載者:User

Linter 分析,揪出因語法錯誤、打字錯誤或資料類型錯誤而引起的bug源頭.Infer也支援這樣簡單的分析,只需要加一個參數-a checkers就可以 命令

infer -a checkers -i -- xcodebuild -target HelloWorldApp -configuration Debug -sdk iphonesimulator

我們對iOS相對進行linter檢查

58deMacBook-Pro:ios_hello wuxian$ infer -a checkers -i -- xcodebuild -target HelloWorldApp -configuration Debug -sdk iphonesimulatorBuild settings from command line:    CC = /Users/wuxian/Downloads/infer-osx-v0.1.0/infer/infer/bin/../lib/capture/clang    CPLUSPLUS = /Users/wuxian/Downloads/infer-osx-v0.1.0/infer/infer/bin/../lib/capture/clang++    DEBUG_INFORMATION_FORMAT = 'dwarf'    LD = /usr/bin/true    LDPLUSPLUS = /usr/bin/true    LIPO = /usr/bin/true    SDKROOT = iphonesimulator8.2=== BUILD TARGET HelloWorldApp OF PROJECT HelloWorldApp WITH CONFIGURATION Debug ===Check dependencies** BUILD SUCCEEDED **Starting analysis (Infer version v0.1.0)Analysis done4 files analyzed/Users/wuxian/Downloads/infer-osx-v0.1.0/infer/examples/ios_hello/HelloWorldApp/main.m:13: error: CHECKERS_DEAD_CODE  Node not visited: 20958deMacBook-Pro:ios_hello wuxian$ infer -a checkers -i -- xcodebuild -target HelloWorldApp -configuration Debug -sdk iphonesimulatorBuild settings from command line:    CC = /Users/wuxian/Downloads/infer-osx-v0.1.0/infer/infer/bin/../lib/capture/clang    CPLUSPLUS = /Users/wuxian/Downloads/infer-osx-v0.1.0/infer/infer/bin/../lib/capture/clang++    DEBUG_INFORMATION_FORMAT = 'dwarf'    LD = /usr/bin/true    LDPLUSPLUS = /usr/bin/true    LIPO = /usr/bin/true    SDKROOT = iphonesimulator8.2=== BUILD TARGET HelloWorldApp OF PROJECT HelloWorldApp WITH CONFIGURATION Debug ===Check dependencies** BUILD SUCCEEDED **Starting analysis (Infer version v0.1.0)Analysis done4 files analyzed/Users/wuxian/Downloads/infer-osx-v0.1.0/infer/examples/ios_hello/HelloWorldApp/main.m:13: error: CHECKERS_DEAD_CODE  Node not visited: 20958deMacBook-Pro:ios_hello wuxian$

明顯提示出來的問題和之前是有區別的.

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.