@ -10,7 +10,8 @@ open! IStd
type t =
type t =
| AnnotationReachability
| AnnotationReachability
| Biabduction
| Biabduction
| BufferOverrun
| BufferOverrunAnalysis
| BufferOverrunChecker
| ClassLoads
| ClassLoads
| Cost
| Cost
| Eradicate
| Eradicate
@ -38,13 +39,15 @@ type t =
type support = NoSupport | Support | ExperimentalSupport | ToySupport
type support = NoSupport | Support | ExperimentalSupport | ToySupport
type cli_flags = { long : string ; deprecated : string list ; show_in_help : bool }
type config =
type config =
{ support : Language . t -> support
{ name : string
; support : Language . t -> support
; short_documentation : string
; short_documentation : string
; cli_flag : string
; cli_flags : cli_flags option
; show_in_help : bool
; enabled_by_default : bool
; enabled_by_default : bool
; cli_deprecated_flags: string list }
; activates: t list }
(* support for languages should be consistent with the corresponding
(* support for languages should be consistent with the corresponding
callbacks registered . Or maybe with the issues reported in link
callbacks registered . Or maybe with the issues reported in link
@ -63,197 +66,210 @@ let config checker =
in
in
match checker with
match checker with
| AnnotationReachability ->
| AnnotationReachability ->
{ support = supports_clang_and_java
{ name = " annotation reachability "
; support = supports_clang_and_java
; short_documentation =
; short_documentation =
" the annotation reachability checker. Given a pair of source and sink annotation, e.g. \
" the annotation reachability checker. Given a pair of source and sink annotation, e.g. \
@ PerformanceCritical and @ Expensive , this checker will warn whenever some method \
@ PerformanceCritical and @ Expensive , this checker will warn whenever some method \
annotated with @ PerformanceCritical calls , directly or indirectly , another method \
annotated with @ PerformanceCritical calls , directly or indirectly , another method \
annotated with @ Expensive "
annotated with @ Expensive "
; show_in_help = true
; cli_flags = Some { long = " annotation-reachability " ; deprecated = [] ; show_in_help = true }
; cli_flag = " annotation-reachability "
; enabled_by_default = false
; enabled_by_default = false
; cli_deprecated_flag s= [] }
; activate s= [] }
| Biabduction ->
| Biabduction ->
{ support = supports_clang_and_java
{ name = " biabduction "
; support = supports_clang_and_java
; short_documentation =
; short_documentation =
" the separation logic based bi-abduction analysis using the checkers framework "
" the separation logic based bi-abduction analysis using the checkers framework "
; show_in_help = true
; cli_flags = Some { long = " biabduction " ; deprecated = [] ; show_in_help = true }
; cli_flag = " biabduction "
; enabled_by_default = true
; enabled_by_default = true
; cli_deprecated_flags = [] }
; activates = [] }
| BufferOverrun ->
| BufferOverrunAnalysis ->
{ support = supports_clang_and_java
{ name = " buffer overrun analysis "
; support = supports_clang_and_java
; short_documentation =
" internal part of the buffer overrun analysis that computes values at each program \
point , automatically triggered when analyses that depend on these are run "
; cli_flags = None
; enabled_by_default = false
; activates = [] }
| BufferOverrunChecker ->
{ name = " buffer overrun checker "
; support = supports_clang_and_java
; short_documentation = " the buffer overrun analysis "
; short_documentation = " the buffer overrun analysis "
; show_in_help = true
; cli_flags = Some { long = " bufferoverrun " ; deprecated = [] ; show_in_help = true }
; cli_flag = " bufferoverrun "
; enabled_by_default = false
; enabled_by_default = false
; cli_deprecated_flags = [] }
; activates= [ BufferOverrunAnalysis ] }
| ClassLoads ->
| ClassLoads ->
{ support = supports_java
{ name = " Class loading analysis "
; support = supports_java
; short_documentation = " Java class loading analysis "
; short_documentation = " Java class loading analysis "
; show_in_help = true
; cli_flags = Some { long = " class-loads " ; deprecated = [] ; show_in_help = true }
; cli_flag = " class-loads "
; enabled_by_default = false
; enabled_by_default = false
; cli_deprecated_flag s= [] }
; activate s= [] }
| Cost ->
| Cost ->
{ support = supports_clang_and_java
{ name = " cost analysis "
; support = supports_clang_and_java
; short_documentation = " checker for performance cost analysis "
; short_documentation = " checker for performance cost analysis "
; show_in_help = true
; cli_flags = Some { long = " cost " ; deprecated = [] ; show_in_help = true }
; cli_flag = " cost "
; enabled_by_default = false
; enabled_by_default = false
; cli_deprecated_flags= [ ] }
; activates= [ BufferOverrunAnalysis ] }
| Eradicate ->
| Eradicate ->
{ support = supports_java
{ name = " eradicate "
; support = supports_java
; short_documentation = " the eradicate @Nullable checker for Java annotations "
; short_documentation = " the eradicate @Nullable checker for Java annotations "
; show_in_help = true
; cli_flags = Some { long = " eradicate " ; deprecated = [] ; show_in_help = true }
; cli_flag = " eradicate "
; enabled_by_default = false
; enabled_by_default = false
; cli_deprecated_flag s= [] }
; activate s= [] }
| FragmentRetainsView ->
| FragmentRetainsView ->
{ support = supports_java
{ name = " fragment retains view "
; support = supports_java
; short_documentation =
; short_documentation =
" detects when Android fragments are not explicitly nullified before becoming unreabable "
" detects when Android fragments are not explicitly nullified before becoming unreabable "
; show_in_help = true
; cli_flags = Some { long = " fragment-retains-view " ; deprecated = [] ; show_in_help = true }
; cli_flag = " fragment-retains-view "
; enabled_by_default = true
; enabled_by_default = true
; cli_deprecated_flag s= [] }
; activate s= [] }
| ImmutableCast ->
| ImmutableCast ->
{ support = supports_java
{ name = " immutable cast "
; support = supports_java
; short_documentation =
; short_documentation =
" the detection of object cast from immutable type to mutable type. For instance, it will \
" the detection of object cast from immutable type to mutable type. For instance, it will \
detect cast from ImmutableList to List , ImmutableMap to Map , and ImmutableSet to Set . "
detect cast from ImmutableList to List , ImmutableMap to Map , and ImmutableSet to Set . "
; show_in_help = true
; cli_flags = Some { long = " immutable-cast " ; deprecated = [] ; show_in_help = true }
; cli_flag = " immutable-cast "
; enabled_by_default = false
; enabled_by_default = false
; cli_deprecated_flag s= [] }
; activate s= [] }
| Impurity ->
| Impurity ->
{ support = supports_clang_and_java_experimental
{ name = " impurity "
; support = supports_clang_and_java_experimental
; short_documentation = " [EXPERIMENTAL] Impurity analysis "
; short_documentation = " [EXPERIMENTAL] Impurity analysis "
; show_in_help = true
; cli_flags = Some { long = " impurity " ; deprecated = [] ; show_in_help = true }
; cli_flag = " impurity "
; enabled_by_default = false
; enabled_by_default = false
; cli_deprecated_flags= [ ] }
; activates= [ Pulse ] }
| InefficientKeysetIterator ->
| InefficientKeysetIterator ->
{ support = supports_java
{ name = " inefficient keyset iterator "
; support = supports_java
; short_documentation =
; short_documentation =
" Check for inefficient uses of keySet iterator that access both the key and the value. "
" Check for inefficient uses of keySet iterator that access both the key and the value. "
; show_in_help = true
; cli_flags = Some { long = " inefficient-keyset-iterator " ; deprecated = [] ; show_in_help = true }
; cli_flag = " inefficient-keyset-iterator "
; enabled_by_default = true
; enabled_by_default = true
; cli_deprecated_flag s= [] }
; activate s= [] }
| Linters ->
| Linters ->
{ support = supports_clang
{ name = " AST Language (AL) linters "
; support = supports_clang
; short_documentation = " syntactic linters "
; short_documentation = " syntactic linters "
; show_in_help = true
; cli_flags = Some { long = " linters " ; deprecated = [] ; show_in_help = true }
; cli_flag = " linters "
; enabled_by_default = true
; enabled_by_default = true
; cli_deprecated_flag s= [] }
; activate s= [] }
| LithoRequiredProps ->
| LithoRequiredProps ->
{ support = supports_java_experimental
{ name = " litho-required-props "
; support = supports_java_experimental
; short_documentation = " [EXPERIMENTAL] Required Prop check for Litho "
; short_documentation = " [EXPERIMENTAL] Required Prop check for Litho "
; show_in_help = true
; cli_flags = Some { long = " litho-required-props " ; deprecated = [] ; show_in_help = true }
; cli_flag = " litho-required-props "
; enabled_by_default = false
; enabled_by_default = false
; cli_deprecated_flag s= [] }
; activate s= [] }
| Liveness ->
| Liveness ->
{ support = supports_clang
{ name = " liveness "
; support = supports_clang
; short_documentation = " the detection of dead stores and unused variables "
; short_documentation = " the detection of dead stores and unused variables "
; show_in_help = true
; cli_flags = Some { long = " liveness " ; deprecated = [] ; show_in_help = true }
; cli_flag = " liveness "
; enabled_by_default = true
; enabled_by_default = true
; cli_deprecated_flag s= [] }
; activate s= [] }
| LoopHoisting ->
| LoopHoisting ->
{ support = supports_clang_and_java
{ name = " loop hoisting "
; support = supports_clang_and_java
; short_documentation = " checker for loop-hoisting "
; short_documentation = " checker for loop-hoisting "
; show_in_help = true
; cli_flags = Some { long = " loop-hoisting " ; deprecated = [] ; show_in_help = true }
; cli_flag = " loop-hoisting "
; enabled_by_default = false
; enabled_by_default = false
; cli_deprecated_flags= [ ] }
; activates= [ BufferOverrunAnalysis ; Purity ] }
| NullsafeDeprecated ->
| NullsafeDeprecated ->
{ support = ( fun _ -> NoSupport )
{ name = " nullsafe "
; support = ( fun _ -> NoSupport )
; short_documentation = " [RESERVED] Reserved for nullsafe typechecker, use --eradicate for now "
; short_documentation = " [RESERVED] Reserved for nullsafe typechecker, use --eradicate for now "
; show_in_help = false
; cli_flags =
; cli_flag = " nullsafe "
Some
{ long = " nullsafe "
; deprecated = [ " -check-nullable " ; " -suggest-nullable " ]
; show_in_help = false }
; enabled_by_default = false
; enabled_by_default = false
; cli_deprecated_flags = [ " -check-nullable " ; " -suggest-nullable " ] }
; activates= [ ] }
| PrintfArgs ->
| PrintfArgs ->
{ support = supports_java
{ name = " printf args "
; support = supports_java
; short_documentation =
; short_documentation =
" the detection of mismatch between the Java printf format strings and the argument types \
" the detection of mismatch between the Java printf format strings and the argument types \
For , example , this checker will warn about the type error in ` printf ( \ " Hello %d \" , \
For , example , this checker will warn about the type error in ` printf ( \ " Hello %d \" , \
\ " world \" )` "
\ " world \" )` "
; show_in_help = true
; cli_flags = Some { long = " printf-args " ; deprecated = [] ; show_in_help = true }
; cli_flag = " printf-args "
; enabled_by_default = false
; enabled_by_default = false
; cli_deprecated_flag s= [] }
; activate s= [] }
| Pulse ->
| Pulse ->
{ support = supports_clang_and_java_experimental
{ name = " pulse "
; support = supports_clang_and_java_experimental
; short_documentation = " [EXPERIMENTAL] memory and lifetime analysis "
; short_documentation = " [EXPERIMENTAL] memory and lifetime analysis "
; show_in_help = true
; cli_flags = Some { long = " pulse " ; deprecated = [ " -ownership " ] ; show_in_help = true }
; cli_flag = " pulse "
; enabled_by_default = false
; enabled_by_default = false
; cli_deprecated_flags= [ " -ownership " ] }
; activates= [ ] }
| Purity ->
| Purity ->
{ support = supports_clang_and_java_experimental
{ name = " purity "
; support = supports_clang_and_java_experimental
; short_documentation = " [EXPERIMENTAL] Purity analysis "
; short_documentation = " [EXPERIMENTAL] Purity analysis "
; show_in_help = true
; cli_flags = Some { long = " purity " ; deprecated = [] ; show_in_help = true }
; cli_flag = " purity "
; enabled_by_default = false
; enabled_by_default = false
; cli_deprecated_flags= [ ] }
; activates= [ BufferOverrunAnalysis ] }
| Quandary ->
| Quandary ->
{ support = supports_clang_and_java
{ name = " quandary "
; support = supports_clang_and_java
; short_documentation = " the quandary taint analysis "
; short_documentation = " the quandary taint analysis "
; show_in_help = true
; cli_flags = Some { long = " quandary " ; deprecated = [] ; show_in_help = true }
; cli_flag = " quandary "
; enabled_by_default = false
; enabled_by_default = false
; cli_deprecated_flag s= [] }
; activate s= [] }
| RacerD ->
| RacerD ->
{ support = supports_clang_and_java
{ name = " RacerD "
; support = supports_clang_and_java
; short_documentation = " the RacerD thread safety analysis "
; short_documentation = " the RacerD thread safety analysis "
; show_in_help = true
; cli_flags = Some { long = " racerd " ; deprecated = [ " -threadsafety " ] ; show_in_help = true }
; cli_flag = " racerd "
; enabled_by_default = true
; enabled_by_default = true
; cli_deprecated_flags= [ " -threadsafety " ] }
; activates= [ ] }
| ResourceLeakLabExercise ->
| ResourceLeakLabExercise ->
{ support = ( fun _ -> ToySupport )
{ name = " resource leak lab exercise "
; support = ( fun _ -> ToySupport )
; short_documentation = " "
; short_documentation = " "
; show_in_help = false
; cli_flags = Some { long = " resource-leak " ; deprecated = [] ; show_in_help = false }
; cli_flag = " resource-leak "
; enabled_by_default = false
; enabled_by_default = false
; cli_deprecated_flag s= [] }
; activate s= [] }
| SIOF ->
| SIOF ->
{ support = supports_clang
{ name = " SIOF "
; support = supports_clang
; short_documentation = " the Static Initialization Order Fiasco analysis (C++ only) "
; short_documentation = " the Static Initialization Order Fiasco analysis (C++ only) "
; show_in_help = true
; cli_flags = Some { long = " siof " ; deprecated = [] ; show_in_help = true }
; cli_flag = " siof "
; enabled_by_default = true
; enabled_by_default = true
; cli_deprecated_flag s= [] }
; activate s= [] }
| SelfInBlock ->
| SelfInBlock ->
{ support = supports_clang
{ name = " Self captured in block checker "
; support = supports_clang
; short_documentation =
; short_documentation =
" checker to flag incorrect uses of when Objective-C blocks capture self "
" checker to flag incorrect uses of when Objective-C blocks capture self "
; show_in_help = true
; cli_flags = Some { long = " self_in_block " ; deprecated = [] ; show_in_help = true }
; cli_flag = " self_in_block "
; enabled_by_default = true
; enabled_by_default = true
; cli_deprecated_flag s= [] }
; activate s= [] }
| Starvation ->
| Starvation ->
{ support = supports_clang_and_java
{ name = " Starvation analysis "
; support = supports_clang_and_java
; short_documentation = " starvation analysis "
; short_documentation = " starvation analysis "
; show_in_help = true
; cli_flags = Some { long = " starvation " ; deprecated = [] ; show_in_help = true }
; cli_flag = " starvation "
; enabled_by_default = true
; enabled_by_default = true
; cli_deprecated_flag s= [] }
; activate s= [] }
| TOPL ->
| TOPL ->
{ support = supports_clang_and_java_experimental
{ name = " TOPL "
; support = supports_clang_and_java_experimental
; short_documentation = " TOPL "
; short_documentation = " TOPL "
; show_in_help = true
; cli_flags = Some { long = " topl " ; deprecated = [] ; show_in_help = true }
; cli_flag = " topl "
; enabled_by_default = false
; enabled_by_default = false
; cli_deprecated_flags= [ ] }
; activates= [ Biabduction ] }
| Uninit ->
| Uninit ->
{ support = supports_clang
{ name = " uninitialized variables "
; support = supports_clang
; short_documentation = " checker for use of uninitialized values "
; short_documentation = " checker for use of uninitialized values "
; show_in_help = true
; cli_flags = Some { long = " uninit " ; deprecated = [] ; show_in_help = true }
; cli_flag = " uninit "
; enabled_by_default = true
; enabled_by_default = true
; cli_deprecated_flag s= [] }
; activate s= [] }