infer(1)
okay bestie, this is the infer(1) manual page β welcome to Infer Static Analyzer π
β¨
πΈ NAME πΈ
infer β static analysis for Java and C/C++/Objective-C/Objective-C++ π«Ά
β¨ SYNOPSIS β¨
infer analyze [options]
infer capture [options]
infer compile [options]
infer help [options]
infer explore [options]
infer report [options]
infer reportdiff [options]
infer run [options]
infer semdiff [options]
infer --compilation-database[-escaped] file [options]
infer [options] -- compile command
infer [options]
π DESCRIPTION π
Infer is a static analyzer. Give it a collection of source files written in Java or in languages of the C family, plus a command to build them, and it produces a list of potential issues. No cap, thatβs the whole vibe check π₯
Infer is made of a bunch of tools referenced in the SEE ALSO section of this manual. Peep their respective manuals for more info, bestie.
When you run it without a subcommand, and if a compilation command is specified via the -- option or one of the --clang-compilation-database[-escaped] options, then infer behaves as infer-run(1). Otherwise, infer behaves as infer-analyze(1). Slay π
π OPTIONS π
Every infer command accepts the arguments from all the other infer commands. Iconic.
Options are read from the .inferconfig file, then from the INFER_ARGS environment variable, then from the command line. Options in INFER_ARGS take precedence over options in .inferconfig, and options passed on the command line take precedence over options in INFER_ARGS. See the ENVIRONMENT and FILES sections of this manual for more info π«Ά
Options can be specified inside an argument file file by passing @file as argument. The format is one option per line, and enclosing single ' and double " quotes are ignored.
Options without a default value (e.g., --changed-files-index) and options with list-like values (e.g., --Xbuck) all have a corresponding --option-reset flag that resets their values to nothing or the empty list, respectively. For instance, --Xbuck-reset will cancel any previous --Xbuck option passed to infer. Cleanup queen π§Ήβ¨
See the manuals of individual infer commands for details about their supported options. The following is a list of all the supported options (see also --help-full for options reserved for internal use).
--analysis-schedule-filepath β the file where an analysis schedule is stored. The default isinfer-out/analysis_dependency_graph. See alsoinfer-analyze(1).--android-view-class-list+string β a classCis considered a view when it has a supertype that matches one of these classes. The default is[android.view.View]. See alsoinfer-analyze(1).--annotation-reachabilityβ activates: annotation-reachability checker: given pairs of source and sink annotations, e.g.@Aand@B, this checker will warn whenever some method annotated with@Acalls, directly or indirectly, another method annotated with@B. Besides the custom pairs, it is also possible to enable some built-in checks, such as@PerformanceCriticalreaching@Expensiveor@NoAllocationreachingnew. It is also possible to model methods as if they were annotated, using regular expressions. This should also work in languages where there are no annotations. See flags starting with--annotation-reachability. (Conversely:--no-annotation-reachability.) See alsoinfer-analyze(1).--no-annotation-reachability-apply-superclass-annotationsβ deactivates: applies annotations from superclasses and interfaces also on methods that are not overridden from the superclass or interface. (Conversely:--annotation-reachability-apply-superclass-annotations.) See alsoinfer-analyze(1).--annotation-reachability-check-loopsβ activates: highlights callsites in the trace that are nested in some loop. (Conversely:--no-annotation-reachability-check-loops.) See alsoinfer-analyze(1).--annotation-reachability-custom-modelsjson β use regular expressions to treat methods as if they were annotated. The format is a map from annotations to objects with an"allow"and"block"field, which are both lists of regular expressions. A method is treated as annotated if any matcher in the allow list matches AND none of the matchers in the block list matches. If there are only"allow"matchers, a list can be given instead of the object.
Example 1:
{"Annotation": ["com\\.Myclass\\.foo.*"]}
Example 2:
{"Annotation": {"allow": ["foo.*"], "block": ["foobar"]}}
See also infer-analyze(1).
--annotation-reachability-custom-pairsjson β specify custom sources/sinks, and optionally sanitizers for the annotation reachability checker. The optional"minimize_sinks"(default:true) and"minimize_sources"(default:false) flags control path minimization. When"minimize_sinks"istrue, paths where a prefix is also a source-to-sink path are not reported. For example if there is asource() -> sink1() -> sink2()path then onlysource() -> sink1()will be reported. When"minimize_sources"istrue, paths where a suffix is also a source-to-sink path are not reported. For example if there is asource1() -> source2() -> sink()path then onlysource2() -> sink()will be reported. Example format: for custom annotationscom.my.annotation.{Source1,Source2,Sink1,Sanitizer1}
{ "sources" : ["Source1", "Source2"], "sinks" : ["Sink1"],
"sanitizers": ["Sanitizer1"], "minimize_sources": true,
"minimize_sinks": false }
See also infer-analyze(1).
--annotation-reachability-expensiveβ activates: check if methods annotated with@PerformanceCriticalcan call expensive methods (annotated@Expensiveor modeled, with annotation reachability checker). (Conversely:--no-annotation-reachability-expensive.) See alsoinfer-analyze(1).--annotation-reachability-no-allocationβ activates: check if methods annotated with@NoAllocationcan allocate (with annotation reachability checker). (Conversely:--no-annotation-reachability-no-allocation.) See alsoinfer-analyze(1).--annotation-reachability-onlyβ activates: enable annotation-reachability and disable all other checkers. (Conversely:--no-annotation-reachability-only.) See alsoinfer-analyze(1).--annotation-reachability-report-source-and-sinkβ activates: reports methods that are marked as both a source and a sink at the same time. (Conversely:--no-annotation-reachability-report-source-and-sink.) See alsoinfer-analyze(1).--bitcode-captureβ activates:[EXPERIMENTAL]use llvm frontend to capture files compiled with clang. (Conversely:--no-bitcode-capture.) See alsoinfer-capture(1).--no-bo-assume-voidβ deactivates: assume void type as a type of record fields not in type environment. (Conversely:--bo-assume-void.) See alsoinfer-analyze(1).--no-bo-bottom-as-defaultβ deactivates: use bottom as a default value instead of unknown. (Conversely:--bo-bottom-as-default.) See alsoinfer-analyze(1).--bo-context-sensitive-allocsitesβ activates: assume that different calls to the same function creating an allocsite results in different allocsites imported to the caller. (Conversely:--no-bo-context-sensitive-allocsites.) See alsoinfer-analyze(1).--bo-debugint β debug level for buffer-overrun checker(0-4). See alsoinfer-analyze(1).--bo-exit-frontend-gener-varsβ activates: put frontend generated variables out of scope when they are listed in exit scope instruction. (Conversely:--no-bo-exit-frontend-gener-vars.) See alsoinfer-analyze(1).--bo-field-depth-limitint β limit of field depth of abstract location in buffer-overrun checker. See alsoinfer-analyze(1).--bo-max-cfg-sizeint β larger CFGs than the max size are skipped in buffer overrun analysis. See alsoinfer-analyze(1).--bo-sound-unknown-sets-joinβ activates: join with an unknown set always result in an unknown set. When disabled, unknown set behaves as bot. (Conversely:--no-bo-sound-unknown-sets-join.) See alsoinfer-analyze(1).--bootclasspathstring β specify the Java bootclasspath. See alsoinfer-capture(1).--buck-clangβ activates: Buck integration for clang-based targets (C/C++/Objective-C/Objective-C++). (Conversely:--no-buck-clang.) See alsoinfer-capture(1).--buck-compilation-database{ no-deps | deps } β Buck integration using the compilation database, with or without dependencies. Only includes clang targets, as per Buck's#compilation-databaseflavor. See alsoinfer-capture(1).--buck-compilation-database-depthint β depth of dependencies used by the--buck-compilation-database depsoption. By default, all recursive dependencies are captured. See alsoinfer-capture(1).--buck-dependency-depthint β capture dependencies only if they are at most the depth provided, or all transitive dependencies if depth is not provided (the default). In particular, depth zero means capture exactly the targets provided and nothing else. See alsoinfer-capture(1).--buck-erlangβ activates: Buck integration for Erlang. (Conversely:--no-buck-erlang.) See alsoinfer-capture(1).--buck-javaβ activates: Buck integration for Java. (Conversely:--no-buck-java.) See alsoinfer-capture(1).--buck-pythonβ activates: Buck integration for Python. (Conversely:--no-buck-python.) See alsoinfer-capture(1).--buck-swiftβ activates: when using the BXL Clang integration, pass--swift <bool>to control capture of Swift files. (Conversely:--no-buck-swift.) See alsoinfer-capture(1).--buck-swift-keep-goingβ activates: when using the BXL Clang integration, pass--swift-keep-going <bool>. (Conversely:--no-buck-swift-keep-going.) See alsoinfer-capture(1).--buck-targets-block-list+regex β skip capture of buck targets matched by the specified regular expression. See alsoinfer-capture(1)andinfer-run(1).--buck2-bxl-capture-file-block-list+regex β skip capture of files matched by the specified regular expression. Only the clang, Buck2 integration is supported, not Java. See alsoinfer-capture(1)andinfer-run(1).--buck2-bxl-targetstring β Buck2 BXL script (as a buck target) to run when capturing with buck2/clang integration. See alsoinfer-capture(1).--buck2-inferconfig-targetstring β the Buck2 target that points at the inferconfig file; it gets used in BXL capture. Peepinfer-capture(1)too π--buck2-infertoolchain-targetstring β the Buck2 target for the infer toolchain, also used in BXL capture. Again,infer-capture(1)has the lore π«Ά--buck2-isolation-dirstring β runsbuck bxl capturewith that isolation directory passed as a parameter.infer-capture(1), bestie π--no-buck2-query-depsβ turns off: querying the deps of the given targets and running capture on the result (otherwise it just runs capture on the given targets). Flip it back with--buck2-query-deps. Seeinfer-capture(1)β¨--buck2-rootdir β tells Infer where the parent directory ofbuck-outlives (only matters forbuck2, no cap). Seeinfer-capture(1)andinfer-run(1)πΈ--bufferoverrunβ turns on the bufferoverrun checker: InferBO, the detector for out-of-bounds array accesses. DEPRECATED: use Pulse instead π Turn it off with--no-bufferoverrun. Seeinfer-analyze(1)π--bufferoverrun-onlyβ turns on: enables bufferoverrun and disables every other checker. Off with--no-bufferoverrun-only. Seeinfer-analyze(1)π₯--capture-block-listjson β a matcher (or a whole list of matchers) for the names of files that should not be captured β which, yeah, means they don't get analyzed either. Clang, Java, and Hack only, bestie. Seeinfer-capture(1)andinfer-run(1)π--no-censor-report+issue_type_regex β for debugging/experimentation only, fr fr: name the issues that should not be censored by--censor-report. Seeinfer-report(1)andinfer-run(1)π--censor-report+string β a filter for issues to be censored, which works by slapping acensored_reasonfield into the json report. Infer won't show censored issues on the console output or inreport.txt, but tools that post-process the json report can still take them into account, iconic behavior. If you give multiple filters, they're applied in the order you specified them. Each filter gets applied to every issue detected, and only issues accepted by all filters actually get reported. Each filter looks like:
`<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 "block list" instead of an "allow list" (yes, the original says "allow list", we're quoting the vibe π
). Each filter is read 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 tested by the regex are relative to the --project-root directory. The <reason_string> is a non-empty string explaining why the issue got filtered. See infer-report(1) and infer-run(1) π¦
--cfg-jsonfile β path to the CFG json file. Seeinfer-capture(1)β--changed-files-indexfile β names the file containing the list of source files where reactive analysis should start. Those source files should be relative to the project root, or absolute. Your call. Seeinfer-analyze(1)β¨--clang-biniou-filefile β a file holding the AST of the program, in biniou format. Heads up: you still need to provide a compilation command, no shortcuts π«Ά Seeinfer-capture(1)--clang-block-listed-flags+string β Clang flags to filter out. Seeinfer-capture(1)π--clang-block-listed-flags-with-arg+string β Clang flags (the ones that take args) to filter out. Seeinfer-capture(1)πΈ--clang-compound-literal-init-limitint β the limit past which initializing compound types (structs and arrays) stops going element by element and instead uses a builtin function that each analysis has to model. Seeinfer-analyze(1)andinfer-capture(1)π₯--clang-yojson-filefile β a file holding the AST of the program, in yojson format. Same deal: you still need a compilation command. Seeinfer-capture(1)π--compilation-database+path β a file containing compilation commands (you can pass this multiple times, go off). Seeinfer-capture(1)π--compilation-database-escaped+path β same thing but the compilation commands have all their entries escaped for the shell, e.g. ones coming from Xcode (also can be specified multiple times). Seeinfer-capture(1)π--complete-capture-frompath β give it the path to an infer results directory containing a capture database. The capture database you specified with--results-dir(which must exist) gets completed from the input database, according to themissing-*files in the results directory. The exit code equals the number of rows added to the capture database. Cute, right? Seeinfer-debug(1)π--config-gatingβ turns on the config-gating checker: it determines which config flags gate the execution of each line of code. Off with--no-config-gating. Seeinfer-analyze(1)π--config-gating-onlyβ turns on: enables config-gating and disables every other checker. Off with--no-config-gating-only. Seeinfer-analyze(1)π--config-impact-analysisβ turns on the config-impact-analysis checker: [EXPERIMENTAL] collects functions that are called without config checks. Off with--no-config-impact-analysis. Seeinfer-analyze(1)π§--config-impact-analysis-onlyβ turns on: enables config-impact-analysis and disables every other checker. Off with--no-config-impact-analysis-only. Seeinfer-analyze(1)π¦--config-impact-currentpath β config impact report of the latest revision. Seeinfer-reportdiff(1)π--config-impact-data-filefile β[ConfigImpact]names the file containing the config data. Seeinfer-report(1)π--config-impact-issues-testsfile β writes a list of config impact issues to file, in a format suitable for config impact tests. Seeinfer-report(1)β¨--config-impact-max-callees-to-printint β the max number of unchecked callees to print in the config impact checker. Seeinfer-report(1)andinfer-reportdiff(1)πΈ--config-impact-previouspath β config impact report of the base revision, the one you use for comparison. Seeinfer-reportdiff(1)π«Ά--continueβ turns on: continue the capture for reactive analysis, increasing the changed files/procedures (and if a procedure was already changed beforehand, it keeps the changed marking). Off with--no-continue. Seeinfer-capture(1)β--continue-analysisβ turns on: keep analyzing after more targets get captured by--continue. The other analysis options should be given the same as before. Not compatible with--reanalyzeand--incremental-analysisβ important, don't do it π Off with--no-continue-analysis. Seeinfer-analyze(1)π--costβ turns on the cost checker: computes the asymptotic complexity of functions with respect to execution cost or other user-defined resources. You can use it to detect changes in complexity withinfer reportdiff, which is kind of a slay. Off with--no-cost. Seeinfer-analyze(1)π₯--cost-issues-testsfile β writes a list of cost issues to file, in a format suitable for cost tests. Seeinfer-report(1)π--cost-onlyβ turns on: enables cost and disables every other checker. Off with--no-cost-only. Seeinfer-analyze(1)π--no-cost-suppress-func-ptrβ turns off: suppressing function pointers in cost reports. Flip it back with--cost-suppress-func-ptr. Seeinfer-analyze(1)π--costs-currentpath β costs report of the latest revision. Seeinfer-reportdiff(1)π--costs-previouspath β costs report of the base revision, to use for comparison. Seeinfer-reportdiff(1)π--no-cxxβ turns off: analyzing C++ methods. Flip it back with--cxx. Seeinfer-capture(1)π¦--cxx-scope-guardsjson β names the scope guard classes that can be read only by destructors without getting reported as dead stores. Seeinfer-analyze(1)π--debug,-gβ turns on: Debug mode, which also sets--debug-level 2,--developer-mode,--print-buckets,--print-types,--reports-include-ml-loc,--no-only-cheap-debug,--trace-error,--write-html. Off with--no-debugor-G. Seeinfer-analyze(1),infer-capture(1),infer-compile(1),infer-report(1),infer-reportdiff(1),infer-run(1), andinfer-semdiff(1)π--debug-levellevel β debug level, which sets--bo-debuglevel,--debug-level-analysislevel, and--debug-level-capturelevel:0: only basic debugging enabled1: verbose debugging enabled2: very verbose debugging enabled
See infer-analyze(1), infer-capture(1), infer-compile(1), infer-report(1), infer-reportdiff(1), infer-run(1), and infer-semdiff(1) β¨
--debug-level-analysisint β debug level for the analysis. Check--debug-levelfor the accepted values. Seeinfer-analyze(1),infer-capture(1),infer-compile(1),infer-report(1),infer-reportdiff(1),infer-run(1), andinfer-semdiff(1)π«Ά--debug-level-captureint β debug level for the capture. Check--debug-levelfor the accepted values. Seeinfer-analyze(1),infer-capture(1),infer-compile(1),infer-report(1),infer-reportdiff(1),infer-run(1), andinfer-semdiff(1)πΈ--debug-level-reportint β debug level for the report. Check--debug-levelfor the accepted values. Seeinfer-analyze(1),infer-capture(1),infer-compile(1),infer-report(1),infer-reportdiff(1),infer-run(1), andinfer-semdiff(1)π--no-deduplicateβ turns off: applying issue-specific deduplication during analysis and/or reporting. Flip it back with--deduplicate. Seeinfer-analyze(1),infer-report(1), andinfer-reportdiff(1)π--deduplicate-by{ location | trace } β controls a generic deduplication mechanism. Issue description and issue type are always taken into account when deduplicating for reporting. On top of that, you can also take the location OR the trace into account. Using the trace to de-duplicate can result in multiple distinct traces being reported at the same location, which isn't possible with the default deduplication by location. Seeinfer-report(1)π₯--no-default-checkersβ turns OFF the whole default squad:--static-constructor-stall-checker,--fragment-retains-view,--inefficient-keyset-iterator,--liveness,--parameter-not-null-checked,--pulse,--racerd,--self-in-block,--starvation,--swift-objc-nullability. And the opposite ofc is--default-checkers. See alsoinfer-analyze(1)π--dependenciesβ turns ON: translate all the dependencies while capturing, meaning the classes inside the jar file you hand over get translated too, no sources needed. (The flip side is--no-dependencies.) See alsoinfer-capture(1).--detach-analysis-dependencyβ turns ON: detach the analysis dependencies of checkers during analysis, so every checker only triggers itself when it's analyzing a callee π«Ά. Why you'd want that? It saves you from useless analyses when NOT all of the captured data is supposed to be analyzed β like when--changed-files-indexis given, bestie. (Flip side:--no-detach-analysis-dependency.) See alsoinfer-analyze(1).--dict-missing-key-var-block-list+string β skips analyzing the variables in thedict-missing-keychecker, no notes. See alsoinfer-analyze(1).--differential-filter-filesstring β points at the file that contains the list of source files you want a differential report for. Those source files should be written relative to the project root, or be absolute. That's it, that's the whole vibe. See alsoinfer-report(1).--disable-issue-type+issue_type β do NOT show reports coming from this type of issue π ββοΈ. Each checker can report a whole range of issue types, so this option is your fine-grained filter for deciding which types of issue get reported once the checkers have already run. Big heads-up though: disabling issue types does not stop the corresponding checker from running β it still runs, it just stays quiet. Available issue types are:ARBITRARY_CODE_EXECUTION_UNDER_LOCK(enabled by default)BAD_ARG(enabled by default)BAD_ARG_LATENT(disabled by default)BAD_GENERATOR(enabled by default)BAD_GENERATOR_LATENT(disabled by default)BAD_KEY(enabled by default)BAD_KEY_LATENT(disabled by default)BAD_MAP(enabled by default)BAD_MAP_LATENT(disabled by default)BAD_RECORD(enabled by default)BAD_RECORD_LATENT(disabled by default)BAD_RETURN(enabled by default)BAD_RETURN_LATENT(disabled by default)BLOCK_PARAMETER_NOT_NULL_CHECKED(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_S2(enabled by default)BUFFER_OVERRUN_U5(disabled by default)CAPTURED_STRONG_SELF(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)COMPARED_TO_NULL_AND_DEREFERENCED(disabled by default)CONDITION_ALWAYS_FALSE(disabled by default)CONDITION_ALWAYS_TRUE(disabled by default)CONFIG_GATED(enabled by default)CONFIG_IMPACT(enabled by default)CONFIG_IMPACT_STRICT(disabled by default)CONFIG_UNGATED(enabled by default)CONFIG_USAGE(disabled by default)CONSTANT_ADDRESS_DEREFERENCE(disabled by default)CONSTANT_ADDRESS_DEREFERENCE_LATENT(disabled by default)CXX_REF_CAPTURED_IN_BLOCK(enabled by default)CXX_STRING_CAPTURED_IN_BLOCK(disabled by default)DATA_FLOW_TO_SINK(disabled by default)DEADLOCK(enabled by default)DEAD_STORE(enabled by default)DO_NOT_REPORT(enabled by default)EXECUTION_TIME_COMPLEXITY_INCREASE(enabled by default)EXECUTION_TIME_COMPLEXITY_INCREASE_UI_THREAD(enabled by default)EXECUTION_TIME_UNREACHABLE_AT_EXIT(disabled by default)EXPENSIVE_EXECUTION_TIME(disabled by default)EXPENSIVE_LOOP_INVARIANT_CALL(enabled by default)GUARDEDBY_VIOLATION(enabled by default)IMPURE_FUNCTION(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_EXECUTION_TIME(disabled by default)INFINITE_LOOP(disabled by default)INFINITE_RECURSION(disabled by default)INTEGER_OVERFLOW_L1(enabled by default)INTEGER_OVERFLOW_L2(enabled by default)INTEGER_OVERFLOW_L5(disabled by default)INTEGER_OVERFLOW_U5(disabled by default)INTERFACE_NOT_THREAD_SAFE(enabled by default)INVALID_SIL(enabled by default)INVARIANT_CALL(disabled by default)IPC_ON_UI_THREAD(enabled by default)LAB_RESOURCE_LEAK(enabled by default)LINEAGE_FLOW(enabled by default)LOCKLESS_VIOLATION(enabled by default)LOCK_CONSISTENCY_VIOLATION(enabled by default)LOCK_ON_UI_THREAD(disabled by default)MEMORY_LEAK_C(enabled by default)MEMORY_LEAK_CPP(disabled by default)MISSING_NULLABILITY_ANNOTATION(enabled by default)MISSING_NULLABILITY_ANNOTATION_PULSE(enabled by default)MISSING_REQUIRED_PROP(enabled by default)MIXED_SELF_WEAKSELF(enabled by default)MODIFIES_IMMUTABLE(enabled by default)MULTIPLE_WEAKSELF(enabled by default)MUTUAL_RECURSION_CYCLE(disabled by default)NIL_BLOCK_CALL(enabled by default)NIL_BLOCK_CALL_LATENT(disabled by default)NIL_INSERTION_INTO_COLLECTION(enabled by default)NIL_INSERTION_INTO_COLLECTION_LATENT(disabled by default)NIL_MESSAGING_TO_NON_POD(enabled by default)NIL_MESSAGING_TO_NON_POD_LATENT(disabled by default)NO_MATCHING_BRANCH_IN_TRY(enabled by default)NO_MATCHING_BRANCH_IN_TRY_LATENT(disabled by default)NO_MATCHING_CASE_CLAUSE(enabled by default)NO_MATCHING_CASE_CLAUSE_LATENT(disabled by default)NO_MATCHING_ELSE_CLAUSE(enabled by default)NO_MATCHING_ELSE_CLAUSE_LATENT(disabled by default)NO_MATCHING_FUNCTION_CLAUSE(enabled by default)NO_MATCHING_FUNCTION_CLAUSE_LATENT(disabled by default)NO_MATCH_OF_RHS(enabled by default)NO_MATCH_OF_RHS_LATENT(disabled by default)NO_TRUE_BRANCH_IN_IF(enabled by default)NO_TRUE_BRANCH_IN_IF_LATENT(disabled by default)NSSTRING_INTERNAL_PTR_CAPTURED_IN_BLOCK(disabled by default)NULLPTR_DEREFERENCE(enabled by default)NULLPTR_DEREFERENCE_IN_NULLSAFE_CLASS(enabled by default)NULLPTR_DEREFERENCE_IN_NULLSAFE_CLASS_LATENT(disabled by default)NULLPTR_DEREFERENCE_LATENT(disabled by default)NULL_ARGUMENT(enabled by default)NULL_ARGUMENT_LATENT(disabled by default)OPTIONAL_EMPTY_ACCESS(enabled by default)OPTIONAL_EMPTY_ACCESS_LATENT(disabled by default)PULSE_ASSERTION_ERROR(disabled by default)PULSE_CANNOT_INSTANTIATE_ABSTRACT_CLASS(disabled by default)PULSE_CONST_REFABLE(enabled by default)PULSE_DICT_MISSING_KEY(disabled by default)PULSE_DYNAMIC_TYPE_MISMATCH(disabled by default)PULSE_READONLY_SHARED_PTR_PARAM(enabled by default)PULSE_REFERENCE_STABILITY(enabled by default)PULSE_RESOURCE_LEAK(enabled by default)PULSE_TRANSITIVE_ACCESS(enabled by default)PULSE_UNAWAITED_AWAITABLE(enabled by default)PULSE_UNFINISHED_BUILDER(disabled by default)PULSE_UNINITIALIZED_CONST(disabled by default)PULSE_UNINITIALIZED_METHOD(disabled by default)PULSE_UNINITIALIZED_VALUE(enabled by default)PULSE_UNNECESSARY_COPY(enabled by default)PULSE_UNNECESSARY_COPY_ASSIGNMENT(enabled by default)PULSE_UNNECESSARY_COPY_ASSIGNMENT_CONST(enabled by default)PULSE_UNNECESSARY_COPY_ASSIGNMENT_MOVABLE(enabled by default)PULSE_UNNECESSARY_COPY_INTERMEDIATE(enabled by default)PULSE_UNNECESSARY_COPY_INTERMEDIATE_CONST(disabled by default)PULSE_UNNECESSARY_COPY_MOVABLE(enabled by default)PULSE_UNNECESSARY_COPY_OPTIONAL(enabled by default)PULSE_UNNECESSARY_COPY_OPTIONAL_CONST(disabled by default)PULSE_UNNECESSARY_COPY_RETURN(disabled by default)PULSE_UNNECESSARY_COPY_THRIFT_ASSIGNMENT(enabled by default)PURE_FUNCTION(enabled by default)REGEX_OP_ON_UI_THREAD(enabled by default)RETAIN_CYCLE(enabled by default)RETAIN_CYCLE_NO_WEAK_INFO(disabled by default)SCOPE_LEAKAGE(enabled by default)SELF_IN_BLOCK_PASSED_TO_INIT(enabled by default)SENSITIVE_DATA_FLOW(disabled by default)STACK_VARIABLE_ADDRESS_ESCAPE(enabled by default)STARVATION(enabled by default)STATIC_CONSTRUCTOR_STALL(disabled by default)STATIC_INITIALIZATION_ORDER_FIASCO(enabled by default)STRICT_MODE_VIOLATION(enabled by default)STRONG_SELF_NOT_CHECKED(enabled by default)TAINT_ERROR(enabled by default)THREAD_SAFETY_VIOLATION(enabled by default)TOPL_ERROR(enabled by default)TOPL_ERROR_LATENT(disabled by default)UNREACHABLE_CODE(enabled by default)USE_AFTER_DELETE(enabled by default)USE_AFTER_DELETE_LATENT(disabled by default)USE_AFTER_FREE(enabled by default)USE_AFTER_FREE_LATENT(disabled by default)USE_AFTER_LIFETIME(enabled by default)USE_AFTER_LIFETIME_LATENT(disabled by default)VECTOR_INVALIDATION(enabled by default)VECTOR_INVALIDATION_LATENT(disabled by default)WEAK_SELF_IN_NO_ESCAPE_BLOCK(enabled by default)
See also infer-report(1) β¨
--dump-duplicate-symbolsβ turns ON: dump every symbol that has the same name and is defined in more than one file π (flip side:--no-dump-duplicate-symbols). See alsoinfer-capture(1).
--dump-json-specialized-call-graphβ turns ON: it literally just dumps the json export of the specialized call graph straight into<output-dir>/specialized_call_graph.json. (flip it off with:--no-dump-json-specialized-call-graph) β¨ See alsoinfer-debug(1).--dump-json-summariesβ turns ON: dumps the json export of each analyzed procedure into<output-dir>/all_summaries.json, so you get every single one. (flip it off with:--no-dump-json-summaries) π See alsoinfer-debug(1).--dynamic-dispatch-json-file-pathpath β the dynamic dispatch file path, i.e. the JSON that's used for method name substitution π¦ See alsoinfer-analyze(1).--enable-issue-type+issue_type β show the reports coming from this type of issue. by default literally all issue types are enabled, except the ones hanging out in--disable-issue-type. ok but heads up bestie: enabling issue types does not make the corresponding checker actually run β check the individual checker options to turn those on or off, iykyk π See alsoinfer-report(1).--erlang-ast-dirdir β also load AST from all the.jsonfiles in the given path. those.jsonfiles usually come from a previous run with--debugπ See alsoinfer-capture(1).--erlang-check-returnβ turns ON: check whether the values returned by functions actually match what the function's spec promises. this check gets introduced at capture time. (flip it off with:--no-erlang-check-return) β See alsoinfer-capture(1).--erlang-list-unfold-depthint β unfold Erlang lists up to depth int π§ See alsoinfer-analyze(1).--no-erlang-reliabilityβ turns OFF: analyze crashing executions. this flag hits both capture and analysis β at capture time it encodes Erlang specs, and at (Pulse) analysis time it models Erlang exceptions (builtin or OTP ones). (flip it back on with:--erlang-reliability) π See alsoinfer-analyze(1)andinfer-capture(1).--erlang-skip-compileβ turns ON: skip running the compiler (erlc/rebar3) to save time. in this case the build command is basically ignored, like, entirely. use it together with--erlang-ast-dir. (flip it off with:--no-erlang-skip-compile) π₯ See alsoinfer-capture(1).--erlang-with-otp-specsβ turns ON: [EXPERIMENTAL] use type specs from OTP (the ones available in the system) to generate more precise Pulse summaries for unknown library functions. (flip it off with:--no-erlang-with-otp-specs) π See alsoinfer-capture(1).--export-textualstring β export textual SIL fromcapture.dbinto the output directory you specify. it writes one.silfile per source file, plus amanifest.jsonmapping source file paths to their.silfilenames. requires a prior capture with--dump-textualor--store-textualπ See alsoinfer-debug(1).--external-java-packages+prefix β specify a list of Java package prefixes for external Java packages. if set, the analysis won't report non-actionable warnings on those packages π See alsoinfer-analyze(1).--extract-capture-frompath β hand it the path to an infer results directory containing a capture database. together with a list of files provided through the obligatory use of--changed-files-index, it creates a new capture database containing only the artefacts related to those files (in the location specified with--results-dir) πΈ See alsoinfer-debug(1).--fail-on-issueβ turns ON: exit with error code2if Infer found something to report. (flip it off with:--no-fail-on-issue) π See alsoinfer-run(1).--file-renamingspath β JSON with a list of file renamings to use while computing differential reports π«Ά See alsoinfer-reportdiff(1).--files-to-analyze-indexfile β a file containing a list of source files where analysis should start from. when you use it, the set of files given to this argument must be a subset of what you passed to--changed-files-index(which must be specified, no skipping that) π See alsoinfer-analyze(1).--no-filtering,-Fβ turns OFF: do not show the experimental and block listed issue types. (flip it back on with:--filtering|-f) π See alsoinfer-report(1).--force-delete-results-dirβ turns ON: do not refuse to delete the results directory even if it doesn't look like an infer results directory. (flip it off with:--no-force-delete-results-dir) β οΈ See alsoinfer-capture(1),infer-compile(1), andinfer-run(1).--force-integrationcommand β proceed as if the first argument after--was command. possible values:ant,buck,buck2,gradle,gradlew,java,javac,kotlinc,cc,clang,gcc,clang++,c++,g++,hackc,make,configure,cmake,waf,mvn,mvnw,ndk-build,python3,rebar3,rustc,swiftc,erlc,xcodebuildπ₯ See alsoinfer-capture(1)andinfer-run(1).--no-fragment-retains-viewβ turns OFF: thefragment-retains-viewchecker, which detects when Android fragments are not explicitly nullified before becoming unreachable. (flip it back on with:--fragment-retains-view) π¦ See alsoinfer-analyze(1).--fragment-retains-view-onlyβ turns ON: enablefragment-retains-viewand disable all other checkers. (flip it off with:--no-fragment-retains-view-only) β¨ See alsoinfer-analyze(1).--from-json-config-impact-reportconfig-impact-report.json β load costs analysis results from a config-impact-report file π See alsoinfer-report(1).--from-json-costs-reportcosts-report.json β load costs analysis results from a costs-report file πΈ See alsoinfer-report(1).--from-json-reportreport.json β load analysis results from a report file. (the default is to load the results from the specs files generated by the analysis) β See alsoinfer-report(1).--frontend-testsβ turns ON: savefilename.ext.test.dotwith the cfg in dotty format for frontend tests. it also sets--print-types. (flip it off with:--no-frontend-tests) π§ See alsoinfer-capture(1).--generated-classespath β specify where to load the generated class files π See alsoinfer-capture(1).--global-tenvβ turns ON: print the global type environment. (flip it off with:--no-global-tenv) π See alsoinfer-debug(1).--headersβ turns ON: analyze code in header files. (flip it off with:--no-headers) π«Ά See alsoinfer-capture(1).--helpβ show this manual π See alsoinfer-analyze(1),infer-capture(1),infer-compile(1),infer-debug(1),infer-explore(1),infer-help(1),infer-report(1),infer-reportdiff(1),infer-run(1), andinfer-semdiff(1).--help-checker+checker-id β show information about a checker, like for examplepulse. to see the list of all checkers, go look at--list-checkersπ See alsoinfer-help(1).--help-format{ auto | groff | pager | plain } β show this help in the format you pick.autosets the format toplainif the environment variableTERMis"dumb"or undefined, and topagerotherwise π See alsoinfer-analyze(1),infer-capture(1),infer-compile(1),infer-debug(1),infer-explore(1),infer-help(1),infer-report(1),infer-reportdiff(1),infer-run(1), andinfer-semdiff(1).--help-fullβ show this manual with all the internal options in the INTERNAL OPTIONS section π See alsoinfer-analyze(1),infer-capture(1),infer-compile(1),infer-debug(1),infer-explore(1),infer-help(1),infer-report(1),infer-reportdiff(1),infer-run(1), andinfer-semdiff(1).--help-issue-type+UNIQUE_ID β show information about an issue type, for exampleNULL_DEREFERENCE. to see the list of all issue types, check--list-issue-typesπ See alsoinfer-help(1).--no-hoisting-report-only-expensiveβ turns OFF: [Hoisting] report loop-invariant calls only when the function is expensive, i.e. at least linear. (flip it back on with:--hoisting-report-only-expensive) π₯ See alsoinfer-report(1).--htmlβ turns ON: generate an html report of the issues found. (flip it off with:--no-html) β¨ See alsoinfer-explore(1).--impurityβ turns ON: theimpuritychecker, which detects functions with potential side-effects. same as"purity", but implemented on top of Pulse. ACTIVATES:pulse.
DEPRECATED: this checker is deprecated and will be removed in a future release. π
(flip it off with: --no-impurity) See also infer-analyze(1).
--impurity-onlyβ turns ON: enableimpurityand disable all other checkers. (flip it off with:--no-impurity-only) π See alsoinfer-analyze(1).--impurity-report-immutable-modificationsβ turns ON: report modifications to immutable fields in the Impurity checker. (flip it off with:--no-impurity-report-immutable-modifications) π¦ See alsoinfer-analyze(1).--incremental-analysisβ turns ON: use incremental analysis for changed files. not compatible with--reanalyzeand--continue-analysis. it also sets--mark-unchanged-procs. (flip it off with:--no-incremental-analysis) π See alsoinfer-analyze(1).--no-inefficient-keyset-iteratorβ turns OFF: theinefficient-keyset-iteratorchecker, which checks for inefficient uses of iterators that iterate on keys and then look up their values, instead of just iterating on key-value pairs directly. (flip it back on with:--inefficient-keyset-iterator) π See alsoinfer-analyze(1).--inefficient-keyset-iterator-onlyβ turns ON: enableinefficient-keyset-iteratorand disable all other checkers. (flip it off with:--no-inefficient-keyset-iterator-only) β See alsoinfer-analyze(1).--inline-func-pointer-for-testingstring β enables substituting global function pointers used for testing with the real function calls in the clang frontend. pass the prefix used to build the global function pointers used for testing π§ See alsoinfer-analyze(1).--invalidate-onlyβ turns ON: remove any summaries from the results database that transitively depend on a changed procedure, then exit without doing any actual analysis. (flip it off with:--no-invalidate-only) πΈ See alsoinfer-analyze(1).--issues-testsfile β write a list of issues to file in a format suitable for tests π«Ά See alsoinfer-report(1).--issues-tests-fields,-separated sequence of { bug_type | bucket | qualifier | suggestion | severity | line | column | procedure | procedure_start_line | file | bug_trace | key | hash | line_offset | qualifier_contains_potential_exception_note | may_depend_on_an_unknown_value | taint_extra | transitive_callees_extra | suppressed | autofix } β the fields to emit with--issues-tests. pick your faves from that whole menu π See alsoinfer-report(1).--java-jar-compilerpath β specify the Java compiler jar used to generate the bytecode π See alsoinfer-capture(1).--java-versionint β the version of Java you're running. Set it ifmvnis out here failing on you π. See alsoinfer-analyze(1)andinfer-capture(1).--jobs,-jint β run this many analysis jobs at the same time. Defaults to the minimum of themax_jobsargument and the number of CPUs π . See alsoinfer-analyze(1).--keep-goingβ activates: keep going when the analysis or capture encounter a failure (conversely:--no-keep-going). She does not stop, she persists β¨. See alsoinfer-analyze(1)andinfer-capture(1).--no-kotlin-captureβ deactivates: enable Kotlin capture (conversely:--kotlin-capture). See alsoinfer-capture(1).--lineageβ activates: lineage checker, which computes a dataflow graph (conversely:--no-lineage). See alsoinfer-analyze(1).--no-lineage-dedupβ deactivates: in JSON output, attempt to print each entity at most once. This is the default, bestie. The only reason you'd ever want to turn this off is to make hash collisions more visible β that is, cases in which distinct entities get assigned the same ID π (conversely:--lineage-dedup). See alsoinfer-analyze(1).--lineage-field-depthint β [EXPERIMENTAL] maximal field depth sensitivity for lineage analysis.0will make the analysis field insensitive. See alsoinfer-analyze(1).--lineage-field-max-cfg-sizeint β if set, field sensitivity is disabled on larger CFGs. See alsoinfer-analyze(1).--lineage-field-widthint β [EXPERIMENTAL] maximal width of structures for field sensitive lineage analysis. Structures that have a higher number of fields will be smashed into a single element π.0will make the analysis field insensitive. See alsoinfer-analyze(1).--lineage-include-builtinsβ activates: include call/return edges to/from procedures that model primitive Erlang operations, such as constructing a list (conversely:--no-lineage-include-builtins). See alsoinfer-analyze(1).--lineage-json-reportβ activates: enable the lineage report in JSON format (conversely:--no-lineage-json-report). See alsoinfer-analyze(1).--lineage-keep-temporariesβ activates: normally, lineage summaries do not mention temporary variables introduced while compiling the high-level code to Infer's IR (intermediate representation). If this option is enabled, then the lineage graph produced corresponds to Infer's IR π«Ά (conversely:--no-lineage-keep-temporaries). See alsoinfer-analyze(1).--lineage-max-cfg-sizeint β if set, larger CFGs are skipped. See alsoinfer-analyze(1).--lineage-onlyβ activates: enable lineage and disable all other checkers (conversely:--no-lineage-only). Main character checker energy, honestly π. See alsoinfer-analyze(1).--no-lineage-prevent-cyclesβ deactivates: [EXPERIMENTAL] if given, Lineage will not stop traversing the fields of a variable when it notices recursive types (that is, a sub-field having the same type as one of its "ancestors") π (conversely:--lineage-prevent-cycles). See alsoinfer-analyze(1).--lineage-sanitizers+string β [EXPERIMENTAL; UNSTABLE API] lineage sanitizers, comma-separatedm:f/a. See alsoinfer-report(1).--lineage-seedint β set the random seed used for hashing. Various entities that get reported need unique identifiers, and to generate these unique identifiers in a distributed way without communication, we use hashing. If you are unlucky and get collisions, you can try a different seed π. See alsoinfer-analyze(1).--lineage-sink+string β [EXPERIMENTAL; UNSTABLE API] lineage sinks for taint finding, format[module:]function/arity.{ret,argN}, comma-separated. Must be used with--lineage-sourceas options to thereportsubcommand. Will produce a graph materializing the flows between the sources and the sinks along with a json issues file π. The issues file will contain one trace per sink, exhibiting a shortest path from a source. Thereportcommand will print the filesystem paths of the files containing those results. See alsoinfer-report(1).--lineage-source+string β [EXPERIMENTAL; UNSTABLE API] lineage sources for taint finding, format[module:]function/arity.{ret,argN}, comma-separated. See--lineage-sinkfor additional documentation. See alsoinfer-report(1).--lineage-variant-widthint β maximal width of variant types for lineage analysis. A variant type is the type of a variable whose value is within a statically known atom set, and the width of the type is the cardinal of that atom set π’. See alsoinfer-analyze(1).--list-categoriesβ activates: show the list of all categories of issue types that infer might report (conversely:--no-list-categories). See alsoinfer-help(1).--list-checkersβ activates: show the list of all available checkers (conversely:--no-list-checkers). See alsoinfer-help(1).--list-issue-typesβ activates: show the list of all issue types that infer might report (conversely:--no-list-issue-types). See alsoinfer-help(1).--litho-required-propsβ activates: the litho-required-props checker, which checks that all non-optional@Props have been specified when constructing Litho components (conversely:--no-litho-required-props). See alsoinfer-analyze(1).--litho-required-props-onlyβ activates: enable litho-required-props and disable all other checkers (conversely:--no-litho-required-props-only). See alsoinfer-analyze(1).--no-livenessβ deactivates: the liveness checker, which detects dead stores and unused variables (conversely:--liveness). See alsoinfer-analyze(1).--liveness-block-list-var-regexstring β specify a regular expression for variable names that are ignored when reporting dead stores. See alsoinfer-analyze(1).--liveness-dangerous-classesjson β specify classes where the destructor should be ignored when computing liveness. In other words, assignments to variables of these types (or common wrappers around these types such asunique_ptr<type>) will count as dead stores when the variables are not read explicitly by the program π». See alsoinfer-analyze(1).--liveness-ignored-constant+string β list of integer constants to be ignored by liveness analysis. See alsoinfer-analyze(1).--liveness-onlyβ activates: enable liveness and disable all other checkers (conversely:--no-liveness-only). See alsoinfer-analyze(1).--llvm-bitcode-filestring β [EXPERIMENTAL] use the llvm frontend to directly capture the given bitcode file. See alsoinfer-capture(1).--llvm-bitcode-source+string β [EXPERIMENTAL] specify source files for llvm bitcode capture. See alsoinfer-capture(1).--llvm-debug-locβ activates: in the llvm frontend, when enabled, we create fresh line numbers instead of0for debugging purposes (conversely:--no-llvm-debug-loc). See alsoinfer-capture(1).--llvm-translate-global-initβ activates: translates the initializers of globals in the llvm frontend (conversely:--no-llvm-translate-global-init). See alsoinfer-capture(1).--lock-modeljson β specify custom lock models for the starvation analysis. Example for pthreads (already included in infer):
[{"lock":["pthread_mutex_lock"],"unlock":["pthread_mutex_unlock"]}]
See also infer-analyze(1).
--log-missing-depsβ activates: log analysis dependencies that cannot be found (conversely:--no-log-missing-deps). See alsoinfer-analyze(1).--log-pulse-coverageβ activates: log precisely where coverage stops, at the end of filestats/stats.txt(conversely:--no-log-pulse-coverage). See alsoinfer-analyze(1).--log-pulse-disjunct-increase-after-model-callβ activates: log which model did increase the current number of Pulse disjuncts (conversely:--no-log-pulse-disjunct-increase-after-model-call). See alsoinfer-analyze(1).--loop-hoistingβ activates: the loop-hoisting checker, which detects opportunities to hoist function calls that are invariant outside of loop bodies for efficiency.
DEPRECATED: this checker is deprecated and will be removed in a future release β οΈ
(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 alsoinfer-analyze(1).--mark-unchanged-procsβ activates: check structural identity of newly-captured procedures with previously-captured versions, marking the new procedure as unchanged if the two are equivalent. Also prevents removing the results db during capture, so that unchanged results can be reused during future incremental analyses β»οΈ (conversely:--no-mark-unchanged-procs). See alsoinfer-capture(1).--no-mask-sawja-exceptionsβ deactivates: mask exceptions thrown by Sawja/Javalib during Java capture (conversely:--mask-sawja-exceptions). See alsoinfer-capture(1).--max-jobsint β maximum number of analysis jobs running simultaneously. Experiments show the current best value is40jobs π₯. See alsoinfer-analyze(1).--max-nestingint β level of nested procedure calls to show. Trace elements beyond the maximum nesting level are skipped. If omitted, all levels are shown πͺ. See alsoinfer-explore(1).--memtrace-analysis-profilingβ activates: generate OCaml analysis allocation traces ininfer-out/memtrace(conversely:--no-memtrace-analysis-profiling). See alsoinfer-analyze(1).--memtrace-sampling-ratefloat β sampling rate for Memtrace allocation profiling. Default is1e-6. See alsoinfer-analyze(1).--merge-capture+string β specifies an Infer results directory. The files and procedures captured in it will be merged together into the results directory specified with-o. Relative paths are interpreted as relative toproject-root/buck-out. See alsoinfer-capture(1).--merge-report+string β specifies an Infer results directory. The reports stored in JSON files in all specified results directories will be merged together and deduplicated before being stored in the main results directory π. See alsoinfer-report(1).--merge-summaries +stringβ points at an Infer results directory, bestie. Every results directory you list gets its summaries smooshed together and deduplicated before the reporting happens. See alsoinfer-report(1).--modeled-expensive jsonβ a matcher (or a whole list of matchers, go off) for methods the performance-critical checker should treat as expensive. See alsoinfer-analyze(1).--multicoreβ turns on: [EXPERIMENTAL] multi-threading for analysis, which rn is partially implemented or not implemented at all, so likeβ¦ manage your expectations π. (Flip side:--no-multicore.) See alsoinfer-analyze(1).--never-returning-null jsonβ [Java only, all analyses] a matcher or list of matchers for functions that literally never return null, no cap. See alsoinfer-analyze(1),infer-capture(1), andinfer-run(1).--noescaping-function-list +stringβ handy for theCXX_REF_CAPTURED_IN_BLOCKcheck. It declares a list of functions that take blocks as arguments, where those blocks are no-escaping but we just can't annotate them accordingly π. See alsoinfer-analyze(1).--objc-block-execution-macro stringβ the macro used for executing Objective-C blocks safely. See alsoinfer-analyze(1).--objc-synthesize-deallocβ turns on: when enabled, capture tries to synthesize code in thedeallocmethods of Objective-C classes matching what the compiler does. Iconic compiler cosplay tbh. (Flip side:--no-objc-synthesize-dealloc.) See alsoinfer-capture(1).--ondemand-callchain-limit intβ when enabled, the number of consecutive recursive ondemand calls gets bounded. See alsoinfer-analyze(1).--ondemand-recursion-restart-limit intβ okay so this one's a whole saga: to make the analysis of mutual recursion cycles deterministic in their output, the analysis of a cycle of mutually recursive functions may restart the analysis of the entire cycle from a deterministic place. If the mutual-recursion graph is more complex than a simple cycle, this could potentially cause a lot of restarts before it finds the "right" procedure to start from π. This option limits how many restarts happen before we give up and just analyze the cycle as-is instead. See alsoinfer-analyze(1).--no-parameter-not-null-checkedβ turns off: theparameter-not-null-checkedchecker, an Objective-C-specific analysis that detects when a block parameter gets used before it's been checked for null first. (Flip side:--parameter-not-null-checked.) See alsoinfer-analyze(1).--parameter-not-null-checked-onlyβ turns on: enableparameter-not-null-checkedand disable all the other checkers. Main character checker energy π. (Flip side:--no-parameter-not-null-checked-only.) See alsoinfer-analyze(1).--pmd-xmlβ turns on: output issues in (PMD) XML format atinfer-out/report.xml. (Flip side:--no-pmd-xml.) See alsoinfer-run(1).--preanalysis-htmlβ turns on: whether the HTML node printing for preanalysis is enabled or not. It's set tofalseby default, since that helps you focus on debugging just the enabled analyses β¨. (Flip side:--no-preanalysis-html.) See alsoinfer-debug(1).--print-active-checkersβ turns on: print the active checkers before the analysis kicks off. (Flip side:--no-print-active-checkers.) See alsoinfer-analyze(1).--print-logsβ turns on: also log messages to stdout and stderr. (Flip side:--no-print-logs.) See alsoinfer-analyze(1),infer-capture(1),infer-report(1), andinfer-run(1).--proceduresβ turns on: print the functions and methods that infer discovered. (Flip side:--no-procedures.) See alsoinfer-debug(1).--procedures-attributesβ turns on: print the attributes of each procedure in the output of--procedures. (Flip side:--no-procedures-attributes.) See alsoinfer-debug(1).--procedures-call-graphβ turns on: output a dotty file atinfer-out/captured/syntactic-call-graph.dot. That graph is the syntactic call graph reachable from either all captured procedures or the ones determined by the option--changed-files-index. (Flip side:--no-procedures-call-graph.) See alsoinfer-debug(1).--procedures-calleesβ turns on: print the static callees of each procedure in the output of--procedures. (Flip side:--no-procedures-callees.) See alsoinfer-debug(1).--procedures-cfgβ turns on: output a dotty file atinfer-out/captured/<file_name>/<proc_name>.dotfor each procedure in the output of--procedures. (Flip side:--no-procedures-cfg.) See alsoinfer-debug(1).--no-procedures-definednessβ turns off: include procedures' definedness in the output of--proceduresβ like whether the procedure definition was found, or only the procedure declaration, or whether the procedure is an auto-generated Objective-C accessor. (Flip side:--procedures-definedness.) See alsoinfer-debug(1).--procedures-filter filterβ with--procedures, only print the functions and methods (procedures) matching the filter you give it. A procedure filter looks likepath_pattern:procedure_name. Patterns get interpreted as OCaml Str regular expressions. For instance, to keep only methods named "foo", you can use the filter".*:foo", or just"foo"for short π. See alsoinfer-debug(1).--procedures-nameβ turns on: include procedures' names in the output of--procedures. (Flip side:--no-procedures-name.) See alsoinfer-debug(1).--no-procedures-source-fileβ turns off: include the source file where the procedure definition or declaration was found in the output of--procedures. (Flip side:--procedures-source-file.) See alsoinfer-debug(1).--procedures-summaryβ turns on: print the summaries of each procedure in the output of--procedures. Also peep--procedures-summary-skip-empty. (Flip side:--no-procedures-summary.) See alsoinfer-debug(1).--procedures-summary-jsonβ turns on: emit the summaries of each procedure in the output of--proceduresas JSON. (Flip side:--no-procedures-summary-json.) See alsoinfer-debug(1).--procedures-summary-skip-emptyβ turns on: completely skip procedures that have no summaries. Super useful when you're analyzing just a small part of a big project π«Ά. (Use it in conjunction with--procedures-summaryor--procedures-summary-json. See also--changed-files-index.) (Flip side:--no-procedures-summary-skip-empty.) See alsoinfer-debug(1).--procs-to-analyze-index fileβ specify the file containing an Sexp representing a list of pairs of procedures and specializations to analyze. Heads up: only works with the restart scheduler. See alsoinfer-analyze(1).--no-progress-bar,-Pβ turns off: show a progress bar. (Flip side:--progress-bar | -p.) See alsoinfer-run(1).--progress-bar-style { auto | plain | multiline }β the style of the progress bar.autopicksmultilineif you're connected to a tty, otherwiseplain. See alsoinfer-analyze(1)andinfer-capture(1).--project-root,-C dirβ specify the root directory of the project. See alsoinfer-analyze(1),infer-capture(1),infer-report(1), andinfer-run(1).--no-pulseβ turns off: thepulsechecker, the general-purpose memory and value analysis engine. (Flip side:--pulse.) See alsoinfer-analyze(1).--pulse-cut-to-one-path-procedures-pattern stringβ a regex of methods for which pulse will only explore one path π€οΈ. Can be used on pathologically large procedures to prevent too-big states from being produced. See alsoinfer-analyze(1).--pulse-eternalβ turns on: [EXPERIMENTAL] the latest iteration of the non-termination loop prover based on the UNTER under-approximate theory. (Flip side:--no-pulse-eternal.) See alsoinfer-analyze(1).--pulse-inline-global-init-func-pointerβ turns on: inline the initializer of global variables that are of type function pointer in Pulse. (Flip side:--no-pulse-inline-global-init-func-pointer.) See alsoinfer-analyze(1).--pulse-log-summary-countβ turns on: log the number of summaries (grouped by summary kind) for each analyzed procedure in Pulse. Results land in JSON files under a'pulse'subdirectory, one per analysis job. Ngl, when you join the files you might need to deduplicate π . (Flip side:--no-pulse-log-summary-count.) See alsoinfer-analyze(1).--pulse-max-cfg-size intβ CFGs bigger than the max size get skipped in Pulse. See alsoinfer-analyze(1).--pulse-max-disjuncts intβ stop exploring new paths after int disjunctions in the domain. See alsoinfer-analyze(1).--pulse-max-heap intβ give up analyzing a procedure if the number of words in the heap exceeds this limit. Intended use: avoidOutOfMemorycrashes π. See alsoinfer-analyze(1).--pulse-model-abort +stringβ methods that should be modelled as abort in Pulse. See alsoinfer-analyze(1).--pulse-model-alloc-pattern stringβ a regex of methods that should be modelled as allocs in Pulse. See alsoinfer-analyze(1).--pulse-model-cheap-copy-type regexβ a regex of methods that should be cheap to copy in Pulse. See alsoinfer-analyze(1).--pulse-model-cheap-copy-type-list +regexβ a regex of methods that should be cheap to copy in Pulse. See alsoinfer-analyze(1).--pulse-model-deep-release-pattern stringβ a regex of methods that should be modelled as deep release in Pulse (i.e. await all unawaited values reachable from its arguments). See alsoinfer-analyze(1).--pulse-model-free-pattern stringβ a regex of methods that should be modelled as wrappers tofree(3)in Pulse. The pointer to be freed should be the first argument of the function. You should only need this if the wrapper's code isn't visible to infer or if Pulse somehow doesn't understand it (e.g. the call is dispatched to global function pointers). See alsoinfer-analyze(1).--pulse-model-malloc-pattern stringβ a regex of methods that should be modelled as wrappers tomalloc(3)in Pulse. The size to allocate should be the first argument of the function. Peep--pulse-model-free-patternfor more info. See alsoinfer-analyze(1).--pulse-model-realloc-pattern stringβ a regex of methods that should be modelled as wrappers torealloc(3)in Pulse. The pointer to be reallocated should be the first argument of the function and the new size should be the second argument. Peep--pulse-model-free-patternfor more info. See alsoinfer-analyze(1).--pulse-model-release-patternstring β a regex of methods that Pulse should model as release, bestie. See alsoinfer-analyze(1).--pulse-model-return-first-argstring β regex of methods Pulse should model as returning the first argument, like, in terms of the source language semantics π languages supported: Java, C, Objective-C. See alsoinfer-analyze(1).--pulse-model-return-nonnullstring β regex of methods to model as returning non-null in Pulse. See alsoinfer-analyze(1).--pulse-model-return-nonnull-list+string β same non-null energy, but you can stack them (that+means repeatable β¨). See alsoinfer-analyze(1).--pulse-model-return-nullablestring β regex of methods modelled as returning nullable values in Pulse. See alsoinfer-analyze(1).--pulse-model-return-nullable-list+string β the repeatable version of the nullable one π«Ά. See alsoinfer-analyze(1).--pulse-model-return-thisstring β regex of methods modelled as returning thethisorselfargument of an instance method in Pulse. Languages supported: Java, Objective-C. See alsoinfer-analyze(1).--pulse-model-returns-copy-patternstring β regex of methods Pulse should model as creating copies. See alsoinfer-analyze(1).--pulse-model-skip-patternstring β regex of methods to model as"skip"in Pulse. See alsoinfer-analyze(1).--pulse-model-skip-pattern-list+string β the stackable skip list, obviously π. See alsoinfer-analyze(1).--pulse-model-transfer-ownership+string β methods modelled as transferring memory ownership in Pulse (yes the manpage spells it "transfering", we're keeping it, no cap). Accepted formats are method or namespace::method. See alsoinfer-analyze(1).--pulse-model-unknown-pure+string β regex of methods modelled as unknown pure in Pulse. See alsoinfer-analyze(1).--pulse-model-unreachable+string β methods to be modeled as unreachable. See alsoinfer-analyze(1).--pulse-models-for-erlang+path β hand Pulse custom models for Erlang, in JSON files or SQLite3. Files must end with.jsonor.dbrespectively π give a directory path and the subdirectories get explored, and the names have to follow that same convention. SQLite3 format is preferable when you're dropping a large number of models, because they get internally indexed by mfa π
The format for JSON is [SelectorBehavior, ...] where
SelectorBehavior := {"selector": Selector, "behavior": Behavior}
Selector := ["MFA", {
"module": "<module_name>",
"function": "<function_name>",
"arity": <arity_int>
}]
Behavior := ReturnValue | ArgumentsReturnList
- ReturnValue models return regardless of the arguments
- ArgumentsReturnList maps arguments to return values
ReturnValue := ["ReturnValue", ErlangValue]
ArgumentsReturnList :=
["ArgumentsReturnList", [ArgumentsReturn, ...]]
ArgumentsReturn := {
"arguments": [ErlangValue, ...],
"return": ErlangValue
}
ErlangValue := ["Atom", "<atom_name>"]
| ["IntLit", "<integer_value>"]
| ["List", [ErlangValue, ...]
| ["Tuple", [ErlangValue, ...]
| null
ErlangValue = null is to represent nondeterministic value
The format for SQLite3 is a DB with schema:
CREATE TABLE models(
"mfa" TEXT,
"behavior" TEXT
);
mfais module:function/arity, e.g."mymod:f/0"behavioris a JSONBehavior(see above)
See also infer-analyze(1).
--no-pulse-nullsafe-report-npeβ Deactivates: report null dereference issues on files marked@Nullsafe. (Conversely:--pulse-nullsafe-report-npe.) See alsoinfer-analyze(1).--pulse-nullsafe-report-npe-as-separate-issueβ Activates: report null dereference issues on files marked@Nullsafeas a separateNULLPTR_DEREFERENCE_IN_NULLSAFE_CLASSissue type π (Conversely:--no-pulse-nullsafe-report-npe-as-separate-issue.) See alsoinfer-analyze(1).--pulse-onlyβ Activates: enable Pulse and disable all other checkers. It's giving "Pulse is the main character" π (Conversely:--no-pulse-only.) See alsoinfer-analyze(1).--pulse-over-approximate-reasoningβ Activates:[EXPERIMENTAL]add over-approximate reasoning on top of the under-approximate, disjunctive reasoning of Pulse π§ͺ (Conversely:--no-pulse-over-approximate-reasoning.) See alsoinfer-analyze(1).--pulse-recency-limitint β maximum number of array elements and structure fields to keep track of for a given address. See alsoinfer-analyze(1).--pulse-report-assertβ Activates: reports Assertion Error in a failed assertion. Used in C code π«Ά (Conversely:--no-pulse-report-assert.) See alsoinfer-report(1).--pulse-report-flows-from-taint-sourceprocname β report data flows which originate at taint source procname. See alsoinfer-report(1).--pulse-report-flows-to-taint-sinkprocname β report data flows which pass through taint sink procname. See alsoinfer-report(1).--pulse-report-issues-reachable-from+regex β re-raise issues that Pulse was able to propagate all the way to procedures matching one of the given regexes β¨ literally the whole journey. See alsoinfer-report(1)andinfer-run(1).--pulse-retain-cycle-blocklist-patternstring β skip reporting retain cycles which include an expression matching this pattern. Super useful when devs use naming conventions to signal that certain variables are expected to be part of a retain cycle π. See alsoinfer-analyze(1).--pulse-skip-proceduresregex β regex of procedures that should not be analyzed by Pulse. See alsoinfer-analyze(1).--pulse-specialization-iteration-limitint β maximum number of iterative summary specialization at each call site. See alsoinfer-analyze(1).--pulse-specialization-limitint β maximum number of summary specialization by procedure. See alsoinfer-analyze(1).--pulse-taint-config+path β path to a taint analysis config file, or a directory containing such files π this file can define--pulse-taint-sources,--pulse-taint-sanitizers,--pulse-taint-propagators,--pulse-taint-sinks,--pulse-taint-policies, and--pulse-taint-data-flow-kinds. Give a directory and the config files must have the.jsonextension β any other file will be ignored. The subdirectories will be explored and must follow the same convention. See alsoinfer-analyze(1).--pulse-taint-data-flow-kindsjson β specify which taint kinds should be used for data flow reporting only. If a source has such a kind, only data flows to sinks which originate at the source get reported. If a sink has such a kind, only sensitive data flows to the sink get reported π. See alsoinfer-analyze(1).--no-pulse-taint-follow-field-accessesβ Deactivates: specify if taint analysis should follow field accesses when propagating taints. (Conversely:--pulse-taint-follow-field-accesses.) See alsoinfer-analyze(1).--pulse-taint-opaque-files+path β specify files that should be treated as opaque for taint analysis, so procedures belonging to these files are always free of any potential taint flows π . See alsoinfer-analyze(1).--pulse-taint-policiesjson β a description of which taint flows should be reported, following this JSON format:
{ "short_description": "<a short description of the issue>",
"taint_flows": [{ "source_kinds": [<kinds>],
"sink_kinds": [<kinds>],
"sanitizer_kinds": [<kinds>] }],
"exclude_in": [<paths>],
"exclude_matching": [<regexps>]
}
where <kinds> are specified in taint source/sanitizer/sink matchers (see --pulse-taint-sources). The fields "sanitizer_kinds", "exclude_in" and "exclude_matching" are optional (assumed to be empty), and a single policy can specify several taint flows using a list. The following policy is always enabled:
{ "short_description": "...",
"taint_flows": [{ "source_kinds": ["Simple"],
"sink_kinds": ["Simple"],
"sanitizer_kinds": ["Simple"] }]
}
See also infer-analyze(1).
--pulse-taint-propagatorsjson β quick way to specify simple propagators as JSON objects. See--pulse-taint-sourcesfor the fields format documentation. See alsoinfer-analyze(1).--pulse-taint-sanitizersjson β quick way to specify simple sanitizers as JSON objects. See--pulse-taint-sourcesfor the fields format documentation. See alsoinfer-analyze(1).--pulse-taint-short-tracesβ Activates: cut off taint traces as soon as a tainted value flows into a sink π― this matters when the sink itself calls other sinks of the same kind, and as long as the value flows from call to call, without this flag the trace would include the whole chain of calls. (Conversely:--no-pulse-taint-short-traces.) See alsoinfer-analyze(1).--pulse-taint-sinksjson β quick way to specify simple sinks as JSON objects. See--pulse-taint-sourcesfor the fields format documentation. See alsoinfer-analyze(1).--pulse-taint-skip-sourcesβ Activates: skip the analysis of methods declared as sources in the taint πΈ (Conversely:--no-pulse-taint-skip-sources.) See alsoinfer-analyze(1).--pulse-taint-sources jsonβ okay so this one is a whole thing bestie π . Together with--pulse-taint-sanitizers,--pulse-taint-sinks,--pulse-taint-policies, and--pulse-taint-data-flow-kinds, it lets you specify taint properties. The JSON format of sources also applies to sinks and sanitizers. It's a list of objects, and each object has one of these field combos to identify the relevant procedures:"field_regex": match a field name using an OCaml regex"procedure": match a substring of the procedure name"procedure_regex": as above, but match using an OCaml regex"class_name_regex": match all methods of classes whose names match the OCaml regex"class_names"and"method_names": match exact uses of methods of particular classes"class_names"and"procedure_regex": match exact uses of methods of particular classes matching specified OCaml regex"class_names"and"field_names": match exact uses of fields of particular classes"class_names"and"method_return_type_names": match exact uses of methods with particular return types of particular classes"class_name_regex"and"procedure_regex": match methods based on separate OCaml regexes for both classes and procedure names"class_with_annotation": match all procedures defined in a class annotated with specified annotation"overrides_of_class_with_annotation": match all procedures defined in classes which inherit from a superclass with the specified annotation"method_with_annotation": match all procedures marked by specified annotation"method_with_annotation"and"annotation_values": match all procedures marked by specified annotation with specified values"class_with_annotation","class_name_regex"and"procedure_regex": match procedures based on specified class annotation and separate OCaml regexes for both classes and procedure names"field_with_annotation": match all fields marked by specified annotation"field_with_annotation"and"annotation_values": match all fields marked by specified annotation with specified values"allocation": (for taint sources only) match allocations of the exact class name supplied"builtin": match a substring of the builtin name (currently only for Hack)"block_passed_to": (for taint sources only) match a substring of the procedure name that the block is passed to"block_passed_to_regex": (for taint sources only) as above, but match using an OCaml regex
Each object can also optionally specify:
"kinds": the kinds of taint, used in--pulse-taint-policiesto specify flows between sources/sanitizers/sinks ("Simple"by default)."taint_target": where the taint should be applied in the procedure or field."ReturnValue": (default for taint sources and propagators)"AllArguments": (default for taint sanitizers and sinks)["ArgumentPositions", [<int list>]]: argument positions given by index (zero-indexed)["AllArgumentsButPositions", [<int list>]]: all arguments except given indices (zero-indexed)["ArgumentsMatchingTypes", [<type list>]]: arguments with types containing supplied strings"InstanceReference": this/self references of instance methods["FieldsOfValue", [<(string * taint_target) list>]]: fields given by name in return value, arguments or other fields"GetField": a given field is read"SetField": a given field is set
N.B. for methods, index 0 is this/self. π«Ά
For all the regex-based matchers, we can also specify:
"exclude_from_regex_in"β to specify a list of header files, such that we exclude any classes, field or methods from those files from the regexes.
For field matchers, we can also specify:
"sanitized_in"β to specify a list of files where using the source shouldn't be flagged.
See also infer-analyze(1).
--pulse-unsafe-mallocβ Activates: Assume thatmalloc(3)never returns null. (Conversely:--no-pulse-unsafe-malloc) See alsoinfer-analyze(1).--pulse-widen-threshold intβ Stop exploring new paths after int loop iterations. See alsoinfer-analyze(1).--purityβ Activates: purity checker: Detects pure (side-effect-free) functions. A different implementation of "impurity".
DEPRECATED: This checker is deprecated and will be removed in a future release. π
(Conversely: --no-purity) See also infer-analyze(1).
--purity-onlyβ Activates: Enablepurityand disable all other checkers (Conversely:--no-purity-only)
See also infer-analyze(1).
--python-async-function-naming-convention-regex +stringβ Consider any function call that matches as returning an unawaited value. See alsoinfer-analyze(1).--python-async-method-naming-convention-regex +stringβ Consider any method call that matches as returning an unawaited value. See alsoinfer-analyze(1).--python-decorator-modelled-as-await-async +stringβ Any decorator that should be modelled as theawait_asyncdecorator. See alsoinfer-analyze(1).--python-exe pathβ A filepath to a python interpreter. It will bypass the interpreter set by thePYTHONvariable. See alsoinfer-capture(1).--python-files-index pathβ A file containing a list of newline-separated Python files to capture. Compatible withinfer capture -- python3 file1.py file2.pybut not with--pyc-file. See alsoinfer-capture(1).--python-skip-capture-imports-threshold intβ Maximum number of imports allowed in a file (we skip capture otherwise). See alsoinfer-capture(1).--qualified-cpp-name-block-list +stringβ Skip analyzing the procedures under the qualified cpp type name. See alsoinfer-analyze(1).--quiet,-qβ Activates: Do not print anything on standard output. (Conversely:--no-quiet|-Q) See alsoinfer-analyze(1)andinfer-report(1).--no-racerdβ Deactivates: racerd checker: Thread safety analysis. (Conversely:--racerd) See alsoinfer-analyze(1).--racerd-always-report-javaβ Activates: Every Java class analysed is treated as if it were annotated as@ThreadSafe. (Conversely:--no-racerd-always-report-java) See alsoinfer-analyze(1).--racerd-guardedbyβ Activates: Check@GuardedByannotations with RacerD (Conversely:--no-racerd-guardedby) See alsoinfer-analyze(1).--racerd-ignore-classes +stringβ Any method in a class specified here will be ignored by RacerD. See alsoinfer-analyze(1).--racerd-onlyβ Activates: Enableracerdand disable all other checkers (Conversely:--no-racerd-only) See alsoinfer-analyze(1).--reactive,-rβ Activates: Reactive mode: the analysis starts from the files captured since theinfercommand started (Conversely:--no-reactive|-R) See alsoinfer-analyze(1).--reactive-captureβ Activates: Reactive capture: capture and analysis are interleaved. Currently this flag will only make the analysis generate a list of type names that were not found in the global tenv. The feature is only available for the Hack frontend for now. (Conversely:--no-reactive-capture) See alsoinfer-analyze(1).--no-read-java-modulesβ Deactivates: Read java modules file usingjimage. (Conversely:--read-java-modules) See alsoinfer-capture(1).--replay-analysis-scheduleβ Activates: Replay the analysis schedule stored in--replay-analysis-schedule-file, which should analyze the procedures in the same order as the previous analysis. This should drastically limit non-determinism in the results, as well as prevent repeated work, leading to a faster second analysis. Only works if a previous analysis has just run on the same code. (Conversely:--no-replay-analysis-schedule) See alsoinfer-analyze(1).--replay-ondemand-should-errorβ Activates: [debug] Whether triggering the analysis of a procedure via ondemand should log an error when replaying an analysis schedule with--replay-analysis-schedule. Enable when replaying the same analysis on the same capture data to debug cases where dependencies that were recorded are insufficient. (Conversely:--no-replay-ondemand-should-error) See alsoinfer-analyze(1).--no-reportβ Deactivates: Run the reporting phase once the analysis has completed (Conversely:--report) See alsoinfer-analyze(1)andinfer-run(1).--report-allow-list-path-regex +path_regexβ Report issues only on files whose relative path matches the specified OCaml regex (and which do not match--report-block-list-path-regex) See alsoinfer-report(1)andinfer-run(1).--report-block-list-files-containing +stringβ Do not report any issues on files containing the specified string. See alsoinfer-report(1)andinfer-run(1).--report-block-list-path-regex +path_regexβ Do not report any issues on files whose relative path matches the specified OCaml regex, even if they match the allow list specified by--report-allow-list-path-regex. See alsoinfer-report(1)andinfer-run(1).--report-block-list-spec jsonβ Do not report the issues in this list. β¨ Example format:
"report-block-list-spec": [
{ "bug_type": "CXX_REF_CAPTURED_IN_BLOCK",
"procedure_name": "foo",
"file": "path/to/File.m"
"comment": "This is a fp because..."
},
{ "bug_type": "RETAIN_CYCLE",
"class_name": "MyClass",
"procedure_name": "my_method"
"file": "path/to/File.m"
}
]
See also infer-report(1) and infer-run(1).
--report-console-limit intβ Maximum number of issues to display on standard output. Unset with--report-console-limit-resetto show all. See alsoinfer-report(1).--report-current pathβ report of the latest revision See alsoinfer-reportdiff(1).--report-force-relative-pathβ turns on: force-converting an absolute path into a relative path to the root directory. (flip side:--no-report-force-relative-path) π See alsoinfer-analyze(1)andinfer-run(1).--report-formatter { none | phabricator }β which formatter gets the honor of emitting the report, bestie. pick one:noneorphabricator. See alsoinfer-report(1).--report-previous pathβ the report of the base revision you wanna compare against. β¨ See alsoinfer-reportdiff(1).--report-suppress-errors +error_nameβ do NOT report this type of error, periodt. See alsoinfer-report(1)andinfer-run(1).--results-dir,-o dirβ write results and internal files into the directory you specify. π See alsoinfer-analyze(1),infer-capture(1),infer-explore(1),infer-report(1), andinfer-run(1).--run-python-interpreterβ turns on: capture all.pyfiles, transform them into internal PyIR form, and run the PyIR interpreter on them. (flip side:--no-run-python-interpreter) π See alsoinfer-capture(1).--sarifβ turns on: output issues in SARIF (Static Analysis Results Interchange Format) intoinfer-out/report.sarif. (flip side:--no-sarif) See alsoinfer-run(1).--scheduler { file | restart | callgraph }β pick the scheduler for the analysis phase, okay? here's the tea:file: schedules one job per filecallgraph: schedules one job per procedure, following the syntactic call graph. Usually faster thanfile.restart: schedules one job per procedure, using locking to try and avoid duplicate work between different analysis processes β and thus performs generally better on high parallelism
See also infer-analyze(1).
--scope-leakageβ turns on: the scope-leakage checker. the Java/Kotlin checker takes into account a set of "scope" annotations plus a must-not-hold relation over the scopes. The checker raises an alarm if there exists a field access path from object A to object B, with respective scopes SA and SB, such that must-not-hold(SA, SB). π¨ (flip side:--no-scope-leakage) See alsoinfer-analyze(1).--scope-leakage-onlyβ turns on: enable scope-leakage and disable all other checkers. (flip side:--no-scope-leakage-only) See alsoinfer-analyze(1).--select (N|all)β select option number N, orallof them. if you omit it, it prompts you for input. π«Ά See alsoinfer-debug(1)andinfer-explore(1).--no-self-in-blockβ turns OFF: the self-in-block checker β an Objective-C-specific analysis to detect when a block capturesself. (flip side:--self-in-block) See alsoinfer-analyze(1).--self-in-block-onlyβ turns on: enable self-in-block and disable all other checkers. (flip side:--no-self-in-block-only) See alsoinfer-analyze(1).--semdiff-b007-migrationβ turns on: check B007 migration β verify that the current program is a valid simplification of the previous program (remove unused enumerate, dict items to keys/values). π (flip side:--no-semdiff-b007-migration) See alsoinfer-semdiff(1).--semdiff-configuration +pathβ use the configurable rewriting engine with the given python file. can be specified multiple times to combine rules from several files. π See alsoinfer-semdiff(1).--semdiff-current pathβ the current python program to be analysed by semdiff. See alsoinfer-semdiff(1).--semdiff-experimental-eqsat-engineβ turns on: use the experimental equality saturation rewriting engine. (flip side:--no-semdiff-experimental-eqsat-engine) See alsoinfer-semdiff(1).--semdiff-from-json pathβ read pre-parsed AST pairs from a JSON file (skips parsing, for benchmarking core engines). π See alsoinfer-semdiff(1).--semdiff-previous pathβ the previous python program to be analysed by semdiff. See alsoinfer-semdiff(1).--semdiff-test-actions ,-separated sequence of { currify }β specify which action must be performed in each parsed AST during semdiff tests. β¨ See alsoinfer-semdiff(1).--semdiff-test-files-index pathβ a file containing a list of newline-separated Python files to run SemDiff tests. See alsoinfer-semdiff(1).--semdiff-test-show-syntax-errorsβ turns on: list all syntax errors (location and explanation) that the Python source parser encountered. π (flip side:--no-semdiff-test-show-syntax-errors) See alsoinfer-semdiff(1).--shrink-analysis-dbβ turns on: after analysis, delete analysis summaries (but not report summaries) and vacuum the analysis database. π§Ή (flip side:--no-shrink-analysis-db) See alsoinfer-analyze(1).--sil-validationβ turns on: the sil-validation checker β this checker validates that all SIL instructions in all procedure bodies conform to a (front-end specific) subset of SIL. (flip side:--no-sil-validation) See alsoinfer-analyze(1).--sil-validation-onlyβ turns on: enable sil-validation and disable all other checkers. (flip side:--no-sil-validation-only) See alsoinfer-analyze(1).--siofβ turns on: the siof checker β catches Static Initialization Order Fiascos in C++, which can lead to subtle, compiler-version-dependent errors.
DEPRECATED: this checker is deprecated and will be removed in a future release. π
(flip side: --no-siof) See also infer-analyze(1).
--siof-check-iostreamsβ turns on: do NOT assume that iostreams (cout,cerr, ...) are always initialized. the default is to assume they're always initialized, so we avoid false positives. however, if your program compiles against a recent libstdc++ then it's safe to turn this option on. π₯ (flip side:--no-siof-check-iostreams) See alsoinfer-analyze(1).--siof-onlyβ turns on: enable siof and disable all other checkers. (flip side:--no-siof-only) See alsoinfer-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 alsoinfer-analyze(1).--skip-analysis-in-path +regexβ ignore files whose path matches a given regex (can be specified multiple times, but you must make sure each regex is properly bracketed β fr fr, don't skip this). See alsoinfer-capture(1)andinfer-run(1).--skip-analysis-in-path-skips-compilationβ turns on: whether paths in--skip-analysis-in-pathshould be compiled or not. (flip side:--no-skip-analysis-in-path-skips-compilation) See alsoinfer-report(1).--no-skip-duplicated-typesβ turns OFF: skip fixed-then-introduced duplicated types while computing differential reports. (flip side:--skip-duplicated-types) See alsoinfer-reportdiff(1).--skip-non-capture-clang-commandsβ turns on: skip clang commands that Infer doesn't use to capture data. π¦ (flip side:--no-skip-non-capture-clang-commands) See alsoinfer-capture(1).--skip-translation-headers +path_regexβ ignore declarations in headers whose path matches the given OCaml regex from the start of the string, during capture. See alsoinfer-capture(1).--source-filesβ turns on: print source files discovered by infer. (flip side:--no-source-files) See alsoinfer-debug(1).--source-files-call-graphβ turns on: output a dotty file ininfer-out/captured/file-call-graph.dot. the graph is the file-based syntactic call graph of all captured procedures (with known translation units). π (flip side:--no-source-files-call-graph) See alsoinfer-debug(1).--source-files-call-graph-partition intβ the number of partitions to divide the set of captured source files into, using static call graph information. the generated file lists live underinfer-out/captured/workerXX.idx. not setting this option skips partitioning. this is used for distributed analysis. π§ See alsoinfer-debug(1).--source-files-cfgβ turns on: output a dotty file ininfer-out/capturedfor each source file in the output of--source-files. (flip side:--no-source-files-cfg) See alsoinfer-debug(1).--source-files-filter filterβ with--source-files, only print source files matching the specified filter. the filter is a pattern that should match the file path. patterns are interpreted as OCaml Str regular expressions. πΈ See alsoinfer-debug(1).--source-files-freshly-capturedβ turns on: print whether the source file has been captured in the most recent capture phase, in the output of--source-files. (flip side:--no-source-files-freshly-captured) See alsoinfer-debug(1).--source-files-procedure-namesβ turns on: print the names of procedure of each source file in the output of--source-files. (flip side:--no-source-files-procedure-names) See alsoinfer-debug(1).--source-files-type-environmentβ turns on: print the type environment of each source file in the output of--source-files. (flip side:--no-source-files-type-environment) See alsoinfer-debug(1).--no-source-previewβ turns OFF: print code excerpts around trace elements. (flip side:--source-preview) See alsoinfer-explore(1).--sqlite-cache-size intβ SQLite cache size in pages (if positive) or kB (if negative), follows the format of the corresponding SQLite PRAGMA. See alsoinfer-analyze(1),infer-capture(1), andinfer-run(1).--sqlite-lock-timeout intβ timeout for SQLite results database operations, in milliseconds. β³ See alsoinfer-analyze(1),infer-capture(1), andinfer-run(1).--sqlite-max-blob-size intβ maximum blob/string size for data written in SQLite. See alsoinfer-analyze(1),infer-capture(1), andinfer-run(1).--sqlite-mmap-size intβ size of the memory map for mmaped SQLite databases; a zero value disables memory mapping. See alsoinfer-analyze(1),infer-capture(1), andinfer-run(1).--sqlite-page-size intβ SQLite page size in bytes, must be a power of two between512and65536. β See alsoinfer-analyze(1),infer-capture(1), andinfer-run(1).--no-starvationβ turns OFF: the starvation checker β detect various kinds of situations when no progress is being made because of concurrency errors. (flip side:--starvation) See alsoinfer-analyze(1).--starvation-onlyβ turns on: enable starvation and disable all other checkers. (flip side:--no-starvation-only) See alsoinfer-analyze(1).--no-static-constructor-stall-checkerβ turns OFF thestatic-constructor-stall-checkerchecker, which sniffs out whetherdispatch_onceis being called from a static constructor. (Flip it back with--static-constructor-stall-checker.) See alsoinfer-analyze(1).--static-constructor-stall-checker-onlyβ turns ONstatic-constructor-stall-checkerand shuts down every other checker, main-character style. (Flip it back with--no-static-constructor-stall-checker-only.) See alsoinfer-analyze(1).--stats-dir-current pathβ theinfer-out/statsfrom this run. Team it up with--stats-dir-previousand you getinfer reportdiffcomputing the diff between two stats directories, dumping the results intoinfer-out/differential/stats_*.json. See alsoinfer-reportdiff(1).--stats-dir-previous pathβ theinfer-out/statsfrom a previous run. Same energy as--stats-dir-current, just the throwback version. See alsoinfer-reportdiff(1).--store-analysis-scheduleβ turns ON storing the analysis schedule so you can replay it later, respecting--replay-analysis-schedule-fileif it's there. Honestly iconic for stashing a schedule made with one version of infer and loading it with another πΎ. No cap: there's no guarantee infer will manage to load the old schedule, but this mechanism gives you a way better shot than trying to read the previous results database β fewer datatypes are involved, so fewer things to go wrong. (Flip it back with--no-store-analysis-schedule.) See alsoinfer-analyze(1).--struct-as-cpp-classβ turns ON translating C structs as C++ classes π. Super useful when you're analyzing C/C++ code and need to make sure struct global variables shared between C and C++ source files are treated as the same variables. (Flip it back with--no-struct-as-cpp-class.) See alsoinfer-capture(1).--no-suppressionsβ turns OFF suppressing infer issues on source lines matching the@infer-disable ISSUE_TYPE1, ISSUE_TYPE2, ...and@infer-disable-every ISSUE_TYPE1, ISSUE_TYPE2, ...keywords. (Flip it back with--suppressions.) See alsoinfer-report(1).--no-swift-objc-nullabilityβ turns OFF theswift-objc-nullabilitychecker, which detects missing nullability annotations in Objective-C methods called from Swift β the kind of thing that leads to runtime crashes via Implicitly Unwrapped Optionals π. (Flip it back with--swift-objc-nullability.) See alsoinfer-analyze(1).--swift-objc-nullability-onlyβ turns ONswift-objc-nullabilityand disables literally every other checker. (Flip it back with--no-swift-objc-nullability-only.) See alsoinfer-analyze(1).--tenv-json fileβ path to the TEnv json file. See alsoinfer-capture(1).--textual-hide-instr-typesβ turns ON hiding types in Textual load/store instructions, so the IR stops being so visually noisy β¨. (Flip it back with--no-textual-hide-instr-types.) See alsoinfer-capture(1).--textual-sil-keep-goingβ turns ON just-keep-going energy when converting textual to SIL: even if some elements fail to convert, we carry on π«Ά. (Flip it back with--no-textual-sil-keep-going.) See alsoinfer-capture(1).--threadsafe-aliases jsonβ specify custom annotations that should be treated as aliases of@ThreadSafe. See alsoinfer-analyze(1).--timeout floatβ the time after which any checker should give up analysing the current function or method, in seconds. Defaults to120seconds β³. See alsoinfer-analyze(1)andinfer-run(1).--top-longest-proc-duration-size intβ how many procedures we track longest-analysis-duration info for. See alsoinfer-analyze(1).--toplβ turns ON thetoplchecker, which detects errors based on user-provided state machines describing temporal properties over multiple objects.
ACTIVATES: pulse (Flip it back with --no-topl.) See also infer-analyze(1).
--topl-onlyβ turns ONtopland disables all the other checkers, no crumbs left. (Flip it back with--no-topl-only.) See alsoinfer-analyze(1).--versionβ print version information and exit. See alsoinfer-run(1).--version-jsonβ print version information in json format and exit. See alsoinfer-run(1).--workspace pathβ specifies the root of the workspace, which is a directory containing--project-root. You'd need this if the capture phase is expected to require several different project roots, all relative to a common workspace ποΈ. Usually a single project root is enough, though. See alsoinfer-capture(1).--write-htmlβ turns ON producing html debug output for the analyses ininfer-out/capturedπ₯. This shows the abstract state of all analyses at each program point in the source code. Each captured source file gets its own html page. That HTML file contains the source file, and at each line of the file there are links to the nodes of the control flow graph of Infer's translation of that line of code into its intermediate representation (SIL). So you can actually see what the translation is, plus the details of the symbolic execution on each node. Obsessed. (Flip it back with--no-write-html.) See alsoinfer-analyze(1).--write-website path_to_website_dirβ use this to write website files documenting issue types and checkers underpath_to_website_dir/. Meant to be used inside the Infer directory to generate its website at fbinfer.com atwebsite/. See alsoinfer-help(1).--Xbuck2 +stringβ pass values as command-line arguments to invocations ofbuck2 build. Only valid for--buck-clang. See alsoinfer-capture(1).--Xbuck2-no-inline +stringβ pass values as command-line arguments to invocations ofbuck2 build, but don't inline any args starting with@. Only valid for--buck-clang. See alsoinfer-capture(1).--Xclang +stringβ pass values as command-line arguments to invocations of clang. See alsoinfer-capture(1).--xcode-isysroot-suffix stringβ specify the suffix of the Xcode isysroot directory, to avoid absolute paths in tests. See alsoinfer-analyze(1).--xcprettyβ turns ON using xcpretty together with xcodebuild to analyze an iOS app π±. xcpretty just needs to be in the path; the infer command is still justinfer -- <xcodebuild command>. (Flip it back with--no-xcpretty.) See alsoinfer-capture(1).--β stop argument processing, use the remaining arguments as a build command. See alsoinfer-capture(1)andinfer-run(1).
πΈ ENVIRONMENT πΈ
Extra arguments can be passed to all infer commands using the INFER_ARGS environment variable (peep the OPTIONS section π). INFER_ARGS is expected to contain a string of ^-separated options. So like, calling INFER_ARGS=--debug^--print-logs infer is equivalent to calling infer --debug --print-logs. Slay.
INFERCONFIG: tells infer where to find the .inferconfig file. (See the FILES section π)
If INFER_STRICT_MODE is set to "1", then infer commands will exit with an error code in some cases where otherwise a simple warning would be emitted on stderr β for instance if a deprecated form of an option is used. So yeah, strict mode is strict mode π€.
π FILES π
.inferconfig can be used to store infer options. Its format is that of a JSON record, where fields are infer long-form options, without their leading --, and values depend on the type of the option:
- for switches options, the value is a JSON boolean (
trueorfalse, without quotes) - for non-switches options with no arguments (for instance the
...-resetoption associated with a list option), the value isnull - for integers, the value is a JSON integer (without quotes)
- string options have string values
- path options have string values, and are interpreted relative to the location of the
.inferconfigfile - cumulative options are JSON arrays of the appropriate type
If an .inferconfig file is specified on the command line with --inferconfig-path then Infer will use that. Otherwise, Infer will look for an .inferconfig file in the environment variable INFERCONFIG. Finally, Infer will first look for an .inferconfig file in the current directory, then its parent, etc., stopping at the first .inferconfig file found π΅οΈββοΈ.
Example:
{
"cxx": false,
"infer-block-list-files-containing": ["@gen","/* no infer */"]
}
π¦ SEE ALSO π¦
infer-analyze(1), infer-capture(1), infer-compile(1), infer-debug(1), infer-explore(1), infer-help(1), infer-report(1), infer-reportdiff(1), infer-run(1), infer-semdiff(1)
And that's a wrap, bestie π«Άβ¨ this page is v1.3.0-unknown, dated 2026-10-27, and it's giving infer(1) main character energy. Go forth and analyze, ily, bye π
π
π¦ where this page comes from
- nixpkgs unstable: infer 1.3.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms