Source:
<code><START> public void perform(@Nonnull Run<?, ?> run, @Nonnull FilePath workspace, @Nonnull Launcher launcher, <END> @Nonnull TaskListener listener) throws InterruptedException, IOException { PrintStream listenerLogger = listener.getLogger(); String publishedURL = getTriggerDescriptor().getJenkinsURL(); if (getStatusVerifier() != null && !getStatusVerifier().isRunAllowed(run)) { return; } if (publishedURL != null && !publishedURL.isEmpty()) { GHCommitState state = getCommitState(run, unstableAs); GitHubPRCause c = run.getCause(GitHubPRCause.class); String statusMsgValue = getStatusMsg().expandAll(run, listener); String buildUrl = publishedURL + run.getUrl(); LOGGER.info("Setting status of to with url and message: {}", c.getHeadSha(), state, buildUrl, statusMsgValue); try { final GitHubPRTrigger trigger = JobInfoHelpers.triggerFrom(run.getParent(), GitHubPRTrigger.class); if (trigger == null) { return; } trigger.getRemoteRepo().createCommitStatus(c.getHeadSha(), state, buildUrl, statusMsgValue, run.getParent().getFullName()); } catch (IOException ex) { if (buildMessage != null) { String comment = null; LOGGER.error("Could not update commit status of the Pull Request on GitHub. ", ex); if (state == GHCommitState.SUCCESS) { comment = buildMessage.getSuccessMsg().expandAll(run, listener); } else if (state == GHCommitState.FAILURE) { comment = buildMessage.getFailureMsg().expandAll(run, listener); } listenerLogger.println("Adding comment..."); LOGGER.info("Adding comment, because: ", ex); addComment(c.getNumber(), comment, run, listener); } else { listenerLogger.println("Could not update commit status of the Pull Request on GitHub." + ex.getMessage()); LOGGER.error("Could not update commit status of the Pull Request on GitHub.", ex); } handlePublisherError(run); } } }</code><technical_language>![MAJOR](<LINK_0> Cyclomatic Complexity of this method "perform" is 13 is greater 10 authorized. [![rule](<LINK_1>](<LINK_2></technical_language>

Target:
public void perform(@Nonnull Run<?, ?> run, @Nonnull FilePath workspace, @Nonnull Launcher launcher, @Nonnull TaskListener listener) throws InterruptedException, IOException { PrintStream listenerLogger = listener.getLogger(); String publishedURL = getTriggerDescriptor().getJenkinsURL(); if (getStatusVerifier() != null && !getStatusVerifier().isRunAllowed(run)) { return; } if (publishedURL == null || publishedURL.isEmpty()) { return; } GHCommitState state = getCommitState(run, unstableAs); GitHubPRCause c = run.getCause(GitHubPRCause.class); String statusMsgValue = getStatusMsg().expandAll(run, listener); String buildUrl = publishedURL + run.getUrl(); LOGGER.info("Setting status of to with url and message: {}", c.getHeadSha(), state, buildUrl, statusMsgValue); final GitHubPRTrigger trigger = JobInfoHelpers.triggerFrom(run.getParent(), GitHubPRTrigger.class); if (trigger == null) { return; } try { trigger.getRemoteRepo().createCommitStatus(c.getHeadSha(), state, buildUrl, statusMsgValue, run.getParent().getFullName()); } catch (IOException ex) { if (buildMessage != null) { String comment = null; LOGGER.error("Could not update commit status of the Pull Request on GitHub. ", ex); if (state == GHCommitState.SUCCESS) { comment = buildMessage.getSuccessMsg().expandAll(run, listener); } else if (state == GHCommitState.FAILURE) { comment = buildMessage.getFailureMsg().expandAll(run, listener); } listenerLogger.println("Adding comment..."); LOGGER.info("Adding comment, because: ", ex); addComment(c.getNumber(), comment, run, listener); } else { listenerLogger.println("Could not update commit status of the Pull Request on GitHub." + ex.getMessage()); LOGGER.error("Could not update commit status of the Pull Request on GitHub.", ex); } handlePublisherError(run); } }