[website] make docs URLs absolute

Summary:
A bug in docusaurus makes relative URLs fail depending on how the page
was accessed, because the URL of a page in docs/ will end in / if
accessed directly or via hyperlink, but that / will be omitted when
clicking on the sidebar. The final / makes all the difference when
interpreting relative URLs so relative URLs are essentially broken.

See https://github.com/facebook/docusaurus/issues/2832 for more details.

This changes URL generation to generate URLs /docs/next/..., and
manually substitute relative URLs that had been written by hand.

Also fix a few other things about outdated links/comments.

Finally, `make doc-publish`.

Reviewed By: dulmarod

Differential Revision: D22117187

fbshipit-source-id: 32e2ba7e1
master
Jules Villard 5 years ago committed by Facebook GitHub Bot
parent a49b094e0c
commit c4e3f51d83

@ -1,7 +1,7 @@
For C/C++ and Objective-C languages, we provide a linters framework. These are For C/C++ and Objective-C languages, we provide a linters framework. These are
checks about the syntax of the program; it could be about a property, or about checks about the syntax of the program; it could be about a property, or about
code inside one method, or that a class or method have certain properties. We code inside one method, or that a class or method have certain properties. We
provide [a few checks](/docs/linters-bug-types) and we have developed a domain provide [a few checks by default](#list-of-issue-types) and we have developed a domain
specific language (DSL) to make it easier to write checks. specific language (DSL) to make it easier to write checks.
## AL: A declarative language for writing linters in Infer ## AL: A declarative language for writing linters in Infer
@ -686,4 +686,4 @@ infer run --linters -- clang -c Test.m
``` ```
There are a few other command-line options that are useful for using or There are a few other command-line options that are useful for using or
developing new linters in Infer. Read about them in the [`infer capture` manual](man-pages). developing new linters in Infer. Read about them in the [`infer capture` manual](/docs/next/man-infer-capture).

@ -21,12 +21,12 @@ The total cost of the node is the scalar product of these two vectors. Then, the
At a high level, the analysis has three steps: At a high level, the analysis has three steps:
- Choose control variables that allude to "how many times a loop may iterate". - Choose control variables that allude to "how many times a loop may iterate".
- Get abstract ranges of the control variables from [InferBO](checker-bufferoverrun) (a numerical analysis that infers symbolic intervals) - Get abstract ranges of the control variables from [InferBO](/docs/next/checker-bufferoverrun) (a numerical analysis that infers symbolic intervals)
- Construct complexity polynomials for loops and functions by via a constraint solving algorithm. - Construct complexity polynomials for loops and functions by via a constraint solving algorithm.
## Examples ## Examples
Infers cost analysis statically estimates the execution cost of a Infers cost analysis statically estimates the execution cost of a
program without running the code. For instance, assume that we had the program without running the code. For instance, assume that we had the
@ -49,7 +49,7 @@ void loop(ArrayList<Integer> list){
} }
``` ```
where `foo` has a linear cost in its parameter, then Infer automatically detects that the complexity of loop has increased from `O(|list|)` to `O(|list|^2)` and then reports an [`EXECUTION_TIME_COMPLEXITY_INCREASE`](execution_time_complexity_increase) issue. where `foo` has a linear cost in its parameter, then Infer automatically detects that the complexity of loop has increased from `O(|list|)` to `O(|list|^2)` and then reports an [`EXECUTION_TIME_COMPLEXITY_INCREASE`](/docs/next/all-issue-types#execution_time_complexity_increase) issue.
@ -59,13 +59,13 @@ Differential cost analysis in action:
- first run infer's cost analysis on `File.java` and rename `costs-report.json` (which is in `/infer-out`) to `previous-costs-report.json` - first run infer's cost analysis on `File.java` and rename `costs-report.json` (which is in `/infer-out`) to `previous-costs-report.json`
- modify the function as shown above - modify the function as shown above
- re-run infer on `File.java` and rename `costs-report.json` to `current-costs-report.json` - re-run infer on `File.java` and rename `costs-report.json` to `current-costs-report.json`
- run `infer reportdiff --costs-current current-costs-report.json --costs-previous current-costs-report`. - run `infer reportdiff --costs-current current-costs-report.json --costs-previous current-costs-report`.
- Inspect `infer-out/differential/introduced.json` to see the newly found complexity increase issue(s). - Inspect `infer-out/differential/introduced.json` to see the newly found complexity increase issue(s).
## Limitations ## Limitations
There are a number of known limitations to the design of the static cost analysis: There are a number of known limitations to the design of the static cost analysis:
- InferBo's intervals are limited to affine expressions, not full-blown polynomials. Hence, we can automatically infer bounds involving square roots. - InferBo's intervals are limited to affine expressions, not full-blown polynomials. Hence, we can automatically infer bounds involving square roots.

@ -1,6 +1,6 @@
RacerD finds data races in your C++ and Java code. This page gives a more in-depth RacerD finds data races in your C++ and Java code. This page gives a more in-depth
explanation of how the analysis works *for Java code*, but may be less complete than the explanation of how the analysis works *for Java code*, but may be less complete than the
[Thread Safety Violation bug description page](#thread-safety-violation). [Thread Safety Violation bug description page](/docs/next/all-issue-types#thread_safety_violation).
To run the analysis, you can use plain `infer` (to run RacerD along with other To run the analysis, you can use plain `infer` (to run RacerD along with other
analyses that are run by default) or `infer --racerd-only` (to run only RacerD). analyses that are run by default) or `infer --racerd-only` (to run only RacerD).
@ -295,7 +295,7 @@ synchronized void setFWithLock() {
Unlike the other annotations shown here, this one lives in Unlike the other annotations shown here, this one lives in
[Android](https://developer.android.com/reference/android/support/annotation/VisibleForTesting.html). [Android](https://developer.android.com/reference/android/support/annotation/VisibleForTesting.html).
## <a name="interprocedural"></a> Interprocedural Reasoning ## Interprocedural Reasoning
An important feature of RacerD is that it finds races by analyzing not just one An important feature of RacerD is that it finds races by analyzing not just one
file or class, but by looking at memory accesses that occur after going through file or class, but by looking at memory accesses that occur after going through
@ -396,7 +396,7 @@ Facebook engineers.
[A separate blog post looked at 100 recent data race fixes](https://code.facebook.com/posts/1537144479682247/finding-inter-procedural-bugs-at-scale-with-infer-static-analyzer/) [A separate blog post looked at 100 recent data race fixes](https://code.facebook.com/posts/1537144479682247/finding-inter-procedural-bugs-at-scale-with-infer-static-analyzer/)
in Infer's deployment in various bug categories, and for data races observed in Infer's deployment in various bug categories, and for data races observed
that 53 of them were inter-file (and thus involving multiple classes). that 53 of them were inter-file (and thus involving multiple classes).
[See above](racerd#interprocedural) for an example of RacerD's interprocedural [See above](#interprocedural-reasoning) for an example of RacerD's interprocedural
capabilities. capabilities.
One reaction to the challenge of developing effective static race detectors has One reaction to the challenge of developing effective static race detectors has
@ -408,14 +408,7 @@ Rust, and the use/checking of @GuardedBy annotations in
[Java](https://homes.cs.washington.edu/~mernst/pubs/locking-semantics-nfm2016.pdf) [Java](https://homes.cs.washington.edu/~mernst/pubs/locking-semantics-nfm2016.pdf)
including in including in
[Google's Error Prone analyzer](https://github.com/google/error-prone/blob/master/docs/bugpattern/GuardedBy.md). [Google's Error Prone analyzer](https://github.com/google/error-prone/blob/master/docs/bugpattern/GuardedBy.md).
When lock annotations are present they make the analyzer's life easier, and we When lock annotations are present they make the analyzer's life easier. It is possible to have a very effective race analysis without decreeing
have
[GuardedBy checking as part of Infer](checkers-bug-types#UNSAFE_GUARDEDBY_ACCESS)
(though separate from the race detector). Our GuardedBy checker can find some
bugs that RacerD does not (see
[this example on anonymous inner classes](checkers-bug-types#anonymous_inner)),
but the race detector finds a greater number because it can work on un-annotated
code. It is possible to have a very effective race analysis without decreeing
that such annotations must be present. This was essential for our deployment, that such annotations must be present. This was essential for our deployment,
since _requiring_ lock annotations would have been a show stopper for converting since _requiring_ lock annotations would have been a show stopper for converting
many thousands of lines of code to a concurrent context. We believe that this many thousands of lines of code to a concurrent context. We believe that this

@ -3,4 +3,4 @@ with `@ThreadSafe` from a thread-safe context (e.g., code that uses locks or is
marked `@ThreadSafe`). The fix is to add the `@ThreadSafe` annotation to the marked `@ThreadSafe`). The fix is to add the `@ThreadSafe` annotation to the
interface or to the interface method. For background on why these annotations interface or to the interface method. For background on why these annotations
are needed, see the detailed explanation are needed, see the detailed explanation
[here](racerd#interface-not-thread-safe). [here](/docs/next/checker-racerd#interface-not-thread-safe).

@ -1,11 +1,8 @@
This warning indicates a potential data race in Java. The analyser is called This warning indicates a potential data race in Java. The analyser is called
RacerD and this section gives brief but a mostly complete description of its RacerD and this section gives brief but a mostly complete description of its
features. See the [RacerD page](/docs/racerd) for more in-depth information and features. See the [RacerD page](/docs/next/checker-racerd) for more in-depth information and
examples. examples.
NB this warning **is not related to @GuardedBy** and not issued by the same
analysis.
### Thread-safety: What is a data race ### Thread-safety: What is a data race
Here a data race is a pair of accesses to the same member field such that: Here a data race is a pair of accesses to the same member field such that:

@ -9,7 +9,9 @@ open! IStd
module F = Format module F = Format
module L = Logging module L = Logging
let mk_markdown_docs_path ~website_root ~basename = website_root ^/ "docs" ^/ basename ^ ".md" let docs_dir = "docs"
let mk_markdown_docs_path ~website_root ~basename = website_root ^/ docs_dir ^/ basename ^ ".md"
let escape_double_quotes s = String.substr_replace_all s ~pattern:"\"" ~with_:"\\\"" let escape_double_quotes s = String.substr_replace_all s ~pattern:"\"" ~with_:"\\\""
@ -19,8 +21,8 @@ let basename_checker_prefix = "checker-"
let basename_of_checker {Checker.id} = basename_checker_prefix ^ id let basename_of_checker {Checker.id} = basename_checker_prefix ^ id
let url_fragment_of_issue_type unique_id = let abs_url_of_issue_type unique_id =
Printf.sprintf "%s#%s" all_issues_basename (String.lowercase unique_id) Printf.sprintf "/%s/next/%s#%s" docs_dir all_issues_basename (String.lowercase unique_id)
let get_checker_web_documentation (checker : Checker.config) = let get_checker_web_documentation (checker : Checker.config) =
@ -41,7 +43,8 @@ let markdown_one_issue f (issue_type : IssueType.t) =
"Checker %s can report user-facing issue %s but is not of type UserFacing in \ "Checker %s can report user-facing issue %s but is not of type UserFacing in \
src/base/Checker.ml. Please fix!" src/base/Checker.ml. Please fix!"
checker_config.id issue_type.unique_id ; checker_config.id issue_type.unique_id ;
F.fprintf f "Reported as \"%s\" by [%s](%s.md).@\n@\n" issue_type.hum checker_config.id F.fprintf f "Reported as \"%s\" by [%s](/%s/next/%s).@\n@\n" issue_type.hum checker_config.id
docs_dir
(basename_of_checker checker_config) ; (basename_of_checker checker_config) ;
match issue_type.user_documentation with match issue_type.user_documentation with
| None -> | None ->
@ -272,7 +275,7 @@ let pp_checker_issue_types f checker =
Checker.equal issue_checker checker ) Checker.equal issue_checker checker )
in in
let pp_issue f {IssueType.unique_id} = let pp_issue f {IssueType.unique_id} =
F.fprintf f "- [%s](%s)@\n" unique_id (url_fragment_of_issue_type unique_id) F.fprintf f "- [%s](%s)@\n" unique_id (abs_url_of_issue_type unique_id)
in in
List.iter checker_issues ~f:(pp_issue f) List.iter checker_issues ~f:(pp_issue f)
@ -304,7 +307,7 @@ let delete_checkers_website ~website_root =
if String.is_prefix ~prefix:basename_checker_prefix (Filename.basename path) then ( if String.is_prefix ~prefix:basename_checker_prefix (Filename.basename path) then (
L.progress "deleting '%s'@\n" path ; L.progress "deleting '%s'@\n" path ;
Unix.unlink path ) ) Unix.unlink path ) )
(website_root ^/ "docs") (website_root ^/ docs_dir)
let all_checkers_website ~website_root = let all_checkers_website ~website_root =

@ -22,6 +22,6 @@ val show_issue_types : IssueType.t list -> unit
val write_website : website_root:string -> unit val write_website : website_root:string -> unit
(** generate files for the fbinfer.com website *) (** generate files for the fbinfer.com website *)
val url_fragment_of_issue_type : string -> string val abs_url_of_issue_type : string -> string
(** given an issue type unique ID, return the URL fragment relative to the website documentation, (** given an issue type unique ID, return the URL relative to the root of the website, e.g.
e.g. [url_fragment_of_issue_type "NULL_DEREFERENCE"] is ["all-issue-types#null_dereference"] *) [abs_url_of_issue_type "NULL_DEREFERENCE"] is ["/docs/all-issue-types#null_dereference"] *)

@ -28,11 +28,11 @@ let pp_xml_issue f (issue : Jsonbug_t.jsonbug) =
in in
F.fprintf f F.fprintf f
{|<file name="%s"> {|<file name="%s">
<violation begincolumn="%d" beginline="%d" endcolumn="%d" endline="%d" class="%s" method="%s" package="%s" priority="1" rule="%s" ruleset="Infer Rules" externalinfourl="https://fbinfer.com/docs/next/%s">%s</violation> <violation begincolumn="%d" beginline="%d" endcolumn="%d" endline="%d" class="%s" method="%s" package="%s" priority="1" rule="%s" ruleset="Infer Rules" externalinfourl="https://fbinfer.com/%s">%s</violation>
</file>|} </file>|}
issue.file (max issue.column 0) issue.line (max issue.column 0) (issue.line + 1) java_class_name issue.file (max issue.column 0) issue.line (max issue.column 0) (issue.line + 1) java_class_name
method_name java_package issue.bug_type method_name java_package issue.bug_type
(Help.url_fragment_of_issue_type issue.bug_type) (Help.abs_url_of_issue_type issue.bug_type)
issue.qualifier issue.qualifier

@ -1,5 +1,5 @@
<pmd version="5.4.1" date=""> <pmd version="5.4.1" date="">
<file name="hello.c"> <file name="hello.c">
<violation begincolumn="3" beginline="12" endcolumn="3" endline="13" class="" method="test" package="" priority="1" rule="NULL_DEREFERENCE" ruleset="Infer Rules" externalinfourl="https://fbinfer.com/docs/next/all-issue-types#null_dereference">pointer `s` last assigned on line 11 could be null and is dereferenced at line 12, column 3.</violation> <violation begincolumn="3" beginline="12" endcolumn="3" endline="13" class="" method="test" package="" priority="1" rule="NULL_DEREFERENCE" ruleset="Infer Rules" externalinfourl="https://fbinfer.com//docs/next/all-issue-types#null_dereference">pointer `s` last assigned on line 11 could be null and is dereferenced at line 12, column 3.</violation>
</file> </file>
</pmd> </pmd>

@ -5,10 +5,11 @@
"all-issue-types", "checker-annotation-reachability", "all-issue-types", "checker-annotation-reachability",
"checker-biabduction", "checker-bufferoverrun", "checker-cost", "checker-biabduction", "checker-bufferoverrun", "checker-cost",
"checker-eradicate", "checker-fragment-retains-view", "checker-eradicate", "checker-fragment-retains-view",
"checker-immutable-cast", "checker-inefficient-keyset-iterator", "checker-immutable-cast", "checker-impurity",
"checker-linters", "checker-litho-required-props", "checker-liveness", "checker-inefficient-keyset-iterator", "checker-linters",
"checker-litho-required-props", "checker-liveness",
"checker-loop-hoisting", "checker-printf-args", "checker-pulse", "checker-loop-hoisting", "checker-printf-args", "checker-pulse",
"checker-quandary", "checker-racerd", "checker-siof", "checker-purity", "checker-quandary", "checker-racerd", "checker-siof",
"checker-self-in-block", "checker-starvation", "checker-topl", "checker-self-in-block", "checker-starvation", "checker-topl",
"checker-uninit" "checker-uninit"
] ]

@ -7,7 +7,7 @@ Here is an overview of the issue types currently reported by Infer. Currently ou
## ASSIGN_POINTER_WARNING ## ASSIGN_POINTER_WARNING
Reported as "Assign Pointer Warning" by [linters](checker-linters.md). Reported as "Assign Pointer Warning" by [linters](/docs/next/checker-linters).
This check fires when a pointer to an Obj-C object is tagged with an `assign` This check fires when a pointer to an Obj-C object is tagged with an `assign`
property (similar to the `-Warc-unsafe-retained-assign` compiler flag). Not property (similar to the `-Warc-unsafe-retained-assign` compiler flag). Not
@ -16,7 +16,7 @@ and use a dangling pointer.
## BAD_POINTER_COMPARISON ## BAD_POINTER_COMPARISON
Reported as "Bad Pointer Comparison" by [linters](checker-linters.md). Reported as "Bad Pointer Comparison" by [linters](/docs/next/checker-linters).
Infer reports these warnings in Objective-C when a boxed primitive type such as Infer reports these warnings in Objective-C when a boxed primitive type such as
`NSNumber *` is coerced to a boolean in a comparison. For example, consider the `NSNumber *` is coerced to a boolean in a comparison. For example, consider the
@ -35,7 +35,7 @@ compare `n` to `nil` or call an accessor to clarify her intention.
## BUFFER_OVERRUN_L1 ## BUFFER_OVERRUN_L1
Reported as "Buffer Overrun L1" by [bufferoverrun](checker-bufferoverrun.md). Reported as "Buffer Overrun L1" by [bufferoverrun](/docs/next/checker-bufferoverrun).
Buffer overrun reports fall into several "buckets" corresponding to the expected precision of the Buffer overrun reports fall into several "buckets" corresponding to the expected precision of the
report. The higher the number, the more likely it is to be a false positive. report. The higher the number, the more likely it is to be a false positive.
@ -84,47 +84,47 @@ Other than them, there are some specific-purpose buffer overrun reports as follo
## BUFFER_OVERRUN_L2 ## BUFFER_OVERRUN_L2
Reported as "Buffer Overrun L2" by [bufferoverrun](checker-bufferoverrun.md). Reported as "Buffer Overrun L2" by [bufferoverrun](/docs/next/checker-bufferoverrun).
See [BUFFER_OVERRUN_L1](#buffer_overrun_l1) See [BUFFER_OVERRUN_L1](#buffer_overrun_l1)
## BUFFER_OVERRUN_L3 ## BUFFER_OVERRUN_L3
Reported as "Buffer Overrun L3" by [bufferoverrun](checker-bufferoverrun.md). Reported as "Buffer Overrun L3" by [bufferoverrun](/docs/next/checker-bufferoverrun).
See [BUFFER_OVERRUN_L1](#buffer_overrun_l1) See [BUFFER_OVERRUN_L1](#buffer_overrun_l1)
## BUFFER_OVERRUN_L4 ## BUFFER_OVERRUN_L4
Reported as "Buffer Overrun L4" by [bufferoverrun](checker-bufferoverrun.md). Reported as "Buffer Overrun L4" by [bufferoverrun](/docs/next/checker-bufferoverrun).
See [BUFFER_OVERRUN_L1](#buffer_overrun_l1) See [BUFFER_OVERRUN_L1](#buffer_overrun_l1)
## BUFFER_OVERRUN_L5 ## BUFFER_OVERRUN_L5
Reported as "Buffer Overrun L5" by [bufferoverrun](checker-bufferoverrun.md). Reported as "Buffer Overrun L5" by [bufferoverrun](/docs/next/checker-bufferoverrun).
See [BUFFER_OVERRUN_L1](#buffer_overrun_l1) See [BUFFER_OVERRUN_L1](#buffer_overrun_l1)
## BUFFER_OVERRUN_R2 ## BUFFER_OVERRUN_R2
Reported as "Buffer Overrun R2" by [bufferoverrun](checker-bufferoverrun.md). Reported as "Buffer Overrun R2" by [bufferoverrun](/docs/next/checker-bufferoverrun).
See [BUFFER_OVERRUN_L1](#buffer_overrun_l1) See [BUFFER_OVERRUN_L1](#buffer_overrun_l1)
## BUFFER_OVERRUN_S2 ## BUFFER_OVERRUN_S2
Reported as "Buffer Overrun S2" by [bufferoverrun](checker-bufferoverrun.md). Reported as "Buffer Overrun S2" by [bufferoverrun](/docs/next/checker-bufferoverrun).
See [BUFFER_OVERRUN_L1](#buffer_overrun_l1) See [BUFFER_OVERRUN_L1](#buffer_overrun_l1)
## BUFFER_OVERRUN_T1 ## BUFFER_OVERRUN_T1
Reported as "Buffer Overrun T1" by [bufferoverrun](checker-bufferoverrun.md). Reported as "Buffer Overrun T1" by [bufferoverrun](/docs/next/checker-bufferoverrun).
See [BUFFER_OVERRUN_L1](#buffer_overrun_l1) See [BUFFER_OVERRUN_L1](#buffer_overrun_l1)
## BUFFER_OVERRUN_U5 ## BUFFER_OVERRUN_U5
Reported as "Buffer Overrun U5" by [bufferoverrun](checker-bufferoverrun.md). Reported as "Buffer Overrun U5" by [bufferoverrun](/docs/next/checker-bufferoverrun).
See [BUFFER_OVERRUN_L1](#buffer_overrun_l1) See [BUFFER_OVERRUN_L1](#buffer_overrun_l1)
## CAPTURED_STRONG_SELF ## CAPTURED_STRONG_SELF
Reported as "Captured strongSelf" by [self-in-block](checker-self-in-block.md). Reported as "Captured strongSelf" by [self-in-block](/docs/next/checker-self-in-block).
This will happen in one of two cases generally: This will happen in one of two cases generally:
@ -137,7 +137,7 @@ This will happen in one of two cases generally:
## CHECKERS_ALLOCATES_MEMORY ## CHECKERS_ALLOCATES_MEMORY
Reported as "Allocates Memory" by [annotation-reachability](checker-annotation-reachability.md). Reported as "Allocates Memory" by [annotation-reachability](/docs/next/checker-annotation-reachability).
A method annotated with `@NoAllocation` transitively calls `new`. A method annotated with `@NoAllocation` transitively calls `new`.
@ -154,13 +154,13 @@ class C implements I {
## CHECKERS_ANNOTATION_REACHABILITY_ERROR ## CHECKERS_ANNOTATION_REACHABILITY_ERROR
Reported as "Annotation Reachability Error" by [annotation-reachability](checker-annotation-reachability.md). Reported as "Annotation Reachability Error" by [annotation-reachability](/docs/next/checker-annotation-reachability).
A method annotated with an annotation `@A` transitively calls a method annotated `@B` where the combination of annotations is forbidden (for example, `@UiThread` calling `@WorkerThread`). A method annotated with an annotation `@A` transitively calls a method annotated `@B` where the combination of annotations is forbidden (for example, `@UiThread` calling `@WorkerThread`).
## CHECKERS_CALLS_EXPENSIVE_METHOD ## CHECKERS_CALLS_EXPENSIVE_METHOD
Reported as "Expensive Method Called" by [annotation-reachability](checker-annotation-reachability.md). Reported as "Expensive Method Called" by [annotation-reachability](/docs/next/checker-annotation-reachability).
A method annotated with `@PerformanceCritical` transitively calls a method annotated `@Expensive`. A method annotated with `@PerformanceCritical` transitively calls a method annotated `@Expensive`.
@ -180,7 +180,7 @@ class C {
## CHECKERS_EXPENSIVE_OVERRIDES_UNANNOTATED ## CHECKERS_EXPENSIVE_OVERRIDES_UNANNOTATED
Reported as "Expensive Overrides Unannotated" by [annotation-reachability](checker-annotation-reachability.md). Reported as "Expensive Overrides Unannotated" by [annotation-reachability](/docs/next/checker-annotation-reachability).
A method annotated with `@Expensive` overrides an un-annotated method. A method annotated with `@Expensive` overrides an un-annotated method.
@ -199,7 +199,7 @@ class A implements I {
## CHECKERS_FRAGMENT_RETAINS_VIEW ## CHECKERS_FRAGMENT_RETAINS_VIEW
Reported as "Fragment Retains View" by [fragment-retains-view](checker-fragment-retains-view.md). Reported as "Fragment Retains View" by [fragment-retains-view](/docs/next/checker-fragment-retains-view).
This error type is Android-specific. It fires when a `Fragment` type fails to This error type is Android-specific. It fires when a `Fragment` type fails to
nullify one or more of its declared `View` fields in `onDestroyView`. In nullify one or more of its declared `View` fields in `onDestroyView`. In
@ -213,7 +213,7 @@ Action: Nullify the `View` in question in `onDestroyView`.
## CHECKERS_IMMUTABLE_CAST ## CHECKERS_IMMUTABLE_CAST
Reported as "Checkers Immutable Cast" by [immutable-cast](checker-immutable-cast.md). Reported as "Checkers Immutable Cast" by [immutable-cast](/docs/next/checker-immutable-cast).
This error type is reported in Java. It fires when an immutable collection is This error type is reported in Java. It fires when an immutable collection is
returned from a method whose type is mutable. returned from a method whose type is mutable.
@ -233,7 +233,7 @@ collection so that it can be modified.
## CHECKERS_PRINTF_ARGS ## CHECKERS_PRINTF_ARGS
Reported as "Checkers Printf Args" by [printf-args](checker-printf-args.md). Reported as "Checkers Printf Args" by [printf-args](/docs/next/checker-printf-args).
This error is reported when the argument types to a `printf` method do not match the format string. This error is reported when the argument types to a `printf` method do not match the format string.
@ -247,38 +247,38 @@ Action: fix the mismatch between format string and argument types.
## COMPONENT_FACTORY_FUNCTION ## COMPONENT_FACTORY_FUNCTION
Reported as "Component Factory Function" by [linters](checker-linters.md). Reported as "Component Factory Function" by [linters](/docs/next/checker-linters).
## COMPONENT_INITIALIZER_WITH_SIDE_EFFECTS ## COMPONENT_INITIALIZER_WITH_SIDE_EFFECTS
Reported as "Component Initializer With Side Effects" by [linters](checker-linters.md). Reported as "Component Initializer With Side Effects" by [linters](/docs/next/checker-linters).
## COMPONENT_WITH_MULTIPLE_FACTORY_METHODS ## COMPONENT_WITH_MULTIPLE_FACTORY_METHODS
Reported as "Component With Multiple Factory Methods" by [linters](checker-linters.md). Reported as "Component With Multiple Factory Methods" by [linters](/docs/next/checker-linters).
## COMPONENT_WITH_UNCONVENTIONAL_SUPERCLASS ## COMPONENT_WITH_UNCONVENTIONAL_SUPERCLASS
Reported as "Component With Unconventional Superclass" by [linters](checker-linters.md). Reported as "Component With Unconventional Superclass" by [linters](/docs/next/checker-linters).
[Doc in ComponentKit page](http://componentkit.org/docs/never-subclass-components) [Doc in ComponentKit page](http://componentkit.org/docs/never-subclass-components)
## CONDITION_ALWAYS_FALSE ## CONDITION_ALWAYS_FALSE
Reported as "Condition Always False" by [bufferoverrun](checker-bufferoverrun.md). Reported as "Condition Always False" by [bufferoverrun](/docs/next/checker-bufferoverrun).
A condition expression is **always** evaluated to false. A condition expression is **always** evaluated to false.
## CONDITION_ALWAYS_TRUE ## CONDITION_ALWAYS_TRUE
Reported as "Condition Always True" by [bufferoverrun](checker-bufferoverrun.md). Reported as "Condition Always True" by [bufferoverrun](/docs/next/checker-bufferoverrun).
A condition expression is **always** evaluated to true. A condition expression is **always** evaluated to true.
## CONSTANT_ADDRESS_DEREFERENCE ## CONSTANT_ADDRESS_DEREFERENCE
Reported as "Constant Address Dereference" by [pulse](checker-pulse.md). Reported as "Constant Address Dereference" by [pulse](/docs/next/checker-pulse).
This is reported when an address obtained via a non-zero constant is This is reported when an address obtained via a non-zero constant is
dereferenced. If the address is zero then dereferenced. If the address is zero then
@ -289,17 +289,17 @@ type.
## CREATE_INTENT_FROM_URI ## CREATE_INTENT_FROM_URI
Reported as "Create Intent From Uri" by [quandary](checker-quandary.md). Reported as "Create Intent From Uri" by [quandary](/docs/next/checker-quandary).
Create an intent/start a component using a (possibly user-controlled) URI. may or may not be an issue depending on where the URI comes from. Create an intent/start a component using a (possibly user-controlled) URI. may or may not be an issue depending on where the URI comes from.
## CROSS_SITE_SCRIPTING ## CROSS_SITE_SCRIPTING
Reported as "Cross Site Scripting" by [quandary](checker-quandary.md). Reported as "Cross Site Scripting" by [quandary](/docs/next/checker-quandary).
Untrusted data flows into HTML; XSS risk. Untrusted data flows into HTML; XSS risk.
## CXX_REFERENCE_CAPTURED_IN_OBJC_BLOCK ## CXX_REFERENCE_CAPTURED_IN_OBJC_BLOCK
Reported as "Cxx Reference Captured In Objc Block" by [linters](checker-linters.md). Reported as "Cxx Reference Captured In Objc Block" by [linters](/docs/next/checker-linters).
With this check, Infer detects C++ references captured in a block. Doing this is With this check, Infer detects C++ references captured in a block. Doing this is
almost always wrong. The reason is that C++ references are not managed pointers almost always wrong. The reason is that C++ references are not managed pointers
@ -318,7 +318,7 @@ const int copied_v = v;
## DEADLOCK ## DEADLOCK
Reported as "Deadlock" by [starvation](checker-starvation.md). Reported as "Deadlock" by [starvation](/docs/next/checker-starvation).
This error is currently reported in Java. A deadlock occurs when two distinct This error is currently reported in Java. A deadlock occurs when two distinct
threads try to acquire two locks in reverse orders. The following code threads try to acquire two locks in reverse orders. The following code
@ -383,14 +383,14 @@ To suppress reports of deadlocks in a method `m()` use the
## DEAD_STORE ## DEAD_STORE
Reported as "Dead Store" by [liveness](checker-liveness.md). Reported as "Dead Store" by [liveness](/docs/next/checker-liveness).
This error is reported in C++. It fires when the value assigned to a variables This error is reported in C++. It fires when the value assigned to a variables
is never used (e.g., `int i = 1; i = 2; return i;`). is never used (e.g., `int i = 1; i = 2; return i;`).
## DIRECT_ATOMIC_PROPERTY_ACCESS ## DIRECT_ATOMIC_PROPERTY_ACCESS
Reported as "Direct Atomic Property Access" by [linters](checker-linters.md). Reported as "Direct Atomic Property Access" by [linters](/docs/next/checker-linters).
This check warns you when you are accessing an atomic property directly with an This check warns you when you are accessing an atomic property directly with an
ivar. This makes the atomic property not atomic anymore. So potentially you may ivar. This makes the atomic property not atomic anymore. So potentially you may
@ -400,7 +400,7 @@ To fix the problem you need to access properties with their getter or setter.
## DISCOURAGED_WEAK_PROPERTY_CUSTOM_SETTER ## DISCOURAGED_WEAK_PROPERTY_CUSTOM_SETTER
Reported as "Discouraged Weak Property Custom Setter" by [linters](checker-linters.md). Reported as "Discouraged Weak Property Custom Setter" by [linters](/docs/next/checker-linters).
This check warns you when you have a custom setter for a weak property. When This check warns you when you have a custom setter for a weak property. When
compiled with Automatic Reference Counting (ARC, `-fobj-arc`) ARC may set the compiled with Automatic Reference Counting (ARC, `-fobj-arc`) ARC may set the
@ -469,7 +469,7 @@ Note that the custom setter was only invoked once.
## EMPTY_VECTOR_ACCESS ## EMPTY_VECTOR_ACCESS
Reported as "Empty Vector Access" by [biabduction](checker-biabduction.md). Reported as "Empty Vector Access" by [biabduction](/docs/next/checker-biabduction).
This error type is reported only in C++, in versions >= C++11. This error type is reported only in C++, in versions >= C++11.
@ -486,7 +486,7 @@ int foo(){
## ERADICATE_CONDITION_REDUNDANT ## ERADICATE_CONDITION_REDUNDANT
Reported as "Condition Redundant" by [eradicate](checker-eradicate.md). Reported as "Condition Redundant" by [eradicate](/docs/next/checker-eradicate).
This report is inactive by default. Condition (x != null) or (x == null) when x This report is inactive by default. Condition (x != null) or (x == null) when x
cannot be null: the first condition is always true and the second is always cannot be null: the first condition is always true and the second is always
@ -513,7 +513,7 @@ relevant. If the annotations are correct, you can remove the redundant case.
## ERADICATE_FIELD_NOT_INITIALIZED ## ERADICATE_FIELD_NOT_INITIALIZED
Reported as "Field Not Initialized" by [eradicate](checker-eradicate.md). Reported as "Field Not Initialized" by [eradicate](/docs/next/checker-eradicate).
The constructor does not initialize a field f which is not annotated with The constructor does not initialize a field f which is not annotated with
@Nullable @Nullable
@ -535,7 +535,7 @@ annotated with @Nullable.
## ERADICATE_FIELD_NOT_NULLABLE ## ERADICATE_FIELD_NOT_NULLABLE
Reported as "Field Not Nullable" by [eradicate](checker-eradicate.md). Reported as "Field Not Nullable" by [eradicate](/docs/next/checker-eradicate).
An assignment x.f = v where v could be null and field f is not annotated with An assignment x.f = v where v could be null and field f is not annotated with
@Nullable. @Nullable.
@ -560,7 +560,7 @@ values.
## ERADICATE_INCONSISTENT_SUBCLASS_PARAMETER_ANNOTATION ## ERADICATE_INCONSISTENT_SUBCLASS_PARAMETER_ANNOTATION
Reported as "Inconsistent Subclass Parameter Annotation" by [eradicate](checker-eradicate.md). Reported as "Inconsistent Subclass Parameter Annotation" by [eradicate](/docs/next/checker-eradicate).
A parameter of the overridden method is missing a @Nullable annotation present in the superclass. A parameter of the overridden method is missing a @Nullable annotation present in the superclass.
@ -605,7 +605,7 @@ public class Main {
## ERADICATE_INCONSISTENT_SUBCLASS_RETURN_ANNOTATION ## ERADICATE_INCONSISTENT_SUBCLASS_RETURN_ANNOTATION
Reported as "Inconsistent Subclass Return Annotation" by [eradicate](checker-eradicate.md). Reported as "Inconsistent Subclass Return Annotation" by [eradicate](/docs/next/checker-eradicate).
The return type of the overridden method is annotated @Nullable, but the The return type of the overridden method is annotated @Nullable, but the
corresponding method in the superclass is not. corresponding method in the superclass is not.
@ -649,7 +649,7 @@ class Main {
## ERADICATE_PARAMETER_NOT_NULLABLE ## ERADICATE_PARAMETER_NOT_NULLABLE
Reported as "Parameter Not Nullable" by [eradicate](checker-eradicate.md). Reported as "Parameter Not Nullable" by [eradicate](/docs/next/checker-eradicate).
Method call x.m(..., v, ...) where v can be null and the corresponding parameter Method call x.m(..., v, ...) where v can be null and the corresponding parameter
in method m is not annotated with @Nullable in method m is not annotated with @Nullable
@ -676,7 +676,7 @@ of method m, as that code must now deal with null values.
## ERADICATE_RETURN_NOT_NULLABLE ## ERADICATE_RETURN_NOT_NULLABLE
Reported as "Return Not Nullable" by [eradicate](checker-eradicate.md). Reported as "Return Not Nullable" by [eradicate](/docs/next/checker-eradicate).
Method m can return null, but the method's return type is not annotated with Method m can return null, but the method's return type is not annotated with
@Nullable @Nullable
@ -699,7 +699,7 @@ deal with null values.
## ERADICATE_RETURN_OVER_ANNOTATED ## ERADICATE_RETURN_OVER_ANNOTATED
Reported as "Return Over Annotated" by [eradicate](checker-eradicate.md). Reported as "Return Over Annotated" by [eradicate](/docs/next/checker-eradicate).
This report is inactive by default. Method m is annotated with @Nullable but the This report is inactive by default. Method m is annotated with @Nullable but the
method cannot return null method cannot return null
@ -724,7 +724,7 @@ annotation.
## EXECUTION_TIME_COMPLEXITY_INCREASE ## EXECUTION_TIME_COMPLEXITY_INCREASE
Reported as "Execution Time Complexity Increase" by [cost](checker-cost.md). Reported as "Execution Time Complexity Increase" by [cost](/docs/next/checker-cost).
Infer reports this issue when the execution time complexity of a Infer reports this issue when the execution time complexity of a
program increases in degree: e.g. from constant to linear or from program increases in degree: e.g. from constant to linear or from
@ -736,7 +736,7 @@ two runs of infer on a file.
## EXECUTION_TIME_COMPLEXITY_INCREASE_UI_THREAD ## EXECUTION_TIME_COMPLEXITY_INCREASE_UI_THREAD
Reported as "Execution Time Complexity Increase Ui Thread" by [cost](checker-cost.md). Reported as "Execution Time Complexity Increase Ui Thread" by [cost](/docs/next/checker-cost).
Infer reports this issue when the execution time complexity of the procedure increases in degree **and** the procedure runs on the UI (main) thread. Infer reports this issue when the execution time complexity of the procedure increases in degree **and** the procedure runs on the UI (main) thread.
@ -752,7 +752,7 @@ Infer considers a method as running on the UI thread whenever:
## EXECUTION_TIME_UNREACHABLE_AT_EXIT ## EXECUTION_TIME_UNREACHABLE_AT_EXIT
Reported as "Execution Time Unreachable At Exit" by [cost](checker-cost.md). Reported as "Execution Time Unreachable At Exit" by [cost](/docs/next/checker-cost).
This issue type indicates that the program's execution doesn't reach This issue type indicates that the program's execution doesn't reach
the exit node. Hence, we cannot compute a static bound for the the exit node. Hence, we cannot compute a static bound for the
@ -771,14 +771,41 @@ void infeasible_path_unreachable() {
} }
``` ```
## EXPENSIVE_LOOP_INVARIANT_CALL
Reported as "Expensive Loop Invariant Call" by [loop-hoisting](/docs/next/checker-loop-hoisting).
We report this issue type when a function is [loop-invariant](/docs/next/all-issue-types#invariant_call) and also expensive (i.e. at least has linear complexity as determined by the [cost](/docs/next/checker-cost) analysis).
```java
int incr(int x) {
return x + 1;
}
// incr will not be hoisted since it is cheap(constant time)
void foo_linear(int size) {
int x = 10;
for (int i = 0; i < size; i++) {
incr(x); // constant call, don't hoist
}
}
// call to foo_linear will be hoisted since it is expensive(linear in size).
void symbolic_expensive_hoist(int size) {
for (int i = 0; i < size; i++) {
foo_linear(size); // hoist
}
}
```
## EXPOSED_INSECURE_INTENT_HANDLING ## EXPOSED_INSECURE_INTENT_HANDLING
Reported as "Exposed Insecure Intent Handling" by [quandary](checker-quandary.md). Reported as "Exposed Insecure Intent Handling" by [quandary](/docs/next/checker-quandary).
Undocumented. Undocumented.
## GLOBAL_VARIABLE_INITIALIZED_WITH_FUNCTION_OR_METHOD_CALL ## GLOBAL_VARIABLE_INITIALIZED_WITH_FUNCTION_OR_METHOD_CALL
Reported as "Global Variable Initialized With Function Or Method Call" by [linters](checker-linters.md). Reported as "Global Variable Initialized With Function Or Method Call" by [linters](/docs/next/checker-linters).
This checker warns you when the initialization of global variable contain a This checker warns you when the initialization of global variable contain a
method or function call. The warning wants to make you aware that some functions method or function call. The warning wants to make you aware that some functions
@ -787,7 +814,7 @@ these initializations can slow down the start-up time of an app.
## GUARDEDBY_VIOLATION ## GUARDEDBY_VIOLATION
Reported as "GuardedBy Violation" by [racerd](checker-racerd.md). Reported as "GuardedBy Violation" by [racerd](/docs/next/checker-racerd).
A field annotated with `@GuardedBy` is being accessed by a call-chain that starts at a non-private method without synchronization. A field annotated with `@GuardedBy` is being accessed by a call-chain that starts at a non-private method without synchronization.
@ -806,9 +833,24 @@ class C {
Action: Protect the offending access by acquiring the lock indicated by the `@GuardedBy(...)`. Action: Protect the offending access by acquiring the lock indicated by the `@GuardedBy(...)`.
## IMPURE_FUNCTION
Reported as "Impure Function" by [impurity](/docs/next/checker-impurity).
This issue type indicates impure functions. For instance, below functions would be marked as impure:
```java
void makeAllZero_impure(ArrayList<Foo> list) {
Iterator<Foo> listIterator = list.iterator();
while (listIterator.hasNext()) {
Foo foo = listIterator.next();
foo.x = 0;
}
}
```
## INEFFICIENT_KEYSET_ITERATOR ## INEFFICIENT_KEYSET_ITERATOR
Reported as "Inefficient Keyset Iterator" by [inefficient-keyset-iterator](checker-inefficient-keyset-iterator.md). Reported as "Inefficient Keyset Iterator" by [inefficient-keyset-iterator](/docs/next/checker-inefficient-keyset-iterator).
This issue is raised when This issue is raised when
- iterating over a HashMap with `ketSet()` iterator - iterating over a HashMap with `ketSet()` iterator
@ -839,37 +881,37 @@ void efficient_loop_ok(HashMap<String, Integer> testMap) {
## INFERBO_ALLOC_IS_BIG ## INFERBO_ALLOC_IS_BIG
Reported as "Inferbo Alloc Is Big" by [bufferoverrun](checker-bufferoverrun.md). Reported as "Inferbo Alloc Is Big" by [bufferoverrun](/docs/next/checker-bufferoverrun).
`malloc` is passed a large constant value. `malloc` is passed a large constant value.
## INFERBO_ALLOC_IS_NEGATIVE ## INFERBO_ALLOC_IS_NEGATIVE
Reported as "Inferbo Alloc Is Negative" by [bufferoverrun](checker-bufferoverrun.md). Reported as "Inferbo Alloc Is Negative" by [bufferoverrun](/docs/next/checker-bufferoverrun).
`malloc` is called with a negative size. `malloc` is called with a negative size.
## INFERBO_ALLOC_IS_ZERO ## INFERBO_ALLOC_IS_ZERO
Reported as "Inferbo Alloc Is Zero" by [bufferoverrun](checker-bufferoverrun.md). Reported as "Inferbo Alloc Is Zero" by [bufferoverrun](/docs/next/checker-bufferoverrun).
`malloc` is called with a zero size. `malloc` is called with a zero size.
## INFERBO_ALLOC_MAY_BE_BIG ## INFERBO_ALLOC_MAY_BE_BIG
Reported as "Inferbo Alloc May Be Big" by [bufferoverrun](checker-bufferoverrun.md). Reported as "Inferbo Alloc May Be Big" by [bufferoverrun](/docs/next/checker-bufferoverrun).
`malloc` *may* be called with a large value. `malloc` *may* be called with a large value.
## INFERBO_ALLOC_MAY_BE_NEGATIVE ## INFERBO_ALLOC_MAY_BE_NEGATIVE
Reported as "Inferbo Alloc May Be Negative" by [bufferoverrun](checker-bufferoverrun.md). Reported as "Inferbo Alloc May Be Negative" by [bufferoverrun](/docs/next/checker-bufferoverrun).
`malloc` *may* be called with a negative value. `malloc` *may* be called with a negative value.
## INFERBO_ALLOC_MAY_BE_TAINTED ## INFERBO_ALLOC_MAY_BE_TAINTED
Reported as "Inferbo Alloc May Be Tainted" by [bufferoverrun](checker-bufferoverrun.md). Reported as "Inferbo Alloc May Be Tainted" by [bufferoverrun](/docs/next/checker-bufferoverrun).
`malloc` *may* be called with a tainted value from external sources. This is experimental and will be removed sooner or later. `malloc` *may* be called with a tainted value from external sources. This is experimental and will be removed sooner or later.
## INFINITE_EXECUTION_TIME ## INFINITE_EXECUTION_TIME
Reported as "Infinite Execution Time" by [cost](checker-cost.md). Reported as "Infinite Execution Time" by [cost](/docs/next/checker-cost).
This warning indicates that Infer was not able to determine a static This warning indicates that Infer was not able to determine a static
upper bound on the execution cost of the procedure. By default, this upper bound on the execution cost of the procedure. By default, this
@ -893,12 +935,12 @@ Consequently, we report an `INFINITE_EXECUTION_TIME`, corresponding to the bigge
## INSECURE_INTENT_HANDLING ## INSECURE_INTENT_HANDLING
Reported as "Insecure Intent Handling" by [quandary](checker-quandary.md). Reported as "Insecure Intent Handling" by [quandary](/docs/next/checker-quandary).
Undocumented. Undocumented.
## INTEGER_OVERFLOW_L1 ## INTEGER_OVERFLOW_L1
Reported as "Integer Overflow L1" by [bufferoverrun](checker-bufferoverrun.md). Reported as "Integer Overflow L1" by [bufferoverrun](/docs/next/checker-bufferoverrun).
Integer overflows reports fall into several "buckets" corresponding to the expected precision of the Integer overflows reports fall into several "buckets" corresponding to the expected precision of the
report. The higher the number, the more likely it is to be a false positive. report. The higher the number, the more likely it is to be a false positive.
@ -921,38 +963,62 @@ Other than them, there as some specific-purpose buffer overrun reports as follow
## INTEGER_OVERFLOW_L2 ## INTEGER_OVERFLOW_L2
Reported as "Integer Overflow L2" by [bufferoverrun](checker-bufferoverrun.md). Reported as "Integer Overflow L2" by [bufferoverrun](/docs/next/checker-bufferoverrun).
See [INTEGER_OVERFLOW_L1](#integer_overflow_l1) See [INTEGER_OVERFLOW_L1](#integer_overflow_l1)
## INTEGER_OVERFLOW_L5 ## INTEGER_OVERFLOW_L5
Reported as "Integer Overflow L5" by [bufferoverrun](checker-bufferoverrun.md). Reported as "Integer Overflow L5" by [bufferoverrun](/docs/next/checker-bufferoverrun).
See [INTEGER_OVERFLOW_L1](#integer_overflow_l1) See [INTEGER_OVERFLOW_L1](#integer_overflow_l1)
## INTEGER_OVERFLOW_R2 ## INTEGER_OVERFLOW_R2
Reported as "Integer Overflow R2" by [bufferoverrun](checker-bufferoverrun.md). Reported as "Integer Overflow R2" by [bufferoverrun](/docs/next/checker-bufferoverrun).
See [INTEGER_OVERFLOW_L1](#integer_overflow_l1) See [INTEGER_OVERFLOW_L1](#integer_overflow_l1)
## INTEGER_OVERFLOW_U5 ## INTEGER_OVERFLOW_U5
Reported as "Integer Overflow U5" by [bufferoverrun](checker-bufferoverrun.md). Reported as "Integer Overflow U5" by [bufferoverrun](/docs/next/checker-bufferoverrun).
See [INTEGER_OVERFLOW_L1](#integer_overflow_l1) See [INTEGER_OVERFLOW_L1](#integer_overflow_l1)
## INTERFACE_NOT_THREAD_SAFE ## INTERFACE_NOT_THREAD_SAFE
Reported as "Interface Not Thread Safe" by [racerd](checker-racerd.md). Reported as "Interface Not Thread Safe" by [racerd](/docs/next/checker-racerd).
This error indicates that you have invoked an interface method not annotated This error indicates that you have invoked an interface method not annotated
with `@ThreadSafe` from a thread-safe context (e.g., code that uses locks or is with `@ThreadSafe` from a thread-safe context (e.g., code that uses locks or is
marked `@ThreadSafe`). The fix is to add the `@ThreadSafe` annotation to the marked `@ThreadSafe`). The fix is to add the `@ThreadSafe` annotation to the
interface or to the interface method. For background on why these annotations interface or to the interface method. For background on why these annotations
are needed, see the detailed explanation are needed, see the detailed explanation
[here](racerd#interface-not-thread-safe). [here](/docs/next/checker-racerd#interface-not-thread-safe).
## INVARIANT_CALL
Reported as "Invariant Call" by [loop-hoisting](/docs/next/checker-loop-hoisting).
We report this issue type when a function call is loop-invariant and hoistable, i.e.
- the function has no side side effects (pure)
- has invariant arguments and result (i.e. have the same value in all loop iterations)
- it is guaranteed to execute, i.e. it dominates all loop sources
```java
int foo(int x, int y) {
return x + y;
}
void invariant_hoist(int size) {
int x = 10;
int y = 5;
for (int i = 0; i < size; i++) {
foo(x, y); // hoistable
}
}
```
## IVAR_NOT_NULL_CHECKED ## IVAR_NOT_NULL_CHECKED
Reported as "Ivar Not Null Checked" by [biabduction](checker-biabduction.md). Reported as "Ivar Not Null Checked" by [biabduction](/docs/next/checker-biabduction).
This error type is only reported in Objective-C. This is similar to Null This error type is only reported in Objective-C. This is similar to Null
dereference, but Infer hasn't found a whole trace where the error can happen, dereference, but Infer hasn't found a whole trace where the error can happen,
@ -971,12 +1037,12 @@ is not called with `nil`.
## JAVASCRIPT_INJECTION ## JAVASCRIPT_INJECTION
Reported as "Javascript Injection" by [quandary](checker-quandary.md). Reported as "Javascript Injection" by [quandary](/docs/next/checker-quandary).
Untrusted data flows into JavaScript. Untrusted data flows into JavaScript.
## LOCKLESS_VIOLATION ## LOCKLESS_VIOLATION
Reported as "Lockless Violation" by [starvation](checker-starvation.md). Reported as "Lockless Violation" by [starvation](/docs/next/checker-starvation).
A method implements an interface signature annotated with `@Lockless` but which transitively acquires a lock. A method implements an interface signature annotated with `@Lockless` but which transitively acquires a lock.
@ -999,7 +1065,7 @@ class C implements I {
## LOCK_CONSISTENCY_VIOLATION ## LOCK_CONSISTENCY_VIOLATION
Reported as "Lock Consistency Violation" by [racerd](checker-racerd.md). Reported as "Lock Consistency Violation" by [racerd](/docs/next/checker-racerd).
This is a C++ and Objective C error reported whenever: This is a C++ and Objective C error reported whenever:
@ -1024,12 +1090,12 @@ container (an array, a vector, etc).
## LOGGING_PRIVATE_DATA ## LOGGING_PRIVATE_DATA
Reported as "Logging Private Data" by [quandary](checker-quandary.md). Reported as "Logging Private Data" by [quandary](/docs/next/checker-quandary).
Undocumented. Undocumented.
## MEMORY_LEAK ## MEMORY_LEAK
Reported as "Memory Leak" by [pulse](checker-pulse.md). Reported as "Memory Leak" by [pulse](/docs/next/checker-pulse).
### Memory leak in C ### Memory leak in C
@ -1056,9 +1122,14 @@ objects from Core Foundation or Core Graphics don't get released.
} }
``` ```
## MISSING_REQUIRED_PROP
Reported as "Missing Required Prop" by [litho-required-props](/docs/next/checker-litho-required-props).
As explained by the analysis.
## MIXED_SELF_WEAKSELF ## MIXED_SELF_WEAKSELF
Reported as "Mixed Self WeakSelf" by [self-in-block](checker-self-in-block.md). Reported as "Mixed Self WeakSelf" by [self-in-block](/docs/next/checker-self-in-block).
This happens when an Objective-C block captures both `self` and `weakSelf`, a This happens when an Objective-C block captures both `self` and `weakSelf`, a
weak pointer to `self`. Possibly the developer meant to capture only `weakSelf` weak pointer to `self`. Possibly the developer meant to capture only `weakSelf`
@ -1067,7 +1138,7 @@ instead of `strongSelf`. In this case, this could cause a retain cycle.
## MULTIPLE_WEAKSELF ## MULTIPLE_WEAKSELF
Reported as "Multiple WeakSelf Use" by [self-in-block](checker-self-in-block.md). Reported as "Multiple WeakSelf Use" by [self-in-block](/docs/next/checker-self-in-block).
An Objective-C block uses `weakSelf` more than once. This could lead to An Objective-C block uses `weakSelf` more than once. This could lead to
unexpected behaviour. Even if `weakSelf` is not nil in the first use, it could unexpected behaviour. Even if `weakSelf` is not nil in the first use, it could
@ -1077,18 +1148,18 @@ in the block.
## MUTABLE_LOCAL_VARIABLE_IN_COMPONENT_FILE ## MUTABLE_LOCAL_VARIABLE_IN_COMPONENT_FILE
Reported as "Mutable Local Variable In Component File" by [linters](checker-linters.md). Reported as "Mutable Local Variable In Component File" by [linters](/docs/next/checker-linters).
[Doc in ComponentKit page](http://componentkit.org/docs/avoid-local-variables) [Doc in ComponentKit page](http://componentkit.org/docs/avoid-local-variables)
## NULLPTR_DEREFERENCE ## NULLPTR_DEREFERENCE
Reported as "Nullptr Dereference" by [pulse](checker-pulse.md). Reported as "Nullptr Dereference" by [pulse](/docs/next/checker-pulse).
See [NULL_DEREFERENCE](#null_dereference). See [NULL_DEREFERENCE](#null_dereference).
## NULL_DEREFERENCE ## NULL_DEREFERENCE
Reported as "Null Dereference" by [biabduction](checker-biabduction.md). Reported as "Null Dereference" by [biabduction](/docs/next/checker-biabduction).
Infer reports null dereference bugs in C, Objective-C and Java. The issue is Infer reports null dereference bugs in C, Objective-C and Java. The issue is
about a pointer that can be `null` and it is dereferenced. This leads to a crash about a pointer that can be `null` and it is dereferenced. This leads to a crash
@ -1190,7 +1261,7 @@ but that is for later.
## PARAMETER_NOT_NULL_CHECKED ## PARAMETER_NOT_NULL_CHECKED
Reported as "Parameter Not Null Checked" by [biabduction](checker-biabduction.md). Reported as "Parameter Not Null Checked" by [biabduction](/docs/next/checker-biabduction).
This error type is reported only in Objective-C. It is similar to Null This error type is reported only in Objective-C. It is similar to Null
dereference, but Infer hasn't found a whole trace where the error can happen, dereference, but Infer hasn't found a whole trace where the error can happen,
@ -1219,7 +1290,7 @@ system), that the argument won't be `nil`. This will silence the warning.
## POINTER_TO_CONST_OBJC_CLASS ## POINTER_TO_CONST_OBJC_CLASS
Reported as "Pointer To Const Objc Class" by [linters](checker-linters.md). Reported as "Pointer To Const Objc Class" by [linters](/docs/next/checker-linters).
In Objective-C, `const Class *` represents a mutable pointer pointing to an In Objective-C, `const Class *` represents a mutable pointer pointing to an
Objective-C class where the ivars cannot be changed. More useful is Objective-C class where the ivars cannot be changed. More useful is
@ -1228,7 +1299,7 @@ changed.
## PREMATURE_NIL_TERMINATION_ARGUMENT ## PREMATURE_NIL_TERMINATION_ARGUMENT
Reported as "Premature Nil Termination Argument" by [biabduction](checker-biabduction.md). Reported as "Premature Nil Termination Argument" by [biabduction](/docs/next/checker-biabduction).
This error type is reported in C and Objective-C. In many variadic methods, This error type is reported in C and Objective-C. In many variadic methods,
`nil` is used to signify the end of the list of input objects. This is similar `nil` is used to signify the end of the list of input objects. This is similar
@ -1246,14 +1317,52 @@ An example of such variadic methods is
In this example, if `str` is `nil` then an array `@[@"aaa"]` of size 1 will be In this example, if `str` is `nil` then an array `@[@"aaa"]` of size 1 will be
created, and not an array `@[@"aaa", str, @"bbb"]` of size 3 as expected. created, and not an array `@[@"aaa", str, @"bbb"]` of size 3 as expected.
## PURE_FUNCTION
Reported as "Pure Function" by [purity](/docs/next/checker-purity).
This issue type indicates pure functions. For instance, below functions would be marked as pure:
```java
int local_write_pure(int x, int y) {
int k = x + y;
k++;
return k;
}
// no change to outside state, the local allocation is ok.
int local_alloc_pure(ArrayList<Integer> list) {
ArrayList<Integer> list_new = new ArrayList<Integer>();
for (Integer el : list) {
list_new.add(el);
}
return list_new.size();
}
```
However, the following ones would not be pure:
```java
void swap_impure(int[] array, int i, int j) {
int tmp = array[i];
array[i] = array[j]; // modifying the input array
array[j] = tmp;
}
int a = 0;
void set_impure(int x, int y) {
a = x + y; //modifying a global variable
}
```
## QUANDARY_TAINT_ERROR ## QUANDARY_TAINT_ERROR
Reported as "Taint Error" by [quandary](checker-quandary.md). Reported as "Taint Error" by [quandary](/docs/next/checker-quandary).
Generic taint error when nothing else fits. Generic taint error when nothing else fits.
## REGISTERED_OBSERVER_BEING_DEALLOCATED ## REGISTERED_OBSERVER_BEING_DEALLOCATED
Reported as "Registered Observer Being Deallocated" by [linters](checker-linters.md). Reported as "Registered Observer Being Deallocated" by [linters](/docs/next/checker-linters).
Objects register with a notification center to receive notifications. This check Objects register with a notification center to receive notifications. This check
warns you when an object is registered as observer of a NSNotificationCenter but warns you when an object is registered as observer of a NSNotificationCenter but
@ -1263,7 +1372,7 @@ object has been deallocated. In that case we would get a crash.
## RESOURCE_LEAK ## RESOURCE_LEAK
Reported as "Resource Leak" by [biabduction](checker-biabduction.md). Reported as "Resource Leak" by [biabduction](/docs/next/checker-biabduction).
Infer reports resource leaks in C, Objective-C and Java. In general, resources Infer reports resource leaks in C, Objective-C and Java. In general, resources
are entities such as files, sockets, connections, etc, that need to be closed are entities such as files, sockets, connections, etc, that need to be closed
@ -1541,7 +1650,7 @@ useful, but you cannot use it blindly when you see a resource-allocation site.
## RETAIN_CYCLE ## RETAIN_CYCLE
Reported as "Retain Cycle" by [biabduction](checker-biabduction.md). Reported as "Retain Cycle" by [biabduction](/docs/next/checker-biabduction).
A retain cycle is a situation when object A retains object B, and object B A retain cycle is a situation when object A retains object B, and object B
retains object A at the same time. Here is an example: retains object A at the same time. Here is an example:
@ -1576,27 +1685,27 @@ hierarchy:
## SHELL_INJECTION ## SHELL_INJECTION
Reported as "Shell Injection" by [quandary](checker-quandary.md). Reported as "Shell Injection" by [quandary](/docs/next/checker-quandary).
Environment variable or file data flowing to shell. Environment variable or file data flowing to shell.
## SHELL_INJECTION_RISK ## SHELL_INJECTION_RISK
Reported as "Shell Injection Risk" by [quandary](checker-quandary.md). Reported as "Shell Injection Risk" by [quandary](/docs/next/checker-quandary).
Code injection if the caller of the endpoint doesn't sanitize on its end. Code injection if the caller of the endpoint doesn't sanitize on its end.
## SQL_INJECTION ## SQL_INJECTION
Reported as "Sql Injection" by [quandary](checker-quandary.md). Reported as "Sql Injection" by [quandary](/docs/next/checker-quandary).
Untrusted and unescaped data flows to SQL. Untrusted and unescaped data flows to SQL.
## SQL_INJECTION_RISK ## SQL_INJECTION_RISK
Reported as "Sql Injection Risk" by [quandary](checker-quandary.md). Reported as "Sql Injection Risk" by [quandary](/docs/next/checker-quandary).
Untrusted and unescaped data flows to SQL. Untrusted and unescaped data flows to SQL.
## STACK_VARIABLE_ADDRESS_ESCAPE ## STACK_VARIABLE_ADDRESS_ESCAPE
Reported as "Stack Variable Address Escape" by [pulse](checker-pulse.md). Reported as "Stack Variable Address Escape" by [pulse](/docs/next/checker-pulse).
Reported when an address pointing into the stack of the current Reported when an address pointing into the stack of the current
function will escape to its calling context. Such addresses will function will escape to its calling context. Such addresses will
@ -1614,7 +1723,7 @@ int* foo() {
## STARVATION ## STARVATION
Reported as "UI Thread Starvation" by [starvation](checker-starvation.md). Reported as "UI Thread Starvation" by [starvation](/docs/next/checker-starvation).
This error is reported in Java, and specifically on Android. These reports are This error is reported in Java, and specifically on Android. These reports are
triggered when a method that runs on the UI thread may block, thus potentially triggered when a method that runs on the UI thread may block, thus potentially
@ -1674,7 +1783,7 @@ include the JAR files in `infer/annotations` for this annotation to work.
## STATIC_INITIALIZATION_ORDER_FIASCO ## STATIC_INITIALIZATION_ORDER_FIASCO
Reported as "Static Initialization Order Fiasco" by [siof](checker-siof.md). Reported as "Static Initialization Order Fiasco" by [siof](/docs/next/checker-siof).
This error is reported in C++. It fires when the initialization of a static This error is reported in C++. It fires when the initialization of a static
variable `A`, accesses a static variable `B` from another translation unit variable `A`, accesses a static variable `B` from another translation unit
@ -1686,7 +1795,7 @@ For more technical definition and techniques to avoid/remediate, see the
## STRICT_MODE_VIOLATION ## STRICT_MODE_VIOLATION
Reported as "Strict Mode Violation" by [starvation](checker-starvation.md). Reported as "Strict Mode Violation" by [starvation](/docs/next/checker-starvation).
Android has a feature called Android has a feature called
[strict mode](https://developer.android.com/reference/android/os/StrictMode), [strict mode](https://developer.android.com/reference/android/os/StrictMode),
@ -1700,7 +1809,7 @@ To suppress this warning, it's enough to annotate the offending method with
## STRONG_DELEGATE_WARNING ## STRONG_DELEGATE_WARNING
Reported as "Strong Delegate Warning" by [linters](checker-linters.md). Reported as "Strong Delegate Warning" by [linters](/docs/next/checker-linters).
This check warns you when you have a property called delegate or variations This check warns you when you have a property called delegate or variations
thereof which is declared strong. The idea is that delegates should generally be thereof which is declared strong. The idea is that delegates should generally be
@ -1708,7 +1817,7 @@ weak, otherwise this may cause retain cycles.
## STRONG_SELF_NOT_CHECKED ## STRONG_SELF_NOT_CHECKED
Reported as "StrongSelf Not Checked" by [self-in-block](checker-self-in-block.md). Reported as "StrongSelf Not Checked" by [self-in-block](/docs/next/checker-self-in-block).
When a block captures `weakSelf` in the following pattern: When a block captures `weakSelf` in the following pattern:
@ -1725,16 +1834,13 @@ otherwise this could cause a crash because the weak pointer `weakSelf` could be
## THREAD_SAFETY_VIOLATION ## THREAD_SAFETY_VIOLATION
Reported as "Thread Safety Violation" by [racerd](checker-racerd.md). Reported as "Thread Safety Violation" by [racerd](/docs/next/checker-racerd).
This warning indicates a potential data race in Java. The analyser is called This warning indicates a potential data race in Java. The analyser is called
RacerD and this section gives brief but a mostly complete description of its RacerD and this section gives brief but a mostly complete description of its
features. See the [RacerD page](/docs/racerd) for more in-depth information and features. See the [RacerD page](/docs/next/checker-racerd) for more in-depth information and
examples. examples.
NB this warning **is not related to @GuardedBy** and not issued by the same
analysis.
### Thread-safety: What is a data race ### Thread-safety: What is a data race
Here a data race is a pair of accesses to the same member field such that: Here a data race is a pair of accesses to the same member field such that:
@ -1824,7 +1930,7 @@ These annotations can be found at `com.facebook.infer.annotation.*`.
## UNAVAILABLE_API_IN_SUPPORTED_IOS_SDK ## UNAVAILABLE_API_IN_SUPPORTED_IOS_SDK
Reported as "Unavailable Api In Supported Ios Sdk" by [linters](checker-linters.md). Reported as "Unavailable Api In Supported Ios Sdk" by [linters](/docs/next/checker-linters).
This checks warns you when you are using an API (constant, method call, etc.) This checks warns you when you are using an API (constant, method call, etc.)
that is only defined in a version higher than the version that you support. To that is only defined in a version higher than the version that you support. To
@ -1849,7 +1955,7 @@ if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_9_0) {
## UNINITIALIZED_VALUE ## UNINITIALIZED_VALUE
Reported as "Uninitialized Value" by [uninit](checker-uninit.md). Reported as "Uninitialized Value" by [uninit](/docs/next/checker-uninit).
A value is read before it has been initialized. For example, in C: A value is read before it has been initialized. For example, in C:
@ -1873,79 +1979,79 @@ void foo() {
## UNREACHABLE_CODE ## UNREACHABLE_CODE
Reported as "Unreachable Code" by [bufferoverrun](checker-bufferoverrun.md). Reported as "Unreachable Code" by [bufferoverrun](/docs/next/checker-bufferoverrun).
A program point is unreachable. A program point is unreachable.
## UNTRUSTED_BUFFER_ACCESS ## UNTRUSTED_BUFFER_ACCESS
Reported as "Untrusted Buffer Access" by [quandary](checker-quandary.md). Reported as "Untrusted Buffer Access" by [quandary](/docs/next/checker-quandary).
Untrusted data of any kind flowing to buffer. Untrusted data of any kind flowing to buffer.
## UNTRUSTED_DESERIALIZATION ## UNTRUSTED_DESERIALIZATION
Reported as "Untrusted Deserialization" by [quandary](checker-quandary.md). Reported as "Untrusted Deserialization" by [quandary](/docs/next/checker-quandary).
User-controlled deserialization. User-controlled deserialization.
## UNTRUSTED_DESERIALIZATION_RISK ## UNTRUSTED_DESERIALIZATION_RISK
Reported as "Untrusted Deserialization Risk" by [quandary](checker-quandary.md). Reported as "Untrusted Deserialization Risk" by [quandary](/docs/next/checker-quandary).
User-controlled deserialization User-controlled deserialization
## UNTRUSTED_ENVIRONMENT_CHANGE_RISK ## UNTRUSTED_ENVIRONMENT_CHANGE_RISK
Reported as "Untrusted Environment Change Risk" by [quandary](checker-quandary.md). Reported as "Untrusted Environment Change Risk" by [quandary](/docs/next/checker-quandary).
User-controlled environment mutation. User-controlled environment mutation.
## UNTRUSTED_FILE ## UNTRUSTED_FILE
Reported as "Untrusted File" by [quandary](checker-quandary.md). Reported as "Untrusted File" by [quandary](/docs/next/checker-quandary).
User-controlled file creation; may be vulnerable to path traversal and more. User-controlled file creation; may be vulnerable to path traversal and more.
## UNTRUSTED_FILE_RISK ## UNTRUSTED_FILE_RISK
Reported as "Untrusted File Risk" by [quandary](checker-quandary.md). Reported as "Untrusted File Risk" by [quandary](/docs/next/checker-quandary).
User-controlled file creation; may be vulnerable to path traversal and more. User-controlled file creation; may be vulnerable to path traversal and more.
## UNTRUSTED_HEAP_ALLOCATION ## UNTRUSTED_HEAP_ALLOCATION
Reported as "Untrusted Heap Allocation" by [quandary](checker-quandary.md). Reported as "Untrusted Heap Allocation" by [quandary](/docs/next/checker-quandary).
Untrusted data of any kind flowing to heap allocation. this can cause crashes or DOS. Untrusted data of any kind flowing to heap allocation. this can cause crashes or DOS.
## UNTRUSTED_INTENT_CREATION ## UNTRUSTED_INTENT_CREATION
Reported as "Untrusted Intent Creation" by [quandary](checker-quandary.md). Reported as "Untrusted Intent Creation" by [quandary](/docs/next/checker-quandary).
Creating an Intent from user-controlled data. Creating an Intent from user-controlled data.
## UNTRUSTED_URL_RISK ## UNTRUSTED_URL_RISK
Reported as "Untrusted Url Risk" by [quandary](checker-quandary.md). Reported as "Untrusted Url Risk" by [quandary](/docs/next/checker-quandary).
Untrusted flag, environment variable, or file data flowing to URL. Untrusted flag, environment variable, or file data flowing to URL.
## UNTRUSTED_VARIABLE_LENGTH_ARRAY ## UNTRUSTED_VARIABLE_LENGTH_ARRAY
Reported as "Untrusted Variable Length Array" by [quandary](checker-quandary.md). Reported as "Untrusted Variable Length Array" by [quandary](/docs/next/checker-quandary).
Untrusted data of any kind flowing to stack buffer allocation. Trying to allocate a stack buffer that's too large will cause a stack overflow. Untrusted data of any kind flowing to stack buffer allocation. Trying to allocate a stack buffer that's too large will cause a stack overflow.
## USER_CONTROLLED_SQL_RISK ## USER_CONTROLLED_SQL_RISK
Reported as "User Controlled Sql Risk" by [quandary](checker-quandary.md). Reported as "User Controlled Sql Risk" by [quandary](/docs/next/checker-quandary).
Untrusted data flows to SQL (no injection risk). Untrusted data flows to SQL (no injection risk).
## USE_AFTER_DELETE ## USE_AFTER_DELETE
Reported as "Use After Delete" by [pulse](checker-pulse.md). Reported as "Use After Delete" by [pulse](/docs/next/checker-pulse).
An address that was invalidated by a call to `delete` in C++ is dereferenced. An address that was invalidated by a call to `delete` in C++ is dereferenced.
## USE_AFTER_FREE ## USE_AFTER_FREE
Reported as "Use After Free" by [pulse](checker-pulse.md). Reported as "Use After Free" by [pulse](/docs/next/checker-pulse).
An address that was invalidated by a call to `free` in C is dereferenced. An address that was invalidated by a call to `free` in C is dereferenced.
## USE_AFTER_LIFETIME ## USE_AFTER_LIFETIME
Reported as "Use After Lifetime" by [pulse](checker-pulse.md). Reported as "Use After Lifetime" by [pulse](/docs/next/checker-pulse).
The lifetime of an object has ended but that object is being The lifetime of an object has ended but that object is being
accessed. For example, the address of a variable holding a C++ object accessed. For example, the address of a variable holding a C++ object
@ -1964,7 +2070,7 @@ void foo() {
## WEAK_SELF_IN_NO_ESCAPE_BLOCK ## WEAK_SELF_IN_NO_ESCAPE_BLOCK
Reported as "Weak Self In No Escape Block" by [self-in-block](checker-self-in-block.md). Reported as "Weak Self In No Escape Block" by [self-in-block](/docs/next/checker-self-in-block).
In many methods that take a block as an argument, the block position is In many methods that take a block as an argument, the block position is
annotated with NS_NOESCAPE to mark that the block passed to this method won't be annotated with NS_NOESCAPE to mark that the block passed to this method won't be

@ -16,7 +16,7 @@ Supported languages:
## List of Issue Types ## List of Issue Types
The following issue types are reported by this checker: The following issue types are reported by this checker:
- [CHECKERS_ALLOCATES_MEMORY](all-issue-types#checkers_allocates_memory) - [CHECKERS_ALLOCATES_MEMORY](/docs/next/all-issue-types#checkers_allocates_memory)
- [CHECKERS_ANNOTATION_REACHABILITY_ERROR](all-issue-types#checkers_annotation_reachability_error) - [CHECKERS_ANNOTATION_REACHABILITY_ERROR](/docs/next/all-issue-types#checkers_annotation_reachability_error)
- [CHECKERS_CALLS_EXPENSIVE_METHOD](all-issue-types#checkers_calls_expensive_method) - [CHECKERS_CALLS_EXPENSIVE_METHOD](/docs/next/all-issue-types#checkers_calls_expensive_method)
- [CHECKERS_EXPENSIVE_OVERRIDES_UNANNOTATED](all-issue-types#checkers_expensive_overrides_unannotated) - [CHECKERS_EXPENSIVE_OVERRIDES_UNANNOTATED](/docs/next/all-issue-types#checkers_expensive_overrides_unannotated)

@ -16,10 +16,10 @@ Read more about its foundations in the [Separation Logic and Biabduction page](s
## List of Issue Types ## List of Issue Types
The following issue types are reported by this checker: The following issue types are reported by this checker:
- [EMPTY_VECTOR_ACCESS](all-issue-types#empty_vector_access) - [EMPTY_VECTOR_ACCESS](/docs/next/all-issue-types#empty_vector_access)
- [IVAR_NOT_NULL_CHECKED](all-issue-types#ivar_not_null_checked) - [IVAR_NOT_NULL_CHECKED](/docs/next/all-issue-types#ivar_not_null_checked)
- [NULL_DEREFERENCE](all-issue-types#null_dereference) - [NULL_DEREFERENCE](/docs/next/all-issue-types#null_dereference)
- [PARAMETER_NOT_NULL_CHECKED](all-issue-types#parameter_not_null_checked) - [PARAMETER_NOT_NULL_CHECKED](/docs/next/all-issue-types#parameter_not_null_checked)
- [PREMATURE_NIL_TERMINATION_ARGUMENT](all-issue-types#premature_nil_termination_argument) - [PREMATURE_NIL_TERMINATION_ARGUMENT](/docs/next/all-issue-types#premature_nil_termination_argument)
- [RESOURCE_LEAK](all-issue-types#resource_leak) - [RESOURCE_LEAK](/docs/next/all-issue-types#resource_leak)
- [RETAIN_CYCLE](all-issue-types#retain_cycle) - [RETAIN_CYCLE](/docs/next/all-issue-types#retain_cycle)

@ -16,26 +16,26 @@ You can read about its origins in this [blog post](https://research.fb.com/infer
## List of Issue Types ## List of Issue Types
The following issue types are reported by this checker: The following issue types are reported by this checker:
- [BUFFER_OVERRUN_L1](all-issue-types#buffer_overrun_l1) - [BUFFER_OVERRUN_L1](/docs/next/all-issue-types#buffer_overrun_l1)
- [BUFFER_OVERRUN_L2](all-issue-types#buffer_overrun_l2) - [BUFFER_OVERRUN_L2](/docs/next/all-issue-types#buffer_overrun_l2)
- [BUFFER_OVERRUN_L3](all-issue-types#buffer_overrun_l3) - [BUFFER_OVERRUN_L3](/docs/next/all-issue-types#buffer_overrun_l3)
- [BUFFER_OVERRUN_L4](all-issue-types#buffer_overrun_l4) - [BUFFER_OVERRUN_L4](/docs/next/all-issue-types#buffer_overrun_l4)
- [BUFFER_OVERRUN_L5](all-issue-types#buffer_overrun_l5) - [BUFFER_OVERRUN_L5](/docs/next/all-issue-types#buffer_overrun_l5)
- [BUFFER_OVERRUN_R2](all-issue-types#buffer_overrun_r2) - [BUFFER_OVERRUN_R2](/docs/next/all-issue-types#buffer_overrun_r2)
- [BUFFER_OVERRUN_S2](all-issue-types#buffer_overrun_s2) - [BUFFER_OVERRUN_S2](/docs/next/all-issue-types#buffer_overrun_s2)
- [BUFFER_OVERRUN_T1](all-issue-types#buffer_overrun_t1) - [BUFFER_OVERRUN_T1](/docs/next/all-issue-types#buffer_overrun_t1)
- [BUFFER_OVERRUN_U5](all-issue-types#buffer_overrun_u5) - [BUFFER_OVERRUN_U5](/docs/next/all-issue-types#buffer_overrun_u5)
- [CONDITION_ALWAYS_FALSE](all-issue-types#condition_always_false) - [CONDITION_ALWAYS_FALSE](/docs/next/all-issue-types#condition_always_false)
- [CONDITION_ALWAYS_TRUE](all-issue-types#condition_always_true) - [CONDITION_ALWAYS_TRUE](/docs/next/all-issue-types#condition_always_true)
- [INFERBO_ALLOC_IS_BIG](all-issue-types#inferbo_alloc_is_big) - [INFERBO_ALLOC_IS_BIG](/docs/next/all-issue-types#inferbo_alloc_is_big)
- [INFERBO_ALLOC_IS_NEGATIVE](all-issue-types#inferbo_alloc_is_negative) - [INFERBO_ALLOC_IS_NEGATIVE](/docs/next/all-issue-types#inferbo_alloc_is_negative)
- [INFERBO_ALLOC_IS_ZERO](all-issue-types#inferbo_alloc_is_zero) - [INFERBO_ALLOC_IS_ZERO](/docs/next/all-issue-types#inferbo_alloc_is_zero)
- [INFERBO_ALLOC_MAY_BE_BIG](all-issue-types#inferbo_alloc_may_be_big) - [INFERBO_ALLOC_MAY_BE_BIG](/docs/next/all-issue-types#inferbo_alloc_may_be_big)
- [INFERBO_ALLOC_MAY_BE_NEGATIVE](all-issue-types#inferbo_alloc_may_be_negative) - [INFERBO_ALLOC_MAY_BE_NEGATIVE](/docs/next/all-issue-types#inferbo_alloc_may_be_negative)
- [INFERBO_ALLOC_MAY_BE_TAINTED](all-issue-types#inferbo_alloc_may_be_tainted) - [INFERBO_ALLOC_MAY_BE_TAINTED](/docs/next/all-issue-types#inferbo_alloc_may_be_tainted)
- [INTEGER_OVERFLOW_L1](all-issue-types#integer_overflow_l1) - [INTEGER_OVERFLOW_L1](/docs/next/all-issue-types#integer_overflow_l1)
- [INTEGER_OVERFLOW_L2](all-issue-types#integer_overflow_l2) - [INTEGER_OVERFLOW_L2](/docs/next/all-issue-types#integer_overflow_l2)
- [INTEGER_OVERFLOW_L5](all-issue-types#integer_overflow_l5) - [INTEGER_OVERFLOW_L5](/docs/next/all-issue-types#integer_overflow_l5)
- [INTEGER_OVERFLOW_R2](all-issue-types#integer_overflow_r2) - [INTEGER_OVERFLOW_R2](/docs/next/all-issue-types#integer_overflow_r2)
- [INTEGER_OVERFLOW_U5](all-issue-types#integer_overflow_u5) - [INTEGER_OVERFLOW_U5](/docs/next/all-issue-types#integer_overflow_u5)
- [UNREACHABLE_CODE](all-issue-types#unreachable_code) - [UNREACHABLE_CODE](/docs/next/all-issue-types#unreachable_code)

@ -34,12 +34,12 @@ The total cost of the node is the scalar product of these two vectors. Then, the
At a high level, the analysis has three steps: At a high level, the analysis has three steps:
- Choose control variables that allude to "how many times a loop may iterate". - Choose control variables that allude to "how many times a loop may iterate".
- Get abstract ranges of the control variables from [InferBO](checker-bufferoverrun) (a numerical analysis that infers symbolic intervals) - Get abstract ranges of the control variables from [InferBO](/docs/next/checker-bufferoverrun) (a numerical analysis that infers symbolic intervals)
- Construct complexity polynomials for loops and functions by via a constraint solving algorithm. - Construct complexity polynomials for loops and functions by via a constraint solving algorithm.
## Examples ## Examples
Infers cost analysis statically estimates the execution cost of a Infers cost analysis statically estimates the execution cost of a
program without running the code. For instance, assume that we had the program without running the code. For instance, assume that we had the
@ -62,7 +62,7 @@ void loop(ArrayList<Integer> list){
} }
``` ```
where `foo` has a linear cost in its parameter, then Infer automatically detects that the complexity of loop has increased from `O(|list|)` to `O(|list|^2)` and then reports an [`EXECUTION_TIME_COMPLEXITY_INCREASE`](execution_time_complexity_increase) issue. where `foo` has a linear cost in its parameter, then Infer automatically detects that the complexity of loop has increased from `O(|list|)` to `O(|list|^2)` and then reports an [`EXECUTION_TIME_COMPLEXITY_INCREASE`](/docs/next/all-issue-types#execution_time_complexity_increase) issue.
@ -72,13 +72,13 @@ Differential cost analysis in action:
- first run infer's cost analysis on `File.java` and rename `costs-report.json` (which is in `/infer-out`) to `previous-costs-report.json` - first run infer's cost analysis on `File.java` and rename `costs-report.json` (which is in `/infer-out`) to `previous-costs-report.json`
- modify the function as shown above - modify the function as shown above
- re-run infer on `File.java` and rename `costs-report.json` to `current-costs-report.json` - re-run infer on `File.java` and rename `costs-report.json` to `current-costs-report.json`
- run `infer reportdiff --costs-current current-costs-report.json --costs-previous current-costs-report`. - run `infer reportdiff --costs-current current-costs-report.json --costs-previous current-costs-report`.
- Inspect `infer-out/differential/introduced.json` to see the newly found complexity increase issue(s). - Inspect `infer-out/differential/introduced.json` to see the newly found complexity increase issue(s).
## Limitations ## Limitations
There are a number of known limitations to the design of the static cost analysis: There are a number of known limitations to the design of the static cost analysis:
- InferBo's intervals are limited to affine expressions, not full-blown polynomials. Hence, we can automatically infer bounds involving square roots. - InferBo's intervals are limited to affine expressions, not full-blown polynomials. Hence, we can automatically infer bounds involving square roots.
@ -90,7 +90,7 @@ There are a number of known limitations to the design of the static cost analysi
## List of Issue Types ## List of Issue Types
The following issue types are reported by this checker: The following issue types are reported by this checker:
- [EXECUTION_TIME_COMPLEXITY_INCREASE](all-issue-types#execution_time_complexity_increase) - [EXECUTION_TIME_COMPLEXITY_INCREASE](/docs/next/all-issue-types#execution_time_complexity_increase)
- [EXECUTION_TIME_COMPLEXITY_INCREASE_UI_THREAD](all-issue-types#execution_time_complexity_increase_ui_thread) - [EXECUTION_TIME_COMPLEXITY_INCREASE_UI_THREAD](/docs/next/all-issue-types#execution_time_complexity_increase_ui_thread)
- [EXECUTION_TIME_UNREACHABLE_AT_EXIT](all-issue-types#execution_time_unreachable_at_exit) - [EXECUTION_TIME_UNREACHABLE_AT_EXIT](/docs/next/all-issue-types#execution_time_unreachable_at_exit)
- [INFINITE_EXECUTION_TIME](all-issue-types#infinite_execution_time) - [INFINITE_EXECUTION_TIME](/docs/next/all-issue-types#infinite_execution_time)

@ -91,11 +91,11 @@ class C {
## List of Issue Types ## List of Issue Types
The following issue types are reported by this checker: The following issue types are reported by this checker:
- [ERADICATE_CONDITION_REDUNDANT](all-issue-types#eradicate_condition_redundant) - [ERADICATE_CONDITION_REDUNDANT](/docs/next/all-issue-types#eradicate_condition_redundant)
- [ERADICATE_FIELD_NOT_INITIALIZED](all-issue-types#eradicate_field_not_initialized) - [ERADICATE_FIELD_NOT_INITIALIZED](/docs/next/all-issue-types#eradicate_field_not_initialized)
- [ERADICATE_FIELD_NOT_NULLABLE](all-issue-types#eradicate_field_not_nullable) - [ERADICATE_FIELD_NOT_NULLABLE](/docs/next/all-issue-types#eradicate_field_not_nullable)
- [ERADICATE_INCONSISTENT_SUBCLASS_PARAMETER_ANNOTATION](all-issue-types#eradicate_inconsistent_subclass_parameter_annotation) - [ERADICATE_INCONSISTENT_SUBCLASS_PARAMETER_ANNOTATION](/docs/next/all-issue-types#eradicate_inconsistent_subclass_parameter_annotation)
- [ERADICATE_INCONSISTENT_SUBCLASS_RETURN_ANNOTATION](all-issue-types#eradicate_inconsistent_subclass_return_annotation) - [ERADICATE_INCONSISTENT_SUBCLASS_RETURN_ANNOTATION](/docs/next/all-issue-types#eradicate_inconsistent_subclass_return_annotation)
- [ERADICATE_PARAMETER_NOT_NULLABLE](all-issue-types#eradicate_parameter_not_nullable) - [ERADICATE_PARAMETER_NOT_NULLABLE](/docs/next/all-issue-types#eradicate_parameter_not_nullable)
- [ERADICATE_RETURN_NOT_NULLABLE](all-issue-types#eradicate_return_not_nullable) - [ERADICATE_RETURN_NOT_NULLABLE](/docs/next/all-issue-types#eradicate_return_not_nullable)
- [ERADICATE_RETURN_OVER_ANNOTATED](all-issue-types#eradicate_return_over_annotated) - [ERADICATE_RETURN_OVER_ANNOTATED](/docs/next/all-issue-types#eradicate_return_over_annotated)

@ -18,4 +18,4 @@ Supported languages:
## List of Issue Types ## List of Issue Types
The following issue types are reported by this checker: The following issue types are reported by this checker:
- [CHECKERS_FRAGMENT_RETAINS_VIEW](all-issue-types#checkers_fragment_retains_view) - [CHECKERS_FRAGMENT_RETAINS_VIEW](/docs/next/all-issue-types#checkers_fragment_retains_view)

@ -18,4 +18,4 @@ Casts flagged by this checker are unsafe because calling mutation operations on
## List of Issue Types ## List of Issue Types
The following issue types are reported by this checker: The following issue types are reported by this checker:
- [CHECKERS_IMMUTABLE_CAST](all-issue-types#checkers_immutable_cast) - [CHECKERS_IMMUTABLE_CAST](/docs/next/all-issue-types#checkers_immutable_cast)

@ -0,0 +1,20 @@
---
title: "Impurity"
description: "Detects functions with potential side-effects. Same as \"purity\", but implemented on top of Pulse."
---
Detects functions with potential side-effects. Same as "purity", but implemented on top of Pulse.
Activate with `--impurity`.
Supported languages:
- C/C++/ObjC: Experimental
- Java: Experimental
This is an experimental inter-procedural analysis that detects impure functions. It is meant to be an improvement over the [purity](/docs/next/checker-purity) analysis with a negation on the issue types. For each function, impurity analysis keeps track of not only the impurity of the function but also some additional information such as which parameters/globals the function modifies. It models functions with no summary/model as impure. The analysis relies on [Pulse](/docs/next/checker-pulse) summaries to determine impurity.
## List of Issue Types
The following issue types are reported by this checker:
- [IMPURE_FUNCTION](/docs/next/all-issue-types#impure_function)

@ -16,4 +16,4 @@ Supported languages:
## List of Issue Types ## List of Issue Types
The following issue types are reported by this checker: The following issue types are reported by this checker:
- [INEFFICIENT_KEYSET_ITERATOR](all-issue-types#inefficient_keyset_iterator) - [INEFFICIENT_KEYSET_ITERATOR](/docs/next/all-issue-types#inefficient_keyset_iterator)

@ -16,7 +16,7 @@ Supported languages:
For C/C++ and Objective-C languages, we provide a linters framework. These are For C/C++ and Objective-C languages, we provide a linters framework. These are
checks about the syntax of the program; it could be about a property, or about checks about the syntax of the program; it could be about a property, or about
code inside one method, or that a class or method have certain properties. We code inside one method, or that a class or method have certain properties. We
provide [a few checks](/docs/linters-bug-types) and we have developed a domain provide [a few checks by default](#list-of-issue-types) and we have developed a domain
specific language (DSL) to make it easier to write checks. specific language (DSL) to make it easier to write checks.
## AL: A declarative language for writing linters in Infer ## AL: A declarative language for writing linters in Infer
@ -701,24 +701,24 @@ infer run --linters -- clang -c Test.m
``` ```
There are a few other command-line options that are useful for using or There are a few other command-line options that are useful for using or
developing new linters in Infer. Read about them in the [`infer capture` manual](man-pages). developing new linters in Infer. Read about them in the [`infer capture` manual](/docs/next/man-infer-capture).
## List of Issue Types ## List of Issue Types
The following issue types are reported by this checker: The following issue types are reported by this checker:
- [ASSIGN_POINTER_WARNING](all-issue-types#assign_pointer_warning) - [ASSIGN_POINTER_WARNING](/docs/next/all-issue-types#assign_pointer_warning)
- [BAD_POINTER_COMPARISON](all-issue-types#bad_pointer_comparison) - [BAD_POINTER_COMPARISON](/docs/next/all-issue-types#bad_pointer_comparison)
- [COMPONENT_FACTORY_FUNCTION](all-issue-types#component_factory_function) - [COMPONENT_FACTORY_FUNCTION](/docs/next/all-issue-types#component_factory_function)
- [COMPONENT_INITIALIZER_WITH_SIDE_EFFECTS](all-issue-types#component_initializer_with_side_effects) - [COMPONENT_INITIALIZER_WITH_SIDE_EFFECTS](/docs/next/all-issue-types#component_initializer_with_side_effects)
- [COMPONENT_WITH_MULTIPLE_FACTORY_METHODS](all-issue-types#component_with_multiple_factory_methods) - [COMPONENT_WITH_MULTIPLE_FACTORY_METHODS](/docs/next/all-issue-types#component_with_multiple_factory_methods)
- [COMPONENT_WITH_UNCONVENTIONAL_SUPERCLASS](all-issue-types#component_with_unconventional_superclass) - [COMPONENT_WITH_UNCONVENTIONAL_SUPERCLASS](/docs/next/all-issue-types#component_with_unconventional_superclass)
- [CXX_REFERENCE_CAPTURED_IN_OBJC_BLOCK](all-issue-types#cxx_reference_captured_in_objc_block) - [CXX_REFERENCE_CAPTURED_IN_OBJC_BLOCK](/docs/next/all-issue-types#cxx_reference_captured_in_objc_block)
- [DIRECT_ATOMIC_PROPERTY_ACCESS](all-issue-types#direct_atomic_property_access) - [DIRECT_ATOMIC_PROPERTY_ACCESS](/docs/next/all-issue-types#direct_atomic_property_access)
- [DISCOURAGED_WEAK_PROPERTY_CUSTOM_SETTER](all-issue-types#discouraged_weak_property_custom_setter) - [DISCOURAGED_WEAK_PROPERTY_CUSTOM_SETTER](/docs/next/all-issue-types#discouraged_weak_property_custom_setter)
- [GLOBAL_VARIABLE_INITIALIZED_WITH_FUNCTION_OR_METHOD_CALL](all-issue-types#global_variable_initialized_with_function_or_method_call) - [GLOBAL_VARIABLE_INITIALIZED_WITH_FUNCTION_OR_METHOD_CALL](/docs/next/all-issue-types#global_variable_initialized_with_function_or_method_call)
- [MUTABLE_LOCAL_VARIABLE_IN_COMPONENT_FILE](all-issue-types#mutable_local_variable_in_component_file) - [MUTABLE_LOCAL_VARIABLE_IN_COMPONENT_FILE](/docs/next/all-issue-types#mutable_local_variable_in_component_file)
- [POINTER_TO_CONST_OBJC_CLASS](all-issue-types#pointer_to_const_objc_class) - [POINTER_TO_CONST_OBJC_CLASS](/docs/next/all-issue-types#pointer_to_const_objc_class)
- [REGISTERED_OBSERVER_BEING_DEALLOCATED](all-issue-types#registered_observer_being_deallocated) - [REGISTERED_OBSERVER_BEING_DEALLOCATED](/docs/next/all-issue-types#registered_observer_being_deallocated)
- [STRONG_DELEGATE_WARNING](all-issue-types#strong_delegate_warning) - [STRONG_DELEGATE_WARNING](/docs/next/all-issue-types#strong_delegate_warning)
- [UNAVAILABLE_API_IN_SUPPORTED_IOS_SDK](all-issue-types#unavailable_api_in_supported_ios_sdk) - [UNAVAILABLE_API_IN_SUPPORTED_IOS_SDK](/docs/next/all-issue-types#unavailable_api_in_supported_ios_sdk)

@ -1,9 +1,9 @@
--- ---
title: "Litho \"Required Props\"" title: "Litho \"Required Props\""
description: "Checks that all non-option `@Prop`s have been specified when constructing Litho components." description: "Checks that all non-optional `@Prop`s have been specified when constructing Litho components."
--- ---
Checks that all non-option `@Prop`s have been specified when constructing Litho components. Checks that all non-optional `@Prop`s have been specified when constructing Litho components.
Activate with `--litho-required-props`. Activate with `--litho-required-props`.
@ -11,3 +11,60 @@ Supported languages:
- C/C++/ObjC: No - C/C++/ObjC: No
- Java: Yes - Java: Yes
This analysis checks that all non-optional [`@Prop`](https://fblitho.com/docs/props)`s have been specified when constructing Litho components. This is a [Litho](https://fblitho.com/) specific checker.
## What are required Props?
In a nutshell, a Litho Component is essentially a class that defines immutable inputs, called prop (annotated with `@Prop`) in component hierarchy methods. For each Component there is a corresponding spec class which defines the required props:. E.g:
```java
class MyComponentSpec {
static void onCreate(
ComponentContext c,
@Prop(optional = true) String prop1, @Prop int prop2) {
...
}
...
}
```
`MyComponentSpec` defines two props: a String prop called `prop1` and an int prop named `prop2`. For each prop defined on the spec, the annotation processor creates a builder pattern method that has the same name as the prop.
Developers pass down values for these props by calling the appropriate methods:
```java
MyComponent.create(c)
.prop1("My prop 1")
.prop2(256)
.build();
```
If the required props are not called, then annotation processor throws an exception in run time. This is really bad and that's where this checker comes into play to detect such cases statically.
## Examples
E.g. the following is caught as [MISSING_REQUIRED_PROP](/docs/next/all-issue-types#missing_required_prop) `prop2`.
```java
MyComponent.create(c)
.prop1("My prop 1")
.build();
```
The following is ok though since `prop1` is optional.
```java
MyComponent.create(c)
.prop2(8)
.build();
```
Note that, the functions `create()` and `build()` could be defined in different methods and there could be various function calls, aliasing, and control flow patterns in between. Hence, this checker is inter-procedural.
## List of Issue Types
The following issue types are reported by this checker:
- [MISSING_REQUIRED_PROP](/docs/next/all-issue-types#missing_required_prop)

@ -16,4 +16,4 @@ Supported languages:
## List of Issue Types ## List of Issue Types
The following issue types are reported by this checker: The following issue types are reported by this checker:
- [DEAD_STORE](all-issue-types#dead_store) - [DEAD_STORE](/docs/next/all-issue-types#dead_store)

@ -11,3 +11,13 @@ Supported languages:
- C/C++/ObjC: Yes - C/C++/ObjC: Yes
- Java: Yes - Java: Yes
This checker detects opportunities to hoist function calls that are invariant to outside of loop bodies. The hoisting analysis relies on [purity](/docs/next/checker-purity) analysis to determine whather a function is pure or not.
It has an additional mode that reports [loop-invariant functions that are expensive](/docs/next/all-issue-types#expensive_loop_invariant_call) (i.e. at least linear). This is enabled by the flag `--hoisting-report-only-expensive`.
## List of Issue Types
The following issue types are reported by this checker:
- [EXPENSIVE_LOOP_INVARIANT_CALL](/docs/next/all-issue-types#expensive_loop_invariant_call)
- [INVARIANT_CALL](/docs/next/all-issue-types#invariant_call)

@ -18,4 +18,4 @@ Supported languages:
## List of Issue Types ## List of Issue Types
The following issue types are reported by this checker: The following issue types are reported by this checker:
- [CHECKERS_PRINTF_ARGS](all-issue-types#checkers_printf_args) - [CHECKERS_PRINTF_ARGS](/docs/next/all-issue-types#checkers_printf_args)

@ -16,10 +16,10 @@ Supported languages:
## List of Issue Types ## List of Issue Types
The following issue types are reported by this checker: The following issue types are reported by this checker:
- [CONSTANT_ADDRESS_DEREFERENCE](all-issue-types#constant_address_dereference) - [CONSTANT_ADDRESS_DEREFERENCE](/docs/next/all-issue-types#constant_address_dereference)
- [MEMORY_LEAK](all-issue-types#memory_leak) - [MEMORY_LEAK](/docs/next/all-issue-types#memory_leak)
- [NULLPTR_DEREFERENCE](all-issue-types#nullptr_dereference) - [NULLPTR_DEREFERENCE](/docs/next/all-issue-types#nullptr_dereference)
- [STACK_VARIABLE_ADDRESS_ESCAPE](all-issue-types#stack_variable_address_escape) - [STACK_VARIABLE_ADDRESS_ESCAPE](/docs/next/all-issue-types#stack_variable_address_escape)
- [USE_AFTER_DELETE](all-issue-types#use_after_delete) - [USE_AFTER_DELETE](/docs/next/all-issue-types#use_after_delete)
- [USE_AFTER_FREE](all-issue-types#use_after_free) - [USE_AFTER_FREE](/docs/next/all-issue-types#use_after_free)
- [USE_AFTER_LIFETIME](all-issue-types#use_after_lifetime) - [USE_AFTER_LIFETIME](/docs/next/all-issue-types#use_after_lifetime)

@ -0,0 +1,65 @@
---
title: "Purity"
description: "Detects pure (side-effect-free) functions. A different implementation of \"impurity\"."
---
Detects pure (side-effect-free) functions. A different implementation of "impurity".
Activate with `--purity`.
Supported languages:
- C/C++/ObjC: Experimental
- Java: Experimental
This is an experimental inter-procedural analysis that detects pure (side-effect free) functions. For each function, purity analysis keeps track of not only the purity of the function but also some additional information such as whether the function modifies a global variable or which of the parameters are modified. It models functions with no summary/model as modifying the global state (hence impure).
If the function is pure (i.e. doesn't modify any global state or its parameters and doesn't call any unknown functions), then it reports an [`PURE_FUNCTION`](/docs/next/all-issue-types#pure_function) issue.
## Weaknesses
There are two issues with the existing purity analysis:
- In order to detect which parameters are modified, we need an alias analysis which is difficult to get right.
- Just keeping track of modified arguments doesn't suffice.
Too see the issue with the first point, consider the following simple program:
```java
void foo(Foo a){
Foo b = a;
b.x = 10;
}
```
in order to determine that `foo` is impure, we need to know that the write to `b`'s field is actually changing the function parameter `a`, i.e. we need to check if `b` is aliasing `a`. This is known as alias analysis and is hard to get right in a scalable manner. When this analysis was being developed, Infer didn't have a unified alias analysis and using biabduction seemed like a too daunting task at the time. Hence, we relied on [InferBo](/docs/next/checker-bufferoverrun)'s aliasing mechanism which was easy to invoke and integrate with. However, InferBo's aliasing analysis is far from perfect and causes issues for purity.
To see the issue with the second point, consider the following program:
```java
boolean contains(Integer i, ArrayList<Integer> list){
Iterator<Integer> listIterator = list.iterator();
while(listIterator.hasNext()) {
Integer el = listIterator.next();
if (i.equals(el)){
return true;
}
}
return false;
}
```
The existing purity analysis concludes that the above function `contains` is impure because it calls an impure function `next()` which modifies the iterator (hence it thinks it also modifies the `list`). However, notice that `contains` doesn't have an observable side-effect: `list.iterator()` returns a new object, `hasNext()` and `equals()` are pure, and `next()` only modifies the fields of the fresh object `listIterator`. Therefore, `contains` should be considered as pure.
To alleviate this problem, we have developed an [Impurity](/docs/next/checker-impurity) analysis which uses [pulse](/docs/next/checker-pulse) which can successfully analyze this program as pure \o/
The analysis is used by:
- [Loop-hoisting](/docs/next/checker-loop-hoisting) analysis which identifies loop-invariant function calls, i.e. functions that are pure and have loop-invariant arguments.
- [Cost](/docs/next/checker-cost) analysis which identifies control variables in the loop that affect how many times a loop is executed. In this computation, we need to prune control variables that do not affect how many times a loop is executed. In this pruning step, we need to compute loop-invariant variables (which requires the above analysis).
## List of Issue Types
The following issue types are reported by this checker:
- [PURE_FUNCTION](/docs/next/all-issue-types#pure_function)

@ -24,25 +24,25 @@ example
## List of Issue Types ## List of Issue Types
The following issue types are reported by this checker: The following issue types are reported by this checker:
- [CREATE_INTENT_FROM_URI](all-issue-types#create_intent_from_uri) - [CREATE_INTENT_FROM_URI](/docs/next/all-issue-types#create_intent_from_uri)
- [CROSS_SITE_SCRIPTING](all-issue-types#cross_site_scripting) - [CROSS_SITE_SCRIPTING](/docs/next/all-issue-types#cross_site_scripting)
- [EXPOSED_INSECURE_INTENT_HANDLING](all-issue-types#exposed_insecure_intent_handling) - [EXPOSED_INSECURE_INTENT_HANDLING](/docs/next/all-issue-types#exposed_insecure_intent_handling)
- [INSECURE_INTENT_HANDLING](all-issue-types#insecure_intent_handling) - [INSECURE_INTENT_HANDLING](/docs/next/all-issue-types#insecure_intent_handling)
- [JAVASCRIPT_INJECTION](all-issue-types#javascript_injection) - [JAVASCRIPT_INJECTION](/docs/next/all-issue-types#javascript_injection)
- [LOGGING_PRIVATE_DATA](all-issue-types#logging_private_data) - [LOGGING_PRIVATE_DATA](/docs/next/all-issue-types#logging_private_data)
- [QUANDARY_TAINT_ERROR](all-issue-types#quandary_taint_error) - [QUANDARY_TAINT_ERROR](/docs/next/all-issue-types#quandary_taint_error)
- [SHELL_INJECTION](all-issue-types#shell_injection) - [SHELL_INJECTION](/docs/next/all-issue-types#shell_injection)
- [SHELL_INJECTION_RISK](all-issue-types#shell_injection_risk) - [SHELL_INJECTION_RISK](/docs/next/all-issue-types#shell_injection_risk)
- [SQL_INJECTION](all-issue-types#sql_injection) - [SQL_INJECTION](/docs/next/all-issue-types#sql_injection)
- [SQL_INJECTION_RISK](all-issue-types#sql_injection_risk) - [SQL_INJECTION_RISK](/docs/next/all-issue-types#sql_injection_risk)
- [UNTRUSTED_BUFFER_ACCESS](all-issue-types#untrusted_buffer_access) - [UNTRUSTED_BUFFER_ACCESS](/docs/next/all-issue-types#untrusted_buffer_access)
- [UNTRUSTED_DESERIALIZATION](all-issue-types#untrusted_deserialization) - [UNTRUSTED_DESERIALIZATION](/docs/next/all-issue-types#untrusted_deserialization)
- [UNTRUSTED_DESERIALIZATION_RISK](all-issue-types#untrusted_deserialization_risk) - [UNTRUSTED_DESERIALIZATION_RISK](/docs/next/all-issue-types#untrusted_deserialization_risk)
- [UNTRUSTED_ENVIRONMENT_CHANGE_RISK](all-issue-types#untrusted_environment_change_risk) - [UNTRUSTED_ENVIRONMENT_CHANGE_RISK](/docs/next/all-issue-types#untrusted_environment_change_risk)
- [UNTRUSTED_FILE](all-issue-types#untrusted_file) - [UNTRUSTED_FILE](/docs/next/all-issue-types#untrusted_file)
- [UNTRUSTED_FILE_RISK](all-issue-types#untrusted_file_risk) - [UNTRUSTED_FILE_RISK](/docs/next/all-issue-types#untrusted_file_risk)
- [UNTRUSTED_HEAP_ALLOCATION](all-issue-types#untrusted_heap_allocation) - [UNTRUSTED_HEAP_ALLOCATION](/docs/next/all-issue-types#untrusted_heap_allocation)
- [UNTRUSTED_INTENT_CREATION](all-issue-types#untrusted_intent_creation) - [UNTRUSTED_INTENT_CREATION](/docs/next/all-issue-types#untrusted_intent_creation)
- [UNTRUSTED_URL_RISK](all-issue-types#untrusted_url_risk) - [UNTRUSTED_URL_RISK](/docs/next/all-issue-types#untrusted_url_risk)
- [UNTRUSTED_VARIABLE_LENGTH_ARRAY](all-issue-types#untrusted_variable_length_array) - [UNTRUSTED_VARIABLE_LENGTH_ARRAY](/docs/next/all-issue-types#untrusted_variable_length_array)
- [USER_CONTROLLED_SQL_RISK](all-issue-types#user_controlled_sql_risk) - [USER_CONTROLLED_SQL_RISK](/docs/next/all-issue-types#user_controlled_sql_risk)

@ -13,7 +13,7 @@ Supported languages:
RacerD finds data races in your C++ and Java code. This page gives a more in-depth RacerD finds data races in your C++ and Java code. This page gives a more in-depth
explanation of how the analysis works *for Java code*, but may be less complete than the explanation of how the analysis works *for Java code*, but may be less complete than the
[Thread Safety Violation bug description page](#thread-safety-violation). [Thread Safety Violation bug description page](/docs/next/all-issue-types#thread_safety_violation).
To run the analysis, you can use plain `infer` (to run RacerD along with other To run the analysis, you can use plain `infer` (to run RacerD along with other
analyses that are run by default) or `infer --racerd-only` (to run only RacerD). analyses that are run by default) or `infer --racerd-only` (to run only RacerD).
@ -308,7 +308,7 @@ synchronized void setFWithLock() {
Unlike the other annotations shown here, this one lives in Unlike the other annotations shown here, this one lives in
[Android](https://developer.android.com/reference/android/support/annotation/VisibleForTesting.html). [Android](https://developer.android.com/reference/android/support/annotation/VisibleForTesting.html).
## <a name="interprocedural"></a> Interprocedural Reasoning ## Interprocedural Reasoning
An important feature of RacerD is that it finds races by analyzing not just one An important feature of RacerD is that it finds races by analyzing not just one
file or class, but by looking at memory accesses that occur after going through file or class, but by looking at memory accesses that occur after going through
@ -409,7 +409,7 @@ Facebook engineers.
[A separate blog post looked at 100 recent data race fixes](https://code.facebook.com/posts/1537144479682247/finding-inter-procedural-bugs-at-scale-with-infer-static-analyzer/) [A separate blog post looked at 100 recent data race fixes](https://code.facebook.com/posts/1537144479682247/finding-inter-procedural-bugs-at-scale-with-infer-static-analyzer/)
in Infer's deployment in various bug categories, and for data races observed in Infer's deployment in various bug categories, and for data races observed
that 53 of them were inter-file (and thus involving multiple classes). that 53 of them were inter-file (and thus involving multiple classes).
[See above](racerd#interprocedural) for an example of RacerD's interprocedural [See above](#interprocedural-reasoning) for an example of RacerD's interprocedural
capabilities. capabilities.
One reaction to the challenge of developing effective static race detectors has One reaction to the challenge of developing effective static race detectors has
@ -421,14 +421,7 @@ Rust, and the use/checking of @GuardedBy annotations in
[Java](https://homes.cs.washington.edu/~mernst/pubs/locking-semantics-nfm2016.pdf) [Java](https://homes.cs.washington.edu/~mernst/pubs/locking-semantics-nfm2016.pdf)
including in including in
[Google's Error Prone analyzer](https://github.com/google/error-prone/blob/master/docs/bugpattern/GuardedBy.md). [Google's Error Prone analyzer](https://github.com/google/error-prone/blob/master/docs/bugpattern/GuardedBy.md).
When lock annotations are present they make the analyzer's life easier, and we When lock annotations are present they make the analyzer's life easier. It is possible to have a very effective race analysis without decreeing
have
[GuardedBy checking as part of Infer](checkers-bug-types#UNSAFE_GUARDEDBY_ACCESS)
(though separate from the race detector). Our GuardedBy checker can find some
bugs that RacerD does not (see
[this example on anonymous inner classes](checkers-bug-types#anonymous_inner)),
but the race detector finds a greater number because it can work on un-annotated
code. It is possible to have a very effective race analysis without decreeing
that such annotations must be present. This was essential for our deployment, that such annotations must be present. This was essential for our deployment,
since _requiring_ lock annotations would have been a show stopper for converting since _requiring_ lock annotations would have been a show stopper for converting
many thousands of lines of code to a concurrent context. We believe that this many thousands of lines of code to a concurrent context. We believe that this
@ -505,7 +498,7 @@ resource.
## List of Issue Types ## List of Issue Types
The following issue types are reported by this checker: The following issue types are reported by this checker:
- [GUARDEDBY_VIOLATION](all-issue-types#guardedby_violation) - [GUARDEDBY_VIOLATION](/docs/next/all-issue-types#guardedby_violation)
- [INTERFACE_NOT_THREAD_SAFE](all-issue-types#interface_not_thread_safe) - [INTERFACE_NOT_THREAD_SAFE](/docs/next/all-issue-types#interface_not_thread_safe)
- [LOCK_CONSISTENCY_VIOLATION](all-issue-types#lock_consistency_violation) - [LOCK_CONSISTENCY_VIOLATION](/docs/next/all-issue-types#lock_consistency_violation)
- [THREAD_SAFETY_VIOLATION](all-issue-types#thread_safety_violation) - [THREAD_SAFETY_VIOLATION](/docs/next/all-issue-types#thread_safety_violation)

@ -16,8 +16,8 @@ Supported languages:
## List of Issue Types ## List of Issue Types
The following issue types are reported by this checker: The following issue types are reported by this checker:
- [CAPTURED_STRONG_SELF](all-issue-types#captured_strong_self) - [CAPTURED_STRONG_SELF](/docs/next/all-issue-types#captured_strong_self)
- [MIXED_SELF_WEAKSELF](all-issue-types#mixed_self_weakself) - [MIXED_SELF_WEAKSELF](/docs/next/all-issue-types#mixed_self_weakself)
- [MULTIPLE_WEAKSELF](all-issue-types#multiple_weakself) - [MULTIPLE_WEAKSELF](/docs/next/all-issue-types#multiple_weakself)
- [STRONG_SELF_NOT_CHECKED](all-issue-types#strong_self_not_checked) - [STRONG_SELF_NOT_CHECKED](/docs/next/all-issue-types#strong_self_not_checked)
- [WEAK_SELF_IN_NO_ESCAPE_BLOCK](all-issue-types#weak_self_in_no_escape_block) - [WEAK_SELF_IN_NO_ESCAPE_BLOCK](/docs/next/all-issue-types#weak_self_in_no_escape_block)

@ -16,4 +16,4 @@ Supported languages:
## List of Issue Types ## List of Issue Types
The following issue types are reported by this checker: The following issue types are reported by this checker:
- [STATIC_INITIALIZATION_ORDER_FIASCO](all-issue-types#static_initialization_order_fiasco) - [STATIC_INITIALIZATION_ORDER_FIASCO](/docs/next/all-issue-types#static_initialization_order_fiasco)

@ -21,7 +21,7 @@ Detect several kinds of "starvation" problems:
## List of Issue Types ## List of Issue Types
The following issue types are reported by this checker: The following issue types are reported by this checker:
- [DEADLOCK](all-issue-types#deadlock) - [DEADLOCK](/docs/next/all-issue-types#deadlock)
- [LOCKLESS_VIOLATION](all-issue-types#lockless_violation) - [LOCKLESS_VIOLATION](/docs/next/all-issue-types#lockless_violation)
- [STARVATION](all-issue-types#starvation) - [STARVATION](/docs/next/all-issue-types#starvation)
- [STRICT_MODE_VIOLATION](all-issue-types#strict_mode_violation) - [STRICT_MODE_VIOLATION](/docs/next/all-issue-types#strict_mode_violation)

@ -16,4 +16,4 @@ Supported languages:
## List of Issue Types ## List of Issue Types
The following issue types are reported by this checker: The following issue types are reported by this checker:
- [UNINITIALIZED_VALUE](all-issue-types#uninitialized_value) - [UNINITIALIZED_VALUE](/docs/next/all-issue-types#uninitialized_value)

@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.4 --> <!-- Creator : groff version 1.22.4 -->
<!-- CreationDate: Tue Jun 16 10:14:13 2020 --> <!-- CreationDate: Thu Jun 18 15:37:09 2020 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> "http://www.w3.org/TR/html4/loose.dtd">
<html> <html>
@ -343,7 +343,7 @@ disable all other checkers (Conversely:
<p style="margin-left:11%;"><b>--litho-required-props</b></p> <p style="margin-left:11%;"><b>--litho-required-props</b></p>
<p style="margin-left:17%;">Activates: checker <p style="margin-left:17%;">Activates: checker
litho-required-props: Checks that all non-option litho-required-props: Checks that all non-optional
&rsquo;@Prop&rsquo;s have been specified when constructing &rsquo;@Prop&rsquo;s have been specified when constructing
Litho components. (Conversely: Litho components. (Conversely:
<b>--no-litho-required-props</b>)</p> <b>--no-litho-required-props</b>)</p>

@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.4 --> <!-- Creator : groff version 1.22.4 -->
<!-- CreationDate: Tue Jun 16 10:14:13 2020 --> <!-- CreationDate: Thu Jun 18 15:37:09 2020 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> "http://www.w3.org/TR/html4/loose.dtd">
<html> <html>

@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.4 --> <!-- Creator : groff version 1.22.4 -->
<!-- CreationDate: Tue Jun 16 10:14:13 2020 --> <!-- CreationDate: Thu Jun 18 15:37:09 2020 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> "http://www.w3.org/TR/html4/loose.dtd">
<html> <html>

@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.4 --> <!-- Creator : groff version 1.22.4 -->
<!-- CreationDate: Tue Jun 16 10:14:13 2020 --> <!-- CreationDate: Thu Jun 18 15:37:09 2020 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> "http://www.w3.org/TR/html4/loose.dtd">
<html> <html>

@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.4 --> <!-- Creator : groff version 1.22.4 -->
<!-- CreationDate: Tue Jun 16 10:14:13 2020 --> <!-- CreationDate: Thu Jun 18 15:37:09 2020 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> "http://www.w3.org/TR/html4/loose.dtd">
<html> <html>

@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.4 --> <!-- Creator : groff version 1.22.4 -->
<!-- CreationDate: Tue Jun 16 10:14:13 2020 --> <!-- CreationDate: Thu Jun 18 15:37:09 2020 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> "http://www.w3.org/TR/html4/loose.dtd">
<html> <html>
@ -176,8 +176,6 @@ Assert_failure (enabled by default), <br>
BAD_POINTER_COMPARISON (enabled by default), <br> BAD_POINTER_COMPARISON (enabled by default), <br>
BIABDUCTION_ANALYSIS_STOPS (disabled by default), <br> BIABDUCTION_ANALYSIS_STOPS (disabled by default), <br>
BIABDUCTION_MEMORY_LEAK (disabled by default), <br> BIABDUCTION_MEMORY_LEAK (disabled by default), <br>
BIABD_CONDITION_ALWAYS_FALSE (disabled by default), <br>
BIABD_CONDITION_ALWAYS_TRUE (disabled by default), <br>
BUFFER_OVERRUN_L1 (enabled by default), <br> BUFFER_OVERRUN_L1 (enabled by default), <br>
BUFFER_OVERRUN_L2 (enabled by default), <br> BUFFER_OVERRUN_L2 (enabled by default), <br>
BUFFER_OVERRUN_L3 (enabled by default), <br> BUFFER_OVERRUN_L3 (enabled by default), <br>
@ -223,8 +221,6 @@ DANGLING_POINTER_DEREFERENCE_MAYBE (disabled by default),
<br> <br>
DEADLOCK (enabled by default), <br> DEADLOCK (enabled by default), <br>
DEAD_STORE (enabled by default), <br> DEAD_STORE (enabled by default), <br>
DEALLOCATE_STACK_VARIABLE (enabled by default), <br>
DEALLOCATE_STATIC_MEMORY (enabled by default), <br>
DIRECT_ATOMIC_PROPERTY_ACCESS (enabled by default), <br> DIRECT_ATOMIC_PROPERTY_ACCESS (enabled by default), <br>
DISCOURAGED_WEAK_PROPERTY_CUSTOM_SETTER (enabled by DISCOURAGED_WEAK_PROPERTY_CUSTOM_SETTER (enabled by
default), <br> default), <br>
@ -311,7 +307,6 @@ default), <br>
Missing_fld (enabled by default), <br> Missing_fld (enabled by default), <br>
NULLPTR_DEREFERENCE (disabled by default), <br> NULLPTR_DEREFERENCE (disabled by default), <br>
NULL_DEREFERENCE (enabled by default), <br> NULL_DEREFERENCE (enabled by default), <br>
NULL_TEST_AFTER_DEREFERENCE (disabled by default), <br>
PARAMETER_NOT_NULL_CHECKED (enabled by default), <br> PARAMETER_NOT_NULL_CHECKED (enabled by default), <br>
POINTER_SIZE_MISMATCH (enabled by default), <br> POINTER_SIZE_MISMATCH (enabled by default), <br>
POINTER_TO_CONST_OBJC_CLASS (enabled by default), <br> POINTER_TO_CONST_OBJC_CLASS (enabled by default), <br>

@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.4 --> <!-- Creator : groff version 1.22.4 -->
<!-- CreationDate: Tue Jun 16 10:14:13 2020 --> <!-- CreationDate: Thu Jun 18 15:37:09 2020 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> "http://www.w3.org/TR/html4/loose.dtd">
<html> <html>

@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.4 --> <!-- Creator : groff version 1.22.4 -->
<!-- CreationDate: Tue Jun 16 10:14:14 2020 --> <!-- CreationDate: Thu Jun 18 15:37:09 2020 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> "http://www.w3.org/TR/html4/loose.dtd">
<html> <html>

@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.4 --> <!-- Creator : groff version 1.22.4 -->
<!-- CreationDate: Tue Jun 16 10:14:14 2020 --> <!-- CreationDate: Thu Jun 18 15:37:10 2020 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> "http://www.w3.org/TR/html4/loose.dtd">
<html> <html>
@ -663,8 +663,6 @@ Assert_failure (enabled by default), <br>
BAD_POINTER_COMPARISON (enabled by default), <br> BAD_POINTER_COMPARISON (enabled by default), <br>
BIABDUCTION_ANALYSIS_STOPS (disabled by default), <br> BIABDUCTION_ANALYSIS_STOPS (disabled by default), <br>
BIABDUCTION_MEMORY_LEAK (disabled by default), <br> BIABDUCTION_MEMORY_LEAK (disabled by default), <br>
BIABD_CONDITION_ALWAYS_FALSE (disabled by default), <br>
BIABD_CONDITION_ALWAYS_TRUE (disabled by default), <br>
BUFFER_OVERRUN_L1 (enabled by default), <br> BUFFER_OVERRUN_L1 (enabled by default), <br>
BUFFER_OVERRUN_L2 (enabled by default), <br> BUFFER_OVERRUN_L2 (enabled by default), <br>
BUFFER_OVERRUN_L3 (enabled by default), <br> BUFFER_OVERRUN_L3 (enabled by default), <br>
@ -710,8 +708,6 @@ DANGLING_POINTER_DEREFERENCE_MAYBE (disabled by default),
<br> <br>
DEADLOCK (enabled by default), <br> DEADLOCK (enabled by default), <br>
DEAD_STORE (enabled by default), <br> DEAD_STORE (enabled by default), <br>
DEALLOCATE_STACK_VARIABLE (enabled by default), <br>
DEALLOCATE_STATIC_MEMORY (enabled by default), <br>
DIRECT_ATOMIC_PROPERTY_ACCESS (enabled by default), <br> DIRECT_ATOMIC_PROPERTY_ACCESS (enabled by default), <br>
DISCOURAGED_WEAK_PROPERTY_CUSTOM_SETTER (enabled by DISCOURAGED_WEAK_PROPERTY_CUSTOM_SETTER (enabled by
default), <br> default), <br>
@ -798,7 +794,6 @@ default), <br>
Missing_fld (enabled by default), <br> Missing_fld (enabled by default), <br>
NULLPTR_DEREFERENCE (disabled by default), <br> NULLPTR_DEREFERENCE (disabled by default), <br>
NULL_DEREFERENCE (enabled by default), <br> NULL_DEREFERENCE (enabled by default), <br>
NULL_TEST_AFTER_DEREFERENCE (disabled by default), <br>
PARAMETER_NOT_NULL_CHECKED (enabled by default), <br> PARAMETER_NOT_NULL_CHECKED (enabled by default), <br>
POINTER_SIZE_MISMATCH (enabled by default), <br> POINTER_SIZE_MISMATCH (enabled by default), <br>
POINTER_TO_CONST_OBJC_CLASS (enabled by default), <br> POINTER_TO_CONST_OBJC_CLASS (enabled by default), <br>
@ -1280,7 +1275,7 @@ issue types that infer might report. (Conversely:
--litho-required-props</b></p> --litho-required-props</b></p>
<p style="margin-left:17%;">Activates: checker <p style="margin-left:17%;">Activates: checker
litho-required-props: Checks that all non-option litho-required-props: Checks that all non-optional
&rsquo;@Prop&rsquo;s have been specified when constructing &rsquo;@Prop&rsquo;s have been specified when constructing
Litho components. (Conversely: Litho components. (Conversely:
<b>--no-litho-required-props</b>)</p> <b>--no-litho-required-props</b>)</p>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,2 +1,2 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Help (infer.Integration.Help)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 1.5.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> <a href="../../index.html">infer</a> &#x00BB; <a href="../index.html">Integration</a> &#x00BB; Help</nav><h1>Module <code>Integration.Help</code></h1></header><dl><dt class="spec value" id="val-list_checkers"><a href="#val-list_checkers" class="anchor"></a><code><span class="keyword">val</span> list_checkers : unit <span>&#45;&gt;</span> unit</code></dt><dd><p>print the list of all checkers</p></dd></dl><dl><dt class="spec value" id="val-list_issue_types"><a href="#val-list_issue_types" class="anchor"></a><code><span class="keyword">val</span> list_issue_types : unit <span>&#45;&gt;</span> unit</code></dt><dd><p>print the list of all known issue types</p></dd></dl><dl><dt class="spec value" id="val-show_checkers"><a href="#val-show_checkers" class="anchor"></a><code><span class="keyword">val</span> show_checkers : <span><a href="../../IBase/Checker/index.html#type-t">IBase.Checker.t</a> list</span> <span>&#45;&gt;</span> unit</code></dt><dd><p>show information about the given checkers</p></dd></dl><dl><dt class="spec value" id="val-show_issue_types"><a href="#val-show_issue_types" class="anchor"></a><code><span class="keyword">val</span> show_issue_types : <span><a href="../../IBase/IssueType/index.html#type-t">IBase.IssueType.t</a> list</span> <span>&#45;&gt;</span> unit</code></dt><dd><p>show information about the given issue_types</p></dd></dl><dl><dt class="spec value" id="val-write_website"><a href="#val-write_website" class="anchor"></a><code><span class="keyword">val</span> write_website : <span>website_root:string</span> <span>&#45;&gt;</span> unit</code></dt><dd><p>generate files for the fbinfer.com website</p></dd></dl><dl><dt class="spec value" id="val-url_fragment_of_issue_type"><a href="#val-url_fragment_of_issue_type" class="anchor"></a><code><span class="keyword">val</span> url_fragment_of_issue_type : string <span>&#45;&gt;</span> string</code></dt><dd><p>given an issue type unique ID, return the URL fragment relative to the website documentation, e.g. <code>url_fragment_of_issue_type &quot;NULL_DEREFERENCE&quot;</code> is <code>&quot;all-issue-types#null_dereference&quot;</code></p></dd></dl></div></body></html> <html xmlns="http://www.w3.org/1999/xhtml"><head><title>Help (infer.Integration.Help)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 1.5.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> <a href="../../index.html">infer</a> &#x00BB; <a href="../index.html">Integration</a> &#x00BB; Help</nav><h1>Module <code>Integration.Help</code></h1></header><dl><dt class="spec value" id="val-list_checkers"><a href="#val-list_checkers" class="anchor"></a><code><span class="keyword">val</span> list_checkers : unit <span>&#45;&gt;</span> unit</code></dt><dd><p>print the list of all checkers</p></dd></dl><dl><dt class="spec value" id="val-list_issue_types"><a href="#val-list_issue_types" class="anchor"></a><code><span class="keyword">val</span> list_issue_types : unit <span>&#45;&gt;</span> unit</code></dt><dd><p>print the list of all known issue types</p></dd></dl><dl><dt class="spec value" id="val-show_checkers"><a href="#val-show_checkers" class="anchor"></a><code><span class="keyword">val</span> show_checkers : <span><a href="../../IBase/Checker/index.html#type-t">IBase.Checker.t</a> list</span> <span>&#45;&gt;</span> unit</code></dt><dd><p>show information about the given checkers</p></dd></dl><dl><dt class="spec value" id="val-show_issue_types"><a href="#val-show_issue_types" class="anchor"></a><code><span class="keyword">val</span> show_issue_types : <span><a href="../../IBase/IssueType/index.html#type-t">IBase.IssueType.t</a> list</span> <span>&#45;&gt;</span> unit</code></dt><dd><p>show information about the given issue_types</p></dd></dl><dl><dt class="spec value" id="val-write_website"><a href="#val-write_website" class="anchor"></a><code><span class="keyword">val</span> write_website : <span>website_root:string</span> <span>&#45;&gt;</span> unit</code></dt><dd><p>generate files for the fbinfer.com website</p></dd></dl><dl><dt class="spec value" id="val-abs_url_of_issue_type"><a href="#val-abs_url_of_issue_type" class="anchor"></a><code><span class="keyword">val</span> abs_url_of_issue_type : string <span>&#45;&gt;</span> string</code></dt><dd><p>given an issue type unique ID, return the URL relative to the root of the website, e.g. <code>abs_url_of_issue_type &quot;NULL_DEREFERENCE&quot;</code> is <code>&quot;/docs/all-issue-types#null_dereference&quot;</code></p></dd></dl></div></body></html>

@ -1,2 +1,2 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Integration__Help (infer.Integration__Help)</title><link rel="stylesheet" href="../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 1.5.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> <a href="../index.html">infer</a> &#x00BB; Integration__Help</nav><h1>Module <code>Integration__Help</code></h1></header><dl><dt class="spec value" id="val-list_checkers"><a href="#val-list_checkers" class="anchor"></a><code><span class="keyword">val</span> list_checkers : unit <span>&#45;&gt;</span> unit</code></dt><dd><p>print the list of all checkers</p></dd></dl><dl><dt class="spec value" id="val-list_issue_types"><a href="#val-list_issue_types" class="anchor"></a><code><span class="keyword">val</span> list_issue_types : unit <span>&#45;&gt;</span> unit</code></dt><dd><p>print the list of all known issue types</p></dd></dl><dl><dt class="spec value" id="val-show_checkers"><a href="#val-show_checkers" class="anchor"></a><code><span class="keyword">val</span> show_checkers : <span><a href="../IBase/Checker/index.html#type-t">IBase.Checker.t</a> list</span> <span>&#45;&gt;</span> unit</code></dt><dd><p>show information about the given checkers</p></dd></dl><dl><dt class="spec value" id="val-show_issue_types"><a href="#val-show_issue_types" class="anchor"></a><code><span class="keyword">val</span> show_issue_types : <span><a href="../IBase/IssueType/index.html#type-t">IBase.IssueType.t</a> list</span> <span>&#45;&gt;</span> unit</code></dt><dd><p>show information about the given issue_types</p></dd></dl><dl><dt class="spec value" id="val-write_website"><a href="#val-write_website" class="anchor"></a><code><span class="keyword">val</span> write_website : <span>website_root:string</span> <span>&#45;&gt;</span> unit</code></dt><dd><p>generate files for the fbinfer.com website</p></dd></dl><dl><dt class="spec value" id="val-url_fragment_of_issue_type"><a href="#val-url_fragment_of_issue_type" class="anchor"></a><code><span class="keyword">val</span> url_fragment_of_issue_type : string <span>&#45;&gt;</span> string</code></dt><dd><p>given an issue type unique ID, return the URL fragment relative to the website documentation, e.g. <code>url_fragment_of_issue_type &quot;NULL_DEREFERENCE&quot;</code> is <code>&quot;all-issue-types#null_dereference&quot;</code></p></dd></dl></div></body></html> <html xmlns="http://www.w3.org/1999/xhtml"><head><title>Integration__Help (infer.Integration__Help)</title><link rel="stylesheet" href="../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 1.5.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> <a href="../index.html">infer</a> &#x00BB; Integration__Help</nav><h1>Module <code>Integration__Help</code></h1></header><dl><dt class="spec value" id="val-list_checkers"><a href="#val-list_checkers" class="anchor"></a><code><span class="keyword">val</span> list_checkers : unit <span>&#45;&gt;</span> unit</code></dt><dd><p>print the list of all checkers</p></dd></dl><dl><dt class="spec value" id="val-list_issue_types"><a href="#val-list_issue_types" class="anchor"></a><code><span class="keyword">val</span> list_issue_types : unit <span>&#45;&gt;</span> unit</code></dt><dd><p>print the list of all known issue types</p></dd></dl><dl><dt class="spec value" id="val-show_checkers"><a href="#val-show_checkers" class="anchor"></a><code><span class="keyword">val</span> show_checkers : <span><a href="../IBase/Checker/index.html#type-t">IBase.Checker.t</a> list</span> <span>&#45;&gt;</span> unit</code></dt><dd><p>show information about the given checkers</p></dd></dl><dl><dt class="spec value" id="val-show_issue_types"><a href="#val-show_issue_types" class="anchor"></a><code><span class="keyword">val</span> show_issue_types : <span><a href="../IBase/IssueType/index.html#type-t">IBase.IssueType.t</a> list</span> <span>&#45;&gt;</span> unit</code></dt><dd><p>show information about the given issue_types</p></dd></dl><dl><dt class="spec value" id="val-write_website"><a href="#val-write_website" class="anchor"></a><code><span class="keyword">val</span> write_website : <span>website_root:string</span> <span>&#45;&gt;</span> unit</code></dt><dd><p>generate files for the fbinfer.com website</p></dd></dl><dl><dt class="spec value" id="val-abs_url_of_issue_type"><a href="#val-abs_url_of_issue_type" class="anchor"></a><code><span class="keyword">val</span> abs_url_of_issue_type : string <span>&#45;&gt;</span> string</code></dt><dd><p>given an issue type unique ID, return the URL relative to the root of the website, e.g. <code>abs_url_of_issue_type &quot;NULL_DEREFERENCE&quot;</code> is <code>&quot;/docs/all-issue-types#null_dereference&quot;</code></p></dd></dl></div></body></html>
Loading…
Cancel
Save