How to make your code suck less
Complexity reduction
- Cyclomatic Complexity – indicator that too much is going on in a class or a method (code smell)
- How many different branches or paths your code has in it
- Dependencies
- Lines of Code
- Stability
- Unstable == few dependencies
- Small fighter jet, very nimble, quick to react
- Stable = many dependencies
- Jumbo jet, slow to change directions
- NDepend
- Commercial tool that reads a VS project
- Shows dependencies and other metrics to help find code smells
- Great for refactoring and looking at legacy systems
- VSTS Static Analysis
- .NET Reflector CodeMetrics add-in (http://www.red-gate.com – still a free version)
- Will graph out dependencies (plugin)
- Will show cyclomatic complexities to help find code smells
- DevExpress CodeRush