original_string: public function reduceArchiveRowName($name)
      {
          // all 'done...' fields are considered the same
          if (strpos($name, 'done') === 0) {
              return 'done';
          }
  
          // check for goal id, if present (Goals_... reports should not be reduced here, just Goal_... ones)
          if (preg_match("/^Goal_(?:-?[0-9]+_)?(.*)/", $name, $matches)) {
              $name = "Goal_*_" . $matches[1];
          }
  
          // remove subtable id suffix, if present
          if (preg_match("/^(.*)_[0-9]+$/", $name, $matches)) {
              $name = $matches[1] . "_*";
          }
  
          return $name;
      }
code: public function reduceArchiveRowName($name)
      {
          // all 'done...' fields are considered the same
          if (strpos($name, 'done') === 0) {
              return 'done';
          }
  
          // check for goal id, if present (Goals_... reports should not be reduced here, just Goal_... ones)
          if (preg_match("/^Goal_(?:-?[0-9]+_)?(.*)/", $name, $matches)) {
              $name = "Goal_*_" . $matches[1];
          }
  
          // remove subtable id suffix, if present
          if (preg_match("/^(.*)_[0-9]+$/", $name, $matches)) {
              $name = $matches[1] . "_*";
          }
  
          return $name;
      }
code_tokens: public function reduceArchiveRowName ( $ name ) { // all 'done...' fields are considered the same if ( strpos ( $ name , 'done' ) === 0 ) { return 'done' ; } // check for goal id, if present (Goals_... reports should not be reduced here, just Goal_... ones) if ( preg_match ( "/^Goal_(?:-?[0-9]+_)?(.*)/" , $ name , $ matches ) ) { $ name = "Goal_*_" . $ matches [ 1 ] ; } // remove subtable id suffix, if present if ( preg_match ( "/^(.*)_[0-9]+$/" , $ name , $ matches ) ) { $ name = $ matches [ 1 ] . "_*" ; } return $ name ; }
docstring: Reduces the given metric name. Used to simplify certain reports.
  
  Some metrics, like goal metrics, can have different string names. For goal metrics,
  there's one name per goal ID. Grouping metrics and reports like these together
  simplifies the tables that display them.
  
  This function makes goal names, 'done...' names and names of the format .*_[0-9]+
  equivalent.
docstring_tokens: Reduces the given metric name . Used to simplify certain reports .