The act of creation of an object should not alter data on the server-side or have any other significant side-effect. For this reason, using DML statements inside constructors is considered unsafe.
Business Impact
Decreased operational efficiency, increased potential for human error, delayed time-to-market, and decreased employee satisfaction.
Is your Salesforce solution affected by Constructor with side effects?
Clayton detects anti-patterns and offers automated fix advice to kickstart your Well-Architected journey.