Introducing Code Checker for MATLAB
current version: v2.13.0
supported MATLAB releases: R2017b - R2023b

Guide your MATLAB code development towards production-quality software with Code Checker for MATLAB. Your code: consistent, reliable and reusable. Code Checker for MATLAB helps developers write clean, consistent and guideline-compliant MATLAB code. Achieved by performing checks and analyses. Accessed from the MATLAB editor or Simulink Model Advisor; MATLAB code, Simulink models and Stateflow charts are checked for consistency and errors.

Code Checker for MATLAB performs (among others) checks on standard guideline conformity, functionality shadowing and missing dependencies. Integrate your company-specific verification guidelines by defining custom checks where needed. Code Checker for MATLAB lets you work quickly, by offering navigation links to the exact corresponding location within the code for each failing check. In addition, Code Checker for MATLAB analyzes your MATLAB code and presents useful information on functions and variables.

Capabilities



Standard checks

Reports presented by the standard checks include (among others) a basic summary, information on block statements and name casing. These checks can be turned on and off according to your needs.


Custom checks

Tailor Code Checker for MATLAB for your project, customize the code checker! Impose company or team-specific coding guidelines on your MATLAB code, put emphasis on what is important to you. Examples include variable naming conventions, casing guidelines and guidelines listing certain MATLAB functions that should be avoided.


Version control

Code Checker for MATLAB - standard edition can be set to check locally modified files under Git and Subversion, ideal as a standard review before each commit. Prevent poor code constructs or non style guide compliant code making it into your repository.


Code analysis

Code Checker for MATLAB analyses variables, functions and dependencies. For instance, it reports on function types and how variables are used. Get a grip and guide your software.


System requirements

Code Checker for MATLAB requires MATLAB R2017b or later. Suitable for deployment on Microsoft Windows, Linux, and macOS.

 

Key Features & Benefits

  • Results in compliant and legible MATLAB code
  • Facilitates teamwork, reuse, and reliability
  • Guidelines compliance checking
  • Functionality shadowing checking
  • Dependency checking
  • Checks individual files or hunderds at a time
  • Comes with configurations for MonkeyProof MATLAB Coding Standard (++), MATLAB Coder compatibility, MAB/MAAB/JMAAB
  • Over 75 configurable checks .. and counting
  • Auto fix from report (for some checks)
  • Function and variable analysis
  • Configurable set of checks
  • Version control (Git & Subversion) aware
  • Intuitive and easy to use
  • Serverity levels for checks
 

Overview of Configurable Checks

Constructs and functions to avoid
  • Check for use of disapproved built-in functions and keywords.
  • Check for disapproved usage of varargin and varargout.
  • Check if there are any comment blocks used.
  • Check if any setters and getters are declared.
  • Check if the keyword 'global' is used.
  • Check for usage of 'if true' and similar.
  • Check for usage of logical operators && and || in logical expression.
  • Check if there are any nested functions used.
  • Check if every constructor has only one output.
  • Check if the keyword 'persistent' is used.
  • Check if there are any script files used.
  • Check if there are no file-wide warning suppressions.
  • Check if TRY is used.
  • Check if warnings are issued in the code.
  • Check if built-in functions, introduced after a certain MATLAB release, are called.
  • Check if any local functions (subfunctions) are used.
  • Check usage of character arrays.
  • Check usage of string data type.
  • Check if shell escape functions are used.
  • Check if all used built-in MATLAB functions were introduced before a specific MATLAB release.
  • Check if dynamic struct field or property names are used.
  • Check if all try blocks are used for exception handling.
  • Check for reuse of iterator variable names.
  • ! NEW ! Check if brackets are used to concatenate struct array field values or object array property values.
Readability and componentization
  • Check if the length of the executable code exceeds its maximum according to the guidelines.
  • Check if commas, semicolons and keywords are followed by a space unless at the end of the line.
  • Check if the contents of all functions are indented or not.
  • Check if all lines have indentation divisible by parameter indentation length.
  • Check if the length of a code line exceeds its maximum according to guidelines.
  • Checks if blocks are nested too deep.
  • Check if all function calls without input arguments have empty parentheses.
  • Check if there are any functions with too many inputs or outputs.
  • Check if there is at most one keyword per line.
  • Check if special characters are surrounded by spaces.
  • Check whether any comments start with ‘to do’, ‘NOTE’, etc.
  • Check whether all constants are defined at the top of the function.
  • Check whether for every struct, the fields are defined in a single, contiguous block of code.
  • Check whether so-called magic numbers are used in your code.
  • Check if there are statements in which insufficient parentheses are used to clarify the precedence of logical operators.
  • Check if mathematical statements use sufficient parentheses to clarify operator precedence.
  • Check if expressions are properly aligned.
  • Check if the elements of all rows are separated with commas.
  • Check if lines are continued before or after binary operators.
  • Check for whitespace at end of line.
  • Check if the tab character is used (including an auto-fixer).
  • Check if properties are defined before methods in class definitions.
  • Check if all methods declared are implemented and matching declaration.
  • Check if command syntax (!, dos, system) statements are used in the code.
  • Check if the decimal point in numeric expressions has a zero before it.
Completeness
  • Check if every ASSERT call has ID and message as 2nd and 3rd inputs.
  • Check if there is a copyright notice and check its formatting.
  • Check if every IF has a matching ELSE section.
  • Check if every SWITCH has a matching OTHERWISE section.
  • Check if lines of code could generate output that could be prevented using a semicolon.
  • Check for duplicate attributes.
  • Check if arguments block is present.
Casing
  • Check if every class name is correctly cased.
  • Check if every enumeration member name is correctly cased.
  • Check if every event name is correctly cased.
  • Check if every method name is correctly cased.
  • Check if constant properties that fail the standard check on property casing are cased as defined by this check.
  • Check if every property name is correctly cased.
  • Check if every struct field is correctly cased.
  • Check if every user-defined function that is not a method is correctly cased.
  • Check if every variable is correctly cased.
  • Check if every package name is correctly cased.
  • Check if name-value pairs are correctly cased.
Other naming conventions
  • Check if the names of local functions and nested functions have specific prefixes.
  • Check if every iterator variable is prefixed with i, j, k etc.
  • Check on MATLAB functionality shadowing.
  • Check for negated boolean variable names.
  • Check if any property name contains the name of the class.
  • Check if any struct fields contain the name of the struct.
  • Check on names to be avoided.
  • Check if the configured suffix is reserved for unit test files (classdefs, functions or scripts).
Code Analysis
  • Report cyclomatic complexity.
  • Report dependencies used.
  • Report implemented functions/methods.
  • Report all mex-files used and their available versions.
  • Report the variables used.
  • Check if there are any editor warnings.
  • Check expressions and conditions to see if operands or operators of logical and numerical types are mixed.
  • Report binary expressions with potentially unexpected behaviour.
  • Report cell arrays that are not used to store arrays of character arrays or heterogeneous objects.
  • Report floating-point value comparisons.
  • Check if the code uses Java.
! NEW ! Runtime errors
  • Check if any abstract classes are instantiated in the code that is checked.
  • Report files that cannot be interpreted by MATLAB due to invalid code.
  • Check if functions are not called with more inputs than expected.
  • Check classdef files to see if any methods use different access permissions than their superclass (if any).
  • Check classdef files to see if it implements any superclass properties (if any).
  • Check if loop iterator variables are used outside the for-loop.
! NEW ! Security
  • Check if the weboptions function is used securely.
  • Check if XML files are accessed securely.
  • ! NEW ! Check if specific (e.g. credential related) variable names are assigned as constants
  • ! NEW ! Check if certificate settings are used securely
  • ! NEW ! Check if username and password properties are used securely
 

Buy or try

A limited version of the Code Checker for MATLAB is available for evaluation purposes. Download and request your evaluation license here.
Community support is available through our forum. The forum is actively monitored by MonkeyProof Solutions support and development team(s).

For quotation inquiries, licensing options and pricing, please contact us.