Summary
MonkeyProof MATLABĀ® Coding Standard
- Naming conventions
- Name length
- Loop iterator naming
- Negated boolean names
- Parent / child name redundancy
- Name shadowing
- Names to avoid
- Function names document their use
- Function name construction
- Name-value pair casing
- Descriptive names
- The 'is' prefix
- Abbreviations
- Units in variable names
- The 'n' prefix
- The 'Test' suffix
- Layout & comments
- Comment blocks
- Function indentation
- Whitespace in statements
- Whitespace after characters
- Line length
- Indentation length
- Comments on poorly written code
- Equals sign alignment
- Commas in rows
- Constants with end of line comments
- Methods/Properties blocks with duplicate attributes
- Whitespace at the end of a line
- Help text
- Whitespace around blocks of code
- Correct spelling
- Align struct definition
- Tab characters
- Properties blocks before methods blocks
- Statements & expressions
- Constant definitions at top
- Magic numbers
- Function calls without inputs
- One statement per line
- Elseif else
- If else
- Switch otherwise
- Mixed types in expressions
- Parentheses in logical expressions
- Parentheses in mathematical expressions
- Assert inputs
- Global variables
- Constant conditional statements
- Group struct field definitions
- Eval-functions
- Shell escape
- Dependencies known
- Try for exception handling
- Floating-point comparisons
- Workspace variable ans
- Debugging functions
- Logical indexing
- Loop vectorization
- Zero before decimal point
- Accessing other workspaces
- Use switch blocks
- Variable in one unit
- Undocumented functions
- Higher level rules
- Complexity
- Number of function arguments
- Constructors with single output
- Scripts
- Editor warnings
- Getters and setters
- Mex-files
- Nesting depth
- Repeated code
- Structure ownership
- Single responsibility
- Commented out code
- Reuse of iterator variables
- Rewriting existing functions
- Columns with implicit meaning
- Nested functions
- Input parameter dependency
- Missing methods declarations and implementations
- Mismatch input and output declarations and implementations
- Release notes