devign: Mismatch methods in graph-for-funcs.sc, may need update?
Hi Dear Author,
Here is a issue about running graph-for-funcs.sc. There seems to have a lot of changes on joern methods and scalars, thus I try to modify your code to fit into the most recent one, however, here are two problems that cannot be solved yet whatever I try. Both are about the lacking methods in io.shiftleft.semanticcpg.language.NodeSteps. I checked the official repository (https://github.com/ShiftLeftSecurity/codepropertygraph) and go to codepropertygraph/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/NodeSteps.scala, but cannot find correct methods for these two errors in line-93 and 94. Your help would be necessary for that. Thanks!
Compiling /home/zxx5113/devign/joern/graph-for-funcs.sc
graph-for-funcs.sc:93: value evalType is not a member of io.shiftleft.semanticcpg.language.NodeSteps[io.shiftleft.codepropertygraph.generated.nodes.Local]
val sink = local.evalType(".*").referencingIdentifiers.dedup
^
graph-for-funcs.sc:94: value nameNot is not a member of io.shiftleft.semanticcpg.language.NodeSteps[io.shiftleft.codepropertygraph.generated.nodes.Call]
val source = new NodeSteps(methodVertex.out(EdgeTypes.CONTAINS).hasLabel(NodeTypes.CALL).cast[nodes.Call]).nameNot("<operator>.*").dedup
^
java.lang.RuntimeException: Compilation Failed
io.shiftleft.console.scripting.AmmoniteExecutor.$anonfun$runScript$7(AmmoniteExecutor.scala:50)
cats.effect.internals.IORunLoop$.liftedTree3$1(IORunLoop.scala:229)
cats.effect.internals.IORunLoop$.step(IORunLoop.scala:229)
cats.effect.IO.unsafeRunTimed(IO.scala:320)
cats.effect.IO.unsafeRunSync(IO.scala:239)
io.shiftleft.console.scripting.ScriptManager.runScript(ScriptManager.scala:130)
io.shiftleft.console.scripting.ScriptManager$CpgScriptRunner.runScript(ScriptManager.scala:64)
io.shiftleft.console.scripting.ScriptManager$CpgScriptRunner.runScript(ScriptManager.scala:54)
ammonite.$sess.cmd4$.<clinit>(cmd4.sc:1)
Bye!
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 24
I had met many different errors when running the graph-for-funcs.sc with different versions of Joern, such as “Mismatch methods…”,“could not find implicit value for parameter encoder:…” and so on. So, I finally found that the version of Joern with 1.0.170 works fine!
In the new version of Joern, the value of graph[“file”] when the graph belongs to no file is
"<empty>"
rather than"N/A"
, so simply replace"N/A"
with"<empty>"
will be ok 😃