I have given my code for Security code Scanner but it is given the following error due to
String attachmentQuery = 'SELECT id,E2CAdv__Attachment__c, E2CAdv__CaseId__c, E2CAdv__Attachment_links__c, E2CAdv__Comment__c FROM E2CAdv__Comment_Attachments__c WHERE E2CAdv__Comment__c =:caseCommentIds';
List<E2CAdv__Comment_Attachments__c> attachmentData = Database.query(attachmentQuery);
for(E2CAdv__Comment_Attachments__c att : attachmentData){
links.add(att.E2CAdv__Attachment_links__c);
}