CRITICAL
Rule Definition
Recursive calls can be unpredictable with regard to consumption of resources, especially memory. Under certain condition, a function or procedure using a recursive call can keep calling itself and as each call consumes memory, the entire application runs out of memory.
Recursive calls are known to be difficult to test for because the termination condition and thus the resource consumption might be dependent on the data used for the test. For all these reasons, it is often forbidden and limited to academic usage rather than for mission-critical systems. Because the flip side is complexity, such a trade-off should be carefully chosen by architects or senior developers, balancing cost with reliability and in all cases the conditions under which it is used should be reviewed in details.
Remediation
Replace the recursive PLI procedures.
Violation Code Sample
MY_PROG: PROC OPTIONS(MAIN) REORDER;
…
F2: PROC (PROGRAMME_TEST,TEST1) RECURSIVE;
…
Related Technologies
Technical Criterion
Complexity - Algorithmic and Control Structure Complexity
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.