Home

Unused event parameters should be removed

Description

    This rule states that any event parameters that are not used in the PowerBuilder code should be removed. This is important because leaving unused event parameters can lead to unexpected behavior in the code, and can also lead to increased memory usage. Unused event parameters should be identified and removed to ensure the code is running optimally.

Key Benefits

  • Reduce complexity: Removing unused event parameters reduces the complexity of the codebase.
  • Improve readability: Removing unused event parameters makes the code easier to read and understand.
  • Reduce maintenance costs: By reducing complexity, unused event parameters can reduce the time and cost of maintaining the codebase.
  • Increase performance: Removing unused event parameters can improve the performance of the codebase.

 

Non-compliant Code Example

event type integer sales_order_generated(integer order_id);// generate sales order 
// record sales order into databse 
return  0 //Non compliant code (id parameter never used)
end event

Compliant Code Example

event type integer sales_order_generated(integer order_id);// generate sales order
// record sales order into databse
return  order_id //Compliant code 
end event
Visual Expert 2024
 VEPBRULE88