@Override
  public void publish(ScannerReportWriter writer) {
    Optional<String> targetBranch = getTargetBranch();
    if (targetBranch.isPresent()) {
      Profiler profiler = Profiler.create(LOG).startInfo(LOG_MSG);
      int count = writeChangedLines(scmConfiguration.provider(), writer, targetBranch.get());
      LOG.debug("SCM reported changed lines for {} {} in the branch", count, ScannerUtils.pluralize("file", count));
      profiler.stopInfo();
    }
  }
@Test
  public void skip_if_scm_provider_returns_null() {
    publisher.publish(writer);
    assertNotPublished();
  }