Property of type %String without a MAXLEN

objectscriptQuality release 
1.0.0
Id 
OS0032
Rule type 
Code Smell
Severity 

Major

Major
SQALE characteristic 
  • Efficiency
    • Efficiency compliance
Tags 
performance
Remediation function 
Constant/issue
Remediation cost 
5min

If a property of type %String (or %Library.String) is declared without a MAXLEN parameter, then the default length (of 50) will be used when an instance of the class is persisted.

Depending on the situation, this will lead to either wasted storage (if 50 is too high) or writes and retrievals which do not perform as well as they could (if 50 is too low).

If possible, modify the declaration of this property and add this class parameter, such as, for instance:

    Property smallString As %String(MAXLEN = 10);