1. MonkeyProof MATLAB Coding Standard
  2. Table of Contents
  3. Introduction
  4. 1. Naming conventions
    ❱
    1. 1.1. Loop iterator naming
    2. 1.2. Negated boolean names
    3. 1.3. Parent / child name redundancy
    4. 1.4. Name shadowing
    5. 1.5. Names to avoid
    6. 1.6. Function names document their use
    7. 1.7. Function name construction
    8. 1.8. Name-value pair casing
    9. 1.9. The 'Test' suffix
    10. 1.10. Name length
    11. 1.11. Descriptive names
    12. 1.12. The 'is' prefix
    13. 1.13. Abbreviations
    14. 1.14. Units in variable names
    15. 1.15. The 'n' prefix
    16. 1.16. Name class object
  5. 2. Layout & comments
    ❱
    1. 2.1. Comment blocks
    2. 2.2. Function indentation
    3. 2.3. Whitespace in statements
    4. 2.4. Whitespace after characters
    5. 2.5. Line length
    6. 2.6. Indentation length
    7. 2.7. Comments on poorly written code
    8. 2.8. Equals sign alignment
    9. 2.9. Commas in rows
    10. 2.10. Methods/Properties blocks with duplicate attributes
    11. 2.11. Whitespace at the end of a line
    12. 2.12. Tab characters
    13. 2.13. Properties blocks before methods blocks
    14. 2.14. Help text
    15. 2.15. Whitespace around blocks of code
    16. 2.16. Correct spelling
    17. 2.17. Align struct definition
    18. 2.18. Constants with end of line comments
  6. 3. Statements & expressions
    ❱
    1. 3.1. Constant definitions at top
    2. 3.2. Magic numbers
    3. 3.3. Function calls without inputs
    4. 3.4. One statement per line
    5. 3.5. If else
    6. 3.6. Switch otherwise
    7. 3.7. Mixed types in expressions
    8. 3.8. Parentheses in logical expressions
    9. 3.9. Parentheses in mathematical expressions
    10. 3.10. Assert inputs
    11. 3.11. Global variables
    12. 3.12. Constant conditional statements
    13. 3.13. Group struct field definitions
    14. 3.14. Dependencies known
    15. 3.15. Try for exception handling
    16. 3.16. Floating-point comparisons
    17. 3.17. Zero before decimal point
    18. 3.18. Workspace variable ans
    19. 3.19. Debugging functions
    20. 3.20. Elseif else
    21. 3.21. Abstract class instantiation
    22. 3.22. Command syntax
    23. 3.23. Accessing other workspaces
    24. 3.24. Logical indexing
    25. 3.25. Loop vectorization
    26. 3.26. Use switch blocks
    27. 3.27. Variable in one unit
    28. 3.28. Undocumented functions
  7. 4. Higher level rules
    ❱
    1. 4.1. Complexity
    2. 4.2. Number of function arguments
    3. 4.3. Constructors with single output
    4. 4.4. Scripts
    5. 4.5. Editor warnings
    6. 4.6. Getters and setters
    7. 4.7. Mex-files
    8. 4.8. Nesting depth
    9. 4.9. Repeated code
    10. 4.10. Structure ownership
    11. 4.11. Single responsibility
    12. 4.12. Commented out code
    13. 4.13. Reuse of iterator variables
    14. 4.14. Rewriting existing functions
    15. 4.15. Columns with implicit meaning
    16. 4.16. Nested functions
    17. 4.17. Input parameter dependency
    18. 4.18. Missing methods declarations and implementations
    19. 4.19. Mismatch input and output declarations and implementations
    20. 4.20. First output constructor
    21. 4.21. Iterator variables outside loop
    22. 4.22. More input arguments than expected
    23. 4.23. Superclass property implementation
    24. 4.24. Java dependency
    25. 4.25. Method access permissions
  8. 5. Security
    ❱
    1. 5.1. Eval-functions
    2. 5.2. Shell escape
    3. 5.3. Security Security Server Certificate Usage
    4. 5.4. Security XML reading
    5. 5.5. Constant variable names
    6. 5.6. Security Username and Password
  9. 6. Release notes

MonkeyProof MATLAB Coding Standard v1.3.2

MonkeyProof MATLAB Coding Standard

Version 1.3

cc4m_logo

© 2023 MonkeyProof Solutions BV

info@monkeyproofsolutions.nl

www.monkeyproofsolutions.nl

T: +31 (0)76 8200 314