<commit_before>var _ = require("underscore");
var config = require("../config/config");
var Mousetrap = require("mousetrap");
require("mousetrap/plugins/global-bind/mousetrap-global-bind");
var React = require("react/addons");
var States = require("../constants/States");
var AppCollection = require("../models/AppCollection");
var AppListComponent = require("../components/AppListComponent");
var AboutModalComponent = require("../components/modals/AboutModalComponent");
var AppPageComponent = require("../components/AppPageComponent");
var DeploymentsListComponent =
  require("../components/DeploymentsListComponent");
var NewAppModalComponent = require("../components/NewAppModalComponent");
var TabPaneComponent = require("../components/TabPaneComponent");
var TogglableTabsComponent = require("../components/TogglableTabsComponent");
var NavTabsComponent = require("../components/NavTabsComponent");

var AppsActions = require("../actions/AppsActions");
var DeploymentActions = require("../actions/DeploymentActions");
var DeploymentEvents = require("../events/DeploymentEvents");
var DeploymentStore = require("../stores/DeploymentStore");
var util = require("../helpers/util");

var tabs = [
  {id: "apps", text: "Apps"},
  {id: "deployments", text: "Deployments"}
];

var Marathon = React.createClass({
  displayName: "Marathon",

  propTypes: {
    router: React.PropTypes.object.isRequired
  },

  getInitialState: function () {
    return {
      activeAppId: null,
      activeApp: null,
      activeAppView: null,
      activeTabId: tabs[0].id,
      appVersionsFetchState: States.STATE_LOADING,
      collection: new AppCollection(),
      fetchState: States.STATE_LOADING,
      modalClass: null,
      tasksFetchState: States.STATE_LOADING
    };
  },

  componentWillMount: function () {
    // TODO: That should be handled directly on the NavTabs
    DeploymentStore.on(DeploymentEvents.CHANGE, function () {
      tabs[1].badge = DeploymentStore.deployments.length;
      this.forceUpdate();
    }.bind(this));
  },

  componentDidMount: function () {
    var router = this.props.router;
<commit_msg>Don't rerender if no change on deployments badge<commit_after>var _ = require("underscore");
var config = require("../config/config");
var Mousetrap = require("mousetrap");
require("mousetrap/plugins/global-bind/mousetrap-global-bind");
var React = require("react/addons");
var States = require("../constants/States");
var AppCollection = require("../models/AppCollection");
var AppListComponent = require("../components/AppListComponent");
var AboutModalComponent = require("../components/modals/AboutModalComponent");
var AppPageComponent = require("../components/AppPageComponent");
var DeploymentsListComponent =
  require("../components/DeploymentsListComponent");
var NewAppModalComponent = require("../components/NewAppModalComponent");
var TabPaneComponent = require("../components/TabPaneComponent");
var TogglableTabsComponent = require("../components/TogglableTabsComponent");
var NavTabsComponent = require("../components/NavTabsComponent");

var AppsActions = require("../actions/AppsActions");
var DeploymentActions = require("../actions/DeploymentActions");
var DeploymentEvents = require("../events/DeploymentEvents");
var DeploymentStore = require("../stores/DeploymentStore");
var util = require("../helpers/util");

var tabs = [
  {id: "apps", text: "Apps"},
  {id: "deployments", text: "Deployments"}
];

var Marathon = React.createClass({
  displayName: "Marathon",

  propTypes: {
    router: React.PropTypes.object.isRequired
  },

  getInitialState: function () {
    return {
      activeAppId: null,
      activeApp: null,
      activeAppView: null,
      activeTabId: tabs[0].id,
      appVersionsFetchState: States.STATE_LOADING,
      collection: new AppCollection(),
      fetchState: States.STATE_LOADING,
      modalClass: null,
      tasksFetchState: States.STATE_LOADING
    };
  },

  componentWillMount: function () {
    // TODO: That should be handled directly on the NavTabs
    DeploymentStore.on(DeploymentEvents.CHANGE, function () {
      if (tabs[1].badge !== DeploymentStore.deployments.length) {
        tabs[1].badge = DeploymentStore.deployments.length;
        this.forceUpdate();
      }
    }.bind(this));
  },

  componentDidMount: function () {
    var router = this.props.router;

{'fraction_non_alphanumeric': 0.14443168771526982, 'fraction_numerical': 0.001148105625717566, 'mean_word_length': 4.577464788732394, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1054150', 'n_tokens_mistral': 1257, 'n_tokens_neox': 1232, 'n_words': 248}