private static void classifyTarget(Data data, PsiElement target) {
    if (target instanceof PsiLocalVariable) {
      data.localVars++;
    }
    else if (target instanceof PsiParameter) {
      data.parameters++;
    }
    else if (target instanceof PsiMethod) {
      data.methods++;
    }
    else if (target instanceof PsiClass) {
      data.classes++;
    }
    else if (target instanceof PsiPackage) {
      data.packages++;
    }
    else if (target instanceof PsiField) {
      if (((PsiField)target).hasModifierProperty(PsiModifier.STATIC) && ((PsiField)target).hasModifierProperty(PsiModifier.FINAL)) {
        data.constants++;
      } else {
        data.fields++;
      }
    }
    else {
      data.other++;
    }
  }
private static void classifyTarget(Data data, PsiElement target)