codeIssues
Collect Nelson code analyzer issues as tables.
📝Syntax
ci = codeIssues()
ci = codeIssues(names)
ci = codeIssues(names, Name, Value)
export(ci, filename)
ci = fix(ci)
📥Input Arguments
Parameter Description
names a string, string array, or cell array of character vectors: files or folders to analyze.
CodeAnalyzerConfiguration a string: JSON configuration file.
IncludeSubfolders a logical scalar: true to recursively analyze folders.
📤Output Arguments
Parameter Description
ci a codeIssues object. Its Issues and SuppressedIssues properties are Nelson tables.
📄Description

codeIssues runs the Nelson code analyzer and stores active and suppressed diagnostics in table properties.

The JSON configuration file uses the same version 2 format as checkcode: extends, files.include, files.exclude, rules, and ci.failOn.

The export method writes JSON, CSV, or text according to the output file extension.

The fix method applies only trivial automatic fixes in this version: trailing whitespace and missing final newline.

💡Examples
Analyze a folder recursively with a JSON configuration.
ci = codeIssues([nelsonroot(), '/modules/interpreter/functions'], ...
  'CodeAnalyzerConfiguration', [nelsonroot(), '/nelson-lint.json'], ...
  'IncludeSubfolders', true);
ci.Issues
Configuration file shape.
{
  "version": 2,
  "files": {
    "include": ["**/*.m", "**/*.xml"],
    "exclude": [".git", "build", "target", "bin", "x64", "generated"]
  },
  "rules": {
    "NLS0001": { "level": "error" },
    "NLS0013": { "level": "error" },
    "NLS0012": { "level": "warning", "options": { "maxLineLength": 120 } }
  },
  "ci": { "failOn": "warning" }
}
Used Functions
codeAnalyzerRules
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub