We try to use Sonar to manage the software quality, like this page, we can get the technical debt. http://www.sonarqube.org/sqale-the-ultimate-quality-model-to-assess-technical-debt/
My question is, how to define the debt to fix a violation, remove some duplicated code or a new test case. Is there any calculate algorithm?