Skip to content

Conversation

@Napalys
Copy link
Contributor

@Napalys Napalys commented Jul 2, 2025

Improves alert message clarity for the js/incomplete-sanitization query by referencing this node when no string value is present. Replaces string concatenation with placeholders for cleaner output.

if node instanceof DataFlow::RegExpConstructorInvokeNode
then result = "/" + node.(DataFlow::RegExpConstructorInvokeNode).getRoot() + "/"
else result = node.toString()
if exists(node.getStringValue()) then result = node.toString() else result = "this node"

Check warning

Code scanning / CodeQL

Using 'toString' in query logic Warning

Query logic depends on implementation of 'toString'.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

node.toString() seems to give a bit more user friendly messages compared to node.getStringValue()

@Napalys Napalys closed this Jul 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant