All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.l10n.oe.rules.rssw-oe.compiler.warning.19822.html Maven / Gradle / Ivy

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.




© 2015 - 2024 Weber Informatics LLC | Privacy Policy