Default Refactoring Rules
There are four different types of rules:
Note that each rule may be disabled if you don't want to use it.
Default Method Rules
- Check if there is an unreasonable ratio of comments to code in a method
- Check to see if there is a RETURN within a WITH statement, a known cause of C5 errors
- Check to see if there are too many lines in a method (defaults to 150) - which is a sign of readability
- Check to see if you have more than a certain number of loop structures in code (defaults to 5)
- Verifies that each function has a RETURN value
- Verifies that a function doesn't have more than 3 return values
Default Object Rules
- Checks if a button named Cancel does not have the Cancel property set to .T.
- Checks if you are simply using the default object names
- Checks if there are methods in the object that have similar number of lines that could therefore be a good candidate for refactoring the code
- Checks if you are using THIS.Parent in a form already
- Checks if you are using duplicate methods in column headers which suggest a possible refactoring use for BindEvent.
Default Line Rules
- Warns if you are using CTOD on a line of code instead of the DATE() function
- Checks if you have more than 3 .Parent lines on the same line, suggesting possible too many uses of .Parent
Anyone have any others?