Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - General
- [x] The code works
- [ ] The code is easy to understand
- [x] Follows coding conventions
- [x] Names are simple and if possible short
- [x] Names are spelt correctly
- [ ] Names contain units where applicable
- [ ] Enums are used instead of int constants where applicable
- [x] There are no usages of 'magic numbers'
- [x] All variables are in the smallest scope possible
- [x] All class, variable, and method modifiers are correct.
- [ ] There is no commented out code
- [x] There is no dead code (inaccessible at Runtime)
- [x] No code can be replaced with library functions
- [ ] Required logs are present
- [x] Frivolous logs are absent
- [x] Debugging code is absent
- [x] No System.out.println or similar calls exist
- [ ] No stack traces are printed
- [ ] Variables are not accidentally used with null values
- [x] Variables are immutable where possible
- [x] Code is not repeated or duplicated
- [ ] There is an else block for every if clause even if it is empty
- [x] No complex/long boolean expressions
- [x] No negatively named boolean variables
- [ ] No empty blocks of code
- [x] Ideal data structures are used
- [x] Constructors do not accept null/none values
- [x] Collections are initialised with a specific estimated capacity
- [ ] Arrays are checked for out of bound conditions
- [ ] Catch clauses are fine grained and catch specific exceptions
- [ ] Exceptions are not eaten if caught, unless explicitly documented otherwise
- [ ] APIs and other public contracts check input values and fail fast
- [ ] Files/Sockets/Cursors and other resources are properly closed even when an exception occurs in using them
- [ ] StringBuilder is used to concatenate strings
- [x] Null/None are not returned from any method
- [x] Floating point numbers are not compared for equality
- [x] Loops have a set length and correct termination conditions
- [x] Blocks of code inside loops are as small as possible
- [x] Order/index of a collection is not modified when it is being looped over
- [x] No methods with boolean parameters
- [x] No object exists longer than necessary
- [ ] Design patterns if used are correctly applied
- [ ] No memory leaks
- [x] Law of Demeter is not violated
- [x] Methods return early without compromising code readability
- - Java only
- [ ] Appropriate JCIP annotations are used
- [x] No use of Object class, use generics instead
- [x] Uses final modifier to prevent mistaken assignments
- - Documentation
- [x] All methods are commented in clear language.
- [ ] Comments exist and describe rationale or reasons for decisions in code
- [ ] All public methods/interfaces/contracts are commented describing usage
- [ ] All edge cases are described in comments
- [ ] All unusual behaviour or edge case handling is commented
- [ ] Data structures and units of measurement are explained
- - Threading
- [ ] Objects accessed by multiple threads are accessed only through a lock, or synchronized methods.
- [ ] Race conditions have been handled
- [ ] Locks are acquired and released in the right order to prevent deadlocks, even in error handling code.
- [ ] StringBuffer is used to concatenate strings in multi-threaded code
- - Security
- [ ] All data inputs are checked (for the correct type, length/size, format, and range)
- [x] Invalid parameter values handled such that exceptions are not thrown
- [x] No sensitive information is logged or visible in a stacktrace
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement