75 new issues, 326 total
Total | New | Outstanding | Fixed | Trend |
---|---|---|---|---|
326 | 75 | 251 | 55 | 👎 |
Reference build: Plugins » warnings-ng-plugin » main #47
Details
Severity distribution of new issues
Error | Warning High | Warning Normal | Warning Low |
---|---|---|---|
0 | 7 | 13 | 55 |
Annotations
ci-jenkins-io / CPD
CPD
HIGH:
Found duplicated code.
Raw output
<pre><code>@SuppressWarnings("unused") // used by Stapler view data binding public List<WarningsQualityGate> getQualityGates() { return qualityGates; } /** * Defines the ID of the results. The ID is used as URL of the results and as name in UI elements. If no ID is * given, then the ID of the associated result object is used. * <p> * Note: this property is not used if {@link #isAggregatingResults} is {@code false}. It is also not visible in the * UI in order to simplify the user interface. * </p> * * @param id * the ID of the results */ @DataBoundSetter public void setId(final String id) { VALIDATION_UTILITIES.ensureValidId(id); this.id = id; } public String getId() { return id; } /** * Defines the name of the results. The name is used for all labels in the UI. If no name is given, then the name of * the associated {@link StaticAnalysisLabelProvider} is used. * <p> * Note: this property is not used if {@link #isAggregatingResults} is {@code false}. It is also not visible in the * UI in order to simplify the user interface. * </p> * * @param name * the name of the results */ @DataBoundSetter public void setName(final String name) { this.name = name; } public String getName() { return name; } /** * Gets the static analysis tools that will scan files and create issues. * * @return the static analysis tools (wrapped as {@link ToolProxy}) * @see #getTools * @deprecated this method is only intended to be called by the UI */ @CheckForNull @Deprecated public List<ToolProxy> getToolProxies() { return analysisTools.stream().map(ToolProxy::new).collect(Collectors.toList()); } /** * Sets the static analysis tools that will scan files and create issues. * * @param toolProxies * the static analysis tools (wrapped as {@link ToolProxy}) * * @see #setTools(List) * @deprecated this method is only intended to be called by the UI */ @DataBoundSetter @Deprecated public void setToolProxies(final List<ToolProxy> toolProxies) { analysisTools = toolProxies.stream().map(ToolProxy::getTool).collect(Collectors.toList()); } /** * Sets the static analysis tools that will scan files and create issues. * * @param tools * the static analysis tools */ @DataBoundSetter public void setTools(final List<Tool> tools) { analysisTools = new ArrayList<>(tools); } /** * Sets the static analysis tools that will scan files and create issues. * * @param tool * the static analysis tool * @param additionalTools * additional static analysis tools (might be empty) * * @see #setTools(List) */ public void setTools(final Tool tool, final Tool... additionalTools) {<!-- --></code></pre>
ci-jenkins-io / CPD
CPD
HIGH:
Found duplicated code.
Raw output
<pre><code>@SuppressWarnings("unused") // used by Stapler view data binding public List<WarningsQualityGate> getQualityGates() { return qualityGates; } /** * Defines the ID of the results. The ID is used as URL of the results and as name in UI elements. If no ID is * given, then the ID of the associated result object is used. * <p> * Note: this property is not used if {@link #isAggregatingResults} is {@code false}. It is also not visible in the * UI in order to simplify the user interface. * </p> * * @param id * the ID of the results */ @DataBoundSetter public void setId(final String id) { VALIDATION_UTILITIES.ensureValidId(id); this.id = id; } public String getId() { return id; } /** * Defines the name of the results. The name is used for all labels in the UI. If no name is given, then the name of * the associated {@link StaticAnalysisLabelProvider} is used. * <p> * Note: this property is not used if {@link #isAggregatingResults} is {@code false}. It is also not visible in the * UI in order to simplify the user interface. * </p> * * @param name * the name of the results */ @DataBoundSetter public void setName(final String name) { this.name = name; } public String getName() { return name; } /** * Gets the static analysis tools that will scan files and create issues. * * @return the static analysis tools (wrapped as {@link ToolProxy}) * @see #getTools * @deprecated this method is only intended to be called by the UI */ @CheckForNull @Deprecated public List<ToolProxy> getToolProxies() { return analysisTools.stream().map(ToolProxy::new).collect(Collectors.toList()); } /** * Sets the static analysis tools that will scan files and create issues. * * @param toolProxies * the static analysis tools (wrapped as {@link ToolProxy}) * * @see #setTools(List) * @deprecated this method is only intended to be called by the UI */ @DataBoundSetter @Deprecated public void setToolProxies(final List<ToolProxy> toolProxies) { analysisTools = toolProxies.stream().map(ToolProxy::getTool).collect(Collectors.toList()); } /** * Sets the static analysis tools that will scan files and create issues. * * @param tools * the static analysis tools */ @DataBoundSetter public void setTools(final List<Tool> tools) { analysisTools = new ArrayList<>(tools); } /** * Sets the static analysis tools that will scan files and create issues. * * @param tool * the static analysis tool * @param additionalTools * additional static analysis tools (might be empty) * * @see #setTools(List) */ public void setTools(final Tool tool, final Tool... additionalTools) {<!-- --></code></pre>
ci-jenkins-io / CPD
CPD
NORMAL:
Found duplicated code.
Raw output
<pre><code>FreeStyleProject reference = createEmptyReferenceJob(REFERENCE_JOB_NAME, "eclipse2Warnings.txt"); enableWarnings(reference, recorder -> { recorder.setEnabledForFailure(true); recorder.setQualityGates(List.of( new WarningsQualityGate(3, QualityGateType.NEW, QualityGateCriticality.UNSTABLE))); }); scheduleBuildAndAssertStatus(reference, Result.SUCCESS, analysisResult -> assertThat(analysisResult).hasTotalSize(2) .hasNewSize(0) .hasQualityGateStatus(QualityGateStatus.PASSED)); // #2 FAILURE cleanAndCopy(reference, "eclipse4Warnings.txt"); Builder failureStep = addFailureStep(reference); Run<?, ?> expectedReference = scheduleBuildAndAssertStatus(reference, Result.FAILURE, analysisResult -> assertThat(analysisResult).hasTotalSize(4) .hasNewSize(2) .hasQualityGateStatus(QualityGateStatus.PASSED)).getOwner(); removeBuilder(reference, failureStep); // #1 SUCCESS (Reference #1) FreeStyleProject project = createJob(JOB_NAME, "eclipse6Warnings.txt", Result.FAILURE, REFERENCE_JOB_NAME); enableWarnings(project, recorder -> { recorder.setQualityGates(List.of( new WarningsQualityGate(2, QualityGateType.NEW, QualityGateCriticality.UNSTABLE)));</code></pre>
ci-jenkins-io / CPD
CPD
NORMAL:
Found duplicated code.
Raw output
<pre><code>FreeStyleProject reference = createEmptyReferenceJob(REFERENCE_JOB_NAME, "eclipse2Warnings.txt"); enableWarnings(reference, recorder -> { recorder.setEnabledForFailure(true); recorder.setQualityGates(List.of( new WarningsQualityGate(3, QualityGateType.NEW, QualityGateCriticality.UNSTABLE))); }); scheduleBuildAndAssertStatus(reference, Result.SUCCESS, analysisResult -> assertThat(analysisResult).hasTotalSize(2) .hasNewSize(0) .hasQualityGateStatus(QualityGateStatus.PASSED)); // #2 FAILURE cleanAndCopy(reference, "eclipse4Warnings.txt"); Builder failureStep = addFailureStep(reference); Run<?, ?> expectedReference = scheduleBuildAndAssertStatus(reference, Result.FAILURE, analysisResult -> assertThat(analysisResult).hasTotalSize(4) .hasNewSize(2) .hasQualityGateStatus(QualityGateStatus.PASSED)).getOwner(); removeBuilder(reference, failureStep); // #1 SUCCESS (Reference #1) FreeStyleProject project = createJob(JOB_NAME, "eclipse6Warnings.txt", Result.FAILURE, REFERENCE_JOB_NAME); enableWarnings(project, recorder -> { recorder.setQualityGates(List.of( new WarningsQualityGate(2, QualityGateType.NEW, QualityGateCriticality.UNSTABLE)));</code></pre>
ci-jenkins-io / CPD
CPD
HIGH:
Found duplicated code.
Raw output
<pre><code>return new ListBoxModel(); } /** * Performs on-the-fly validation of the health report thresholds. * * @param project * the project that is configured * @param healthy * the healthy threshold * @param unhealthy * the unhealthy threshold * * @return the validation result */ @POST public FormValidation doCheckHealthy(@AncestorInPath final BuildableItem project, @QueryParameter final int healthy, @QueryParameter final int unhealthy) { if (!JENKINS.hasPermission(Item.CONFIGURE, project)) { return FormValidation.ok(); } return model.validateHealthy(healthy, unhealthy); } /** * Performs on-the-fly validation of the health report thresholds. * * @param project * the project that is configured * @param healthy * the healthy threshold * @param unhealthy * the unhealthy threshold * * @return the validation result */ @POST public FormValidation doCheckUnhealthy(@AncestorInPath final BuildableItem project, @QueryParameter final int healthy, @QueryParameter final int unhealthy) { if (!JENKINS.hasPermission(Item.CONFIGURE, project)) { return FormValidation.ok(); } return model.validateUnhealthy(healthy, unhealthy); } /** * Returns a model with all aggregation trend chart positions. * * @return a model with all aggregation trend chart positions */ @POST public ListBoxModel doFillTrendChartTypeItems() { if (JENKINS.hasPermission(Jenkins.READ)) { return model.getAllTrendChartTypes(); } return new ListBoxModel(); } /** * Performs on-the-fly validation of the ID. * * @param project * the project that is configured * @param id * the ID of the tool * * @return the validation result */ @POST</code></pre>
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>result = evaluate(qualityGates, builder, new FilteredLog()); assertThat(result.getOverallStatus()).isEqualTo(io.jenkins.plugins.util.QualityGateStatus.WARNING); assertThat(result.getMessages()).hasSize(2).first().asString() .contains("≪Unstable≫", QualityGateType.TOTAL.getDisplayName(), "Actual value: 1", "Quality gate: 1.00"); assertThat(result.getMessages()).hasSize(2).last().asString() .contains("≪Unstable≫", QualityGateType.NEW.getDisplayName(), "Actual value: 1", "Quality gate: 1.00");</code></pre>
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>result = evaluate(qualityGates, builder, new FilteredLog()); assertThat(result.getOverallStatus()).isEqualTo(io.jenkins.plugins.util.QualityGateStatus.WARNING); assertThat(result.getMessages()).hasSize(2).first().asString() .contains("≪Unstable≫", QualityGateType.TOTAL.getDisplayName(), "Actual value: 1", "Quality gate: 1.00"); assertThat(result.getMessages()).hasSize(2).last().asString() .contains("≪Unstable≫", QualityGateType.NEW.getDisplayName(), "Actual value: 1", "Quality gate: 1.00");</code></pre>
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>void shouldObtainBlamesAndForensicsInFreestyleJob() throws IOException { FreeStyleProject job = createFreeStyleProject(); createFileInWorkspace(job, "java-issues.txt", createJavaWarning(SCM_RESOLVER, AFFECTED_LINE)); GitSCM scm = new GitSCM(GitSCM.createRepoList(FORENSICS_API_PLUGIN, null), Collections.singletonList(new BranchSpec(COMMIT)), null, null, Collections.singletonList(new RelativeTargetDirectory("forensics-api"))); job.setScm(scm); job.getPublishersList().add(new RepositoryMinerStep()); enableGenericWarnings(job, new Java());</code></pre>
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>void shouldObtainBlamesAndForensicsInFreestyleJob() throws IOException { FreeStyleProject job = createFreeStyleProject(); createFileInWorkspace(job, "java-issues.txt", createJavaWarning(SCM_RESOLVER, AFFECTED_LINE)); GitSCM scm = new GitSCM(GitSCM.createRepoList(FORENSICS_API_PLUGIN, null), Collections.singletonList(new BranchSpec(COMMIT)), null, null, Collections.singletonList(new RelativeTargetDirectory("forensics-api"))); job.setScm(scm); job.getPublishersList().add(new RepositoryMinerStep()); enableGenericWarnings(job, new Java());</code></pre>
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>void shouldCreateSuccessResultWithIgnoredUnstableInBetween() { // #1 SUCCESS FreeStyleProject project = createEmptyReferenceJob(); enableWarnings(project, recorder -> recorder.setQualityGates(List.of( new WarningsQualityGate(3, QualityGateType.NEW, QualityGateCriticality.UNSTABLE)))); Run<?, ?> expectedReference = scheduleBuildAndAssertStatus(project, Result.SUCCESS, analysisResult -> assertThat(analysisResult) .hasTotalSize(2) .hasNewSize(0) .hasQualityGateStatus(QualityGateStatus.PASSED)).getOwner(); // #2 UNSTABLE cleanAndCopy(project, "eclipse8Warnings.txt");</code></pre>
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>void shouldCreateSuccessResultWithIgnoredUnstableInBetween() { // #1 SUCCESS FreeStyleProject project = createEmptyReferenceJob(); enableWarnings(project, recorder -> recorder.setQualityGates(List.of( new WarningsQualityGate(3, QualityGateType.NEW, QualityGateCriticality.UNSTABLE)))); Run<?, ?> expectedReference = scheduleBuildAndAssertStatus(project, Result.SUCCESS, analysisResult -> assertThat(analysisResult) .hasTotalSize(2) .hasNewSize(0) .hasQualityGateStatus(QualityGateStatus.PASSED)).getOwner(); // #2 UNSTABLE cleanAndCopy(project, "eclipse8Warnings.txt");</code></pre>
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>FreeStyleProject project = createJob(JOB_NAME, "eclipse6Warnings.txt", Result.UNSTABLE, REFERENCE_JOB_NAME); enableWarnings(project, recorder -> { recorder.setQualityGates(List.of( new WarningsQualityGate(3, QualityGateType.NEW, QualityGateCriticality.UNSTABLE))); recorder.setEnabledForFailure(true); }); scheduleBuildAndAssertStatus(project, Result.UNSTABLE, analysisResult -> assertThat(analysisResult) .hasTotalSize(6) .hasNewSize(4) .hasQualityGateStatus(QualityGateStatus.WARNING) .hasReferenceBuild(Optional.of(expectedReference))); } /** * Checks if the plugin ignores failed builds if the reference finder is configured accordingly. * * @see #shouldCreateUnstableResultWithOverAllMustBeSuccessWithReferenceBuild */ @Test void shouldUseFailedBuildsIfConfigured() {<!-- --></code></pre>
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>FreeStyleProject project = createJob(JOB_NAME, "eclipse6Warnings.txt", Result.UNSTABLE, REFERENCE_JOB_NAME); enableWarnings(project, recorder -> { recorder.setQualityGates(List.of( new WarningsQualityGate(3, QualityGateType.NEW, QualityGateCriticality.UNSTABLE))); recorder.setEnabledForFailure(true); }); scheduleBuildAndAssertStatus(project, Result.UNSTABLE, analysisResult -> assertThat(analysisResult) .hasTotalSize(6) .hasNewSize(4) .hasQualityGateStatus(QualityGateStatus.WARNING) .hasReferenceBuild(Optional.of(expectedReference))); } /** * Checks if the plugin ignores failed builds if the reference finder is configured accordingly. * * @see #shouldCreateUnstableResultWithOverAllMustBeSuccessWithReferenceBuild */ @Test void shouldUseFailedBuildsIfConfigured() {<!-- --></code></pre>
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>.setTestName("Job should have analysis result if quality gate has a warning (SUCCESS)") .build(), new BuildHistoryBuilder().setExpectedResult(FIRST) .setJobResult(Result.FAILURE) .setQualityGateResult(createResult(QualityGateStatus.INACTIVE)) .setTestName("Job should have analysis result even if quality gate is not active (FAILED)") .build(), new BuildHistoryBuilder().setExpectedResult(FIRST) .setJobResult(Result.FAILURE) .setQualityGateResult(createResult(QualityGateStatus.PASSED)) .setTestName("Job should have analysis result even if quality gate has been passed (FAILED)") .build() ); } /** * Method to provide test element that return a present optional. * * @return list of test data objects */ private static Stream<Arguments> createTestDataForSuccessfulQualityGateAndIgnoredBuildResult() {<!-- --></code></pre>
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>.setTestName("Job should have analysis result if quality gate has a warning (SUCCESS)") .build(), new BuildHistoryBuilder().setExpectedResult(FIRST) .setJobResult(Result.FAILURE) .setQualityGateResult(createResult(QualityGateStatus.INACTIVE)) .setTestName("Job should have analysis result even if quality gate is not active (FAILED)") .build(), new BuildHistoryBuilder().setExpectedResult(FIRST) .setJobResult(Result.FAILURE) .setQualityGateResult(createResult(QualityGateStatus.PASSED)) .setTestName("Job should have analysis result even if quality gate has been passed (FAILED)") .build() ); } /** * Method to provide test element that return a present optional. * * @return list of test data objects */ private static Stream<Arguments> createTestDataForSuccessfulQualityGateAndIgnoredBuildResult() {<!-- --></code></pre>
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>FreeStyleProject project = createJob(JOB_NAME, "eclipse6Warnings.txt", Result.UNSTABLE, REFERENCE_JOB_NAME); enableWarnings(project, recorder -> { recorder.setQualityGates(List.of( new WarningsQualityGate(3, QualityGateType.NEW, QualityGateCriticality.UNSTABLE))); recorder.setEnabledForFailure(true); }); scheduleBuildAndAssertStatus(project, Result.SUCCESS, analysisResult -> assertThat(analysisResult).hasTotalSize(6) .hasNewSize(2) .hasQualityGateStatus(QualityGateStatus.PASSED) .hasReferenceBuild(Optional.of(expectedReference))); } /** * Checks if the reference only looks at the eclipse result of a build and not the overall success. Should return an * unstable result. Uses a different freestyle project for the reference. */ @Test</code></pre>
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>FreeStyleProject project = createJob(JOB_NAME, "eclipse6Warnings.txt", Result.UNSTABLE, REFERENCE_JOB_NAME); enableWarnings(project, recorder -> { recorder.setQualityGates(List.of( new WarningsQualityGate(3, QualityGateType.NEW, QualityGateCriticality.UNSTABLE))); recorder.setEnabledForFailure(true); }); scheduleBuildAndAssertStatus(project, Result.SUCCESS, analysisResult -> assertThat(analysisResult).hasTotalSize(6) .hasNewSize(2) .hasQualityGateStatus(QualityGateStatus.PASSED) .hasReferenceBuild(Optional.of(expectedReference))); } /** * Checks if the reference only looks at the eclipse result of a build and not the overall success. Should return an * unstable result. Uses a different freestyle project for the reference. */ @Test</code></pre>
ci-jenkins-io / CPD
CPD
HIGH:
Found duplicated code.
Raw output
<pre><code>public void setSkipPublishingChecks(final boolean skipPublishingChecks) { this.skipPublishingChecks = skipPublishingChecks; } /** * Sets the scope of the annotations that should be published to SCM checks. * * @param checksAnnotationScope * the scope to use */ @DataBoundSetter public void setChecksAnnotationScope(final ChecksAnnotationScope checksAnnotationScope) { this.checksAnnotationScope = checksAnnotationScope; } public ChecksAnnotationScope getChecksAnnotationScope() { return checksAnnotationScope; } /** * Returns whether all issues should be published using the Checks API. If set to {@code false} only new issues will * be published. * * @return {@code true} if all issues should be published, {@code false} if only new issues should be published * @deprecated use {@link #getChecksAnnotationScope()} instead */ @Deprecated public boolean isPublishAllIssues() { return getChecksAnnotationScope() == ChecksAnnotationScope.ALL; } /** * Returns whether all issues should be published to SCM checks. * * @param publishAllIssues if {@code true} then all issues should be published, otherwise only new issues * @deprecated use {@link #setChecksAnnotationScope(ChecksAnnotationScope)} instead */ @Deprecated @DataBoundSetter public void setPublishAllIssues(final boolean publishAllIssues) { checksAnnotationScope = publishAllIssues ? ChecksAnnotationScope.ALL : ChecksAnnotationScope.NEW; } /** * If {@code true}, then the result of the quality gate is ignored when selecting a reference build. This option is * disabled by default, so a failing quality gate will be passed from build to build until the original reason for * the failure has been resolved. * * @param ignoreQualityGate * if {@code true} then the result of the quality gate is ignored, otherwise only build with a successful * quality gate are selected */ @DataBoundSetter</code></pre>
ci-jenkins-io / CPD
CPD
HIGH:
Found duplicated code.
Raw output
<pre><code>public void setSkipPublishingChecks(final boolean skipPublishingChecks) { this.skipPublishingChecks = skipPublishingChecks; } /** * Sets the scope of the annotations that should be published to SCM checks. * * @param checksAnnotationScope * the scope to use */ @DataBoundSetter public void setChecksAnnotationScope(final ChecksAnnotationScope checksAnnotationScope) { this.checksAnnotationScope = checksAnnotationScope; } public ChecksAnnotationScope getChecksAnnotationScope() { return checksAnnotationScope; } /** * Returns whether all issues should be published using the Checks API. If set to {@code false} only new issues will * be published. * * @return {@code true} if all issues should be published, {@code false} if only new issues should be published * @deprecated use {@link #getChecksAnnotationScope()} instead */ @Deprecated public boolean isPublishAllIssues() { return getChecksAnnotationScope() == ChecksAnnotationScope.ALL; } /** * Returns whether all issues should be published to SCM checks. * * @param publishAllIssues if {@code true} then all issues should be published, otherwise only new issues * @deprecated use {@link #setChecksAnnotationScope(ChecksAnnotationScope)} instead */ @Deprecated @DataBoundSetter public void setPublishAllIssues(final boolean publishAllIssues) { checksAnnotationScope = publishAllIssues ? ChecksAnnotationScope.ALL : ChecksAnnotationScope.NEW; } /** * If {@code true}, then the result of the quality gate is ignored when selecting a reference build. This option is * disabled by default, so a failing quality gate will be passed from build to build until the original reason for * the failure has been resolved. * * @param ignoreQualityGate * if {@code true} then the result of the quality gate is ignored, otherwise only build with a successful * quality gate are selected */ @DataBoundSetter</code></pre>
ci-jenkins-io / CPD
CPD
NORMAL:
Found duplicated code.
Raw output
<pre><code>return new ArrayList<>(sourceDirectories); } /** * Defines the retention strategy for source code files. * * @param sourceCodeRetention * the retention strategy for source code files */ @DataBoundSetter public void setSourceCodeRetention(final SourceCodeRetention sourceCodeRetention) { this.sourceCodeRetention = sourceCodeRetention; } public SourceCodeRetention getSourceCodeRetention() { return sourceCodeRetention; } /** * Returns whether the results for each configured static analysis result should be aggregated into a single result * or if every tool should get an individual result. * * @return {@code true} if the results of each static analysis tool should be aggregated into a single result, * {@code false} if every tool should get an individual result. */ @SuppressWarnings("PMD.BooleanGetMethodName") public boolean getAggregatingResults() { return isAggregatingResults; } @DataBoundSetter public void setAggregatingResults(final boolean aggregatingResults) { isAggregatingResults = aggregatingResults; } /** * Returns whether report logging should be enabled. * * @return {@code true} report logging is disabled * {@code false} report logging is enabled */ public boolean isQuiet() { return quiet; } @DataBoundSetter public void setQuiet(final boolean quiet) { this.quiet = quiet; }</code></pre>
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>assertThat(result).hasTotalSize(1).hasNewSize(0).hasFixedSize(0); assertThat(result.getBlames().contains(SCM_RESOLVER)).isTrue(); FileBlame blame = result.getBlames().getBlame(SCM_RESOLVER); assertThat(blame.getFileName()).isEqualTo(SCM_RESOLVER); assertThat(blame.getEmail(AFFECTED_LINE)).isEqualTo("ullrich.hafner@gmail.com"); assertThat(blame.getCommit(AFFECTED_LINE)).isEqualTo("43dde5d4f7a06122216494a896c51830ed684572"); assertThat(getConsoleLog(result)).contains(</code></pre>
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>assertThat(result).hasTotalSize(1).hasNewSize(0).hasFixedSize(0); assertThat(result.getBlames().contains(SCM_RESOLVER)).isTrue(); FileBlame blame = result.getBlames().getBlame(SCM_RESOLVER); assertThat(blame.getFileName()).isEqualTo(SCM_RESOLVER); assertThat(blame.getEmail(AFFECTED_LINE)).isEqualTo("ullrich.hafner@gmail.com"); assertThat(blame.getCommit(AFFECTED_LINE)).isEqualTo("43dde5d4f7a06122216494a896c51830ed684572"); assertThat(getConsoleLog(result)).contains(</code></pre>
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>.setTestName("Job should have no analysis result if quality gate has a warning (SUCCESS)") .build(), new BuildHistoryBuilder().setExpectedResult(NONE) .setJobResult(Result.FAILURE) .setQualityGateResult(createResult(QualityGateStatus.INACTIVE)) .setTestName("Job should have no analysis result even if quality gate is not active (FAILED)") .build(), new BuildHistoryBuilder().setExpectedResult(NONE) .setJobResult(Result.FAILURE) .setQualityGateResult(createResult(QualityGateStatus.PASSED)) .setTestName("Job should have no analysis result even if quality gate has been passed (FAILED)") .build() ); }</code></pre>
ci-jenkins-io / CPD
CPD
LOW:
Found duplicated code.
Raw output
<pre><code>.setTestName("Job should have no analysis result if quality gate has a warning (SUCCESS)") .build(), new BuildHistoryBuilder().setExpectedResult(NONE) .setJobResult(Result.FAILURE) .setQualityGateResult(createResult(QualityGateStatus.INACTIVE)) .setTestName("Job should have no analysis result even if quality gate is not active (FAILED)") .build(), new BuildHistoryBuilder().setExpectedResult(NONE) .setJobResult(Result.FAILURE) .setQualityGateResult(createResult(QualityGateStatus.PASSED)) .setTestName("Job should have no analysis result even if quality gate has been passed (FAILED)") .build() ); }</code></pre>
ci-jenkins-io / CPD
CPD
NORMAL:
Found duplicated code.
Raw output
<pre><code>return VALIDATION_UTILITIES.validateCharset(sourceCodeEncoding); } /** * Returns a model with all {@link SourceCodeRetention} strategies. * * @return a model with all {@link SourceCodeRetention} strategies. */ @POST @SuppressWarnings("unused") // used by Stapler view data binding public ListBoxModel doFillSourceCodeRetentionItems() { if (JENKINS.hasPermission(Jenkins.READ)) { return SourceCodeRetention.fillItems(); } return new ListBoxModel(); } /** * Returns a model with all available severity filters. * * @return a model with all available severity filters */ @POST public ListBoxModel doFillMinimumSeverityItems() { if (JENKINS.hasPermission(Jenkins.READ)) { return model.getAllSeverityFilters(); } return new ListBoxModel(); } /** * Performs on-the-fly validation of the health report thresholds. * * @param project * the project that is configured * @param healthy * the healthy threshold * @param unhealthy * the unhealthy threshold * * @return the validation result */ @POST public FormValidation doCheckHealthy(@AncestorInPath final BuildableItem project,</code></pre>