include::../description.adoc[]

== Noncompliant Code Example

----
int Pow(int num, int exponent)   // Noncompliant; no condition under which pow isn't re-called
{
  num = num * Pow(num, exponent-1);
  return num;  // this is never reached
}

void InternalRecursion(int i)  
{
  start:
    goto end;
  end:
    goto start; // Noncompliant; there's no way to break out of this method
}
----

== Compliant Solution

----
int Pow(int num, int exponent) 
{
  if (exponent > 1) // recursion now conditional and stop-able
  {  
    num = num * Pow(num, exponent-1);
  }
  return num;
}
----
