PsiClass (PsiMember member) { final UsageProcessor usageProcessor = new UsageProcessor(); final PsiClass usageClass = usageProcessor.findUsageClass(member); if (usageClass == null) { return null; } final PsiClass containingClass = member.getContainingClass(); if (containingClass == null || usageClass.equals(containingClass)) { return null; } if (isInGeneratedSource(usageClass)) { return null; } if (mySettingsDelegate.ignoreTestClasses && TestUtils.isInTestCode(usageClass)) { return null; } if (usageClass.getContainingClass() != null && !usageClass.hasModifierProperty(PsiModifier.STATIC) || PsiUtil.isLocalOrAnonymousClass(usageClass)) { if (mySettingsDelegate.ignoreAnonymousClasses || PsiTreeUtil.isAncestor(containingClass, usageClass, true)) { return null; } } if (mySettingsDelegate.ignoreUtilityClasses && UtilityClassUtil.isUtilityClass(containingClass)) { return null; } if (mySettingsDelegate.ignoreOnConflicts) { if (member instanceof PsiMethod method) { if (usageClass.findMethodsBySignature(method, true).length > 0 || !areReferenceTargetsAccessible(member, usageClass)) { return null; } } else if (member instanceof PsiField) { if (usageClass.findFieldByName(member.getName(), true) != null || !areReferenceTargetsAccessible(member, usageClass)) { return null; } } } return usageClass; }