docs: @SuppressWarnings({"checkstyle:cyclomaticcomplexity", "checkstyle:npathcomplexity", "checkstyle:nestedifdepth"})
  	protected List<Issue> validate(ResourceSet resourceSet, Collection<Resource> validResources, IProgressMonitor progress) {
  		assert progress != null;
  		progress.subTask(Messages.SarlBatchCompiler_38);
  		getLogger().info(Messages.SarlBatchCompiler_38);
  		final List<Resource> resources = new LinkedList<>(resourceSet.getResources());
  		final List<Issue> issuesToReturn = new ArrayList<>();
  		for (final Resource resource : resources) {
  			if (progress.isCanceled()) {
  				return issuesToReturn;
  			}
  			if (isSourceFile(resource)) {
  				if (getLogger().isDebugEnabled()) {
  					getLogger().debug(Messages.SarlBatchCompiler_22, resource.getURI().lastSegment());
  				}
  				final IResourceServiceProvider resourceServiceProvider = IResourceServiceProvider.Registry.INSTANCE
  						.getResourceServiceProvider(resource.getURI());
  				if (resourceServiceProvider != null) {
  					final IResourceValidator resourceValidator = resourceServiceProvider.getResourceValidator();
  					final List<Issue> result = resourceValidator.validate(resource, CheckMode.ALL, null);
  					if (progress.isCanceled()) {
  						return issuesToReturn;
  					}
  					final SortedSet<Issue> issues = new TreeSet<>(getIssueComparator());
  					boolean hasValidationError = false;
  					for (final Issue issue : result) {
  						if (progress.isCanceled()) {
  							return issuesToReturn;
  						}
  						if (issue.isSyntaxError() || issue.getSeverity() == Severity.ERROR) {
  							hasValidationError = true;
  						}
  						issues.add(issue);
  					}
  					if (!hasValidationError) {
  						if (!issues.isEmpty()) {
  							if (getLogger().isDebugEnabled()) {
  								getLogger().debug(Messages.SarlBatchCompiler_39, resource.getURI().lastSegment());
  							}
  							issuesToReturn.addAll(issues);
  						}
  						validResources.add(resource);
  					} else {
  						if (getLogger().isDebugEnabled()) {
  							getLogger().debug(Messages.SarlBatchCompiler_39, resource.getURI().lastSegment());
  						}
  						issuesToReturn.addAll(issues);
  					}
  				}
  			}
  		}
  		return issuesToReturn;
  	}