Main Content

Metrics for generated code complexity

Check ID: mathworks.hism.himl_0013

Description

Identifies the usage of built-in MATLAB Functions with high code complexity of generated code.

Available with Simulink® Check™.

Input Parameters

For this check, you can set the following customizations using Model Advisor Configuration Editor:

  • Set the threshold to flag MATLAB functions with high code complexity of generated code by using the Complexity threshold parameter. By default, the value is set to 40.

  • Exclude analyzing the MATLAB functions using the parameter Functions excluded from analysis. You can add multiple functions to the field by using a comma separator.

Results and Recommended Actions

ConditionRecommended Action
Some built-in MATLAB Functions used in the model might cause high code complexity when generating code.
  • Functions with significant size and complexity must be reviewed to ensure if full potential of the function is required.

  • Use simpler alternatives to reduce code complexity, or add the functions to exclusion list in Model Advisor Configuration Editor.

Capabilities and Limitations

  • Does not run on library models.

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

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

  • Allows exclusions of blocks and charts.

See Also