int (PsiDirectory directory) { if (TodoTreeHelper.getInstance(getProject()).skipDirectory(directory)) { return 0; } int count = 0; Iterator<PsiFile> iterator = myBuilder.getFiles(directory); while (iterator.hasNext()) { PsiFile psiFile = iterator.next(); count += getStructure().getTodoItemCount(psiFile); } return count; }