Executing SOQL queries inside loops can quickly exhaust the governor limits and decrease system performance. Salesforce enforces a limit on the number of queries per transaction. Instead, batch SOQL queries outside of loops.
Scope
Detection only
Detection Example
apex
for (Integer i = 0; i < 10; i++) {
List<Account> accounts = [SELECT Id FROM Account WHERE Name = :someValue];
}