<commit_before>var _ = require("underscore");

var TooltipMixin = {
  Tooltip: null,

  init: function () {
    if (!this.Tooltip) {
      this.Tooltip = require("../vendor/tooltip");
    }
  },

  getNewTooltip: function (options = {}) {
    return new this.Tooltip(undefined, options);
  },

  componentWillMount: function () {
    this.init();
  },

  /* eslint-disable camelcase */
  componentDidMount: function () {
    this.tips = {};

    this.tip_attachTips();

    var container = this.getDOMNode();
    container.addEventListener("mousemove", this.tip_handleContainerMouseMove);
  },

  componentDidUpdate: function () {
    this.tip_attachTips();
  },

  componentWillUnmount: function () {
    this.tip_destroyAllTips();
  },

  tip_handleContainerMouseMove: function (e) {
    var el = e.target;

    if (el.dataset && el.dataset.behavior
        && el.dataset.behavior === "show-tip") {
      this.tip_showTip(el);
      el.addEventListener("mouseleave", this.tip_handleMouseLeave);
    }
  },

  tip_handleMouseLeave: function (e) {
    var el = e.target;
    this.tip_hideTip(el);
  },

  tip_attachTips: function () {
    var container = this.getDOMNode();
    var selected = container.querySelectorAll("[data-behavior~=show-tip]");
    var el;
    var found = [];
    var newTips = [];

    for (var i = selected.length - 1; i >= 0; i--) {
      el = selected[i];
      if (el.dataset) {
        if (el.dataset.tipID) {
          found.push(el.dataset.tipID);
        } else if (el.dataset.tipContent) {
          newTips.push(this.tip_createTipForElement(el));
        }
      }
    }
<commit_msg>Break if-statement tests onto separate lines<commit_after>var _ = require("underscore");

var TooltipMixin = {
  Tooltip: null,

  init: function () {
    if (!this.Tooltip) {
      this.Tooltip = require("../vendor/tooltip");
    }
  },

  getNewTooltip: function (options = {}) {
    return new this.Tooltip(undefined, options);
  },

  componentWillMount: function () {
    this.init();
  },

  /* eslint-disable camelcase */
  componentDidMount: function () {
    this.tips = {};

    this.tip_attachTips();

    var container = this.getDOMNode();
    container.addEventListener("mousemove", this.tip_handleContainerMouseMove);
  },

  componentDidUpdate: function () {
    this.tip_attachTips();
  },

  componentWillUnmount: function () {
    this.tip_destroyAllTips();
  },

  tip_handleContainerMouseMove: function (e) {
    var el = e.target;

    if (el.dataset &&
        el.dataset.behavior &&
        el.dataset.behavior === "show-tip") {
      this.tip_showTip(el);
      el.addEventListener("mouseleave", this.tip_handleMouseLeave);
    }
  },

  tip_handleMouseLeave: function (e) {
    var el = e.target;
    this.tip_hideTip(el);
  },

  tip_attachTips: function () {
    var container = this.getDOMNode();
    var selected = container.querySelectorAll("[data-behavior~=show-tip]");
    var el;
    var found = [];
    var newTips = [];

    for (var i = selected.length - 1; i >= 0; i--) {
      el = selected[i];
      if (el.dataset) {
        if (el.dataset.tipID) {
          found.push(el.dataset.tipID);
        } else if (el.dataset.tipContent) {
          newTips.push(this.tip_createTipForElement(el));
        }
      }
    }

{'fraction_non_alphanumeric': 0.1494955671048609, 'fraction_numerical': 0.0012228676245796392, 'mean_word_length': 2.7309007981755986, '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': '7196653', 'n_tokens_mistral': 1078, 'n_tokens_neox': 1051, 'n_words': 191}