ShiftLeftSecurity / ShiftLeftSecurity/codepropertygraph
Class member function calls don't map to class
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 597
- Forks
- 84
- Avg merge
- 18h 29m
- Merged PRs (30d)
- 1
Description
Parsing this code:
1 class MyClass
2 {
3 public:
4 int bar()
5 {
6 return 1;
7 }
8 };
9
10 void myfunc()
11 {
12 MyClass *foo = new MyClass();
13 foo->bar();
14 }
I expect the CALL node name on line 13 to be MyClass::bar(), but the name is foo->bar(). Further, an internal METHOD node is correctly created for MyClass::bar(), but there is also one created for an external function called foo->bar().
Is this expected/correct? If yes, is there a way to determine that CALL foo->bar() node is referring to type MyClass, or would one need to implement some type propagation atop the graph to arrive at that?
Thanks!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported C++ snippet and inspecting the generated CALL and METHOD nodes for lines 4 and 13. The issue names no source files or tests, so first locate the parser and graph-generation entry points; done would require an agreed way to represent or resolve the call from foo->bar() to MyClass::bar().
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, scala
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100