MonkeyProof MATLAB Coding Standard++
Table of Contents
Introduction
1.
Naming conventions
❱
1.1.
Name length
1.2.
Loop iterator naming
1.3.
Negated boolean names
1.4.
Parent / child name redundancy
1.5.
Variable casing
1.6.
Function casing
1.7.
Class casing
1.8.
Property casing
1.9.
Package casing
1.10.
Event casing
1.11.
Struct field casing
1.12.
Constant casing
1.13.
Enumeration member casing
1.14.
Name shadowing
1.15.
Names to avoid
1.16.
Name-value pair casing
1.17.
Test suffix
1.18.
Name class object
2.
Layout & comments
❱
2.1.
Comment blocks
2.2.
Function indentation
2.3.
Whitespace in statements
2.4.
Whitespace after characters
2.5.
Line length
2.6.
Indentation length
2.7.
Comments on poorly written code
2.8.
Equals sign alignment
2.9.
Commas in rows
2.10.
Line continuation with operators
2.11.
Methods/Properties blocks with duplicate attributes
2.12.
Whitespace at the end of a line
2.13.
Use spaces instead of tab characters.
2.14.
Properties blocks before methods blocks
3.
Statements & expressions
❱
3.1.
Constant definitions at top
3.2.
Magic numbers
3.3.
Function calls without inputs
3.4.
One statement per line
3.5.
If else
3.6.
Switch otherwise
3.7.
Mixed types in expressions
3.8.
Parentheses in logical expressions
3.9.
Parentheses in mathematical expressions
3.10.
Assert inputs
3.11.
Global variables
3.12.
Constant conditional statements
3.13.
Group struct field definitions
3.14.
Return keyword
3.15.
Dependencies known
3.16.
Try for exception handling
3.17.
Floating-point comparisons
3.18.
Cell arrays
3.19.
Zero before decimal point
3.20.
Abstract class instantiation
3.21.
Command syntax
4.
Higher level rules
❱
4.1.
Complexity
4.2.
Number of function arguments
4.3.
Constructors with single output
4.4.
Scripts
4.5.
Editor warnings
4.6.
Getters and setters
4.7.
Mex-files
4.8.
Nesting depth
4.9.
Reuse of iterator variables
4.10.
Nested functions
4.11.
Missing methods declarations and implementations
4.12.
Mismatch input and output declarations and implementations
4.13.
First output constructor
4.14.
Iterator variables outside loop
4.15.
More input arguments than expected
4.16.
Superclass property implementation
4.17.
Java dependency
4.18.
Method access permissions
4.19.
Write interpretable code
5.
Security
❱
5.1.
Eval-functions
5.2.
Shell escape
5.3.
Security weboptions
5.4.
Security XML reading
5.5.
Constant variable names
5.6.
Security Username and Password
Light
Rust
Coal
Navy
Ayu
MonkeyProof MATLAB Coding Standard++ v1.3.2
Security
This chapter contains rules to help avoiding potential security risks.