<commit_before>package eu.cloudscaleproject.env.staticspotter.validators;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;

import eu.cloudscaleproject.env.common.notification.IResourceValidator;
import eu.cloudscaleproject.env.common.notification.IValidationStatus;
import eu.cloudscaleproject.env.common.notification.IValidationStatusProvider;
import eu.cloudscaleproject.env.staticspotter.alternatives.ConfigAlternative;
import eu.cloudscaleproject.env.toolchain.CSToolResource;

public class ConfigValidator implements IResourceValidator {

	public ConfigValidator()
	{
		// TODO Auto-generated constructor stub
	}
	
	@Override
	public String getID() {
		return CSToolResource.SPOTTER_STA_CONF.getID();
	}
	
	@Override
	public void validate(final IProject project, IValidationStatusProvider statusProvider) {
		
		//GlobalInputAlternative.getInstance().setProject(project);
		//GlobalInputAlternative.getInstance().validate();

		ConfigAlternative ca = (ConfigAlternative) statusProvider;

		IValidationStatus status = statusProvider.getSelfStatus();
		status.clearWarnings();
		status.setIsValid(true);

		if (ca.getInputAlternative() == null)
		{
			status.addWarning("", IValidationStatus.SEVERITY_ERROR, "Input alternative not selected.");
			status.setIsValid(false);
		}
		
		if (!validateCatalog(ca) | !validateEngines(ca))
		{
			status.setIsValid(false);
		}
	}
	
	private boolean validateCatalog (ConfigAlternative ca)
	{
		IValidationStatus selfStatus = ca.getSelfStatus();

		IResource catalog = ca.getSubResource(ConfigAlternative.KEY_CATALOG);
		
		if (catalog == null)
		{
			selfStatus.addWarning("", IValidationStatus.SEVERITY_ERROR, "Static Spotter catalog is missing.");
			return false;
		}
		
		return true;
	}

	private boolean validateEngines (ConfigAlternative ca)
	{
		IValidationStatus selfStatus = ca.getSelfStatus();
<commit_msg>Remove static spotter catalog validations<commit_after>package eu.cloudscaleproject.env.staticspotter.validators;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;

import eu.cloudscaleproject.env.common.notification.IResourceValidator;
import eu.cloudscaleproject.env.common.notification.IValidationStatus;
import eu.cloudscaleproject.env.common.notification.IValidationStatusProvider;
import eu.cloudscaleproject.env.staticspotter.alternatives.ConfigAlternative;
import eu.cloudscaleproject.env.toolchain.CSToolResource;

public class ConfigValidator implements IResourceValidator {

	public ConfigValidator()
	{
		// TODO Auto-generated constructor stub
	}
	
	@Override
	public String getID() {
		return CSToolResource.SPOTTER_STA_CONF.getID();
	}
	
	@Override
	public void validate(final IProject project, IValidationStatusProvider statusProvider) {
		
		//GlobalInputAlternative.getInstance().setProject(project);
		//GlobalInputAlternative.getInstance().validate();

		ConfigAlternative ca = (ConfigAlternative) statusProvider;

		IValidationStatus status = statusProvider.getSelfStatus();
		status.clearWarnings();
		status.setIsValid(true);

		if (ca.getInputAlternative() == null)
		{
			status.addWarning("", IValidationStatus.SEVERITY_ERROR, "Input alternative not selected.");
			status.setIsValid(false);
		}
		
//		if (!validateCatalog(ca) | !validateEngines(ca))
//		{
//			status.setIsValid(false);
//		}
	}
	
	private boolean validateCatalog (ConfigAlternative ca)
	{
		IValidationStatus selfStatus = ca.getSelfStatus();

		IResource catalog = ca.getSubResource(ConfigAlternative.KEY_CATALOG);
		
		if (catalog == null)
		{
			selfStatus.addWarning("", IValidationStatus.SEVERITY_ERROR, "Static Spotter catalog is missing.");
			return false;
		}
		
		return true;
	}

	private boolean validateEngines (ConfigAlternative ca)
	{
		IValidationStatus selfStatus = ca.getSelfStatus();

{'fraction_non_alphanumeric': 0.10052083333333334, 'fraction_numerical': 0.0, 'mean_word_length': 5.543441226575809, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '24119', 'n_tokens_mistral': 1235, 'n_tokens_neox': 1117, 'n_words': 202}