@Override
  public CommonProblemDescriptor @Nullable [] checkElement(@NotNull RefEntity refEntity,
                                                           @NotNull AnalysisScope scope,
                                                           @NotNull InspectionManager manager,
                                                           @NotNull GlobalInspectionContext globalContext) {
    if (refEntity instanceof RefClass refClass) {
      if (!(refClass.getOwner() instanceof RefPackage)) {
        return null;
      }
      final Set<RefClass> dependencies = DependencyUtils.calculateDependenciesForClass(refClass);
      final int numDependencies = dependencies.size();
      if (numDependencies <= limit) {
        return null;
      }
      final String errorString = InspectionGadgetsBundle.message("class.with.too.many.dependencies.problem.descriptor",
                                                                 refClass.getName(), numDependencies, limit);
      return new CommonProblemDescriptor[] {manager.createProblemDescriptor(errorString)};
    }
    return null;
  }
@Override
  public CommonProblemDescriptor @Nullable [] checkElement(@NotNull RefEntity refEntity,
                                                           @NotNull AnalysisScope scope,
                                                           @NotNull InspectionManager manager,
                                                           @NotNull GlobalInspectionContext globalContext)