@Test void canParseMetricViolations() { Report report = new Report(); parser.parse(report, AxIssueKind.MV, dashboard.getIssues(AxIssueKind.MV)); Issue issue = report.get(0); assertThat(issue.getType()).isEqualTo("Maximum nesting"); assertThat(issue.getFileName()).isEqualTo("src/mainwindow.cpp"); assertThat(issue.getOrigin()).isEqualTo(""); assertThat(issue.getBaseName()).isEqualTo("mainwindow.cpp"); assertThat(issue.getCategory()).isEqualTo("MV"); assertThat(issue.getFingerprint()).isEqualTo("MV55"); assertThat(issue.getReference()).isEqualTo(""); assertThat(issue.getFolder()).isEqualTo("src"); assertThat(issue.getPackageName()).isEqualTo("-"); assertThat(issue.getModuleName()).isEqualTo("-"); assertThat(issue.getDescription()).isEqualTo( "Method <i>operator()</i><p>Val: <b>0</b><br>Max: 5<br>Min: 1<p><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"testUrl/issues/MV55\">More details</a>"); }
void parse(final Report report, final AxIssueKind kind, final JsonObject payload) { final JsonArray jsonArray = payload.getAsJsonArray("rows"); if (jsonArray != null) { report.logInfo("Importing %s %s", jsonArray.size(), kind.plural()); StreamSupport.stream(jsonArray.spliterator(), false) .filter(JsonObject.class::isInstance) .map(JsonObject.class::cast) .map(issueAsJson -> new AxRawIssue(projectUrl, baseDir, issueAsJson, kind)) .map(kind::transform) .forEach(report::add); } }
AxivionParser implements Serializable { void parse(final Report report, final AxIssueKind kind, final JsonObject payload) { final JsonArray jsonArray = payload.getAsJsonArray("rows"); if (jsonArray != null) { report.logInfo("Importing %s %s", jsonArray.size(), kind.plural()); StreamSupport.stream(jsonArray.spliterator(), false) .filter(JsonObject.class::isInstance) .map(JsonObject.class::cast) .map(issueAsJson -> new AxRawIssue(projectUrl, baseDir, issueAsJson, kind)) .map(kind::transform) .forEach(report::add); } } }
AxivionParser implements Serializable { void parse(final Report report, final AxIssueKind kind, final JsonObject payload) { final JsonArray jsonArray = payload.getAsJsonArray("rows"); if (jsonArray != null) { report.logInfo("Importing %s %s", jsonArray.size(), kind.plural()); StreamSupport.stream(jsonArray.spliterator(), false) .filter(JsonObject.class::isInstance) .map(JsonObject.class::cast) .map(issueAsJson -> new AxRawIssue(projectUrl, baseDir, issueAsJson, kind)) .map(kind::transform) .forEach(report::add); } } AxivionParser(
            final String projectUrl,
            final String baseDir); }
AxivionParser implements Serializable { void parse(final Report report, final AxIssueKind kind, final JsonObject payload) { final JsonArray jsonArray = payload.getAsJsonArray("rows"); if (jsonArray != null) { report.logInfo("Importing %s %s", jsonArray.size(), kind.plural()); StreamSupport.stream(jsonArray.spliterator(), false) .filter(JsonObject.class::isInstance) .map(JsonObject.class::cast) .map(issueAsJson -> new AxRawIssue(projectUrl, baseDir, issueAsJson, kind)) .map(kind::transform) .forEach(report::add); } } AxivionParser(
            final String projectUrl,
            final String baseDir);  }
AxivionParser implements Serializable { void parse(final Report report, final AxIssueKind kind, final JsonObject payload) { final JsonArray jsonArray = payload.getAsJsonArray("rows"); if (jsonArray != null) { report.logInfo("Importing %s %s", jsonArray.size(), kind.plural()); StreamSupport.stream(jsonArray.spliterator(), false) .filter(JsonObject.class::isInstance) .map(JsonObject.class::cast) .map(issueAsJson -> new AxRawIssue(projectUrl, baseDir, issueAsJson, kind)) .map(kind::transform) .forEach(report::add); } } AxivionParser(
            final String projectUrl,
            final String baseDir);   }