<commit_before>var BrowserPerfRunnerApp = React.createClass({

  propTypes: {
    tests: React.PropTypes.array.isRequired,
    react: React.PropTypes.array.isRequired,
    maxTime: React.PropTypes.number,
    onCompleteEach: React.PropTypes.func,
    onComplete: React.PropTypes.func,
    onError: React.PropTypes.func,
    headless: React.PropTypes.bool
  },

  getInitialState: function() {
    var queue = [];
    this.props.tests.forEach(function(testName) {
      this.props.react.forEach(function(version) {
        queue.push({
          test: testName,
          react: version
        });
      }, this);
    }, this);
    return {
      queue: queue,
      results: {}
    };
  },

  handleResults: function(results) {
    this.state.results[results.test + '@' + results.react] = results;
    this.replaceState(this.state);
  },

  handleComplete: function(queueItem) {
    queueItem.completed = true;

    if (!this.props.onCompleteEach) {
      return;
    }
    // Can't get the resultsForAllVersions if there are still some queued
    var incompleteCount = 0;
    for (var index = this.state.queue.length; --index >= 0;) {
      if (this.state.queue[index].completed) {
        continue;
      }
      if (this.state.queue[index].test === queueItem.test) {
        return;
      }
      incompleteCount++;
    }
    var resultsForAllVersions = Object.keys(this.state.results)
      .filter(function(key) {
        return key.indexOf(queueItem.test) === 0;
      })
      .map(function(key) {
          return this.state.results[key];
      }, this);
    this.props.onCompleteEach(resultsForAllVersions);

    if (this.props.onComplete && incompleteCount === 0) {
      this.props.onComplete(this.state.results);
    }
  },<commit_msg>fix linting<commit_after>var BrowserPerfRunnerApp = React.createClass({

  propTypes: {
    tests: React.PropTypes.array.isRequired,
    react: React.PropTypes.array.isRequired,
    maxTime: React.PropTypes.number,
    onCompleteEach: React.PropTypes.func,
    onComplete: React.PropTypes.func,
    onError: React.PropTypes.func,
    headless: React.PropTypes.bool
  },

  getInitialState: function() {
    var queue = [];
    this.props.tests.forEach(function(testName) {
      this.props.react.forEach(function(version) {
        queue.push({
          test: testName,
          react: version
        });
      }, this);
    }, this);
    return {
      queue: queue,
      results: {}
    };
  },

  handleResults: function(results) {
    this.state.results[results.test + '@' + results.react] = results;
    this.replaceState(this.state);
  },

  handleComplete: function(queueItem) {
    queueItem.completed = true;

    if (!this.props.onCompleteEach) {
      return;
    }
    // Can't get the resultsForAllVersions if there are still some queued
    var incompleteCount = 0;
    for (var index = this.state.queue.length; --index >= 0;) {
      if (this.state.queue[index].completed) {
        continue;
      }
      if (this.state.queue[index].test === queueItem.test) {
        return;
      }
      incompleteCount++;
    }
    var resultsForAllVersions = Object.keys(this.state.results)
      .filter(function(key) {
        return key.indexOf(queueItem.test) === 0;
      })
      .map(function(key) {
        return this.state.results[key];
      }, this);
    this.props.onCompleteEach(resultsForAllVersions);

    if (this.props.onComplete && incompleteCount === 0) {
      this.props.onComplete(this.state.results);
    }
  },
{'fraction_non_alphanumeric': 0.13402061855670103, 'fraction_numerical': 0.002290950744558992, 'mean_word_length': 2.6084710743801653, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6256106', 'n_tokens_mistral': 1106, 'n_tokens_neox': 1073, 'n_words': 185}