CC4M - Code Checker for MATLAB
Current version: v2.13.2
Supported MATLAB releases: R2017b - R2023b
CC4M helps developers write clean, consistent and guideline-compliant MATLAB code.
Accessed from the MATLAB editor or Simulink Model Advisor; MATLAB code, Simulink models and Stateflow charts are checked for consistency and errors.
CC4M analyzes your MATLAB code and presents useful information on functions and variables. CC4M checks on guideline conformity, functionality shadowing and missing dependencies. CC4M lets you work quickly, by offering navigation links to the exact corresponding location within the code for each failing check.
CC4M - Business benefits.
Guide your MATLAB code development towards production-quality software and enjoy the benefits of quality software that is consistent, reliable, easily reviewed, reused and maintained.
Increase developer productivity
CC4M helps improving productivity. Standards compliance checking is largely automated, meaning the boring elements of a code review can be skipped. Developers can now focus functionality. Checking compliance during develpoment educates on used coding standards.
Improve onboarding, collaboration & code reuse
CC4M enforces a uniform code layout, checks for consistent naming, manages complexity, and proclaims recognizable constructions. This not only helps in getting new team members up to speed, but also improves readability, maintainability and code reuse.
Shorten path to embedded code
On top of MATLAB's hints in the editor and the Coder Readines tool, CC4M adds additional analyis to improve code readiness for code generation. Furthermore CC4M reports a range of potential functional differences between m-code, and generated code.
Reduce the cost of defects
CC4M provides checks that improve testability, enforce code completeness and manage complexity. This results in finding defects during test development much easier and earlier, reducing overal costs of defects.
Introduction to CC4M
MATLAB Coding Standards. Shipped to adopt, or adapt.
Several MATLAB Coding Standards for different purposes are included in CC4M. The standards themselves are readily available online (see the links below); and CC4M includes a configuration set to check for compliance.
These standards can be adopted as-is or can be used as a basis and adapted to your needs or existing coding standards.
MATLAB Coding Standard
The MATLAB Coding Standard has been constructed in consultation with multiple large companies that are using MATLAB on a daily basis. With years of experience in the industry, they are able to provide invaluable input on what MATLAB-related coding rules to follow and why. The standard is used by TIOBE TiCS , whos CEO Paul Jansen also participates in the CCB.
MATLAB Coding Standard ++
Internally MonkeyProof Solutions uses a variation & extension of the MATLAB Coding Standard to include our corporate naming conventions for variables, structure fieldnames functions, classes, etc.
MATLAB Coder Compatibility Standard
When C/C++ code is generated from MATLAB code, a far more rigid coding style is required, using a subset of available functions, function options and code structures. The provided set of rules not only helps in detecting the correct use of the allowed subset, but also detects and warns possible different behaviour between MATLAB and the generated code.
MATLAB Compiler Compatibility Standard
A set of rules that detect documented (by MathWorks) and undocumented limitations, when code is distributed via the MATLAB Compiler. Also checks for insecure file and web access.
CC4M Checks. Categorized & configurable.
Many checks are configurable. CC4M has several configurations, every configuration has a set of checks with their defined parameter values. Every parametric check can appear many times in a configuration (with different parameters). Every (parametrised) check in the configuration can map to a coding rule. During checking, CC4M uses the selected configuration.
Generic
Checks on generic programming features and constructions, not falling in any other category like "functions to avoid".
Layour & readability
Checks (some with auto-fixing options) to enforce desired uses of commas, spaces, line endings, alignment, comments, etc.
Compatibility
Verify compatibility with a configurable MATLAB releases, detect the use of JAVA, or detect the use of certain features, or functions that might result in compatibility issues during for example deployment.
Naming conventions
CC4M has several checks on the casing of names of certain aspects in the code. There is a separate check for each aspect, which means that every casing check can have their own parameter values.
Testability & functionality
Checks that improve testability and help in managing complexity. Also includes checks on the function/method prototype.
Security
Security-related checks as used in the MATLAB Coding Standard. Recommended especially with application development.