Code Metrics Check-In Policy

This check-in policy uses Metrics.exe command line tool that is published as part of TFS Power Tools. While enabling this check-in policy it accepts a number upto 100 which is the threshold minimum maintainability index for acceptance of code by the policy.

When it is enabled for a team project and if a developer tries to check-in some code in that project it detects if any C# or VB.NET code files are being checked in and gets the project file and from there the binaries created locally. If binaries are not yet ready it gives a policy warning of that effect. It then executes the Metrics.exe to compute maintainability index on those binaries. It does not consider the referenced binaries and targets only the binary file of the project under development. Results of Code Metrics are stored in a file in the Documents folder of that user. Check-in policy then reads the overall maintainability index of all binaries. It compares the maintainability index of each binary against the minimum threshold value. If it is less than the acceptable value then policy shows the failure message for that binary. For each binary a separate message is shown.

Last edited Oct 1, 2014 at 8:33 AM by subodhsohoni, version 3