ShiftLeftSecurity / codepropertygraph

Code Property Graph: specification, query language, and utilities
Apache License 2.0
456 stars 72 forks source link

Allow closure bindings on method parameters #1739

Closed DavidBakerEffendi closed 10 months ago

DavidBakerEffendi commented 10 months ago

The description for CLOSURE_BINDING is: "Represents the binding of a LOCAL or METHOD_PARAMETER_IN into the closure of a method", however there is no edge connecting parameters to the CLOSURE_BINDING. So this adds the CLOSURE_BINDING_ID and CAPTURED_BY edge to match the specification for LOCAL nodes.

Additionally, the cardinality needs to be changed, since if a method parameter is captured, then there won't be a REF to a local which may throw an error. Thus, cardinality was changed to ZeroOrOne.