Main Content

slmetric.metric.getAvailableMetrics

Package: slmetric.metric

(To be removed) Obtain available metrics

slmetric.metric.getAvailableMetrics will be removed in a future release. For size, architecture, and complexity metrics, use the metric.Engine API and the model maintainability metrics instead. For more information, see metric.Engine and Collect Model Maintainability Metrics Programmatically.

Description

example

IDs = slmetric.metric.getAvailableMetrics() get metric identifiers for available metrics in the metric engine.

example

[IDs,props] = slmetric.metric.getAvailableMetrics() get metric identifiers and properties.

Examples

collapse all

This example shows how to obtain the available model metric IDs.

ID = slmetric.metric.getAvailableMetrics()
ID =

  26×1 cell array

    {'mathworks.metrics.CloneContent'                          }
    {'mathworks.metrics.CloneDetection'                        }
    {'mathworks.metrics.CyclomaticComplexity'                  }
    {'mathworks.metrics.DescriptiveBlockNames'                 }
    {'mathworks.metrics.DiagnosticWarningsCount'               }
    {'mathworks.metrics.ExplicitIOCount'                       }
    {'mathworks.metrics.FileCount'                             }
    {'mathworks.metrics.IOCount'                               }
    {'mathworks.metrics.LayerSeparation'                       }
    {'mathworks.metrics.LibraryContent'                        }
    {'mathworks.metrics.LibraryLinkCount'                      }
    {'mathworks.metrics.MatlabCodeAnalyzerWarnings'            }
    {'mathworks.metrics.MatlabFunctionCount'                   }
    {'mathworks.metrics.MatlabLOCCount'                        }
    {'mathworks.metrics.ModelAdvisorCheckCompliance.hisl_do178'}
    {'mathworks.metrics.ModelAdvisorCheckCompliance.maab'      }
    {'mathworks.metrics.ModelAdvisorCheckIssues.hisl_do178'    }
    {'mathworks.metrics.ModelAdvisorCheckIssues.maab'          }
    {'mathworks.metrics.ModelFileCount'                        }
    {'mathworks.metrics.ParameterCount'                        }
    {'mathworks.metrics.SimulinkBlockCount'                    }
    {'mathworks.metrics.StateflowChartCount'                   }
    {'mathworks.metrics.StateflowChartObjectCount'             }
    {'mathworks.metrics.StateflowLOCCount'                     }
    {'mathworks.metrics.SubSystemCount'                        }
    {'mathworks.metrics.SubSystemDepth'                        }

This example shows how to obtain the available model metric properties.

[ID,PROPS]=slmetric.metric.getAvailableMetrics()
ID =

  26×1 cell array

    {'mathworks.metrics.CloneContent'                          }
    {'mathworks.metrics.CloneDetection'                        }
    {'mathworks.metrics.CyclomaticComplexity'                  }
    {'mathworks.metrics.DescriptiveBlockNames'                 }
    {'mathworks.metrics.DiagnosticWarningsCount'               }
    {'mathworks.metrics.ExplicitIOCount'                       }
    {'mathworks.metrics.FileCount'                             }
    {'mathworks.metrics.IOCount'                               }
    {'mathworks.metrics.LayerSeparation'                       }
    {'mathworks.metrics.LibraryContent'                        }
    {'mathworks.metrics.LibraryLinkCount'                      }
    {'mathworks.metrics.MatlabCodeAnalyzerWarnings'            }
    {'mathworks.metrics.MatlabFunctionCount'                   }
    {'mathworks.metrics.MatlabLOCCount'                        }
    {'mathworks.metrics.ModelAdvisorCheckCompliance.hisl_do178'}
    {'mathworks.metrics.ModelAdvisorCheckCompliance.maab'      }
    {'mathworks.metrics.ModelAdvisorCheckIssues.hisl_do178'    }
    {'mathworks.metrics.ModelAdvisorCheckIssues.maab'          }
    {'mathworks.metrics.ModelFileCount'                        }
    {'mathworks.metrics.ParameterCount'                        }
    {'mathworks.metrics.SimulinkBlockCount'                    }
    {'mathworks.metrics.StateflowChartCount'                   }
    {'mathworks.metrics.StateflowChartObjectCount'             }
    {'mathworks.metrics.StateflowLOCCount'                     }
    {'mathworks.metrics.SubSystemCount'                        }
    {'mathworks.metrics.SubSystemDepth'                        }


PROPS = 

  1×26 struct array with fields:

    Name
    Description
    IsBuiltIn
    Version

Output Arguments

collapse all

Metric identifiers in the metric engine.

Metric properties, returned as a structure array with the following fields:

NameName of the metric algorithm.
DescriptionDescription of the metric algorithm.
IsBuiltInBoolean indicating if the metric is included with Simulink® Check™.
VersionMetric algorithm version.

Data Types: struct

Version History

Introduced in R2016a

collapse all

R2022a: Warns

The slmetric.Engine API will be removed in a future release. For size, architecture, and complexity metrics, use the metric.Engine API and the model maintainability metrics instead. For more information, see metric.Engine and Collect Model Maintainability Metrics Programmatically.