Code metrics maintainability index threshold
-
Tuesday, May 15, 2012 9:21 AM
Hi there,
I'm trying to generate a build report using code metrics values. MSDN states:
“[Maintainability Index c]alculates an index value between 0 and 100 that represents the relative ease of maintaining the code. A high value means better maintainability. Color coded ratings can be used to quickly identify trouble spots in your code. A green rating is between 20 and 100 and indicates that the code has good maintainability. A yellow rating is between 10 and 19 and indicates that the code is moderately maintainable. A red rating is a rating between 0 and 9 and indicates low maintainability.”
Are those ranges (0-9, 10-19, 20-100) configurable? If yes, can I somehow access them with any api? Or are those just default constant values?
All Replies
-
Tuesday, May 15, 2012 3:49 PM
The choice of which icon to display in Visual Studio is based on hardcoded maintainability index ranges. However, if you're generating a build report based on the data, there's presumably nothing stopping you from associating any colour and/or icon you wish with whatever range you prefer.
- Marked As Answer by _BostonGeorge_ Thursday, May 17, 2012 7:29 AM
-
Tuesday, May 15, 2012 6:08 PMI agree with Nicole, and I'm working on a similar project. The thresholds in the UI are fixed, but as the metrics.exe doesn't interpret the values, you're free to set your own in whatever code you're using to generate the report.
My blog: blog.jessehouwing.nl

