Method argument with no type

objectscriptQuality release 
1.0.0
Id 
OS0034
Rule type 
Code Smell
Severity 

Major

Major
SQALE characteristic 
  • Maintainability
    • Understandability
Tags 
coding-guidelines, maintainability
Remediation function 
Constant/issue
Remediation cost 
10min

This rule checks that all parameters of a given method or class method have a type declared.

ObjectScript makes it possible to have typeless arguments, as in:

    Method m(foo, bar)
    {
        // body of the method here
    }

This makes it difficult to know what the arguments are, even if the method is documented; what is more, it prevents the IDE (Studio or Atelier) from performing completion.

It is therefore preferable to always declare argument types, as in:

    Method m(foo as %String, bar as %Integer)
    {
        // body of the method here
    }

Limitations

If a method has a CodeMode of objectgenerator, then this rule will not activate; this is due to the fact that string literals currently are not evaluated into code.