Eclipse metrics plugin suggestion [closed]
CodePro AnalytiX originally form Instantiations is now free at Google: http://code.google.com/javadevtools/download-codepro.html
CodePro AnalytiX originally form Instantiations is now free at Google: http://code.google.com/javadevtools/download-codepro.html
The theoretically optimal values are: Maintainability index: 100. Higher values indicate better maintainability. Cyclomatic complexity: 1. The number of different paths that code can take. Depth of inheritance: 1. The number of class definitions above this one in the inheritance tree, not including interfaces. Class coupling: 0. Number of other entities this entity is dependent … Read more
I see this floating around and use it myself: find . “(” -name “*.m” -or -name “*.mm” -or -name “*.cpp” -or -name “*.swift” “)” -print0 | xargs -0 wc -l
We refactor mercilessly, and use Cyclomatic complexity as one of the metrics that gets code on our ‘hit list’. 1-6 we don’t flag for complexity (although it could get questioned for other reasons), 7-9 is questionable, and any method over 10 is assumed to be bad unless proven otherwise. The worst we’ve seen was 87 … Read more
It’s not about lines of code. As Steve Mcconnell and Bob Martin say (two pretty good references on coding best practices), a method should do one thing and only one thing. However many lines of code it takes to do that one thing is how many lines it should have. If that “one thing” can … Read more
The answers in this thread are kind of odd as they speak of: “the team”, like “the one and only beneficiary” of those said metrics; “the metrics”, like they mean anything in themselves. 1/ Metrics is not for one population, but for three: developers: they are concerned with instantaneous static code metrics regarding static analysis … Read more
Assignment Branch Condition (ABC) size is a measurement of the size of a method. It is essentially determined by counting the number of Assignments, Branches, and Conditional statements. (more detail..) To reduce ABC score, you could move some of those assignments into before_action calls: before_action :fetch_current_category, only: [:show,:edit,:update] before_action :fetch_categories, only: [:show,:edit,:update] before_action :fetch_search_results, only: … Read more
I see this floating around and use it myself: find . “(” -name “*.m” -or -name “*.mm” -or -name “*.cpp” -or -name “*.swift” “)” -print0 | xargs -0 wc -l
Just use Analyze | Inspect Code with appropriate inspection enabled (Unused declaration under Declaration redundancy group). Using IntelliJ 11 CE you can now “Analyze | Run Inspection by Name … | Unused declaration”
This prose by Alberto Savoia answers precisely that question (in a nicely entertaining manner at that!): http://www.artima.com/forums/flat.jsp?forum=106&thread=204677 Testivus On Test Coverage Early one morning, a programmer asked the great master: “I am ready to write some unit tests. What code coverage should I aim for?” The great master replied: “Don’t worry about coverage, just write … Read more