Main Content

Check indentation of code in Stateflow states

Check ID: mathworks.jmaab.jc_0736

Guideline: jc_0736: Uniform indentations in Stateflow® blocks

Description

Check for uniform indentation of label Strings in Stateflow States and Transitions.

Checks if the indentations in the Stateflow blocks are described uniformly and adhere to the following recommendations:

This check requires a Simulink® Check™ and Stateflow license.

Check Parameterization

This check contains sub-checks that correspond to the sub IDs specified in the MAB and JMAAB modeling guidelines. You can use the Model Advisor Configuration Editor to specify which sub IDs (one or multiple) to execute.

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

  • NA-MAAB — No recommendations

  • JMAAB — a, b, c

You can use the input parameter Number of single-byte spaces to set the threshold to the desired value. By default the value is set to 1.

Results and Recommended Actions

Guideline Sub IDConditionRecommended Action
jc_0736_a: Check for uniform indentation of action language in Stateflow states.One or more Stateflow states in the model do not have uniform indentation.Consider deleting the blank spaces before state action types and adding the exact number of single-byte spaces as defined in the input parameter before executable statements.
jc_0736_b: Check for uniform spacing of transition action types.One or more Stateflow transitions in the model do not have uniform spacing.Consider not adding blank spaces before '[' of a transition condition, '{' of a transition action and '/' of the event in a transition.
jc_0736_c: Check for uniform spacing of transition actions.One or more Stateflow transitions in the model do not have uniform spacing.Consider adding the exact number of single-byte spaces as defined in the input parameter after the '/' of a transition action.

Capabilities and Limitations

  • Runs on library models.

  • 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 graphical.

  • Allows exclusions of charts.