/**
         * De las vulnerabilidades encontradas las mapeamos a objetos
         * y las agrupamos por tipo de vulnerabilidad y url
         */
private void reduceList(Site site, Map<String, String> zapRelations, 
    		Map<String, Vulnerability> groupVulnerabilities) throws MalformedURLException {
        /**
         * De las vulnerabilidades encontradas las mapeamos a objetos
         * y las agrupamos por tipo de vulnerabilidad y url
         */
    	for (Alert alert: site.getAlerts()) {
    		String nameVuln = zapRelations.get(alert.getPluginid());
    		if(StringUtils.isBlank(nameVuln)){
        		Vulnerability vulnerability = new Vulnerability();
        		vulnerability.setName(Constantes.COMMON_MESSAGE_NOT_FOUND + alert.getName());
                vulnerability.setShortName(alert.getName());                
                vulnerability.setLongName(alert.getName());
                //TODO: Convertir la serveridad
                vulnerability.setSeverity(alert.getRiskdesc().replaceAll("\\(.*\\)", "").trim());
                vulnerability.setCwe(Integer.parseInt(alert.getCweid()));
                for(Endpoint endPointZap : alert.getInstances()){
                	if(!vulnerability.getEndpoint().stream().anyMatch(obj -> obj.getUrl().equals(getUrlWithoutParameters(endPointZap.getUrl())) 
            				&& obj.getMethod().equals(endPointZap.getMethod()))){                		
            			vulnerability.getEndpoint().add(new Endpoint(endPointZap.getMethod(), getUrlWithoutParameters(endPointZap.getUrl())));
            		}
                }
                groupVulnerabilities.put(vulnerability.getName(), vulnerability);
        	} else if(groupVulnerabilities.containsKey(nameVuln)){
        		Vulnerability vulnerability = groupVulnerabilities.get(nameVuln);
        		for(Endpoint endPointZap : alert.getInstances()){
        			if(!vulnerability.getEndpoint().stream().anyMatch(obj -> obj.getUrl().equals(getUrlWithoutParameters(endPointZap.getUrl())) 
            				&& obj.getMethod().equals(endPointZap.getMethod()))){                		
            			vulnerability.getEndpoint().add(new Endpoint(endPointZap.getMethod(), getUrlWithoutParameters(endPointZap.getUrl())));
            		}
                }
        	} else {
        		Vulnerability vulnerability = new Vulnerability();
        		vulnerability.setShortName(alert.getName());                
                vulnerability.setLongName(alert.getName());
                //TODO: Convertir la serveridad
                vulnerability.setSeverity(alert.getRiskdesc().replaceAll("\\(.*\\)", ""));
                vulnerability.setCwe(Integer.parseInt(alert.getCweid()));
                for(Endpoint endPointZap : alert.getInstances()){
                	if(!vulnerability.getEndpoint().stream().anyMatch(obj -> obj.getUrl().equals(getUrlWithoutParameters(endPointZap.getUrl())) 
            				&& obj.getMethod().equals(endPointZap.getMethod()))){                		
            			vulnerability.getEndpoint().add(new Endpoint(endPointZap.getMethod(), getUrlWithoutParameters(endPointZap.getUrl())));
            		}
                }
                groupVulnerabilities.put(vulnerability.getName(), vulnerability);
        	} 
    	}
    }
private void reduceList(Site site, Map<String, String> zapRelations,
Map<String, Vulnerability> groupVulnerabilities) throws MalformedURLException {
/**
* De las vulnerabilidades encontradas las mapeamos a objetos
* y las agrupamos por tipo de vulnerabilidad y url
*/
for (Alert alert: site.getAlerts()) {
String nameVuln = zapRelations.get(alert.getPluginid());
private void reduceList(Site site, Map<String, String> zapRelations,
Map<String, Vulnerability> groupVulnerabilities) throws MalformedURLException {
/**
* De las vulnerabilidades encontradas las mapeamos a objetos
* y las agrupamos por tipo de vulnerabilidad y url
*/
for (Alert alert: site.getAlerts()) {
String nameVuln = zapRelations.get(alert.getPluginid());
if(StringUtils.isBlank(nameVuln)){
Vulnerability vulnerability = new Vulnerability();
vulnerability.setName(Constantes.COMMON_MESSAGE_NOT_FOUND + alert.getName());
vulnerability.setShortName(alert.getName());
vulnerability.setLongName(alert.getName());
//TODO: Convertir la serveridad
vulnerability.setSeverity(alert.getRiskdesc().replaceAll("\\(.*\\)", "").trim());
vulnerability.setCwe(Integer.parseInt(alert.getCweid()));
private void reduceList(Site site, Map<String, String> zapRelations,
Map<String, Vulnerability> groupVulnerabilities) throws MalformedURLException {
/**
* De las vulnerabilidades encontradas las mapeamos a objetos
* y las agrupamos por tipo de vulnerabilidad y url
*/
for (Alert alert: site.getAlerts()) {
String nameVuln = zapRelations.get(alert.getPluginid());
if(StringUtils.isBlank(nameVuln)){
Vulnerability vulnerability = new Vulnerability();
vulnerability.setName(Constantes.COMMON_MESSAGE_NOT_FOUND + alert.getName());
vulnerability.setShortName(alert.getName());
vulnerability.setLongName(alert.getName());
//TODO: Convertir la serveridad
vulnerability.setSeverity(alert.getRiskdesc().replaceAll("\\(.*\\)", "").trim());
vulnerability.setCwe(Integer.parseInt(alert.getCweid()));
for(Endpoint endPointZap : alert.getInstances()){
if(!vulnerability.getEndpoint().stream().anyMatch(obj -> obj.getUrl().equals(getUrlWithoutParameters(endPointZap.getUrl()))
&& obj.getMethod().equals(endPointZap.getMethod()))){
vulnerability.getEndpoint().add(new Endpoint(endPointZap.getMethod(), getUrlWithoutParameters(endPointZap.getUrl())));
}
}
groupVulnerabilities.put(vulnerability.getName(), vulnerability);
} else if(groupVulnerabilities.containsKey(nameVuln)){
Vulnerability vulnerability = groupVulnerabilities.get(nameVuln);
for(Endpoint endPointZap : alert.getInstances()){