zoukankan      html  css  js  c++  java
  • iOS codeview

    1.环境配置

    oclint:http://oclint.org/

    xcpretty:https://github.com/supermarin/xcpretty

    使用Mac安装xcpretty过程可能会出现自带ruby版本错误,需要升级ruby

    $ curl -L get.rvm.io | bash -s stable
    $ source ~/.rvm/scripts/rvm
    $ rvm list known
    $ rvm install 2.2.0
    rvm use 2.2.0 --default 
    

    2.代码扫描

    xcodebuild clean build -sdk iphonesimulator -arch "x86_64" ONLY_ACTIVE_ARCH=NO VALID_ARCHS="i386 x86_64" | xcpretty -r json-compilation-database
    cp build/reports/compilation_db.json compile_commands.json
    oclint-json-compilation-database -e Pods -- -rc=LONG_LINE=200 -rc=NCSS_METHOD=100 -o=report.html
    

    如果扫描的生成的compile_commands.json文件过大,oclint-json-compilation-database会提示出错“OSError: [Errno 7] Argument list too long

    https://github.com/oclint/oclint/issues/233有网友给出解决方案:https://github.com/wuwen1030/oclint_argument_list_too_long_solution/tree/master

    3.oclint默认的rule

    http://docs.oclint.org/en/stable/howto/thresholds.html

  • 相关阅读:
    【UVa#10325】The Lottery
    【洛谷P1868】饥饿的奶牛
    【NOI2005】维护数列
    【NOIP2018】保卫王国
    【洛谷P4719】动态dp
    【NOI2014】魔法森林
    【洛谷P4234】最小差值生成树
    【国家集训队】Tree II
    面试1
    struts2中的方法的调用
  • 原文地址:https://www.cnblogs.com/geweb/p/codeview.html
Copyright © 2011-2022 走看看