SONARPLUGINS-2849 Use strongly typed AST for some checks