Closed oxisto closed 3 years ago
Ok, I have no idea, why the CFG tests fail. They also only fail sometimes it seems :(
The test design here does not make sense in my opinion. It tries to get all AST in getByLineNr
using SubgraphWalker.flattenAST
, including also declarations, which cannot even receive CFG edges. If then someone is a declaration on the same line as a statement and parsed before the statement it returns the declaration in this line.
The main problem is, that I cannot really test codyze because for some reason, this branch leads to https://github.com/Fraunhofer-AISEC/codyze/issues/37.
All changes are documented above and they should not introduce anything that "breaks", if they do, then it was always broken and probably worked around in codyze. Seems we have a little bit of a chicken-and-egg problem here.
So it looks like that it all started with https://github.com/Fraunhofer-AISEC/cpg/pull/164 which somehow causes the OGM wrapper within codyze to malfunction and do all kind of crazy things such as not recognising relationships or not finding property values and so on. It seems to have an issue with the annotations
field within Node
, which looks perfectly fine to me.
Two field relationships were incorrectly defines as incoming, although they should be outgoing. Together with https://github.com/Fraunhofer-AISEC/codyze/pull/41 this should be enough to successfully run all tests on codyze.
Kudos, SonarCloud Quality Gate passed!
0 Bugs
0 Vulnerabilities (and 0 Security Hotspots to review)
6 Code Smells
In this process, I have decided to merge the
DeclarationListHandler
into theDeclarationHandler
. Since an handler can only returnNode
types orList<Node>
types, I have introduced theDeclarationSequence
node. This node should not end up in the final graph and will be "flattened" during CPG transformation.Closes #178