class SerecoReportToSecHubResultTransformer implements ScanReportToSecHubResultTransformer {

    @Override
    public SecHubResult transform(ProductResult productResult) throws SecHubExecutionException {
        String origin = productResult.getResult();
        String projectId = productResult.getProjectId();

        SerecoMetaData data = JSONConverter.get().fromJSON(SerecoMetaData.class, origin);

        falsePositiveMarker.markFalsePositives(projectId, data.getVulnerabilities());

        SecHubResult result = new SecHubResult();

        List<SecHubFinding> findings = result.getFindings();

        int findingId = 0;
        for (SerecoVulnerability v : data.getVulnerabilities()) {
            findingId++;
            if (v.isFalsePositive()) {
                /*
                 * we do not add false positives to report - so we store only real positives.
                 * False positive data is still available in SeReCo results and so in admin scan
                 * logs,
                 */
                continue;
            }
            SecHubFinding finding = new SecHubFinding();
            handleClassifications(finding, v, productResult.getSecHubJobUUID());
            
            finding.setDescription(v.getDescription());
            finding.setName(v.getType());
            finding.setId(findingId);
            finding.setSeverity(transformSeverity(v.getSeverity()));

            if (showProductLineResultLink) {
                finding.setProductResultLink(v.getProductResultLink());
            }
            finding.setCode(convert(v.getCode()));
            finding.setType(v.getScanType());

            findings.add(finding);
        }

        return result;
    }

}