@ -9,12 +9,33 @@ open! IStd
module F = Format
module L = Die
type visibility = User | Developer | Silent [ @@ deriving compare , equal ]
let string_of_visibility = function User -> " User " | Developer -> " Developer " | Silent -> " Silent "
type severity = Like | Info | Advice | Warning | Error [ @@ deriving compare , equal , enumerate ]
let string_of_severity = function
| Advice ->
" ADVICE "
| Error ->
" ERROR "
| Info ->
" INFO "
| Like ->
" LIKE "
| Warning ->
" WARNING "
(* Make sure we cannot create new issue types other than by calling [register_from_string]. This is because
we want to keep track of the list of all the issues ever declared . * )
module Unsafe : sig
type t = private
{ unique_id : string
; checker : Checker . t
; visibility : visibility
; mutable default_severity : severity
; mutable enabled : bool
; mutable hum : string
; mutable doc_url : string option
@ -33,6 +54,8 @@ module Unsafe : sig
-> ? doc_url : string
-> ? linters_def_file : string
-> id : string
-> ? visibility : visibility
-> severity
-> Checker . t
-> t
@ -51,6 +74,8 @@ end = struct
type t =
{ unique_id : string
; checker : Checker . t
; visibility : visibility
; mutable default_severity : severity
; mutable enabled : bool
; mutable hum : string
; mutable doc_url : string option
@ -94,29 +119,42 @@ end = struct
definitely . The [ hum ] an - readable description can be updated when we encounter the definition
of the issue type , eg in AL . * )
let register_from_string ? ( enabled = true ) ? hum : hum0 ? doc_url ? linters_def_file ~ id : unique_id
checker =
? ( visibility = User ) default_severity checker =
match find_from_string ~ id : unique_id with
| ( ( Some
( { unique_id = _ (* we know it has to be the same *)
; checker = checker_old
; visibility = visibility_old
; default_severity = _ (* mutable field to update *)
; enabled = _ (* not touching this one since [Config] will have set it *)
; hum = _ (* mutable field to update *)
; doc_url = _ (* mutable field to update *)
; linters_def_file = _ (* mutable field to update *) } as issue ) ) [ @ warning " +9 " ] ) ->
(* update fields that were supplied this time around, but keep the previous values of others
and assert that the immutable fields are the same ( see doc comment ) * )
if not ( Checker . equal checker checker_old ) then
let die_of_mismatch ~ what ~ old ~ new_ =
L . die InternalError
" Checker definition for issue \" %s \" doesn't match: found new checker \" %s \" but \
checker \ " %s \" was already registered for this issue type "
unique_id ( Checker . get_name checker ) ( Checker . get_name checker_old ) ;
" %s for issue \" %s \" doesn't match: found new %s \" %s \" but %s \" %s \" was already \
registered for this issue type "
( String . capitalize what ) unique_id what new_ what old
in
if not ( Checker . equal checker checker_old ) then
die_of_mismatch ~ what : " checker " ~ old : ( Checker . get_name checker_old )
~ new_ : ( Checker . get_name checker ) ;
if not ( equal_visibility visibility visibility_old ) then
die_of_mismatch ~ what : " visibility "
~ old : ( string_of_visibility visibility_old )
~ new_ : ( string_of_visibility visibility ) ;
issue . default_severity <- default_severity ;
Option . iter hum0 ~ f : ( fun hum -> issue . hum <- hum ) ;
if Option . is_some doc_url then issue . doc_url <- doc_url ;
if Option . is_some linters_def_file then issue . linters_def_file <- linters_def_file ;
issue
| None ->
let hum = match hum0 with Some str -> str | _ -> prettify unique_id in
let issue = { unique_id ; checker ; enabled ; hum ; doc_url ; linters_def_file } in
let issue =
{ unique_id ; visibility ; default_severity ; checker ; enabled ; hum ; doc_url ; linters_def_file }
in
all_issues := IssueSet . add ! all_issues issue ;
issue
@ -126,7 +164,7 @@ end = struct
=
let issue_type_base = F . asprintf s ( CostKind . to_issue_string kind ) in
let issue_type = if is_on_ui_thread then issue_type_base ^ " _UI_THREAD " else issue_type_base in
register_from_string ~ enabled ~ id : issue_type Cost
register_from_string ~ enabled ~ id : issue_type Error Cost
let all_issues () = IssueSet . elements ! all_issues
@ -139,249 +177,279 @@ let checker_can_report reporting_checker {checker= allowed_checker} =
let abduction_case_not_implemented =
register_from_string ~ id : " Abduction_case_not_implemented " Biabduction
register_from_string ~ visibility : Developer ~ id : " Abduction_case_not_implemented " Error Biabduction
let array_of_pointsto =
register_from_string ~ visibility : Developer ~ id : " Array_of_pointsto " Error Biabduction
let array_of_pointsto = register_from_string ~ id : " Array_of_pointsto " Biabduction
let array_out_of_bounds_l1 =
register_from_string ~ enabled : false ~ id : " ARRAY_OUT_OF_BOUNDS_L1 " Biabduction
register_from_string ~ visibility : Developer ~ enabled : false ~ id : " ARRAY_OUT_OF_BOUNDS_L1 " Error
Biabduction
let array_out_of_bounds_l2 =
register_from_string ~ enabled : false ~ id : " ARRAY_OUT_OF_BOUNDS_L2 " Biabduction
register_from_string ~ visibility : Developer ~ enabled : false ~ id : " ARRAY_OUT_OF_BOUNDS_L2 " Warning
Biabduction
let array_out_of_bounds_l3 =
register_from_string ~ enabled : false ~ id : " ARRAY_OUT_OF_BOUNDS_L3 " Biabduction
register_from_string ~ visibility : Developer ~ enabled : false ~ id : " ARRAY_OUT_OF_BOUNDS_L3 " Warning
Biabduction
let assert_failure = register_from_string ~ id : " Assert_failure " Biabduction
let assert_failure =
register_from_string ~ visibility : Developer ~ id : " Assert_failure " Error Biabduction
let bad_footprint = register_from_string ~ id : " Bad_footprint " Biabduction
let bad_footprint = register_from_string ~ visibility : Developer ~ id : " Bad_footprint " Error Biabduction
let biabduction_analysis_stops =
register_from_string ~ enabled : false ~ id : " BIABDUCTION_ANALYSIS_STOPS " Biabduction
register_from_string ~ visibility : Developer ~ enabled : false ~ id : " BIABDUCTION_ANALYSIS_STOPS " Warning
Biabduction
let biabd_condition_always_false =
register_from_string ~ enabled : false ~ hum : " Condition Always False "
~ id : " BIABD_CONDITION_ALWAYS_FALSE " Biabduction
~ id : " BIABD_CONDITION_ALWAYS_FALSE " Warning Biabduction
let biabd_condition_always_true =
register_from_string ~ enabled : false ~ hum : " Condition Always True " ~ id : " BIABD_CONDITION_ALWAYS_TRUE "
Biabduction
Warning Biabduction
let biabd_registered_observer_being_deallocated =
register_from_string ~ hum : " Registered Observer Being Deallocated "
~ id : " BIABD_REGISTERED_OBSERVER_BEING_DEALLOCATED " Biabduction
~ id : " BIABD_REGISTERED_OBSERVER_BEING_DEALLOCATED " Error Biabduction
let biabd_stack_variable_address_escape =
register_from_string ~ enabled : false ~ hum : " Stack Variable Address Escape "
~ id : " BIABD_STACK_VARIABLE_ADDRESS_ESCAPE " Biabduction
~ id : " BIABD_STACK_VARIABLE_ADDRESS_ESCAPE " Error Biabduction
let biabd_use_after_free =
register_from_string ~ hum : " Use After Free " ~ id : " BIABD_USE_AFTER_FREE " Biabduction
register_from_string ~ hum : " Use After Free " ~ id : " BIABD_USE_AFTER_FREE " Error Biabduction
let buffer_overrun_l1 = register_from_string ~ id : " BUFFER_OVERRUN_L1 " BufferOverrunChecker
let buffer_overrun_l1 = register_from_string ~ id : " BUFFER_OVERRUN_L1 " Error BufferOverrunChecker
let buffer_overrun_l2 = register_from_string ~ id : " BUFFER_OVERRUN_L2 " BufferOverrunChecker
let buffer_overrun_l2 = register_from_string ~ id : " BUFFER_OVERRUN_L2 " Error BufferOverrunChecker
let buffer_overrun_l3 = register_from_string ~ id : " BUFFER_OVERRUN_L3 " BufferOverrunChecker
let buffer_overrun_l3 = register_from_string ~ id : " BUFFER_OVERRUN_L3 " Error BufferOverrunChecker
let buffer_overrun_l4 =
register_from_string ~ enabled : false ~ id : " BUFFER_OVERRUN_L4 " BufferOverrunChecker
register_from_string ~ enabled : false ~ id : " BUFFER_OVERRUN_L4 " Error BufferOverrunChecker
let buffer_overrun_l5 =
register_from_string ~ enabled : false ~ id : " BUFFER_OVERRUN_L5 " BufferOverrunChecker
register_from_string ~ enabled : false ~ id : " BUFFER_OVERRUN_L5 " Error BufferOverrunChecker
let buffer_overrun_r2 = register_from_string ~ id : " BUFFER_OVERRUN_R2 " BufferOverrunChecker
let buffer_overrun_r2 = register_from_string ~ id : " BUFFER_OVERRUN_R2 " Error BufferOverrunChecker
let buffer_overrun_s2 = register_from_string ~ id : " BUFFER_OVERRUN_S2 " BufferOverrunChecker
let buffer_overrun_s2 = register_from_string ~ id : " BUFFER_OVERRUN_S2 " Error BufferOverrunChecker
let buffer_overrun_t1 = register_from_string ~ id : " BUFFER_OVERRUN_T1 " BufferOverrunChecker
let buffer_overrun_t1 = register_from_string ~ id : " BUFFER_OVERRUN_T1 " Error BufferOverrunChecker
let buffer_overrun_u5 =
register_from_string ~ enabled : false ~ id : " BUFFER_OVERRUN_U5 " BufferOverrunChecker
register_from_string ~ enabled : false ~ id : " BUFFER_OVERRUN_U5 " Error BufferOverrunChecker
let cannot_star = register_from_string ~ id: " Cannot_star " Biabduction
let cannot_star = register_from_string ~ visibility: Developer ~ id: " Cannot_star " Error Biabduction
let captured_strong_self =
register_from_string ~ id : " CAPTURED_STRONG_SELF " ~ hum : " Captured strongSelf " SelfInBlock
register_from_string ~ id : " CAPTURED_STRONG_SELF " ~ hum : " Captured strongSelf " Error SelfInBlock
let checkers_allocates_memory =
register_from_string ~ id : " CHECKERS_ALLOCATES_MEMORY " ~ hum : " Allocates Memory "
register_from_string ~ id : " CHECKERS_ALLOCATES_MEMORY " ~ hum : " Allocates Memory " Error
AnnotationReachability
let checkers_annotation_reachability_error =
register_from_string ~ id : " CHECKERS_ANNOTATION_REACHABILITY_ERROR "
~ hum : " Annotation Reachability Error " AnnotationReachability
~ hum : " Annotation Reachability Error " Error AnnotationReachability
let checkers_calls_expensive_method =
register_from_string ~ id : " CHECKERS_CALLS_EXPENSIVE_METHOD " ~ hum : " Expensive Method Called "
register_from_string ~ id : " CHECKERS_CALLS_EXPENSIVE_METHOD " ~ hum : " Expensive Method Called " Error
AnnotationReachability
let checkers_expensive_overrides_unexpensive =
register_from_string ~ id : " CHECKERS_EXPENSIVE_OVERRIDES_UNANNOTATED "
~ hum : " Expensive Overrides Unannotated " AnnotationReachability
~ hum : " Expensive Overrides Unannotated " Error AnnotationReachability
let checkers_fragment_retain_view =
register_from_string ~ id : " CHECKERS_FRAGMENT_RETAINS_VIEW " ~ hum : " Fragment Retains View "
register_from_string ~ id : " CHECKERS_FRAGMENT_RETAINS_VIEW " ~ hum : " Fragment Retains View " Warning
FragmentRetainsView
let checkers_immutable_cast = register_from_string ~ id : " CHECKERS_IMMUTABLE_CAST " ImmutableCast
let checkers_immutable_cast =
register_from_string ~ id : " CHECKERS_IMMUTABLE_CAST " Warning ImmutableCast
let checkers_printf_args = register_from_string ~ id : " CHECKERS_PRINTF_ARGS " PrintfArgs
let checkers_printf_args = register_from_string ~ id : " CHECKERS_PRINTF_ARGS " Error PrintfArgs
let class_cast_exception =
register_from_string ~ enabled : false ~ id : " CLASS_CAST_EXCEPTION " Biabduction
register_from_string ~ visibility : Developer ~ enabled : false ~ id : " CLASS_CAST_EXCEPTION " Error
Biabduction
let class_load = register_from_string ~ id : " CLASS_LOAD " ClassLoads
let class_load = register_from_string ~ id : " CLASS_LOAD " Warning ClassLoads
let component_factory_function =
register_from_string ~ id : " COMPONENT_FACTORY_FUNCTION " Advice Linters
let component_factory_function = register_from_string ~ id : " COMPONENT_FACTORY_FUNCTION " Linters
let component_file_cyclomatic_complexity =
register_from_string ~ id : " COMPONENT_FILE_CYCLOMATIC_COMPLEXITY " Linters
register_from_string ~ id : " COMPONENT_FILE_CYCLOMATIC_COMPLEXITY " Info Linters
let component_file_line_count =
register_from_string ~ enabled : false ~ id : " COMPONENT_FILE_LINE_COUNT " Linters
register_from_string ~ enabled : false ~ id : " COMPONENT_FILE_LINE_COUNT " Info Linters
let component_initializer_with_side_effects =
register_from_string ~ id : " COMPONENT_INITIALIZER_WITH_SIDE_EFFECTS " Linters
register_from_string ~ id : " COMPONENT_INITIALIZER_WITH_SIDE_EFFECTS " Advice Linters
let component_with_multiple_factory_methods =
register_from_string ~ id : " COMPONENT_WITH_MULTIPLE_FACTORY_METHODS " Linters
register_from_string ~ id : " COMPONENT_WITH_MULTIPLE_FACTORY_METHODS " Advice Linters
let component_with_unconventional_superclass =
register_from_string ~ id : " COMPONENT_WITH_UNCONVENTIONAL_SUPERCLASS " Linters
register_from_string ~ id : " COMPONENT_WITH_UNCONVENTIONAL_SUPERCLASS " Advice Linters
let condition_always_false =
register_from_string ~ enabled : false ~ id : " CONDITION_ALWAYS_FALSE " BufferOverrunChecker
register_from_string ~ enabled : false ~ id : " CONDITION_ALWAYS_FALSE " Warning BufferOverrunChecker
let condition_always_true =
register_from_string ~ enabled : false ~ id : " CONDITION_ALWAYS_TRUE " BufferOverrunChecker
register_from_string ~ enabled : false ~ id : " CONDITION_ALWAYS_TRUE " Warning BufferOverrunChecker
let constant_address_dereference =
register_from_string ~ enabled : false ~ id : " CONSTANT_ADDRESS_DEREFERENCE " Pulse
register_from_string ~ enabled : false ~ id : " CONSTANT_ADDRESS_DEREFERENCE " Warning Pulse
let create_intent_from_uri = register_from_string ~ id : " CREATE_INTENT_FROM_URI " Quandary
let create_intent_from_uri = register_from_string ~ id : " CREATE_INTENT_FROM_URI " Error Quandary
let cross_site_scripting = register_from_string ~ id : " CROSS_SITE_SCRIPTING " Quandary
let cross_site_scripting = register_from_string ~ id : " CROSS_SITE_SCRIPTING " Error Quandary
let dangling_pointer_dereference =
register_from_string ~ enabled : false ~ id : " DANGLING_POINTER_DEREFERENCE " Biabduction
register_from_string ~ enabled : false ~ id : " DANGLING_POINTER_DEREFERENCE " Error Biabduction
let dangling_pointer_dereference_maybe =
register_from_string ~ enabled : false ~ id : " DANGLING_POINTER_DEREFERENCE_MAYBE " Biabduction
register_from_string ~ visibility : Developer ~ enabled : false ~ id : " DANGLING_POINTER_DEREFERENCE_MAYBE "
Warning Biabduction
let dead_store = register_from_string ~ id : " DEAD_STORE " Error Liveness
let deadlock = register_from_string ~ id : " DEADLOCK " Error Starvation
let dead_store = register_from_string ~ id : " DEAD_STORE " Liveness
let deallocate_stack_variable =
register_from_string ~ id : " DEALLOCATE_STACK_VARIABLE " Error Biabduction
let deadlock = register_from_string ~ id : " DEADLOCK " Starvation
let deallocate_sta ck_variable = register_from_string ~ id : " DEALLOCATE_STA CK_VARIABLE" Biabduction
let deallocate_sta tic_memory = register_from_string ~ id : " DEALLOCATE_STA TIC_MEMORY" Error Biabduction
let deallocat e_static_memory = register_from_string ~ id : " DEALLOCATE_STATIC_MEMORY " Biabduction
let deallocat ion_mismatch = register_from_string ~ id : " DEALLOCATION_MISMATCH " Error Biabduction
let d eallocation_mismatch = register_from_string ~ id : " DEALLOCATION_MISMATCH " Biabduction
let d ivide_by_zero = register_from_string ~ enabled : false ~ id : " DIVIDE_BY_ZERO " Error Biabduction
let d ivide_by_zero = register_from_string ~ enabled : false ~ id : " DIVIDE_BY_ZERO " Biabduction
let d o_not_report = register_from_string ~ id : " DO_NOT_REPORT " Error Quandary
let do_not_report = register_from_string ~ id : " DO_NOT_REPORT " Quandary
let empty_vector_access = register_from_string ~ id : " EMPTY_VECTOR_ACCESS " Error Biabduction
let empty_vector_access = register_from_string ~ id : " EMPTY_VECTOR_ACCESS " Biabduction
(* Condition redundant is a very non-precise issue. Depending on the origin of what is compared with
null , this can have a lot of reasons to be actually nullable .
Until it is made non - precise , it is recommended to not turn this warning on . But even when it is
on , this should not be more than advice . * )
let eradicate_condition_redundant =
register_from_string ~ id : " ERADICATE_CONDITION_REDUNDANT " ~ hum : " Condition Redundant " Eradicate
register_from_string ~ id : " ERADICATE_CONDITION_REDUNDANT " ~ hum : " Condition Redundant " Advice
Eradicate
(* TODO ( T54070503 ) remove condition redundant nonnull *)
let _ =
register_from_string ~ id : " ERADICATE_CONDITION_REDUNDANT_NONNULL "
~ hum : " Condition Redundant Non-Null " Eradicate
~ hum : " Condition Redundant Non-Null " Warning Eradicate
let eradicate_field_not_initialized =
register_from_string ~ id : " ERADICATE_FIELD_NOT_INITIALIZED " ~ hum : " Field Not Initialized " Eradicate
register_from_string ~ id : " ERADICATE_FIELD_NOT_INITIALIZED " ~ hum : " Field Not Initialized " Warning
Eradicate
let eradicate_field_not_nullable =
register_from_string ~ id : " ERADICATE_FIELD_NOT_NULLABLE " ~ hum : " Field Not Nullable " Eradicate
register_from_string ~ id : " ERADICATE_FIELD_NOT_NULLABLE " ~ hum : " Field Not Nullable " Warning
Eradicate
(* Very non-precise issue. Should be actually turned off unless for experimental purposes. *)
let eradicate_field_over_annotated =
register_from_string ~ id : " ERADICATE_FIELD_OVER_ANNOTATED " ~ hum : " Field Over Annotated " Eradicate
register_from_string ~ id : " ERADICATE_FIELD_OVER_ANNOTATED " ~ hum : " Field Over Annotated " Advice
Eradicate
let eradicate_inconsistent_subclass_parameter_annotation =
register_from_string ~ id : " ERADICATE_INCONSISTENT_SUBCLASS_PARAMETER_ANNOTATION "
~ hum : " Inconsistent Subclass Parameter Annotation " Eradicate
~ hum : " Inconsistent Subclass Parameter Annotation " Warning Eradicate
let eradicate_inconsistent_subclass_return_annotation =
register_from_string ~ id : " ERADICATE_INCONSISTENT_SUBCLASS_RETURN_ANNOTATION "
~ hum : " Inconsistent Subclass Return Annotation " Eradicate
~ hum : " Inconsistent Subclass Return Annotation " Warning Eradicate
let eradicate_redundant_nested_class_annotation =
register_from_string ~ id : " ERADICATE_REDUNDANT_NESTED_CLASS_ANNOTATION "
~ hum : " @Nullsafe annotation is redundant " Eradicate
~ hum : " @Nullsafe annotation is redundant " Advice Eradicate
let eradicate_bad_nested_class_annotation =
register_from_string ~ id : " ERADICATE_BAD_NESTED_CLASS_ANNOTATION "
~ hum : " @Nullsafe annotation is inconsistent with outer class " Eradicate
~ hum : " @Nullsafe annotation is inconsistent with outer class " Warning Eradicate
let eradicate_nullable_dereference =
register_from_string ~ id : " ERADICATE_NULLABLE_DEREFERENCE " ~ hum : " Nullable Dereference " Eradicate
register_from_string ~ id : " ERADICATE_NULLABLE_DEREFERENCE " ~ hum : " Nullable Dereference " Warning
Eradicate
let eradicate_parameter_not_nullable =
register_from_string ~ id : " ERADICATE_PARAMETER_NOT_NULLABLE " ~ hum : " Parameter Not Nullable "
register_from_string ~ id : " ERADICATE_PARAMETER_NOT_NULLABLE " ~ hum : " Parameter Not Nullable " Warning
Eradicate
let eradicate_return_not_nullable =
register_from_string ~ id : " ERADICATE_RETURN_NOT_NULLABLE " ~ hum : " Return Not Nullable " Eradicate
register_from_string ~ id : " ERADICATE_RETURN_NOT_NULLABLE " ~ hum : " Return Not Nullable " Warning
Eradicate
(* Very non-precise issue. Should be actually turned off unless for experimental purposes. *)
let eradicate_return_over_annotated =
register_from_string ~ id : " ERADICATE_RETURN_OVER_ANNOTATED " ~ hum : " Return Over Annotated " Eradicate
register_from_string ~ id : " ERADICATE_RETURN_OVER_ANNOTATED " ~ hum : " Return Over Annotated " Advice
Eradicate
let eradicate_unchecked_usage_in_nullsafe =
register_from_string ~ id : " ERADICATE_UNCHECKED_USAGE_IN_NULLSAFE "
~ hum : " Nullsafe mode: unchecked usage of a value " Eradicate
~ hum : " Nullsafe mode: unchecked usage of a value " Warning Eradicate
let eradicate_unvetted_third_party_in_nullsafe =
register_from_string ~ id : " ERADICATE_UNVETTED_THIRD_PARTY_IN_NULLSAFE "
~ hum : " Nullsafe mode: unchecked usage of unvetted third-party " Eradicate
~ hum : " Nullsafe mode: unchecked usage of unvetted third-party " Warning Eradicate
(* Meta issues in eradicate are technical issues reflecting null-safety state of classes in general,
@ -391,7 +459,7 @@ let eradicate_meta_class_is_nullsafe =
register_from_string ~ id : " ERADICATE_META_CLASS_IS_NULLSAFE "
~ hum :
" Class is marked @Nullsafe and has 0 issues " (* Should be enabled for special integrations *)
~ enabled : false Eradicate
~ enabled : false Info Eradicate
(* Class is either:
@ -402,256 +470,287 @@ let eradicate_meta_class_needs_improvement =
register_from_string ~ id : " ERADICATE_META_CLASS_NEEDS_IMPROVEMENT "
~ hum :
" Class needs improvement to become @Nullsafe " (* Should be enabled for special integrations *)
~ enabled : false Eradicate
~ enabled : false Info Eradicate
let eradicate_meta_class_can_be_nullsafe =
register_from_string ~ id : " ERADICATE_META_CLASS_CAN_BE_NULLSAFE "
~ hum :
" Class has 0 issues and can be marked @Nullsafe "
(* Should be enabled for special integrations *) ~ enabled : false Eradicate
(* Should be enabled for special integrations *) ~ enabled : false Advice Eradicate
let exposed_insecure_intent_handling =
register_from_string ~ id : " EXPOSED_INSECURE_INTENT_HANDLING " Quandary
register_from_string ~ id : " EXPOSED_INSECURE_INTENT_HANDLING " Error Quandary
let failure_exe = register_from_string ~ id: " Failure_exe " Biabduction
let failure_exe = register_from_string ~ visibility: Silent ~ id: " Failure_exe " Info Biabduction
let field_not_null_checked = register_from_string ~ id : " IVAR_NOT_NULL_CHECKED " Biabduction
let field_not_null_checked = register_from_string ~ id : " IVAR_NOT_NULL_CHECKED " Warning Biabduction
(* from AL default linters *)
let _ global_variable_initialized_with_function_or_method_call =
register_from_string ~ enabled : false ~ id : " GLOBAL_VARIABLE_INITIALIZED_WITH_FUNCTION_OR_METHOD_CALL "
Linters
Warning Linters
let guardedby_violation_racerd =
register_from_string ~ id : " GUARDEDBY_VIOLATION " ~ hum : " GuardedBy Violation " RacerD
register_from_string Warning ~ id : " GUARDEDBY_VIOLATION " ~ hum : " GuardedBy Violation " RacerD
let impure_function = register_from_string ~ id : " IMPURE_FUNCTION " Impurity
let impure_function = register_from_string ~ id : " IMPURE_FUNCTION " Error Impurity
let inefficient_keyset_iterator =
register_from_string ~ id : " INEFFICIENT_KEYSET_ITERATOR " InefficientKeysetIterator
register_from_string ~ id : " INEFFICIENT_KEYSET_ITERATOR " Error InefficientKeysetIterator
let inferbo_alloc_is_big =
register_from_string ~ id : " INFERBO_ALLOC_IS_BIG " Error BufferOverrunChecker
let inferbo_alloc_is_big = register_from_string ~ id : " INFERBO_ALLOC_IS_BIG " BufferOverrunChecker
let inferbo_alloc_is_negative =
register_from_string ~ id : " INFERBO_ALLOC_IS_NEGATIVE " BufferOverrunChecker
register_from_string ~ id : " INFERBO_ALLOC_IS_NEGATIVE " Error BufferOverrunChecker
let inferbo_alloc_is_zero = register_from_string ~ id : " INFERBO_ALLOC_IS_ZERO " BufferOverrunChecker
let inferbo_alloc_is_zero =
register_from_string ~ id : " INFERBO_ALLOC_IS_ZERO " Error BufferOverrunChecker
let inferbo_alloc_may_be_big =
register_from_string ~ id : " INFERBO_ALLOC_MAY_BE_BIG " BufferOverrunChecker
register_from_string ~ id : " INFERBO_ALLOC_MAY_BE_BIG " Error BufferOverrunChecker
let inferbo_alloc_may_be_negative =
register_from_string ~ id : " INFERBO_ALLOC_MAY_BE_NEGATIVE " BufferOverrunChecker
register_from_string ~ id : " INFERBO_ALLOC_MAY_BE_NEGATIVE " Error BufferOverrunChecker
let inferbo_alloc_may_be_tainted =
register_from_string ~ id : " INFERBO_ALLOC_MAY_BE_TAINTED " BufferOverrunChecker
register_from_string ~ id : " INFERBO_ALLOC_MAY_BE_TAINTED " Error BufferOverrunChecker
let infinite_cost_call ~ kind = register_from_cost_string ~ enabled : false " INFINITE_%s " ~ kind
let inherently_dangerous_function =
register_from_string ~ id: " INHERENTLY_DANGEROUS_FUNCTION " Biabduction
register_from_string ~ visibility: Developer ~ id: " INHERENTLY_DANGEROUS_FUNCTION " Warning Biabduction
let insecure_intent_handling = register_from_string ~ id : " INSECURE_INTENT_HANDLING " Quandary
let insecure_intent_handling = register_from_string ~ id : " INSECURE_INTENT_HANDLING " Error Quandary
let integer_overflow_l1 = register_from_string ~ id : " INTEGER_OVERFLOW_L1 " BufferOverrunChecker
let integer_overflow_l1 = register_from_string ~ id : " INTEGER_OVERFLOW_L1 " Error BufferOverrunChecker
let integer_overflow_l2 = register_from_string ~ id : " INTEGER_OVERFLOW_L2 " BufferOverrunChecker
let integer_overflow_l2 = register_from_string ~ id : " INTEGER_OVERFLOW_L2 " Error BufferOverrunChecker
let integer_overflow_l5 =
register_from_string ~ enabled : false ~ id : " INTEGER_OVERFLOW_L5 " BufferOverrunChecker
register_from_string ~ enabled : false ~ id : " INTEGER_OVERFLOW_L5 " Error BufferOverrunChecker
let integer_overflow_r2 = register_from_string ~ id : " INTEGER_OVERFLOW_R2 " BufferOverrunChecker
let integer_overflow_r2 = register_from_string ~ id : " INTEGER_OVERFLOW_R2 " Error BufferOverrunChecker
let integer_overflow_u5 =
register_from_string ~ enabled : false ~ id : " INTEGER_OVERFLOW_U5 " BufferOverrunChecker
register_from_string ~ enabled : false ~ id : " INTEGER_OVERFLOW_U5 " Error BufferOverrunChecker
let interface_not_thread_safe = register_from_string Warning ~ id : " INTERFACE_NOT_THREAD_SAFE " RacerD
let interface_not_thread_safe = register_from_string ~ id : " INTERFACE_NOT_THREAD_SAFE " RacerD
let internal_error =
register_from_string ~ visibility : Developer ~ id : " Internal_error " Error Biabduction
let internal_error = register_from_string ~ id : " Internal_error " Biabduction
let invariant_call = register_from_string ~ enabled : false ~ id : " INVARIANT_CALL " LoopHoisting
let invariant_call = register_from_string ~ enabled : false ~ id : " INVARIANT_CALL " Error LoopHoisting
let javascript_injection = register_from_string ~ id : " JAVASCRIPT_INJECTION " Quandary
let javascript_injection = register_from_string ~ id : " JAVASCRIPT_INJECTION " Error Quandary
let lab_resource_leak = register_from_string ~ id : " LAB_RESOURCE_LEAK " ResourceLeakLabExercise
let lab_resource_leak = register_from_string ~ id : " LAB_RESOURCE_LEAK " Error ResourceLeakLabExercise
let leak_after_array_abstraction =
register_from_string ~ id : " Leak_after_array_abstraction " Biabduction
register_from_string ~ visibility : Developer ~ id : " Leak_after_array_abstraction " Error Biabduction
let leak_in_footprint =
register_from_string ~ visibility : Developer ~ id : " Leak_in_footprint " Error Biabduction
let leak_in_footprint = register_from_string ~ id : " Leak_in_footprint " Biabduction
let leak_unknown_origin = register_from_string ~ enabled : false ~ id : " Leak_unknown_origin " Biabduction
let leak_unknown_origin =
register_from_string ~ visibility : Developer ~ enabled : false ~ id : " Leak_unknown_origin " Error
Biabduction
let lock_consistency_violation = register_from_string ~ id : " LOCK_CONSISTENCY_VIOLATION " RacerD
let lock_consistency_violation =
register_from_string Warning ~ id : " LOCK_CONSISTENCY_VIOLATION " RacerD
let lockless_violation = register_from_string ~ id : " LOCKLESS_VIOLATION " Starvation
let logging_private_data = register_from_string ~ id : " LOGGING_PRIVATE_DATA " Quandary
let lockless_violation = register_from_string ~ id : " LOCKLESS_VIOLATION " Error Starvation
let logging_private_data = register_from_string ~ id : " LOGGING_PRIVATE_DATA " Error Quandary
let expensive_loop_invariant_call =
register_from_string ~ id : " EXPENSIVE_LOOP_INVARIANT_CALL " LoopHoisting
register_from_string ~ id : " EXPENSIVE_LOOP_INVARIANT_CALL " Error LoopHoisting
let memory_leak = register_from_string ~ id : " MEMORY_LEAK " Error Biabduction
let memory_leak = register_from_string ~ id : " MEMORY_LEAK " Biabduction
let missing_fld =
register_from_string ~ visibility : Developer ~ id : " Missing_fld " ~ hum : " Missing Field " Error
Biabduction
let missing_fld = register_from_string ~ id : " Missing_fld " ~ hum : " Missing Field " Biabduction
let missing_required_prop = register_from_string ~ id : " MISSING_REQUIRED_PROP " LithoRequiredProps
let missing_required_prop =
register_from_string ~ id : " MISSING_REQUIRED_PROP " Error LithoRequiredProps
let mixed_self_weakself =
register_from_string ~ id : " MIXED_SELF_WEAKSELF " ~ hum : " Mixed Self WeakSelf " SelfInBlock
register_from_string ~ id : " MIXED_SELF_WEAKSELF " ~ hum : " Mixed Self WeakSelf " Error SelfInBlock
let multiple_weakself =
register_from_string ~ id : " MULTIPLE_WEAKSELF " ~ hum : " Multiple WeakSelf Use " SelfInBlock
register_from_string ~ id : " MULTIPLE_WEAKSELF " ~ hum : " Multiple WeakSelf Use " Error SelfInBlock
let mutable_local_variable_in_component_file =
register_from_string ~ id : " MUTABLE_LOCAL_VARIABLE_IN_COMPONENT_FILE " Linters
register_from_string ~ id : " MUTABLE_LOCAL_VARIABLE_IN_COMPONENT_FILE " Advice Linters
let null_dereference = register_from_string ~ id : " NULL_DEREFERENCE " Biabduction
let null_dereference = register_from_string ~ id : " NULL_DEREFERENCE " Error Biabduction
let null_test_after_dereference =
register_from_string ~ enabled : false ~ id : " NULL_TEST_AFTER_DEREFERENCE " Biabduction
register_from_string ~ enabled : false ~ id : " NULL_TEST_AFTER_DEREFERENCE " Warning Biabduction
let nullptr_dereference = register_from_string ~ enabled : false ~ id : " NULLPTR_DEREFERENCE " Error Pulse
let nullptr_dereference = register_from_string ~ enabled : false ~ id : " NULLPTR_DEREFERENCE " Pulse
let parameter_not_null_checked =
register_from_string ~ id : " PARAMETER_NOT_NULL_CHECKED " Warning Biabduction
let parameter_not_null_checked = register_from_string ~ id : " PARAMETER_NOT_NULL_CHECKED " Biabduction
let pointer_size_mismatch = register_from_string ~ id : " POINTER_SIZE_MISMATCH " Biabduction
let pointer_size_mismatch = register_from_string ~ id : " POINTER_SIZE_MISMATCH " Error Biabduction
let precondition_not_found = register_from_string ~ id : " PRECONDITION_NOT_FOUND " Biabduction
let precondition_not_found =
register_from_string ~ visibility : Developer ~ id : " PRECONDITION_NOT_FOUND " Error Biabduction
let precondition_not_met =
register_from_string ~ visibility : Developer ~ id : " PRECONDITION_NOT_MET " Warning Biabduction
let precondition_not_met = register_from_string ~ id : " PRECONDITION_NOT_MET " Biabduction
let premature_nil_termination =
register_from_string ~ id : " PREMATURE_NIL_TERMINATION_ARGUMENT " Biabduction
register_from_string ~ id : " PREMATURE_NIL_TERMINATION_ARGUMENT " Warning Biabduction
let pulse_memory_leak = register_from_string ~ enabled : false ~ id : " PULSE_MEMORY_LEAK " Pulse
let pulse_memory_leak = register_from_string ~ enabled : false ~ id : " PULSE_MEMORY_LEAK " Error Pulse
let pure_function = register_from_string ~ id : " PURE_FUNCTION " Purity
let pure_function = register_from_string ~ id : " PURE_FUNCTION " Error Purity
let quandary_taint_error =
register_from_string ~ hum : " Taint Error " ~ id : " QUANDARY_TAINT_ERROR " Quandary
register_from_string ~ hum : " Taint Error " ~ id : " QUANDARY_TAINT_ERROR " Error Quandary
let resource_leak = register_from_string ~ id : " RESOURCE_LEAK " Error Biabduction
let re source_leak = register_from_string ~ id : " RESOURCE_LEAK " Biabduction
let re tain_cycle = register_from_string ~ enabled : true ~ id : " RETAIN_CYCLE " Error Biabduction
let retain_cycle = register_from_string ~ enabled : true ~ id : " RETAIN_CYCLE " Biabduction
let skip_function =
register_from_string ~ visibility : Developer ~ enabled : false ~ id : " SKIP_FUNCTION " Info Biabduction
let skip_function = register_from_string ~ enabled : false ~ id : " SKIP_FUNCTION " Biabduction
let skip_pointer_dereference =
register_from_string ~ enabled : false ~ id : " SKIP_POINTER_DEREFERENCE " Biabduction
register_from_string ~ enabled : false ~ id : " SKIP_POINTER_DEREFERENCE " Info Biabduction
let shell_injection = register_from_string ~ id : " SHELL_INJECTION " Quandary
let shell_injection = register_from_string ~ id : " SHELL_INJECTION " Error Quandary
let shell_injection_risk = register_from_string ~ id : " SHELL_INJECTION_RISK " Quandary
let shell_injection_risk = register_from_string ~ id : " SHELL_INJECTION_RISK " Error Quandary
let sql_injection = register_from_string ~ id : " SQL_INJECTION " Quandary
let sql_injection = register_from_string ~ id : " SQL_INJECTION " Error Quandary
let sql_injection_risk = register_from_string ~ id : " SQL_INJECTION_RISK " Quandary
let sql_injection_risk = register_from_string ~ id : " SQL_INJECTION_RISK " Error Quandary
let stack_variable_address_escape = register_from_string ~ id : " STACK_VARIABLE_ADDRESS_ESCAPE " Pulse
let stack_variable_address_escape =
register_from_string ~ id : " STACK_VARIABLE_ADDRESS_ESCAPE " Error Pulse
let starvation = register_from_string ~ id : " STARVATION " ~ hum : " UI Thread Starvation " Starvation
let starvation = register_from_string ~ id : " STARVATION " ~ hum : " UI Thread Starvation " Error Starvation
let static_initialization_order_fiasco =
register_from_string ~ id : " STATIC_INITIALIZATION_ORDER_FIASCO " SIOF
register_from_string ~ id : " STATIC_INITIALIZATION_ORDER_FIASCO " Error SIOF
let strict_mode_violation =
register_from_string ~ id : " STRICT_MODE_VIOLATION " ~ hum : " Strict Mode Violation " Starvation
register_from_string ~ id : " STRICT_MODE_VIOLATION " ~ hum : " Strict Mode Violation " Error Starvation
let strong_self_not_checked =
register_from_string ~ id : " STRONG_SELF_NOT_CHECKED " ~ hum : " StrongSelf Not Checked " SelfInBlock
register_from_string ~ id : " STRONG_SELF_NOT_CHECKED " ~ hum : " StrongSelf Not Checked " Error SelfInBlock
let symexec_memory_error =
register_from_string ~ id : " Symexec_memory_error " ~ hum : " Symbolic Execution Memory Error " Biabduction
register_from_string ~ visibility : Developer ~ id : " Symexec_memory_error "
~ hum : " Symbolic Execution Memory Error " Error Biabduction
let thread_safety_violation = register_from_string ~ id : " THREAD_SAFETY_VIOLATION " RacerD
let thread_safety_violation = register_from_string Warning ~ id : " THREAD_SAFETY_VIOLATION " RacerD
let complexity_increase ~ kind ~ is_on_ui_thread =
register_from_cost_string ~ kind ~ is_on_ui_thread " %s_COMPLEXITY_INCREASE "
let topl_error = register_from_string ~ id : " TOPL_ERROR " TOPL
let topl_error = register_from_string ~ id : " TOPL_ERROR " Error TOPL
let unary_minus_applied_to_unsigned_expression =
register_from_string ~ enabled : false ~ id : " UNARY_MINUS_APPLIED_TO_UNSIGNED_EXPRESSION " Biabduction
register_from_string ~ enabled : false ~ id : " UNARY_MINUS_APPLIED_TO_UNSIGNED_EXPRESSION " Warning
Biabduction
let uninitialized_value = register_from_string ~ id : " UNINITIALIZED_VALUE " Uninit
let uninitialized_value = register_from_string ~ id : " UNINITIALIZED_VALUE " Error Uninit
let unreachable_code_after = register_from_string ~ id : " UNREACHABLE_CODE " BufferOverrunChecker
let unreachable_code_after = register_from_string ~ id : " UNREACHABLE_CODE " Error BufferOverrunChecker
let use_after_delete = register_from_string ~ id : " USE_AFTER_DELETE " Pulse
let use_after_delete = register_from_string ~ id : " USE_AFTER_DELETE " Error Pulse
let use_after_free = register_from_string ~ id : " USE_AFTER_FREE " Pulse
let use_after_free = register_from_string ~ id : " USE_AFTER_FREE " Error Pulse
let use_after_lifetime = register_from_string ~ id : " USE_AFTER_LIFETIME " Pulse
let use_after_lifetime = register_from_string ~ id : " USE_AFTER_LIFETIME " Error Pulse
let user_controlled_sql_risk = register_from_string ~ id : " USER_CONTROLLED_SQL_RISK " Quandary
let user_controlled_sql_risk = register_from_string ~ id : " USER_CONTROLLED_SQL_RISK " Error Quandary
let untrusted_buffer_access =
register_from_string ~ enabled : false ~ id : " UNTRUSTED_BUFFER_ACCESS " Quandary
register_from_string ~ enabled : false ~ id : " UNTRUSTED_BUFFER_ACCESS " Error Quandary
let untrusted_deserialization = register_from_string ~ id : " UNTRUSTED_DESERIALIZATION " Quandary
let untrusted_deserialization = register_from_string ~ id : " UNTRUSTED_DESERIALIZATION " Error Quandary
let untrusted_deserialization_risk =
register_from_string ~ id : " UNTRUSTED_DESERIALIZATION_RISK " Quandary
register_from_string ~ id : " UNTRUSTED_DESERIALIZATION_RISK " Error Quandary
let untrusted_environment_change_risk =
register_from_string ~ id : " UNTRUSTED_ENVIRONMENT_CHANGE_RISK " Quandary
register_from_string ~ id : " UNTRUSTED_ENVIRONMENT_CHANGE_RISK " Error Quandary
let untrusted_file = register_from_string ~ id : " UNTRUSTED_FILE " Quandary
let untrusted_file = register_from_string ~ id : " UNTRUSTED_FILE " Error Quandary
let untrusted_file_risk = register_from_string ~ id : " UNTRUSTED_FILE_RISK " Quandary
let untrusted_file_risk = register_from_string ~ id : " UNTRUSTED_FILE_RISK " Error Quandary
let untrusted_heap_allocation =
register_from_string ~ enabled : false ~ id : " UNTRUSTED_HEAP_ALLOCATION " Quandary
register_from_string ~ enabled : false ~ id : " UNTRUSTED_HEAP_ALLOCATION " Error Quandary
let untrusted_intent_creation = register_from_string ~ id : " UNTRUSTED_INTENT_CREATION " Quandary
let untrusted_intent_creation = register_from_string ~ id : " UNTRUSTED_INTENT_CREATION " Error Quandary
let untrusted_url_risk = register_from_string ~ id : " UNTRUSTED_URL_RISK " Quandary
let untrusted_url_risk = register_from_string ~ id : " UNTRUSTED_URL_RISK " Error Quandary
let untrusted_variable_length_array =
register_from_string ~ id : " UNTRUSTED_VARIABLE_LENGTH_ARRAY " Quandary
register_from_string ~ id : " UNTRUSTED_VARIABLE_LENGTH_ARRAY " Error Quandary
let vector_invalidation = register_from_string ~ id : " VECTOR_INVALIDATION " Pulse
let vector_invalidation = register_from_string ~ id : " VECTOR_INVALIDATION " Error Pulse
let weak_self_in_noescape_block =
register_from_string ~ id : " WEAK_SELF_IN_NO_ESCAPE_BLOCK " SelfInBlock
register_from_string ~ id : " WEAK_SELF_IN_NO_ESCAPE_BLOCK " Error SelfInBlock
let wrong_argument_number =
register_from_string ~ id : " Wrong_argument_number " ~ hum : " Wrong Argument Number " Biabduction
register_from_string ~ visibility : Developer ~ id : " Wrong_argument_number "
~ hum : " Wrong Argument Number " Error Biabduction
let unreachable_cost_call ~ kind =