org.sonar.l10n.oe.rules.rssw-oe.compiler.warning.19822.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sonar-openedge-plugin Show documentation
Show all versions of sonar-openedge-plugin Show documentation
Enables analysis of OpenEdge projects
The newest version!
All code paths in a function or a method must return a value. Method or function will return an unkwnown value (i.e. ?) if no RETURN statement is found in the body, while the consumer of the method / function would expect the specified return data type.
Noncompliant Code Example
FUNCTION f1 RETURNS CHARACTER:
IF (condition) THEN DO:
// Logic here
RETURN "XYZ".
END.
// If condition evaluates to false, then ? will be returned
END FUNCTION.
Compliant Solution
FUNCTION f1 RETURNS CHARACTER:
IF (condition) THEN DO:
// Logic here
RETURN "XYZ".
END.
ELSE
RETURN "ABC".
END FUNCTION.