sonar-delphi
sonar-delphi copied to clipboard
Add control flow graph implementation
This PR adds the notion of a control flow graph. Control flow graphs are a stepping stone in data flow analysis and symbolic execution.
With just the control flow graph alone, two new rules could be implemented:
- RedundantJump
- LoopExecutingAtMostOnce
In addition to that, some more API traversal methods were added:
RepeatStatementNode::getGuardExpressionRepeatStatementNode::getStatementsCaseStatementNode::getSelectorExpressionCaseItemStatementNode::getStatement
The thinking is that the control flow graph will be internal for a while before being exposed in the stable API. In light of this, I have made a ControlFlowGraph interface in the API, but there are no public ways to create/interact with it.