Skip to content

Latest commit

 

History

History
31 lines (21 loc) · 1.23 KB

FunctionShouldHaveReturn.md

File metadata and controls

31 lines (21 loc) · 1.23 KB

The function should have return (FunctionShouldHaveReturn)

Type Scope Severity Activated
by default
Minutes
to fix
Tags
Error BSL
OS
Major Yes 10 suspicious
unpredictable

Description

Function differs from a Procedure only that it necessarily returns a value and can be used in expressions.

Based on the above-mentioned, a function which does not contain a return is itself erroneous. Corrections required:

  • implement return if the implemented method is a function
  • rewrite function to procedure if return is not needed

Snippets

Diagnostic ignorance in code

// BSLLS:FunctionShouldHaveReturn-off
// BSLLS:FunctionShouldHaveReturn-on

Parameter for config

"FunctionShouldHaveReturn": false