If the following defects (DEFECTS) and code line ((k) LOC) are violated, the defect density metrics will have problems.
Defects = a Loc ** B, with a> 0, b> 1.
If there is no such relationship in your program set, then use the defect density metrics is very problematic. You cannot predict the defect density metrics of the entire system by predicting the defect density metrics of a single program. For more information, please refer to: Horst Zuse: A Framework of Software Measurement.