LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

mh_metric

calculates MATLAB code metrics

TLDR

Calculate metrics for a single file
$ mh_metric [file.m]
copy
Analyze an entire directory recursively
$ mh_metric [src/]
copy
Output metrics as JSON report
$ mh_metric --json=[metrics.json] [file.m]
copy
Output metrics as HTML report
$ mh_metric --html=[metrics.html] [file.m]
copy
Output metrics as text report
$ mh_metric --text=[metrics.txt] [file.m]
copy
Run in CI mode, reporting only violations
$ mh_metric --ci [src/]
copy

SYNOPSIS

mh_metric [options] [files or directories]

DESCRIPTION

mh_metric computes code metrics for MATLAB and Octave files and reports violations when metrics exceed acceptable levels. It measures cyclomatic complexity, number of lines, function length, nesting depth, and other code quality indicators.The tool is part of the MISS_HIT suite. If no files or directories are specified, it analyzes the entire working directory and all subdirectories. Configuration can be provided via miss_hit.cfg files in the project tree.

PARAMETERS

FILES

MATLAB files or directories to analyze. If not given, analyzes the entire working directory recursively.
--json=FILE
Write metrics report in JSON format to the specified file.
--html=FILE
Write metrics report in HTML format to the specified file.
--text=FILE
Write metrics report in plain text format to the specified file.
--ci
CI mode. Suppresses the overall report and only reports metric violations.
--ignore-justifications-with-tickets
Ignore any justifications in code that mention a ticket reference.
--help
Display help information.

CAVEATS

Part of the MISSHIT suite, installed via pip (`pip install misshit`). Only analyzes MATLAB (.m) and Octave files. Requires Python 3.6 or later.

HISTORY

mhmetric is part of **MISSHIT (MATLAB Independent, Small & Safe, High Integrity Tools), created by Florian Schanda** for measuring MATLAB and Simulink code quality metrics.

SEE ALSO

mh_lint(1)

Copied to clipboard
Kai