Skip to content

CodeQL: Make any() expression and exists() formula variable identifier optional #53

@Marcono1234

Description

@Marcono1234

What do you think about making the variable identifiers of the CodeQL any(...) expression and exists(...) formula optional if they do not have any formulas?
Currently the CodeQL language specification requires an identifier even though it is not used.

Examples:

exists(GadgetClass unused) // Check whether a vulnerable "gadget" class exists on the class path
and any(CustomMethodCall unused).getArgument(0) instanceof CustomArgument

Here in both cases it is currently necessary to specify a variable identifier (unused), even though it is not used.

For the exists formula this could lead to some ambiguity because it currently allows using expressions (e.g. exists(call.getAnArgument())), however because type names as part of variable declarations cannot contain a period, this should be unambiguous.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions