Skip to content

Out function parameter (FunctionOutParameter)

Type Scope Severity Activated
by default
Minutes
to fix
Tags
Code smell BSL
OS
Major No 10 design

Description

The function must have no output parameters. All output must be in the return value. If you need to return multiple values, you should use such types as Structure, Array, etc.

Examples

// Incorrect:
ServiceURL = "";
UserName = "";
UserPassword = "";

FillConnectionParameters(ServiceURL, UserName, UserPassword);

// Correct:
ConnectionParameters = NewConnectionParameters();
// Returned value - Structure:
//     Service URL  - String
//     UserName     - String
//     UserPassword - String

Sources

Snippets

Diagnostic ignorance in code

// BSLLS:FunctionOutParameter-off
// BSLLS:FunctionOutParameter-on

Parameter for config

"FunctionOutParameter": false