Method with unexpected arguments

objectscriptQuality release 
1.3.0
Id 
OS0076
Rule type 
Bug
Severity 

Critical

Critical
SQALE characteristic 
  • Reliability
    • Instruction
Tags 
runtime-failure
Remediation function 
Constant/issue
Remediation cost 
1h

Use the right number of parameters to call the function.

Noncompliant Code Example

Following code will compile, but on runtime the foo method will fail with "PARAMETER error" message.

Class Sample.Foobar
{
    ClassMethod foo(pstrArg1 As %String, pstrArgs2 As %String)
    {
        Write !,pstrArg1
        Write !,pstrArg2
    }

    ClassMethod bar()
    {
        Do ..foo(1,2,3) // PARAMETER error
    }
}