@Test void canParseClones() { Report report = new Report(); parser.parse(report, AxIssueKind.CL, dashboard.getIssues(AxIssueKind.CL)); Issue issue = report.get(0); assertThat(issue.getType()).isEqualTo("type 2"); assertThat(issue.getFileName()).isEqualTo("projects/plugins/dg_scripting/generated/dg.cpp"); assertThat(issue.getOrigin()).isEqualTo(""); assertThat(issue.getBaseName()).isEqualTo("dg.cpp"); assertThat(issue.getCategory()).isEqualTo("CL"); assertThat(issue.getFingerprint()).isEqualTo("CL476033"); assertThat(issue.getReference()).isEqualTo(""); assertThat(issue.getFolder()).isEqualTo("projects/plugins/dg_scripting/generated"); assertThat(issue.getPackageName()).isEqualTo("-"); assertThat(issue.getModuleName()).isEqualTo("-"); assertThat(issue.getDescription()).isEqualTo( "Left part of clone pair of type 2 clone of length 54LOC<p><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"testUrl/issues/CL476033\">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);   }