Closed jborgers closed 3 days ago
false positives in:
private static List<String> addTagToDescriptionAndDoc(List<String> mergedFileLines, String taggedDescriptionEndTag) { List<String> fileLinesWithReplaced = new ArrayList<>(mergedFileLines.size()); for(String line : mergedFileLines) { Matcher matcher = TAGGED_DESCRIPTION_END_TAG_PATTERN.matcher(line); if (!matcher.find()) { // not yet tag so add our tag line = line.replace(DESCRIPTION_END_TAG, taggedDescriptionEndTag); // <-----false positive } line = line.replace("${doc_root}", COMPANY_DOC_ROOT); // <-----false positive fileLinesWithReplaced.add(line); } return fileLinesWithReplaced; } //minimal test version: public void goodX() { String logStatement = "ticAtacBtoe"; List<String> values = Arrays.asList("tic", "tac", "toe"); for (String val : values) { logStatement = logStatement.replace(val, "-"); // <-----false positive } }
also, ForStatement is not supported, missed case:
public void badX() { String logStatement = ""; for (int i = 0; i < 3; i++) { logStatement += i + ", "; // bad } }
false positives in: