Main Content

Check function headers

Check ID: mathworks.jmaab_v6.mp_0032

Guideline: mp_0032: Function headers

Description

Checks if function headers contain descriptive items specified by the input parameter.

This check applies to the following target components:

  • MATLAB Function blocks in Simulink®.

  • MATLAB® functions in Stateflow® charts.

  • External MATLAB files referenced in a model.

This check requires a Simulink Check™ license.

Check Parameterization

This check does not include sub-checks because the JMAAB modeling guideline provides only one sub ID.

For reference, the guideline sub ID(s) that are recommended for use by the JMAAB modeling standards organizations are:

  • JMAAB — a

Select Check external .m files referenced in the model, to include files with a .m extension in the analysis. The check box is selected by default.

Enter the descriptive items to check in function headers, separated by the pipe symbol ("|"), in the Descriptive items box. Descriptive items are not case sensitive and can appear in any order in the function headers. The default value is Overview|Processing content|Arguments|Return value|change history.

Each descriptive item of a function header must be located on a separate line and not contain special characters. For example, the check does not flag the following header for potential issues for the default value of the input parameter, Descriptive items.

% Overview
%    sample program
% Processing content
%    Add arg1 and foo and return the value
% Arguments
%    arg1: First term
% Return Value
%    ret: Addition result
% Change History
%     05/24/2022 - added new comments

The check flags the following function header for the default value of Descriptive Items:

% Overview --
%    sample program
% Processing content Add arg1 and foo and return the value
% Arguments    arg1: First term
% Return Value
%    ret: Addition result
% Change History !
%     05/24/2022 - added new comments

Results and Recommended Actions

ConditionRecommended Action
One or more function headers do not include the specified descriptive items.Include descriptive items specified by the Descriptive items input parameter in function headers.

Capabilities and Limitations

  • Analyzes content of library-linked blocks. By default, the input parameter Follow links is set to on.

  • Analyzes content in masked subsystems. By default, the input parameter Look under masks is set to all.

  • Runs on library models.

  • Allows exclusion of blocks and charts.

See Also