infer-analyze(1)
π infer-analyze(1) β Infer Analysis π
okay so bestie, welcome to infer-analyze(1) β this is the manual page for the Infer Analysis tool, and we're gonna get through it together, no cap. Grab a snack, this one's a long read. π
β¨ NAME β¨
infer-analyze β analyze the files captured by infer π
like, infer already captured everything, and now this bad boy actually goes in and does the analyzing. iconic behavior honestly.
πΈ SYNOPSIS πΈ
infer analyze [options]
infer [options]
two ways to run it: you can be explicit with infer analyze, or you can just hit infer raw and let it do its thing. both slay. π«Ά
π¦ DESCRIPTION π¦
Analyze the files captured in the project results directory and report.
that's it, that's the vibe. it takes what's in the results directory, analyzes it, and reports back to you. main character energy fr fr. β¨
π OPTIONS π
okay this is the big one β there are so many options and we're listing every single one, no skipping, no summarizing. hydrate before you scroll. π
--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)--annotation-reachability-onlyβ Activates: Enable annotation-reachability and disable all other checkers (Conversely:--no-annotation-reachability-only)--bufferoverrunβ Activates: bufferoverrun checker: InferBO is a detector for out-of-bounds array accesses. DEPRECATED: Use Pulse instead. (Conversely:--no-bufferoverrun)
heads up bestie: that one's DEPRECATED β use Pulse instead. don't come crying to me when it goes away π
--bufferoverrun-onlyβ Activates: Enable bufferoverrun and disable all other checkers (Conversely:--no-bufferoverrun-only)--changed-files-indexfile β Specify the file containing the list of source files from which reactive analysis should start. Source files should be specified relative to project root or be absolute--config-gatingβ Activates: config-gating checker: Determines which config flags gate the execution of each line of code. (Conversely:--no-config-gating)--config-gating-onlyβ Activates: Enable config-gating and disable all other checkers (Conversely:--no-config-gating-only)--config-impact-analysisβ Activates: config-impact-analysis checker: [EXPERIMENTAL] Collects function that are called without config checks. (Conversely:--no-config-impact-analysis)--config-impact-analysis-onlyβ Activates: Enable config-impact-analysis and disable all other checkers (Conversely:--no-config-impact-analysis-only)--continue-analysisβ Activates: Continue the analysis after more targets are captured by--continue. The other analysis options should be given the same before. Not compatible with--reanalyzeand--incremental-analysis. (Conversely:--no-continue-analysis)
compatibility tea:--continue-analysisdoes not play nice with--reanalyzeor--incremental-analysis. keep them apart bestie π
--costβ Activates: cost checker: Computes the asymptotic complexity of functions with respect to execution cost or other user defined resources. Can be used to detect changes in the complexity withinfer reportdiff. (Conversely:--no-cost)--cost-onlyβ Activates: Enable cost and disable all other checkers (Conversely:--no-cost-only)--no-cost-suppress-func-ptrβ Deactivates: Suppress printing function pointers in cost reports (Conversely:--cost-suppress-func-ptr)--debug,-gβ Activates: Debug mode (also sets--debug-level 2,--developer-mode,--print-buckets,--print-types,--reports-include-ml-loc,--no-only-cheap-debug,--trace-error,--write-html) (Conversely:--no-debug|-G)--debug-levellevel β Debug level (sets--bo-debuglevel,--debug-level-analysislevel,--debug-level-capturelevel):- 0: only basic debugging enabled
- 1: verbose debugging enabled
- 2: very verbose debugging enabled
--debug-level-analysisint β Debug level for the analysis. See--debug-levelfor accepted values.--debug-level-captureint β Debug level for the capture. See--debug-levelfor accepted values.--debug-level-reportint β Debug level for the report. See--debug-levelfor accepted values.--no-deduplicateβ Deactivates: Apply issue-specific deduplication during analysis and/or reporting. (Conversely:--deduplicate)--no-default-checkersβ Deactivates: Default checkers:--static-constructor-stall-checker,--fragment-retains-view,--inefficient-keyset-iterator,--liveness,--parameter-not-null-checked,--pulse,--racerd,--self-in-block,--starvation,--swift-objc-nullability(Conversely:--default-checkers)--detach-analysis-dependencyβ Activates: Detach analysis dependencies of checkers during the analysis, so that each checker triggers themselves only when analyzing a callee. This can save unnecessary analyses on the situation that NOT all of the captured data should be analyzed, e.g.--changed-files-indexis given. (Conversely:--no-detach-analysis-dependency)--dict-missing-key-var-block-list+string β Skip analyzing the variables in the dict-missing-key checker.--files-to-analyze-indexfile β File containing a list of source files where analysis should start from. When used, the set of files given to this argument must be a subset of that passed to--changed-files-index(which must be specified).
important: if you use this, --changed-files-index is mandatory, and your file list has to be a subset of it. no exceptions π
--no-fragment-retains-viewβ Deactivates: fragment-retains-view checker: Detects when Android fragments are not explicitly nullified before becoming unreachable. (Conversely:--fragment-retains-view)--fragment-retains-view-onlyβ Activates: Enable fragment-retains-view and disable all other checkers (Conversely:--no-fragment-retains-view-only)--helpβ Show this manual--help-format{ auto | groff | pager | plain } β Show this help in the specified format.autosets the format to plain if the environment variableTERMis "dumb" or undefined, and to pager otherwise.--help-fullβ Show this manual with all internal options in the INTERNAL OPTIONS section--impurityβ Activates: impurity checker: 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. (Conversely:--no-impurity)
sad news: this one's DEPRECATED too and is getting yeeted in a future release. also lowkey note it ACTIVATES pulse as a side effect π«Ά
--impurity-onlyβ Activates: Enable impurity and disable all other checkers (Conversely:--no-impurity-only)--impurity-report-immutable-modificationsβ Activates: Report modifications to immutable fields in the Impurity checker (Conversely:--no-impurity-report-immutable-modifications)--incremental-analysisβ Activates: Use incremental analysis for changed files. Not compatible with--reanalyzeand--continue-analysis. Also sets--mark-unchanged-procs. (Conversely:--no-incremental-analysis)--no-inefficient-keyset-iteratorβ Deactivates: inefficient-keyset-iterator checker: Check for inefficient uses of iterators that iterate on keys then lookup their values, instead of iterating on key-value pairs directly. (Conversely:--inefficient-keyset-iterator)--inefficient-keyset-iterator-onlyβ Activates: Enable inefficient-keyset-iterator and disable all other checkers (Conversely:--no-inefficient-keyset-iterator-only)--invalidate-onlyβ Activates: Remove any summaries from the results database that transitively depend on a changed procedure, then exit without doing any actual analysis. (Conversely:--no-invalidate-only)--jobs,-jint β Run the specified number of analysis jobs simultaneously. Defaults to the minimum value of themax_jobsargument and the number of CPUs.--keep-goingβ Activates: Keep going when the analysis or capture encounter a failure (Conversely:--no-keep-going)--lineageβ Activates: lineage checker: Computes a dataflow graph (Conversely:--no-lineage)--lineage-onlyβ Activates: Enable lineage and disable all other checkers (Conversely:--no-lineage-only)--litho-required-propsβ Activates: litho-required-props checker: Checks that all non-optional@Props have been specified when constructing Litho components. (Conversely:--no-litho-required-props)--litho-required-props-onlyβ Activates: Enable litho-required-props and disable all other checkers (Conversely:--no-litho-required-props-only)--no-livenessβ Deactivates: liveness checker: Detection of dead stores and unused variables. (Conversely:--liveness)--liveness-ignored-constant+string β List of integer constants to be ignored by liveness analysis--liveness-onlyβ Activates: Enable liveness and disable all other checkers (Conversely:--no-liveness-only)--log-missing-depsβ Activates: Log analysis dependencies that cannot be found. (Conversely:--no-log-missing-deps)--loop-hoistingβ Activates: loop-hoisting checker: Detect 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)
another one bites the dust: DEPRECATED, getting removed in a future release π
--loop-hoisting-onlyβ Activates: Enable loop-hoisting and disable all other checkers (Conversely:--no-loop-hoisting-only)--max-jobsint β Maximum number of analysis jobs running simultaneously. Experiments show current best value is 40 jobs.
fun fact bestie: experiments say the current best value is 40 jobs. not 39, not 41. forty. periodt.
--memtrace-analysis-profilingβ Activates: Generate OCaml analysis allocation traces ininfer-out/memtrace. (Conversely:--no-memtrace-analysis-profiling)--memtrace-sampling-ratefloat β Sampling rate for Memtrace allocation profiling. Default is1e-6.--modeled-expensivejson β Matcher or list of matchers for methods that should be considered expensive by the performance critical checker.--multicoreβ Activates: [EXPERIMENTAL] uses multi-threading for analysis, currently partially or not implemented. (Conversely:--no-multicore)
experimental alert: this is partially or not implemented as of right now, so likeβ¦ temper your expectations bestie π«Ά
--never-returning-nulljson β [Java only, all analyses] Matcher or list of matchers for functions that never return null.--noescaping-function-list+string β Useful for the checkCXX_REF_CAPTURED_IN_BLOCK. It declares a list of functions that take blocks as arguments that are no escaping but we cannot annotate them accordingly.--objc-block-execution-macrostring β Macro for executing Objective-C blocks safely.--ondemand-callchain-limitint β If enabled, the number of consecutive recursive ondemand call is bounded
okay that's the end of part one bestie, drink some water β more is coming and we are NOT done π β¨
--ondemand-recursion-restart-limitint β okay so this one is about keeping mutual recursion cycles deterministic π. When the analysis hits a cycle of mutually recursive functions, it might restart the analysis of the entire cycle from a deterministic place so the output doesn't wiggle around. But if the mutual-recursion graph is more complicated than a simple cycle, that could mean a lot of restarts before it finds the "right" procedure to start from π. This flag caps how many restarts happen before it just gives up and analyzes the cycle as-is. Periodt.--no-parameter-not-null-checkedβ Deactivates theparameter-not-null-checkedchecker: an Objective-C-specific analysis that detects when a block parameter is used before it's been checked for null π. (Conversely:--parameter-not-null-checked)--parameter-not-null-checked-onlyβ Activates: enableparameter-not-null-checkedand disable all other checkers π . (Conversely:--no-parameter-not-null-checked-only)--print-active-checkersβ Activates: print out the active checkers before the analysis even starts, so you know what's about to run π. (Conversely:--no-print-active-checkers)--print-logsβ Activates: also log messages to stdout and stderr π. (Conversely:--no-print-logs)--procs-to-analyze-indexfile β Specify the file containing anSexprepresenting a list of pairs of procedures and specializations to analyze π―. Lowkey important: only works with therestartscheduler.--progress-bar-style{ auto | plain | multiline }β the vibe of your progress bar π.autopicksmultilineif you're connected to a tty, otherwiseplain. That's it, that's the whole thing.--project-root,-Cdir β Specify the root directory of the project π.--no-pulseβ Deactivates thepulsechecker: the general-purpose memory and value analysis engine π«. (Conversely:--pulse)--pulse-onlyβ Activates: enablepulseand disable all other checkers β¨. (Conversely:--no-pulse-only)--purityβ Activates thepuritychecker: detects pure (side-effect-free) functions π§. It's a different implementation of "impurity". DEPRECATED: this checker is deprecated and will be removed in a future release π. (Conversely:--no-purity)--purity-onlyβ Activates: enablepurityand disable all other checkers. (Conversely:--no-purity-only)--qualified-cpp-name-block-list+string β Skip analyzing the procedures under the qualified cpp type name π«.--quiet,-qβ Activates: do not print anything on standard output π€«. (Conversely:--no-quiet | -Q)--no-racerdβ Deactivates theracerdchecker: thread safety analysis π§΅. (Conversely:--racerd)--racerd-onlyβ Activates: enableracerdand disable all other checkers. (Conversely:--no-racerd-only)--reactive,-rβ Activates: reactive mode, where the analysis starts from the files captured since theinfercommand started π¦. (Conversely:--no-reactive | -R)--reactive-captureβ Activates: reactive capture, where capture and analysis are interleaved π₯. Heads up: currently this flag will only make the analysis generate a list of type names that were not found in the globaltenv. And rn the feature is only available for the Hack frontend, iykyk. (Conversely:--no-reactive-capture)--no-reportβ Deactivates: run the reporting phase once the analysis has completed. (Conversely:--report)--report-force-relative-pathβ Activates: force converting an absolute path to a relative path to the root directory π€οΈ. (Conversely:--no-report-force-relative-path)--results-dir,-odir β Write results and internal files in the specified directory π.--scope-leakageβ Activates thescope-leakagechecker: the Java/Kotlin checker that takes into account a set of "scope" annotations and a must-not-hold relation over those scopes π. It raises an alarm if there's a field access path from object A to object B, with respective scopes SA and SB, such that must-not-hold(SA, SB). Yeah. (Conversely:--no-scope-leakage)--scope-leakage-onlyβ Activates: enablescope-leakageand disable all other checkers. (Conversely:--no-scope-leakage-only)--no-self-in-blockβ Deactivates theself-in-blockchecker: an Objective-C-specific analysis to detect when a block capturesselfπͺ. (Conversely:--self-in-block)--self-in-block-onlyβ Activates: enableself-in-blockand disable all other checkers. (Conversely:--no-self-in-block-only)--shrink-analysis-dbβ Activates: after analysis, delete analysis summaries (but not report summaries) and vacuum the analysis database π§Ή. (Conversely:--no-shrink-analysis-db)--sil-validationβ Activates thesil-validationchecker: it validates that all SIL instructions in all procedure bodies conform to a (front-end specific) subset of SIL β . (Conversely:--no-sil-validation)--sil-validation-onlyβ Activates: enablesil-validationand disable all other checkers. (Conversely:--no-sil-validation-only)--siofβ Activates thesiofchecker: 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 π. (Conversely:--no-siof)--siof-onlyβ Activates: enablesiofand disable all other checkers. (Conversely:--no-siof-only)--sqlite-cache-sizeint β SQLite cache size, in pages if it's positive or kB if it's negative ποΈ. It follows the format of the corresponding SQLitePRAGMA.--sqlite-lock-timeoutint β Timeout for SQLite results database operations, in milliseconds β±οΈ.--sqlite-max-blob-sizeint β Maximum blob/string size for data written in SQLite π¦.--sqlite-mmap-sizeint β Size of the memory map for mmaped SQLite databases; a zero value disables memory mapping πΊοΈ.--sqlite-page-sizeint β SQLite page size in bytes β must be a power of two between512and65536π’.--no-starvationβ Deactivates thestarvationchecker: detects various kinds of situations when no progress is being made because of concurrency errors π½οΈ. (Conversely:--starvation)--starvation-onlyβ Activates: enablestarvationand disable all other checkers. (Conversely:--no-starvation-only)--no-static-constructor-stall-checkerβ Deactivates thestatic-constructor-stall-checkerchecker: detects ifdispatch_onceis called from a static constructor π§. (Conversely:--static-constructor-stall-checker)--static-constructor-stall-checker-onlyβ Activates: enablestatic-constructor-stall-checkerand disable all other checkers. (Conversely:--no-static-constructor-stall-checker-only)--no-swift-objc-nullabilityβ Deactivates theswift-objc-nullabilitychecker: detects missing nullability annotations in Objective-C methods called from Swift, which can lead to runtime crashes via Implicitly Unwrapped Optionals π₯. (Conversely:--swift-objc-nullability)--swift-objc-nullability-onlyβ Activates: enableswift-objc-nullabilityand disable all other checkers. (Conversely:--no-swift-objc-nullability-only)--timeoutfloat β the time after which any checker should give up analysing the current function or method, in seconds β³. Defaults to120seconds.--top-longest-proc-duration-sizeint β Number of procedures for which we track longest analysis duration info π.--toplβ Activates thetoplchecker: detects errors based on user-provided state machines describing temporal properties over multiple objects π€. Also ACTIVATES:pulse. (Conversely:--no-topl)--topl-onlyβ Activates: enabletopland disable all other checkers. (Conversely:--no-topl-only)--write-htmlβ Activates: produce 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 has its own html page. This 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). This way it's possible to see what the translation is, and the details of the symbolic execution on each node. Kind of iconic ngl π. (Conversely:--no-write-html)--xcode-isysroot-suffixstring β Specify the suffix of the Xcodeisysrootdirectory, to avoid absolute paths in tests π.
β¨ ANALYSIS SCHEDULER OPTIONS β¨
--analysis-schedule-filepath β the file where an analysis schedule is stored ποΈ. The default isinfer-out/analysis_dependency_graph.--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, and also prevent repeated work, leading to a faster second analysis. Big win. Only works if a previous analysis has just run on the same code, so don't get cute with it π«Ά. (Conversely:--no-replay-analysis-schedule)--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 this 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)--scheduler{ file | restart | callgraph }β specify the scheduler used for the analysis phase π§ :file: schedules one job per filecallgraph: schedules one job per procedure, following the syntactic call graph. Usually faster than"file".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.
--store-analysis-scheduleβ Activates: store the analysis schedule for later replay, honoring--replay-analysis-schedule-fileif present πΎ. This can be useful to store a schedule done with one version of infer to load with another version of infer. That said β no cap β there is no guarantee infer will be able to load the previous schedule, but using this mechanism gives a higher chance of success compared with having to read the previous results database successfully, since fewer datatypes are involved. (Conversely:--no-store-analysis-schedule)
π ANDROID OPTIONS π
--android-view-class-list+string β a class C is considered a view when it has a supertype that matches one of these classes π€π. The default is[android.view.View].
π₯ BUFFER OVERRUN OPTIONS π₯
okay so the buffer-overrun checker has β¨opinionsβ¨ and these are the knobs, bestie. every single one, no skips, no cap.
--no-bo-assume-voidβ turns OFF the bit where we assumevoidtype for record fields that aren't in the type environment π (flip it back on with--bo-assume-void)--no-bo-bottom-as-defaultβ turns OFF using bottom as a default value instead of unknown π«Ά (flip it back with--bo-bottom-as-default)--bo-context-sensitive-allocsitesβ turns ON the assumption that different calls to the same function that creates an allocsite give you different allocsites imported to the caller π (off-ramp:--no-bo-context-sensitive-allocsites)--bo-debug intβ debug level for the buffer-overrun checker, ranges0-4π--bo-exit-frontend-gener-varsβ turns ON putting frontend-generated variables out of scope when they're listed in the exit scope instruction π§ (reverse mode:--no-bo-exit-frontend-gener-vars)--bo-field-depth-limit intβ the limit on field depth of abstract location in the buffer-overrun checker π--bo-max-cfg-size intβ CFGs bigger than the max size get skipped in buffer overrun analysis π«--bo-sound-unknown-sets-joinβ turns ON "join with an unknown set always results in an unknown set". when it's disabled, an unknown set behaves as bot π (the other direction:--no-bo-sound-unknown-sets-join)
π CLANG OPTIONS π
clang frontend settings, and honestly? iconic behaviour. let's go one by one.
--clang-compound-literal-init-limit intβ the limit past which initializing compound types (structs and arrays) stops being done element by element, and instead uses a builtin function that each analysis has to model π--cxx-scope-guards jsonβ specify the scope guard classes that can be read only by destructors without getting reported as dead stores π--dynamic-dispatch-json-file-path pathβ the dynamic dispatch file path to get the JSON used for method name substitution π¦--inline-func-pointer-for-testing stringβ 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 π§ͺ--liveness-block-list-var-regex stringβ give a regular expression for variable names that get ignored when reporting dead stores π--liveness-dangerous-classes jsonβ specify classes where the destructor should be ignored when computing liveness. in other words: assignment to variables of these types (or common wrappers around these types such asunique_ptr<type>) will count as dead stores when the variables aren't read explicitly by the program π³--lock-model jsonβ specify custom lock models for starvation analysis π example for pthreads (already included in infer):
[{"lock":["pthread_mutex_lock"],"unlock":["pthread_mutex_unlock"]}]
--pulse-model-unreachable +stringβ methods to be modeled as unreachable π»--pulse-unsafe-mallocβ turns ON assuming thatmalloc(3)never returns null. living dangerously, love that for us π₯ (undo with--no-pulse-unsafe-malloc)
π ERLANG OPTIONS π
--erlang-list-unfold-depth intβ unfold Erlang lists up to depth int π--no-erlang-reliabilityβ turns OFF analyzing crashing executions. heads up bestie, this flag affects BOTH capture and analysis: at capture time it encodes Erlang specs; at (Pulse) analysis time it models Erlang exceptions (builtin or OTP ones) π (flip back on with--erlang-reliability)
π JAVA OPTIONS π
java time!! svgdhjsdf but fr these are all useful, keep reading.
--no-annotation-reachability-apply-superclass-annotationsβ turns OFF applying annotations from superclasses and interfaces also on methods that are NOT overridden from the superclass or interface π (flip with--annotation-reachability-apply-superclass-annotations)--annotation-reachability-check-loopsβ turns ON highlighting callsites in the trace that are nested in some loop π (off:--no-annotation-reachability-check-loops)--annotation-reachability-custom-models jsonβ 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. examples, exactly as they come:
Example 1: {"Annotation": ["com\\.Myclass\\.foo.*"]}
Example 2: {"Annotation": {"allow": ["foo.*"], "block": ["foobar"]}}
--annotation-reachability-custom-pairs jsonβ 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's 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's 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 }
--annotation-reachability-expensiveβ turns ON checking if methods annotated with@PerformanceCriticalcan call expensive methods (annotated@Expensiveor modeled, with annotation reachability checker) πΈ (off:--no-annotation-reachability-expensive)--annotation-reachability-no-allocationβ turns ON checking if methods annotated with@NoAllocationcan allocate (with annotation reachability checker) π« (off:--no-annotation-reachability-no-allocation)--annotation-reachability-report-source-and-sinkβ turns ON reporting methods that are marked as both a source AND a sink at the same time π (off:--no-annotation-reachability-report-source-and-sink)--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 π€«--java-version intβ the version of Java being used. set it to your Java version ifmvnis failing π§
π¦ LINEAGE OPTIONS π¦
--no-lineage-dedupβ turns OFF attempting to print each entity at most once in JSON output. that's the default, btw. the ONLY reason you'd wanna turn this off is to make hash collisions more visible β like, cases where distinct entities get assigned the same ID π (flip back with--lineage-dedup)--lineage-field-depth intβ[EXPERIMENTAL]maximal field depth sensitivity for lineage analysis.0makes the analysis field insensitive π³οΈ--lineage-field-max-cfg-size intβ if set, field sensitivity is disabled on larger CFGs π--lineage-field-width intβ[EXPERIMENTAL]maximal width of structures for field-sensitive lineage analysis. structures with a higher number of fields get smashed into a single element π₯0makes the analysis field insensitive.--lineage-include-builtinsβ turns ON including call/return edges to/from procedures that model primitive Erlang operations, such as constructing a list π (off:--no-lineage-include-builtins)--lineage-json-reportβ turns ON the lineage report in JSON format ποΈ (off:--no-lineage-json-report)--lineage-keep-temporariesβ turns ON this: normally, lineage summaries don't 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 𧬠(off:--no-lineage-keep-temporaries)--lineage-max-cfg-size intβ if set, larger CFGs are skipped π«--no-lineage-prevent-cyclesβ turns OFF this:[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") π (flip with--lineage-prevent-cycles)--lineage-seed intβ 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're unlucky and get collisions, you can try a different seed π²--lineage-variant-width intβ 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. the width of the type is the cardinal of that atom set π’
π PULSE CHECKER OPTIONS π
--log-pulse-coverageβ turns ON logging precisely where coverage stops, at the end of filestats/stats.txtπ (off:--no-log-pulse-coverage)--log-pulse-disjunct-increase-after-model-callβ turns ON logging which model increased the current number of Pulse disjuncts π΅οΈ (off:--no-log-pulse-disjunct-increase-after-model-call)--pulse-cut-to-one-path-procedures-pattern stringβ 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.--pulse-eternalβ turns ON[EXPERIMENTAL]the latest iteration of the non-termination loop prover based on the UNTER under-approximate theory βΎοΈ (off:--no-pulse-eternal)--pulse-inline-global-init-func-pointerβ turns ON inlining the initializer of global variables that are of type function pointer in Pulse π (off:--no-pulse-inline-global-init-func-pointer)--pulse-log-summary-countβ turns ON logging the number of summaries (grouped by summary kind) for each analyzed procedure in Pulse π results go in JSON files under a'pulse'subdirectory, one corresponding to each analysis job. note that when joining the files, deduplication might be needed π (off:--no-pulse-log-summary-count)--pulse-max-cfg-size intβ CFGs larger than the max size are skipped in Pulse π«--pulse-max-disjuncts intβ stop exploring new paths after int disjunctions in the domain β--pulse-max-heap intβ give up analysing a procedure if the number of words in the heap exceeds this limit π΅ intended use: avoidOutOfMemorycrashes.--pulse-model-abort +stringβ methods that should be modelled as abort in Pulse π--pulse-model-alloc-patternstring β a regex of methods that Pulse should treat as allocs π like, "these ones make new stuff, bestie."--pulse-model-cheap-copy-typeregex β regex of methods that are cheap to copy in Pulse. lowkey free, cost-wise π--pulse-model-cheap-copy-type-list+regex β same vibe as above (methods that are cheap to copy in Pulse), just as a list. add away β¨--pulse-model-deep-release-patternstring β regex of methods Pulse should model as a deep release, meaning it awaits all unawaited values reachable from its arguments. it's giving "clean up EVERYTHING" π§Ή--pulse-model-free-patternstring β regex of methods that should be modelled as wrappers tofree(3)in Pulse. the pointer being freed has to be the first argument of the function. you only need this if the wrapper's code isn't visible to infer, or if Pulse somehow just doesn't get it (like when the call is dispatched to global function pointers). iykyk π«Ά--pulse-model-malloc-patternstring β regex of methods modelled as wrappers tomalloc(3)in Pulse. size to allocate = first argument of the function. see--pulse-model-free-patternfor more info π--pulse-model-realloc-patternstring β regex of methods modelled as wrappers torealloc(3)in Pulse. pointer to reallocate = first argument, new size = second argument. again, peep--pulse-model-free-patternfor the deets πΈ--pulse-model-release-patternstring β regex of methods that should be modelled as release in Pulse π¦--pulse-model-return-first-argstring β regex of methods modelled as returning the first argument in Pulse, in terms of the source language semantics. languages supported: Java, C, Objective-C β¨--pulse-model-return-nonnullstring β regex of methods modelled as returning non-null in Pulse π--pulse-model-return-nonnull-list+string β same thing (methods modelled as returning non-null in Pulse), as a list π--pulse-model-return-nullablestring β regex of methods modelled as returning nullable values in Pulse π--pulse-model-return-nullable-list+string β the list version of methods modelled as returning nullable values in Pulse β--pulse-model-return-thisstring β regex of methods modelled as returning thethisorselfargument of an instance method in Pulse. languages supported: Java, Objective-C π main character returns herself, honestly.--pulse-model-returns-copy-patternstring β regex of methods modelled as creating copies in Pulse π--pulse-model-skip-patternstring β regex of methods modelled as "skip" in Pulse. not today, bestie π--pulse-model-skip-pattern-list+string β the list version of methods modelled as "skip" in Pulse π--pulse-model-transfer-ownership+string β methods modelled as transferring memory ownership in Pulse. accepted formats aremethodornamespace::methodπ₯--pulse-model-unknown-pure+string β regex of methods modelled as unknown pure in Pulse πΈ--pulse-models-for-erlang+path β provide custom models for Erlang in JSON files or SQLite3. files must end with.jsonor.dbrespectively. if you hand it a directory path, the subdirectories get explored and names have to follow that same convention. SQLite3 format is preferable when you're providing a large number of models, because they'll be internally indexed by mfa π§
The JSON format 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 SQLite3 format is a DB with this schema:
CREATE TABLE models(
"mfa" TEXT,
"behavior" TEXT
);
mfaismodule:function/arity, e.g."mymod:f/0"behavioris a JSONBehavior(see above)
--no-pulse-nullsafe-report-npeβ deactivates reporting null dereference issues on files marked@Nullsafe. (conversely:--pulse-nullsafe-report-npe) π«Ά--pulse-nullsafe-report-npe-as-separate-issueβ activates reporting null dereference issues on files marked@Nullsafeas a separateNULLPTR_DEREFERENCE_IN_NULLSAFE_CLASSissue type. (conversely:--no-pulse-nullsafe-report-npe-as-separate-issue) β¨--pulse-over-approximate-reasoningβ activates[EXPERIMENTAL]over-approximate reasoning layered on top of the under-approximate, disjunctive reasoning of Pulse. (conversely:--no-pulse-over-approximate-reasoning) π₯ she's experimental, she's extra, she's doing the most.--pulse-recency-limitint β max number of array elements and structure fields to keep track of for a given address π literally a memory budget for your memory budget.--pulse-retain-cycle-blocklist-patternstring β skip reporting retain cycles that 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 π--pulse-skip-proceduresregex β regex of procedures that Pulse should not analyze. bye bestie π--pulse-specialization-iteration-limitint β max number of iterative summary specializations at each call site π¦--pulse-specialization-limitint β max number of summary specializations by procedure π--pulse-taint-config+path β path to a taint analysis config file, or a directory full of 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πΈ
If you give it a directory path, the config files must have the .json extension. any other file gets ignored, no cap. subdirectories will be explored and must follow the same convention β¨
--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 π--no-pulse-taint-follow-field-accessesβ deactivates specifying whether taint analysis should follow field accesses when propagating taints. (conversely:--pulse-taint-follow-field-accesses) π«Ά--pulse-taint-opaque-files+path β specify files that should be treated as opaque for taint analysis, making sure that procedures belonging to these files are always free of any potential taint flows π like, nothing to see here, move along.--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 the 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 π
this policy is always enabled:
{ "short_description": "...",
"taint_flows": [{ "source_kinds": ["Simple"],
"sink_kinds": ["Simple"],
"sanitizer_kinds": ["Simple"] }]
}
--pulse-taint-propagatorsjson β quick way to specify simple propagators as JSON objects. see--pulse-taint-sourcesfor the fields format documentation β¨--pulse-taint-sanitizersjson β quick way to specify simple sanitizers as JSON objects. see--pulse-taint-sourcesfor the fields format documentation π§Ό--pulse-taint-short-tracesβ activates cutting 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)--pulse-taint-sinksjson β quick way to specify simple sinks as JSON objects. see--pulse-taint-sourcesfor the fields format documentation π³οΈ--pulse-taint-skip-sourcesβ activates skipping the analysis of methods declared as sources in the taint. (conversely:--no-pulse-taint-skip-sources) π--pulse-taint-sources jsonβ okay so this one is a big one, bestie. Together with--pulse-taint-sanitizers,--pulse-taint-sinks,--pulse-taint-policies, and--pulse-taint-data-flow-kinds, you use it to specify taint properties. And the JSON format of sources also applies to sinks and sanitizers, iykyk π . It's a list of objects, and each object has one of these combos of fields 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
Every 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.
--pulse-widen-threshold intβ stop exploring new paths after int loop iterations β¨--python-async-function-naming-convention-regex +stringβ consider any function call that matches as returning an unawaited value--python-async-method-naming-convention-regex +stringβ consider any method call that matches as returning an unawaited value--python-decorator-modelled-as-await-async +stringβ any decorator that should be modelled as theawait_asyncdecorator.
π§΅ RACERD CHECKER OPTIONS π§΅
--racerd-always-report-javaβ activates: every Java class analysed is treated as if it were annotated as@ThreadSafe. (Conversely:--no-racerd-always-report-java)--racerd-guardedbyβ activates: check@GuardedByannotations with RacerD (Conversely:--no-racerd-guardedby)--racerd-ignore-classes +stringβ any method in a class specified here will be ignored by RacerD.--threadsafe-aliases jsonβ specify custom annotations that should be considered aliases of@ThreadSafe
πΈ SIOF CHECKER OPTIONS πΈ
--siof-check-iostreamsβ activates: do not assume that iostreams (cout,cerr, ...) are always initialized. The default is to assume they are always initialized to avoid false positives. However, if your program compiles against a recent libstdc++ then it is safe to turn this option on. (Conversely:--no-siof-check-iostreams)--siof-safe-methods +stringβ methods that are SIOF-safe;"foo::bar"will match"foo::bar()","foo<int>::bar()", etc. (can be specified multiple times)
π ENVIRONMENT π
INFER_ARGS, INFERCONFIG, INFER_STRICT_MODE
See the ENVIRONMENT section in the manual of infer(1). π
π FILES π
.inferconfig
See the FILES section in the manual of infer(1). π
π SEE ALSO π
okay that's the whole page bestie, you ate that π β¨ go forth and analyze, no cap π¦
v1.3.0-unknown Β· 2026-10-27 β that's the version and the date, keep 'em safe in your notes ππ
π¦ 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