Skip to content

Commit

Permalink
Dynamic: Add hasPrettyName()
Browse files Browse the repository at this point in the history
  • Loading branch information
asgerf committed Apr 9, 2024
1 parent 8cb80d6 commit 8210143
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions shared/mad/codeql/mad/dynamic/GraphExport.qll
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ module GraphExport<
exposedEdge(result, path, node)
}

private predicate hasPrettyName(RelevantNode node) {
exposedName(node, _, "")
or
suggestedName(node, _)
}

private predicate nodeMustBeNamed(RelevantNode node) {
exposedName(node, _, "")
or
Expand All @@ -143,8 +149,7 @@ module GraphExport<
prefix
)
or
not exposedName(node, _, _) and
not suggestedName(node, _) and
not hasPrettyName(node) and
result = getAPrefixTypeName(getAPredecessor(node, _))
}

Expand All @@ -153,8 +158,7 @@ module GraphExport<
*/
private predicate isSyntheticallyNamedNode(RelevantNode node, string prefix) {
nodeMustBeNamed(node) and
not exposedName(node, _, "") and
not suggestedName(node, _) and
not hasPrettyName(node) and
prefix = min(getAPrefixTypeName(node))
}

Expand Down

0 comments on commit 8210143

Please sign in to comment.