Search in sources :

Example 6 with Run

use of com.mercedesbenz.sechub.sarif.model.Run in project sechub by mercedes-benz.

the class SarifV1JSONImporter method importResult.

public SerecoMetaData importResult(String data) throws IOException {
    if (data == null) {
        data = "";
    }
    Report report = null;
    try {
        report = sarifSupport.loadReport(data);
    } catch (Exception e) {
        /*
             * here we can throw the exception - should never happen, because with
             * #isAbleToImportForProduct we already check this is possible. So there is
             * something odd here and we throw the exception
             */
        throw new IOException("Import cannot parse sarif json", e);
    }
    SerecoMetaData metaData = new SerecoMetaData();
    for (Run run : report.getRuns()) {
        handleEachRun(run, metaData);
    }
    return metaData;
}
Also used : Report(com.mercedesbenz.sechub.sarif.model.Report) Run(com.mercedesbenz.sechub.sarif.model.Run) IOException(java.io.IOException) SerecoMetaData(com.mercedesbenz.sechub.sereco.metadata.SerecoMetaData) IOException(java.io.IOException)

Aggregations

Report (com.mercedesbenz.sechub.sarif.model.Report)6 Run (com.mercedesbenz.sechub.sarif.model.Run)6 File (java.io.File)5 Test (org.junit.jupiter.api.Test)5 Result (com.mercedesbenz.sechub.sarif.model.Result)3 TreeMap (java.util.TreeMap)3 Rule (com.mercedesbenz.sechub.sarif.model.Rule)2 CodeFlow (com.mercedesbenz.sechub.sarif.model.CodeFlow)1 Message (com.mercedesbenz.sechub.sarif.model.Message)1 ReportingConfiguration (com.mercedesbenz.sechub.sarif.model.ReportingConfiguration)1 Taxon (com.mercedesbenz.sechub.sarif.model.Taxon)1 Taxonomy (com.mercedesbenz.sechub.sarif.model.Taxonomy)1 SerecoMetaData (com.mercedesbenz.sechub.sereco.metadata.SerecoMetaData)1 IOException (java.io.IOException)1 LinkedHashSet (java.util.LinkedHashSet)1