I am trying to resolve some of PMD warnings in Apex (Salesforce), currently I am working on this one UnusedLocalVariable and here is the code snippet where the problem is:
DateTime startDate = startDateOne;
String getData = 'SELECT data ' + 'FROM table ' + 'WHERE date = :startDate'
so..the problem is varible startDate is defined and used in query but it looks like the scanner can not recognize it because it is in a string 'WHERE date = :startDate', does anyone have an idea how to fix this?
Thanks in advance.