third_party/pipeline/pipeline/ui/status.js
function countChildren(pipelineId) {
  var current = STATUS_MAP.pipelines[pipelineId];
  if (!current) {
    return [0, 0];
  }
  var total = 1;
  var done = 0;
  if (current.status == 'done') {
    done += 1;
  }
  for (var i = 0, n = current.children.length; i < n; i++) {
    var parts = countChildren(current.children[i]);
    total += parts[0];
    done += parts[1];
  }
  return [total, done];
}
function countChildren(pipelineId) {
  var current = STATUS_MAP.pipelines[pipelineId];
  if (!current) {
    return [0, 0];
  }
  var total = 1;
  var done = 0;
  if (current.status == 'done') {
    done += 1;
  }
  for (var i = 0, n = current.children.length; i < n; i++) {
    var parts = countChildren(current.children[i]);
    total += parts[0];
    done += parts[1];
  }
  return [total, done];
}
function countChildren ( pipelineId ) { var current = STATUS_MAP . pipelines [ pipelineId ] ; if ( ! current ) { return [ 0 , 0 ] ; } var total = 1 ; var done = 0 ; if ( current . status == 'done' ) { done += 1 ; } for ( var i = 0 , n = current . children . length ; i < n ; i ++ ) { var parts = countChildren ( current . children [ i ] ) ; total += parts [ 0 ] ; done += parts [ 1 ] ; } return [ total , done ] ; }
Counts the number of total and active children for the given pipeline. Will include the supplied pipeline in the totals.
Counts the number of total and active children for the given pipeline . Will include the supplied pipeline in the totals .