@Override
    public void visitReturnStatement(@NotNull PsiReturnStatement statement) {
      super.visitReturnStatement(statement);
      final PsiExpression expression = PsiUtil.skipParenthesizedExprDown(statement.getReturnValue());
      if (expression == null) {
        return;
      }
      final PsiMethod method = PsiTreeUtil.getParentOfType(statement, PsiMethod.class, true, PsiLambdaExpression.class);
      if (method == null || method.hasModifierProperty(PsiModifier.PRIVATE) || method.hasModifierProperty(PsiModifier.STATIC)) {
        return;
      }
      else if (ignoreNonPublic &&
               (method.hasModifierProperty(PsiModifier.PROTECTED) || method.hasModifierProperty(PsiModifier.PACKAGE_LOCAL))) {
        return;
      }
      if (expression instanceof PsiNewExpression newExpression) {
        final PsiAnonymousClass anonymousClass = newExpression.getAnonymousClass();
        if (anonymousClass != null) {
          registerStatementError(statement, ClassType.ANONYMOUS_CLASS);
          return;
        }
      }
      final PsiClass aClass = PsiUtil.resolveClassInClassTypeOnly(expression.getType());
      if (aClass == null) {
        return;
      }
      if (PsiUtil.isLocalClass(aClass)) {
        registerStatementError(statement, ClassType.LOCAL_CLASS, aClass);
        return;
      }
      final PsiClass containingClass = aClass.getContainingClass();
      if (containingClass == null || aClass.hasModifierProperty(PsiModifier.STATIC)) {
        return;
      }
      registerStatementError(statement, ClassType.INNER_CLASS, aClass);
    }
@Override
    public void visitReturnStatement(@NotNull PsiReturnStatement statement)