I'm trying to calculate some Cyclomatic Complexity, hence trying to draw a Control Flow Graph. Firstly i'm trying to make it for a fairly simple method.
Firstly i tried drawing it for just the try part like this:
Heres the method:
[HttpPost]
public ActionResult GraphMethod([FromForm]string str)
{
try
{
int affectedRows = this._copyManager.CreateCopy(str);
if (affectedRows < 1) return BadRequest("Error!");
return Ok();
}
catch (Exception ex)
{
return BadRequest(ex.Message);
}
}
How would i extend it to include the entire method, and the try part?
This is my first ever Control Flow Graph, so if i messed it up i would also like to know.