Avoid PLI Functions and Procedures declared as RECURSIVE (PL1) | CAST Appmarq

Avoid PLI Functions and Procedures declared as RECURSIVE (PL1)

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

Health Factor

  Total Quality Index


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.

Benchmark Statistics

Global Compliance

90.15%

Total Violations
532
Total Opportunities
5,402
Average Violations / App.
88.67
The compliance score represents 1 minus the ratio between the number of times a rule has been violated compared to the number of opportunities in a set of applications that the rule could have been violated.

Industry Insights

Manufacturing

94.49%

IT & Business Consulting

88.47%

Financial Services

100.00%