sonar-openedge
                                
                                 sonar-openedge copied to clipboard
                                
                                    sonar-openedge copied to clipboard
                            
                            
                            
                        Define parameter mode in method calls
The compiler only forces you to define INPUT, OUTPUT etc. in method calls when there are overloads that make the call ambiguous.
This makes code very hard to read since you cannot know if the variable is changing or not without looking at the method definition. (Which usually is defined somewhere else).
A rule that forces you to define the parameter mode in the call would be great. (INPUT should be ignored since it is default, but a setting would be the best solution for this ;-) )
In the following example, the method call in the constructor works fine when removing the last Foo overload but throws an error when it is present.
CLASS FooClass:
   CONSTRUCTOR FooClass(
   ):
      DEFINE VARIABLE lcFoo AS CHARACTER NO-UNDO.
      THIS-OBJECT:Foo(lcFoo).
   END CONSTRUCTOR.
   METHOD PUBLIC VOID Foo(
      INPUT-OUTPUT pcTest AS CHARACTER
   ):
   END METHOD.
   METHOD PUBLIC VOID Foo(
      pcTest AS CHARACTER
   ):
   END METHOD.
END CLASS.
I agree that having the INPUT-OUTPUT or OUTPUT always present would help in terms of readability. But having two methods with the same name and same signature except for INPUT-OUTPUT also really disturbs me !