Infer

Facebook Infer is a static analysis tool - if you give Infer some Objective-C, Java, or C code, it produces a list of potential bugs.

Version

0.17.0

Runtime

Ubuntu Stretch OpenJDK 8

Supported Languages

C C++ Java

Official Documentation

http://fbinfer.com/

YAML Configuration

infer:

  • input:

    Patterns to include in execution and reports.

  • ignore:

    Patterns to exclude from execution and reports.

  • auto-fix:

    N/A

  • config-file:

    Path to your .inferconfig file the directory of which is specified to Infer via --inferconfig-home option.

  • machine:

    • cpu:

      Amount of CPU. The default machine has 0.75 CPU with 2880 MiB RAM.

      Inspecode automatically specifies --jobs option to Infer according to this value. For example, --jobs 1 is specified by default (for 0.75 CPU), --jobs 2 is specified for 1.1 CPU.

  • options:

    Below is the list of options that are supported:

    OPTIONS
         --annotation-reachability-custom-pairs json
             Specify custom sources/sink for the annotation reachability
             checker           Example format: for custom annotations
             com.my.annotation.{Source1,Source2,Sink1}
             { "sources" : ["Source1", "Source2"], "sink" : "Sink1" }
             See also infer-analyze(1). (default: [])
         --annotation-reachability-cxx json
            Specify annotation reachability analyses to be performed on
            C/C++/ObjC code. Each entry is a JSON object whose key is the
            issue name. "sources" and "sinks" can be specified either by
            symbol or path prefix. "sinks" optionally can specify "overrides"
            (by symbol or path prefix) that block the reachability analysis
            when hit. Example:             {
                "ISOLATED_REACHING_CONNECT": {
                  "doc_url": "http::ptional/issue/doc/link.html",
                  "sources": {
                    "desc": "Code that should not call connect [optional]",
                    "paths": [ "isolated/" ]
                  },
                  "sinks": {
                    "symbols": [ "connect" ],
                    "overrides": { "symbols": [ "Trusted::" ] }
                  }
                }
              }
            This will cause us to create a new ISOLATED_REACHING_CONNECT
            issue for every function whose source path starts with "isolated/"
            that may reach the function named "connect", ignoring paths that
            go through a symbol starting with "Trusted::".
            See also infer-analyze(1). (default: [])
         --annotation-reachability-cxx-sources json
            Override sources in all cxx annotation reachability specs with the
            given sources spec           See also infer-analyze(1). (default: [])
         --annotation-reachability-only
             Activates: Enable --annotation-reachability and disable all other
             checkers (Conversely: --no-annotation-reachability-only)
      See also infer-analyze(1).
         --no-biabduction
             Deactivates: the separation logic based bi-abduction analysis
             using the checkers framework (Conversely: --biabduction)
      See also infer-analyze(1).
         --biabduction-fallback-model-alloc-pattern string
            Regex of methods that should be modelled as allocs if definition
            is missing           See also infer-analyze(1).
         --biabduction-fallback-model-free-pattern string
            Regex of methods that should be modelled as free if definition is
            missing           See also infer-analyze(1).
         --biabduction-only
             Activates: Enable --biabduction and disable all other checkers
             (Conversely: --no-biabduction-only)           See also infer-analyze(1).
         --bootclasspath string
             Specify the Java bootclasspath           See also infer-capture(1).
         --buck-blacklist +regex
            Skip capture of files matched by the specified regular expression
            (only the "flavors (C++)" Buck integration is supported, not
            Java).           See also infer-capture(1) and infer-run(1).
         --buck-targets-blacklist +regex
            Skip capture of buck targets matched by the specified regular
            expression.           See also infer-capture(1) and infer-run(1).
         --bufferoverrun
             Activates: the buffer overrun analysis (Conversely:
             --no-bufferoverrun)           See also infer-analyze(1).
         --bufferoverrun-only
             Activates: Enable --bufferoverrun and disable all other checkers
             (Conversely: --no-bufferoverrun-only)           See also infer-analyze(1).
         --capture-blacklist regex
             Skip capture of files matched by the specified OCaml regular
             expression (only supported by the javac integration for now).
      See also infer-capture(1) and infer-run(1).
         --censor-report +string
             Specify a filter for issues to be censored by adding a
             'censored_reason' field in the json report. Infer will not report
             censored issues on the console output and in bugs.txt, but tools
             that post-process the json report can take them into account. If
             multiple filters are specified, they are applied in the order in
             which they are specified. Each filter is applied to each issue
             detected, and only issues which are accepted by all filters are
             reported. Each filter is of the form:
             `<issue_type_regex>:<filename_regex>:<reason_string>`. The first
             two components are OCaml Str regular expressions, with an optional
             `!` character prefix. If a regex has a `!` prefix, the polarity is
             inverted, and the filter becomes a "blacklist" instead of a
             "whitelist". Each filter is interpreted as an implication: an
             issue matches if it does not match the `issue_type_regex` or if it
             does match the `filename_regex`. The filenames that are tested by
             the regex are relative to the `--project-root` directory. The
             `<reason_string>` is a non-empty string used to explain why the
             issue was filtered.           See also infer-report(1) and infer-run(1).
         --clang-blacklisted-flags +string
             Clang flags to filter out           See also infer-capture(1). (default:
             --expt-relaxed-constexpr,-fembed-bitcode-marker,-fno-absolute-module-directory,-fno-canonical-system-headers)
         --clang-blacklisted-flags-with-arg +string
             Clang flags (taking args) to filter out           See also infer-capture(1). (default: -index-store-path,-mllvm)
         --class-loads
             Activates: Java class loading analysis (Conversely:
             --no-class-loads)           See also infer-analyze(1).
         --class-loads-only
             Activates: Enable --class-loads and disable all other checkers
             (Conversely: --no-class-loads-only)           See also infer-analyze(1).
         --cost
             Activates: checker for performance cost analysis (Conversely:
             --no-cost)           See also infer-analyze(1).
         --cost-only
             Activates: Enable --cost and disable all other checkers
             (Conversely: --no-cost-only)           See also infer-analyze(1).
         --custom-symbols json
             Specify named lists of symbols available to rules           See also infer-analyze(1). (default: [])
         --no-cxx
             Deactivates: Analyze C++ methods (Conversely: --cxx)
      See also infer-capture(1).
         --cxx-scope-guards json
             without being reported as dead stores.           See also infer-analyze(1). (default: [])
         --no-default-checkers
             Deactivates: Default checkers: --biabduction,
             --fragment-retains-view, --inefficient-keyset-iterator, --linters,
             --liveness, --racerd, --siof, --starvation, --uninit (Conversely:
             --default-checkers)           See also infer-analyze(1).
         --no-default-linters
             Deactivates: Use the default linters for the analysis.
             (Conversely: --default-linters)           See also infer-capture(1).
         --disable-issue-type +issue_type
             Do not show reports coming from this type of issue. Each checker
             can report a range of issue types. This option provides
             fine-grained filtering over which types of issue should be
             reported once the checkers have run. In particular, note that
             disabling issue types does not make the corresponding checker not
             run.           Available issue types are as follows:
    
             ALLOCATION_COMPLEXITY_INCREASE (enabled by default),
               ALLOCATION_COMPLEXITY_INCREASE_COLD_START (enabled by default),
               ANALYSIS_STOPS (disabled by default),
               ARRAY_OUT_OF_BOUNDS_L1 (disabled by default),
               ARRAY_OUT_OF_BOUNDS_L2 (disabled by default),
               ARRAY_OUT_OF_BOUNDS_L3 (disabled by default),
               Abduction_case_not_implemented (enabled by default),
               Array_of_pointsto (enabled by default),
               Assert_failure (enabled by default),
               BUFFER_OVERRUN_L1 (enabled by default),
               BUFFER_OVERRUN_L2 (enabled by default),
               BUFFER_OVERRUN_L3 (enabled by default),
               BUFFER_OVERRUN_L4 (disabled by default),
               BUFFER_OVERRUN_L5 (disabled by default),
               BUFFER_OVERRUN_R2 (enabled by default),
               BUFFER_OVERRUN_S2 (enabled by default),
               BUFFER_OVERRUN_U5 (disabled by default),
               Bad_footprint (enabled by default),
               CHECKERS_ALLOCATES_MEMORY (enabled by default),
               CHECKERS_ANNOTATION_REACHABILITY_ERROR (enabled by default),
               CHECKERS_CALLS_EXPENSIVE_METHOD (enabled by default),
               CHECKERS_EXPENSIVE_OVERRIDES_UNANNOTATED (enabled by default),
               CHECKERS_FRAGMENT_RETAINS_VIEW (enabled by default),
               CHECKERS_IMMUTABLE_CAST (enabled by default),
               CHECKERS_PRINTF_ARGS (enabled by default),
               CLASS_CAST_EXCEPTION (disabled by default),
               CLASS_LOAD (enabled by default),
               COMPARING_FLOAT_FOR_EQUALITY (enabled by default),
               COMPONENT_FACTORY_FUNCTION (enabled by default),
               COMPONENT_FILE_CYCLOMATIC_COMPLEXITY (enabled by default),
               COMPONENT_FILE_LINE_COUNT (enabled by default),
               COMPONENT_INITIALIZER_WITH_SIDE_EFFECTS (enabled by default),
               COMPONENT_WITH_MULTIPLE_FACTORY_METHODS (enabled by default),
               COMPONENT_WITH_UNCONVENTIONAL_SUPERCLASS (enabled by default),
               CONDITION_ALWAYS_FALSE (disabled by default),
               CONDITION_ALWAYS_TRUE (disabled by default),
               CREATE_INTENT_FROM_URI (enabled by default),
               CROSS_SITE_SCRIPTING (enabled by default),
               Cannot_star (enabled by default),
               Codequery (enabled by default),
               DANGLING_POINTER_DEREFERENCE (disabled by default),
               DEADLOCK (enabled by default),
               DEAD_STORE (enabled by default),
               DEALLOCATE_STACK_VARIABLE (enabled by default),
               DEALLOCATE_STATIC_MEMORY (enabled by default),
               DEALLOCATION_MISMATCH (enabled by default),
               DIVIDE_BY_ZERO (disabled by default),
               DO_NOT_REPORT (enabled by default),
               EMPTY_VECTOR_ACCESS (enabled by default),
               ERADICATE_CONDITION_REDUNDANT (enabled by default),
               ERADICATE_CONDITION_REDUNDANT_NONNULL (enabled by default),
               ERADICATE_FIELD_NOT_INITIALIZED (enabled by default),
               ERADICATE_FIELD_NOT_MUTABLE (enabled by default),
               ERADICATE_FIELD_NOT_NULLABLE (enabled by default),
               ERADICATE_FIELD_OVER_ANNOTATED (enabled by default),
               ERADICATE_FIELD_VALUE_ABSENT (enabled by default),
               ERADICATE_INCONSISTENT_SUBCLASS_PARAMETER_ANNOTATION (enabled
             by default),
               ERADICATE_INCONSISTENT_SUBCLASS_RETURN_ANNOTATION (enabled by
             default),
               ERADICATE_NULLABLE_DEREFERENCE (enabled by default),
               ERADICATE_PARAMETER_NOT_NULLABLE (enabled by default),
               ERADICATE_PARAMETER_VALUE_ABSENT (enabled by default),
               ERADICATE_RETURN_NOT_NULLABLE (enabled by default),
               ERADICATE_RETURN_OVER_ANNOTATED (enabled by default),
               ERADICATE_RETURN_VALUE_NOT_PRESENT (enabled by default),
               ERADICATE_VALUE_NOT_PRESENT (enabled by default),
               EXECUTION_TIME_COMPLEXITY_INCREASE (enabled by default),
               EXECUTION_TIME_COMPLEXITY_INCREASE_COLD_START (enabled by
             default),
               EXPENSIVE_ALLOCATION (disabled by default),
               EXPENSIVE_ALLOCATION_COLD_START (disabled by default),
               EXPENSIVE_EXECUTION_TIME (disabled by default),
               EXPENSIVE_EXECUTION_TIME_COLD_START (disabled by default),
               EXPENSIVE_LOOP_INVARIANT_CALL (enabled by default),
               EXPOSED_INSECURE_INTENT_HANDLING (enabled by default),
               Failure_exe (enabled by default),
               GLOBAL_VARIABLE_INITIALIZED_WITH_FUNCTION_OR_METHOD_CALL
             (disabled by default),
               GRAPHQL_FIELD_ACCESS (enabled by default),
               GUARDEDBY_VIOLATION (enabled by default),
               INEFFICIENT_KEYSET_ITERATOR (enabled by default),
               INFERBO_ALLOC_IS_BIG (enabled by default),
               INFERBO_ALLOC_IS_NEGATIVE (enabled by default),
               INFERBO_ALLOC_IS_ZERO (enabled by default),
               INFERBO_ALLOC_MAY_BE_BIG (enabled by default),
               INFERBO_ALLOC_MAY_BE_NEGATIVE (enabled by default),
               INFINITE_ALLOCATION (disabled by default),
               INFINITE_EXECUTION_TIME (disabled by default),
               INHERENTLY_DANGEROUS_FUNCTION (enabled by default),
               INSECURE_INTENT_HANDLING (enabled by default),
               INTEGER_OVERFLOW_L1 (enabled by default),
               INTEGER_OVERFLOW_L2 (enabled by default),
               INTEGER_OVERFLOW_L5 (disabled by default),
               INTEGER_OVERFLOW_R2 (enabled by default),
               INTEGER_OVERFLOW_U5 (disabled by default),
               INTERFACE_NOT_THREAD_SAFE (enabled by default),
               INVARIANT_CALL (enabled by default),
               IVAR_NOT_NULL_CHECKED (enabled by default),
               Internal_error (enabled by default),
               JAVASCRIPT_INJECTION (enabled by default),
               LOCK_CONSISTENCY_VIOLATION (enabled by default),
               LOGGING_PRIVATE_DATA (enabled by default),
               Leak_after_array_abstraction (enabled by default),
               Leak_in_footprint (enabled by default),
               MEMORY_LEAK (enabled by default),
               MISSING_REQUIRED_PROP (enabled by default),
               MUTABLE_LOCAL_VARIABLE_IN_COMPONENT_FILE (enabled by default),
               Missing_fld (enabled by default),
               NULLSAFE_FIELD_NOT_NULLABLE (enabled by default),
               NULLSAFE_NULLABLE_DEREFERENCE (enabled by default),
               NULL_DEREFERENCE (enabled by default),
               NULL_TEST_AFTER_DEREFERENCE (disabled by default),
               PARAMETER_NOT_NULL_CHECKED (enabled by default),
               POINTER_SIZE_MISMATCH (enabled by default),
               PRECONDITION_NOT_FOUND (enabled by default),
               PRECONDITION_NOT_MET (enabled by default),
               PREMATURE_NIL_TERMINATION_ARGUMENT (enabled by default),
               PURE_FUNCTION (enabled by default),
               QUANDARY_TAINT_ERROR (enabled by default),
               REGISTERED_OBSERVER_BEING_DEALLOCATED (enabled by default),
               RESOURCE_LEAK (enabled by default),
               RETAIN_CYCLE (enabled by default),
               RETURN_EXPRESSION_REQUIRED (enabled by default),
               RETURN_STATEMENT_MISSING (enabled by default),
               RETURN_VALUE_IGNORED (disabled by default),
               SHELL_INJECTION (enabled by default),
               SHELL_INJECTION_RISK (enabled by default),
               SKIP_FUNCTION (enabled by default),
               SKIP_POINTER_DEREFERENCE (enabled by default),
               SQL_INJECTION (enabled by default),
               SQL_INJECTION_RISK (enabled by default),
               STACK_VARIABLE_ADDRESS_ESCAPE (disabled by default),
               STARVATION (enabled by default),
               STATIC_INITIALIZATION_ORDER_FIASCO (enabled by default),
               STRICT_MODE_VIOLATION (enabled by default),
               Symexec_memory_error (enabled by default),
               TAINTED_BUFFER_ACCESS (enabled by default),
               TAINTED_MEMORY_ALLOCATION (enabled by default),
               THREAD_SAFETY_VIOLATION (enabled by default),
               TOPL_ERROR (enabled by default),
               UNARY_MINUS_APPLIED_TO_UNSIGNED_EXPRESSION (disabled by
             default),
               UNINITIALIZED_VALUE (enabled by default),
               UNREACHABLE_CODE (enabled by default),
               UNSAFE_GUARDED_BY_ACCESS (enabled by default),
               UNTRUSTED_BUFFER_ACCESS (disabled by default),
               UNTRUSTED_DESERIALIZATION (enabled by default),
               UNTRUSTED_DESERIALIZATION_RISK (enabled by default),
               UNTRUSTED_ENVIRONMENT_CHANGE_RISK (enabled by default),
               UNTRUSTED_FILE (enabled by default),
               UNTRUSTED_FILE_RISK (enabled by default),
               UNTRUSTED_HEAP_ALLOCATION (disabled by default),
               UNTRUSTED_INTENT_CREATION (enabled by default),
               UNTRUSTED_URL_RISK (enabled by default),
               UNTRUSTED_VARIABLE_LENGTH_ARRAY (enabled by default),
               USER_CONTROLLED_SQL_RISK (enabled by default),
               USE_AFTER_DELETE (enabled by default),
               USE_AFTER_FREE (enabled by default),
               USE_AFTER_LIFETIME (enabled by default),
               Unknown_proc (enabled by default),
               VECTOR_INVALIDATION (enabled by default),
               Wrong_argument_number (enabled by default),
               ZERO_ALLOCATION (disabled by default),
               ZERO_EXECUTION_TIME (disabled by default).
             See also infer-report(1).
         --dump-duplicate-symbols
             Activates: Dump all symbols with the same name that are defined in
             more than one file. (Conversely: --no-dump-duplicate-symbols)
      See also infer-capture(1).
         --enable-issue-type +issue_type
             Show reports coming from this type of issue. By default, all issue
             types are enabled except the ones listed in --disable-issue-type.
             Note that enabling issue types does not make the corresponding
             checker run; see individual checker options to turn them on or
             off.           See also infer-report(1).
         --eradicate
             Activates: the eradicate @Nullable checker for Java annotations
             (Conversely: --no-eradicate)           See also infer-analyze(1).
         --eradicate-only
             Activates: Enable --eradicate and disable all other checkers
             (Conversely: --no-eradicate-only)           See also infer-analyze(1).
         --external-java-packages +prefix
             Specify a list of Java package prefixes for external Java
             packages. If set, the analysis will not report non-actionable
             warnings on those packages.           See also infer-analyze(1).
         --no-fragment-retains-view
             Deactivates: detects when Android fragments are not explicitly
             nullified before becoming unreabable (Conversely:
             --fragment-retains-view)           See also infer-analyze(1).
         --fragment-retains-view-only
             Activates: Enable --fragment-retains-view and disable all other
             checkers (Conversely: --no-fragment-retains-view-only)
      See also infer-analyze(1).
         --no-hoisting-report-only-expensive
             Deactivates: [Hoisting] Report loop-invariant calls only when the
             function is expensive, i.e. at least linear (Conversely:
             --hoisting-report-only-expensive)           See also infer-report(1).
         --immutable-cast
             Activates: the detection of object cast from immutable type to
             mutable type. For instance, it will detect cast from ImmutableList
             to List, ImmutableMap to Map, and ImmutableSet to Set.
             (Conversely: --no-immutable-cast)           See also infer-analyze(1).
         --immutable-cast-only
             Activates: Enable --immutable-cast and disable all other checkers
             (Conversely: --no-immutable-cast-only)           See also infer-analyze(1).
         --no-inefficient-keyset-iterator
             Deactivates: Check for inefficient uses of keySet iterator that
             access both the key and the value. (Conversely:
             --inefficient-keyset-iterator)           See also infer-analyze(1).
         --inefficient-keyset-iterator-only
             Activates: Enable --inefficient-keyset-iterator and disable all
             other checkers (Conversely: --no-inefficient-keyset-iterator-only)
             See also infer-analyze(1).
         --linter string
             From the linters available, only run this one linter. (Useful
             together with --linters-developer-mode)           See also infer-capture(1).
         --no-linters
             Deactivates: syntactic linters (Conversely: --linters)
      See also infer-analyze(1).
         --linters-def-file +file
             Specify the file containing linters definition (e.g. 'linters.al')
      See also infer-capture(1).
         --linters-def-folder +dir
             Specify the folder containing linters files with extension .al
      See also infer-capture(1).
         --linters-ignore-clang-failures
             Activates: Continue linting files even if some compilation fails.
             (Conversely: --no-linters-ignore-clang-failures)           See also infer-capture(1).
         --linters-only
             Activates: Enable --linters and disable all other checkers
             (Conversely: --no-linters-only)           See also infer-analyze(1).
         --no-liveness
             Deactivates: the detection of dead stores and unused variables
             (Conversely: --liveness)           See also infer-analyze(1).
         --liveness-dangerous-classes json
             Specify classes where the destructor should be ignored when
             computing liveness. In other words, assignement to variables of
             these types (or common wrappers around these types such as
             unique_ptr<type>) will count as dead stores when the variables are
             not read explicitly by the program.           See also infer-analyze(1). (default: [])
         --liveness-only
             Activates: Enable --liveness and disable all other checkers
             (Conversely: --no-liveness-only)           See also infer-analyze(1).
         --loop-hoisting
             Activates: checker for loop-hoisting (Conversely:
             --no-loop-hoisting)           See also infer-analyze(1).
         --loop-hoisting-only
             Activates: Enable --loop-hoisting and disable all other checkers
             (Conversely: --no-loop-hoisting-only)           See also infer-analyze(1).
         --perf-profiler-data-file file
             Specify the file containing perf profiler data to read
             See also infer-analyze(1).
         --printf-args
             Activates: the detection of mismatch between the Java printf
             format strings and the argument types For, example, this checker
             will warn about the type error in `printf("Hello %d", "world")`
             (Conversely: --no-printf-args)           See also infer-analyze(1).
         --printf-args-only
             Activates: Enable --printf-args and disable all other checkers
             (Conversely: --no-printf-args-only)           See also infer-analyze(1).
         --quandary
             Activates: the quandary taint analysis (Conversely: --no-quandary)
      See also infer-analyze(1).
         --quandary-endpoints json
             Specify endpoint classes for Quandary           See also infer-analyze(1). (default: [])
         --quandary-only
             Activates: Enable --quandary and disable all other checkers
             (Conversely: --no-quandary-only)           See also infer-analyze(1).
         --quandary-sanitizers json
             Specify custom sanitizers for Quandary           See also infer-analyze(1). (default: [])
         --quandary-sinks json
             Specify custom sinks for Quandary           See also infer-analyze(1). (default: [])
         --quandary-sources json
             Specify custom sources for Quandary           See also infer-analyze(1). (default: [])
         --no-racerd
             Deactivates: the RacerD thread safety analysis (Conversely:
             --racerd)           See also infer-analyze(1).
         --racerd-guardedby
             Activates: Check @GuardedBy annotations with RacerD (Conversely:
             --no-racerd-guardedby)           See also infer-analyze(1).
         --racerd-only
             Activates: Enable --racerd and disable all other checkers
             (Conversely: --no-racerd-only)           See also infer-analyze(1).
         --report-blacklist-files-containing +string
             blacklist files containing the specified string for the given
             analyzer (see --analyzer for valid values)           See also infer-report(1) and infer-run(1).
         --report-blacklist-path-regex +path_regex
             blacklist the analysis of files whose relative path matches the
             specified OCaml-style regex (to whitelist:
             --<analyzer>-whitelist-path-regex)           See also infer-report(1) and infer-run(1).
         --report-suppress-errors +error_name
             do not report a type of errors           See also infer-report(1) and infer-run(1).
         --no-siof
             Deactivates: the Static Initialization Order Fiasco analysis (C++
             only) (Conversely: --siof)           See also infer-analyze(1).
         --siof-check-iostreams
             Activates: Do not assume that iostreams (cout, cerr, ...) are
             always initialized. The default is to assume they are always
             initialized to avoid false positives. However, if your program
             compiles against a recent libstdc++ then it is safe to turn this
             option on. (Conversely: --no-siof-check-iostreams)           See also infer-analyze(1).
         --siof-only
             Activates: Enable --siof and disable all other checkers
             (Conversely: --no-siof-only)           See also infer-analyze(1).
         --siof-safe-methods +string
             Methods that are SIOF-safe; "foo::bar" will match "foo::bar()",
             "foo<int>::bar()", etc. (can be specified multiple times)
      See also infer-analyze(1).
         --skip-analysis-in-path +path_prefix_OCaml_regex
             Ignore files whose path matches the given prefix (can be specified
             multiple times)           See also infer-capture(1) and infer-run(1).
         --skip-analysis-in-path-skips-compilation
             Activates: Whether paths in --skip-analysis-in-path should be
             compiled or not (Conversely:
             --no-skip-analysis-in-path-skips-compilation)           See also infer-report(1).
         --no-skip-duplicated-types
             Deactivates: Skip fixed-then-introduced duplicated types while
             computing differential reports (Conversely:
             --skip-duplicated-types)           See also infer-reportdiff(1).
         --skip-translation-headers +path_prefix
             Ignore headers whose path matches the given prefix           See also infer-capture(1).
         --sqlite-lock-timeout int
             Timeout for SQLite results database operations, in milliseconds.
      See also infer-analyze(1), infer-capture(1), and infer-run(1).
             (default: five seconds times number of cores)
         --no-starvation
             Deactivates: starvation analysis (Conversely: --starvation)
      See also infer-analyze(1).
         --starvation-only
             Activates: Enable --starvation and disable all other checkers
             (Conversely: --no-starvation-only)           See also infer-analyze(1).
         --threadsafe-aliases json
             Specify custom annotations that should be considered aliases of
             @ThreadSafe           See also infer-analyze(1). (default: [])
         --no-uninit
             Deactivates: checker for use of uninitialized values (Conversely:
             --uninit)           See also infer-analyze(1).
         --uninit-only
             Activates: Enable --uninit and disable all other checkers
             (Conversely: --no-uninit-only)           See also infer-analyze(1).
         --Xclang +string
             Pass values as command-line arguments to invocations of clang
      See also infer-capture(1).
         --  Stop argument processing, use remaining arguments as a build
             command           See also infer-capture(1) and infer-run(1).
    
    INTERNAL OPTIONS
         Use at your own risk.
    
         --abs-struct int
             Specify abstraction level for fields of structs:
             - 0 = no
             - 1 = forget some fields during matching (and so lseg
             abstraction)
             (default: 1)
         --abs-val int
             Specify abstraction level for expressions:
             - 0 = no abstraction
             - 1 = evaluate all expressions abstractly
             - 2 = 1 + abstract constant integer values during join
             (default: 2)
         --allow-leak
             Activates: Forget leaked memory during abstraction (Conversely:
             --no-allow-leak)
         --array-level int
             Level of treating the array indexing and pointer arithmetic:
             - 0 = treats both features soundly
             - 1 = assumes that the size of every array is infinite
             - 2 = assumes that all heap dereferences via array indexing and
             pointer arithmetic are correct
             (default: 0)
         --biabduction-fallback-model-alloc-pattern-reset
             Cancel the effect of --biabduction-fallback-model-alloc-pattern.
         --biabduction-fallback-model-free-pattern-reset
             Cancel the effect of --biabduction-fallback-model-free-pattern.
         --biabduction-models-mode
             Activates: Mode for analyzing the biabduction models (Conversely:
             --no-biabduction-models-mode)
         --bootclasspath-reset
             Cancel the effect of --bootclasspath.
         --buck-blacklist-reset
             Set --buck-blacklist to the empty list.
         --buck-targets-blacklist-reset
             Set --buck-targets-blacklist to the empty list.
         --capture-blacklist-reset
             Cancel the effect of --capture-blacklist.
         --censor-report-reset
             Set --censor-report to the empty list.
         --clang-blacklisted-flags-reset
             Set --clang-blacklisted-flags to the empty list.
         --clang-blacklisted-flags-with-arg-reset
             Set --clang-blacklisted-flags-with-arg to the empty list.
         --clang-ignore-regex dir_OCaml_regex
             The files in this regex will be ignored in the compilation process
             and an empty file will be passed to clang instead. This is to be
             used with the buck flavour infer-capture-all to work around
             missing generated files.
         --clang-ignore-regex-reset
             Cancel the effect of --clang-ignore-regex.
         --clang-isystem-to-override-regex dir_OCaml_regex
             Use this option in the uncommon case where the normal compilation
             process overrides the location of internal compiler headers. This
             option should specify regular expression with the path to those
             headers so that infer can use its own clang internal headers
             instead. Concretely, this will replace -isystem <path matching the
             regex> with -isystem
             /path/to/infer/facebook-clang-plugins/clang/install/lib/clang/<version>/include.
         --clang-isystem-to-override-regex-reset
             Cancel the effect of --clang-isystem-to-override-regex.
         --clang-libcxx-include-to-override-regex dir_OCaml_regex
             Use this option in the uncommon case where the normal compilation
             process overrides the location of libc++. Concretely, this will
             replace -I <path matching the regex> with -I
             /path/to/infer/facebook-clang-plugins/clang/install/include/c++/v1.
         --clang-libcxx-include-to-override-regex-reset
             Cancel the effect of --clang-libcxx-include-to-override-regex.
         --class-loads-roots +string
             Report class loads of this list of Java methods
         --class-loads-roots-reset
             Set --class-loads-roots to the empty list.
         --classpath string
             Specify the Java classpath
         --classpath-reset
             Cancel the effect of --classpath.
         --coverage
             analysis mode to maximize coverage (can take longer)
         --disable-issue-type-reset
             Set --disable-issue-type to the empty list.
         --enable-issue-type-reset
             Set --enable-issue-type to the empty list.
         --eradicate-condition-redundant
             Activates: Condition redundant warnings (Conversely:
             --no-eradicate-condition-redundant)
         --eradicate-field-not-mutable
             Activates: Field not mutable warnings (Conversely:
             --no-eradicate-field-not-mutable)
         --eradicate-field-over-annotated
             Activates: Field over-annotated warnings (Conversely:
             --no-eradicate-field-over-annotated)
         --eradicate-optional-present
             Activates: Check for @Present annotations (Conversely:
             --no-eradicate-optional-present)
         --eradicate-return-over-annotated
             Activates: Return over-annotated warning (Conversely:
             --no-eradicate-return-over-annotated)
         --exit-node-bias
             nodes nearest the exit node are analyzed first
         --export-changed-functions
             Activates: Make infer outout changed functions, similar to
             test-determinator. It is used together with the --modified-lines.
             (Conversely: --no-export-changed-functions)
         --export-changed-functions-output path
             Name of file for export-changed-functions results (default:
             changed_functions.json)
         --external-java-packages-reset
             Set --external-java-packages to the empty list.
         --function-pointer-specialization
             Activates: Do function pointer preprocessing (clang only).
             (Conversely: --no-function-pointer-specialization)
         --genrule-master-mode
             Activates: Make the master Infer process merge capture artefacts
             generated by the genrule integration, and report after analysis.
             (Conversely: --no-genrule-master-mode)
         --genrule-mode
             Activates: Enable the genrule compatibility mode used for the Buck
             integration (Conversely: --no-genrule-mode)
         --linter-reset
             Cancel the effect of --linter.
         --linters-def-file-reset
             Set --linters-def-file to the empty list.
         --linters-def-folder-reset
             Set --linters-def-folder to the empty list.
         --nullable-annotation-name string
             Specify custom nullable annotation name
         --nullable-annotation-name-reset
             Cancel the effect of --nullable-annotation-name.
         --nullsafe-strict-containers
             Activates: Warn when containers are used with nullable keys or
             values (Conversely: --no-nullsafe-strict-containers)
         --perf-profiler-data-file-reset
             Cancel the effect of --perf-profiler-data-file.
         --pure-by-default
             Activates: [Purity]Consider unknown functions to be pure by
             default (Conversely: --no-pure-by-default)
         --report-blacklist-files-containing-reset
             Set --report-blacklist-files-containing to the empty list.
         --report-blacklist-path-regex-reset
             Set --report-blacklist-path-regex to the empty list.
         --report-suppress-errors-reset
             Set --report-suppress-errors to the empty list.
         --report-whitelist-path-regex-reset
             Set --report-whitelist-path-regex to the empty list.
         --reset-linters-def-folder
             Reset the list of folders containing linters definitions to be
             empty (see linters-def-folder).
         --siof-safe-methods-reset
             Set --siof-safe-methods to the empty list.
         --skip-analysis-in-path-reset
             Set --skip-analysis-in-path to the empty list.
         --skip-implementation json
             Matcher or list of matchers for names of files where we only want
             to translate the method declaration, skipping the body of the
             methods (Java only). (default: [])
         --skip-translation json
             Matcher or list of matchers for names of files that should not be
             analyzed at all. (default: [])
         --skip-translation-headers-reset
             Set --skip-translation-headers to the empty list.
         --source-files-filter-reset
             Cancel the effect of --source-files-filter.
         --sourcepath string
             Specify the sourcepath
         --sourcepath-reset
             Cancel the effect of --sourcepath.
         --sqlite-vfs string
             VFS for SQLite
         --sqlite-vfs-reset
             Cancel the effect of --sqlite-vfs.
         --starvation-skip-analysis json
             Specify combinations of class/method list that should be skipped
             during starvation analysis (default: [])
         --no-starvation-strict-mode
             Deactivates: During starvation analysis, report strict mode
             violations (Android only) (Conversely: --starvation-strict-mode)
         --tv-limit int
             The maximum number of traces to submit to Traceview (default: 100)
         --tv-limit-filtered int
             The maximum number of traces for issues filtered out by
             --report-filter to submit to Traceview (default: 100)
         --uninit-interproc
             Activates: Run uninit check in the experimental interprocedural
             mode (Conversely: --no-uninit-interproc)
         --use-cost-threshold
             Activates: Emit costs issues by comparing costs with a set
             threshold (Conversely: --no-use-cost-threshold)
         --visits-bias
             nodes visited fewer times are analyzed first
         --write-html-whitelist-regex +string
             whitelist files that will have its html debug output printed
         --write-html-whitelist-regex-reset
             Set --write-html-whitelist-regex to the empty list.
         --Xclang-reset
             Set --Xclang to the empty list.
    
  • thresholds:

    • num-issues:

      In addition to general severity levels, the following tool specific severity levels can be specified:

      • ADVICE (equivalent to general severity level info)
  • incremental:

    N/A

    Note: The incremental analysis cannot be supported for Infer. This is because Infer performs a regular build with requiring all build dependencies and the results on unchanged files can be affected by changed files.

  • experimental:

    No tool specific experimental options are available.

YAML Examples

  • With default options:

    inspecode:
      tools:
          infer: default
    
  • With custom machine:

    inspecode:
      tools:
          infer:
          machine:
              cpu: 1.5 # 1.5 CPU, 5760 MiB RAM
    
  • With custom options:

    inspecode:
      tools:
          infer:
          options:
              - --dump-duplicate-symbols
              - --: [gcc, -c, hello.c]
    
  • With a configuration file:

    inspecode:
      tools:
          infer:
          config-file: ./config/infer.config
    

    The above configuration sets the path to the configuration file to the INFERCONFIG environment variable.

Available Toolchain

  • autoconf (GNU Autoconf) 2.69
  • automake (GNU automake) 1.14.1
  • clang 3.8.1
  • cmake 3.0.2
  • gcc 4.9.2
  • g++ 4.9.2
  • javac 1.8.0_111
  • make (GNU Make) 4.0
  • musl 1.1.5
  • Apache Maven 3.0.5
  • Apache Ant 1.9.4
  • Gradle 3.4
  • Buck v2016.11.11.01

Note: Inspecode does not support iOS apps as of now.

Build Command Detection

If no build commands are explicitly specified via -- option such as when using default built-in configuration, Inspecode recursively scans your repository to detect project directories enabling one of the following build systems, and then run build commands at each directory accordingly.

  • CMake (build commands: cmake . && make)
  • ./configure (build commands: ./configure && make)
  • Make (build commands: make)
  • Gradle (build commands: ./gradlew clean build)
  • Maven (build commands: mvn clean compile)
  • Ant (build commands: ant [clean|clear|clobber] [compile|build|release|debug|<default target>])

In addition, if no project directories are detected and there are any *.java files in your repository, Inspecode runs javac *.java as a build command at the root of your repository.

If the automatic detection does not suit your project, explicitly specify build commands via -- option.

Resolving Dependencies

Infer requires all build dependencies to run, so Inspecode tries to download dependencies before running Infer:

As of now, Inspecode can download:

  • submodules available to the public
  • submodules provided from your private repositories which:
    • belong to the same GitHub organization or Bitbucket team as the repository on which Infer runs
    • have been already registered to Inspecode
    • can be accessed via http://<hostname>/<path>, https://<hostname>/<path>, ssh://git@<hostname>/<path> or git@<hostname>:<path>

Note: If resolving dependencies fails due to some reasons, you can see the error log, however, Inspecode continues the process unless running Infer itself fails.

results matching ""

    No results matching ""