StaticProblem (@NotNull PsiElement element) { if (myOptions.showInstanceInStaticContext && !isQualifiedContext()) { return StaticProblem.none; } if (element instanceof PsiModifierListOwner modifierListOwner) { if (myStatic) { if (!(element instanceof PsiClass) && !modifierListOwner.hasModifierProperty(PsiModifier.STATIC)) { // we don't need non-static method in static context. return StaticProblem.instanceAfterStatic; } } else { if (!myAllowStaticWithInstanceQualifier && modifierListOwner.hasModifierProperty(PsiModifier.STATIC) && !myMembersFlag) { // according settings we don't need to process such fields/methods return StaticProblem.staticAfterInstance; } } } return StaticProblem.none; }