Home

Unused Procedure and Function Parameters

Description

    The Unused Procedure and Function Parameters rule checks for unused parameters in stored procedures and functions. This rule helps to identify and eliminate unnecessary parameters that can lead to code bloat and confusion. Unused parameters can also lead to potential security vulnerabilities if they are not properly handled. The rule checks for parameters that are declared but not used in the body of the procedure or function. If any unused parameters are found, the rule will generate a warning.

Key Benefits

  • Readability: Unused Procedure and Function Parameters rule increases the readability of code by making it easier to identify the purpose of each parameter.
  • Maintainability: Unused Procedure and Function Parameters rule helps maintain code by reducing the number of unnecessary parameters and making it easier to modify existing code.
  • Security: Unused Procedure and Function Parameters rule helps improve security by reducing the potential for malicious code to be injected into a system.

 

Non-compliant Code Example

procedure DeleteCloneCustomerById(customer_Id in NUMBER)      --Non compliant code (Unused parameter)
IS
BEGIN
    DELETE CloneCustomer where ID = id;
    COMMIT;
END DeleteCloneCustomerById

Compliant Code Example

procedure DeleteCloneCustomerById(customer_Id in NUMBER)       --Compliant code
IS
BEGIN
    DELETE CloneCustomer where ID = customer_Id;
    COMMIT;
END DeleteCloneCustomerById
Visual Expert 2024
 VEPLSQLRULE101