joernio / joern

Open-source code analysis platform for C/C++/Java/Binary/Javascript/Python/Kotlin based on code property graphs. Discord https://discord.gg/vv4MH284Hc
https://joern.io/
Apache License 2.0
2.08k stars 285 forks source link

php2cpg: add parameter default values to CPG #2826

Open maltek opened 1 year ago

maltek commented 1 year ago
function test($param = new Foo) {}

currently there's no way to see that $param has a default value new Foo. I don't think we currently have the concept of default/fallback arguments in our schema, but any way to surface this information for AST queries would already be an improvement.

DavidBakerEffendi commented 1 year ago

Agreed, this is the workaround I added for JS https://github.com/joernio/joern/pull/2777, but I would be in favor of a default() property of some sorts or edge type to some literal node.

d1tto commented 12 months ago

I have also encountered this issue. Is there any progress now