• Roger
    2019-03-26
    给宝宝喂夜奶,顺便来看看新的一课讲什么
    
     20
  • iLearn
    2019-03-26
    老师,Swift的要怎么搞?

    作者回复: SwiftLint

    
     15
  • drunkenMouse
    2019-03-27
    1. OClint 想执行自己指定的项目,还是不会。。最后查了别的资料,说是要写脚本安装xcpretty,而且说是不维护了。

    2. CLang 静态分析器的clang —analyze -Xclang -analyzer-checker-help 我执行之后,并没有成功显示常用的Checker。。

    3. Clang 静态分析器的lib/StaticAnalyzer/Checkers这个路径也没有找到,是不是换地方了?

    4. OClint、Clang静态分析器与Infer 都需要Clang编译器的LLVM对源码做词法、语法上的分析生成AST(一种静态语法树,代码更精简,遍历更轻松),然后对生成的AST做静态分析,达到编译代码层面的分析。

    5. OCLint说是不维护了,所以除了规则太多导致的重点找不到,可定制性过高导致的易用性变差外,也PASS(其实我对这句规则多所以XX的理解感受不是很深。。)

    Clang静态分析器,规则少只能检策较大问题,对内存泄漏一类问题若无错误也不提示外,回调次数也多。每执行一句,都要回调所有的Checker的回调函数。所以PASS

    Infer 定制性不是最高,但是不差。可以小范围分析,所以效率高。还支持增量分析(使用已缓存数据,非增量会清楚缓存)。所以,建议Infer
    展开
    
     13
  • yb坏蛋biubiu
    2019-03-26
    clang作为llvm编译器前端,进行预编译、词法分析生成token片、语法分析生成AST后,提供一个切面,开发者可以在这里利用clang生成的AST语法树进行自定义规则遍历分析,clang也提供了相应的checker和抛出诊断异常的diagnosis。
    
     6
  • 快到碗里来
    2019-04-19
    infer扫描单个文件 报错
    7 errors generated.
    Error: the following clang command did not run successfully:
        /usr/local/Cellar/infer/0.15.0/lib/infer/facebook-clang-plugins/clang/install/bin/clang
        @/var/folders/j_/tb3f_ly50rj_qylmtk1h8k2w0000gn/T/clang_command_.tmp.11b92e.txt
      ++Contents of '/var/folders/j_/tb3f_ly50rj_qylmtk1h8k2w0000gn/T/clang_command_.tmp.11b92e.txt':
        "-cc1" "-load"
        "/usr/local/Cellar/infer/0.15.0/lib/infer/infer/bin/../../facebook-clang-plugins/libtooling/build/FacebookClangPlugin.dylib"
        "-add-plugin" "BiniouASTExporter" "-plugin-arg-BiniouASTExporter" "-"
        "-plugin-arg-BiniouASTExporter" "PREPEND_CURRENT_DIR=1"
        "-plugin-arg-BiniouASTExporter" "MAX_STRING_SIZE=65535" "-cc1" "-triple"
        "x86_64-apple-macosx10.14.0" "-Wdeprecated-objc-isa-usage"
        "-Werror=deprecated-objc-isa-usage" "-emit-obj" "-mrelax-all"
        "-disable-free" "-disable-llvm-verifier" "-discard-value-names"
        "-main-file-name" "RootVC.m" "-mrelocation-model" "pic" "-pic-level" "2"
        "-mthread-model" "posix" "-mdisable-fp-elim" "-masm-verbose"
        "-munwind-tables" "-target-cpu" "penryn" "-dwarf-column-info"
        "-debugger-tuning=lldb" "-target-linker-version" "351.8"

        "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk"
        "-include"
        "/usr/local/Cellar/infer/0.15.0/lib/infer/infer/bin/../lib/clang_wrappers/global_defines.h"
        "-Wno-ignored-optimization-argument" "-Wno-everything"
        "-fdebug-compilation-dir" "/Users/mingzhi.liu/Desktop/TON/TON"
        "-ferror-limit" "19" "-fmessage-length" "0" "-stack-protector" "1"
        "-fblocks" "-fencode-extended-block-signature"
        "-fobjc-runtime=macosx-10.14.0" "-fobjc-exceptions" "-fexceptions"
        "-fmax-type-align=16" "-fdiagnostics-show-option" "-o" "RootVC.o" "-x"
        "objective-c" "RootVC.m" "-O0" "-include"
        "/usr/local/Cellar/infer/0.15.0/lib/infer/infer/bin/../lib/clang_wrappers/global_defines.h"
        "-Wno-everything"
    展开
    
     3
  • Yestin Zhao🏀
    2019-04-09
    fatal error: 'Foundation/Foundation.h' file not found 这么解决👇
    infer -- clang -c -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk Hello.m
    
     3
  • 寻心
    2019-04-04
    这个问题有谁遇到吗?
    怎么解决?
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

    Internal Error: /usr/local/Cellar/infer/0.15.0/lib/infer/infer/bin/../lib/python/infer.py
      -j 4 --project-root /Users/yy/工作/项目/test --out
      /Users/yy/工作/项目/test/infer-out -- xcodebuild build -scheme test
      -workspace test.xcworkspace -configuration Debug -sdk iphonesimulator:
      exited with code 1
    Error backtrace:
    Raised at file "base/Die.ml" (inlined), line 25, characters 6-36
    Called from file "base/Logging.ml", line 314, characters 58-80
    Called from file "integration/Driver.ml", line 159, characters 2-16
    Called from file "integration/Driver.ml", line 280, characters 6-420
    Called from file "infer.ml", line 20, characters 2-36
    Called from file "infer.ml", line 130, characters 8-54

    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    展开
    
     3
  • mosn
    2019-04-08
    infer --skip-analysis-in-path Pods
    
     2
  • 简生
    2019-03-30
    个人觉得虽然OCLint检测规则多,易用性没有Infer好。但是Sonar+OCLint可以对检测结果进行一个可视化的管理,还是会偏向于选择OCLint。😊
    
     2
  • 吴小安
    2019-03-29
    infer 扫描怎么过滤不想扫描的文件呢,例如pod
    
     2
  • drunkenMouse
    2019-03-28
    关于brew,因为我之前是在很久之前就安装了,所以现在在安装infer的时候会出现部分所需插件版本过低的情况。然后我想升级插件,也需要先更新brew,但我的brew更新也是失败:Error: /usr/local must be writable! 错误

    这种情况下,还想是使用Brew进行安装的话,需要如下操作:
    1.卸载旧的brew
    ```
    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)”

    ```
    2.安装新的brew
    ```
    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    ```
    之后,再按照infer的安装提示一步步安装。
    展开
    
     1
  • Geek
    2019-03-28
    传统编译器的工作原理,基本上都是三段式的,可以分为前端、优化器和后端。前端负责解析源代码,检查语法错误,并将其翻译为抽象的语法树;优化器对这一中间代码进行优化,试图使代码更高效;后端则负责将优化器优化后的中间代码转换为目标机器的代码,这一过程后端会最大化的利用目标机器的特殊指令,以提高代码的性能。基于这个认知,我们可以认为 LLVM 包括了两个概念:一个广义的 LLVM 和一个狭义的 LLVM 。广义的 LLVM 指的是一个完整的 LLVM 编译器框架系统,包括了前端、优化器、后端、众多的库函数以及很多的模块;而狭义的 LLVM 则是聚焦于编译器后端功能的一系列模块和库,包括代码优化、代码生成、JIT 等。
    ---------------------
    作者:艾蔓草
    来源:CSDN
    原文:https://blog.csdn.net/xhhjin/article/details/81164076
    版权声明:本文为博主原创文章,转载请附上博文链接!
    展开
    
     1
  • Geek_1ce2e0
    2019-03-26
    Swiftlint就行
    
     1
  • Nevermore
    2019-03-26
    SwiftLint
    
     1
  • 疯狂的石头
    2019-07-07
    遇见这个问题的童鞋
    Error: the following clang command did not run successfully:
        /usr/local/Cellar/infer/0.15.0/lib/infer/facebook-clang-plugins/clang/install/bin/clang
    去/Library/Developer/CommandLineTools/Packages这个目录,安装pkg可以解决
    
    
  • 烈人
    2019-05-29
    使用homebrew安装infer后,直接infer -- clang xx.m ,报头文件找不到。我也是无语。xcode10。然后扫描整个工程又是正常的。
    
    
  • GODV
    2019-05-27
    Error while trying to load a compilation database:
    Could not auto-detect compilation database for file "Hello.m"
    No compilation database found in /Users/***/Desktop/OCLintTest or any parent directory
    用OCLint创建应该放在那个目录下,不太明白
    
    
  • CalvinGao
    2019-04-25
    老师,-bash: scan-build: command not found 是什么原因呢,资源也下了,为什么会报这样的错误呢
    
    
  • 快到碗里来
    2019-04-19
    infer扫描iOS单个文件报错 怎么回事啊
    
    
  • 青冈
    2019-04-08
    不知道有人知道infer 怎么配置黑名单来过滤不想扫描的文件,如pod引入的AFN等三方库?
    
    
我们在线,来聊聊吧