github / github/codeql

Customizing string representation of data flow nodes in SARIF or CSV results for Taint Tracking

Open
#16,143 10 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
CodeQL
Stars
10.1k
Forks
2.1k
Avg merge
2d 15h
Merged PRs (30d)
141

Description

Hi,

Currently, when running a cwe query such as TaintedPath (cwe 22) on a java project, I retrieve the CodeFlow for each result in the SARIF files as shown below. Is there an easy way to customize the string representation of nodes in the output, such as, in the message["text"] part for the node? For instance, for a method call I would like the string to have the format "package:class:methodname" instead of "methodname(...)" -- which is the default. Would I need to override the data flow node for this?

Thanks in advance!

```SARIF
...
"codeFlows" : [ {
"threadFlows" : [ {
"locations" : [ {
"location" : {
"physicalLocation" : {
"artifactLocation" : {
"uri" : "one-java-agent/src/main/java/com/alibaba/oneagent/AgentImpl.java",
"uriBaseId" : "%SRCROOT%",
"index" : 0
},
"region" : {
"startLine" : 81,
"startColumn" : 35,
"endColumn" : 69
}
},
"message" : {
"text" : "getFile(...) : String"
}
}
},
....
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.