<commit_before>(function () {

  var template = chrome.extension.getURL('box.html');
  var currentDate = function() {
    return new Date().toLocaleDateString('en-US');
  };
  // TODO: Refactor into options
  var LIKES_LIMIT = 10;

  var storage = {
    /**
     * [ASYNC] Retrieve the current like count of the day from storage.
     * @param  callback should be of the form function(likes) {...}
     *                  where likes is the retrieved like count
     */
    getLikes: function (callback) {
      chrome.storage.local.get(currentDate() + '-likes', function(items) {
        console.log("Get Likes: ", items[currentDate() + '-likes']);
        if (items[currentDate() + '-likes']) {
          callback(items[currentDate() + '-likes']);
        } else {
          // return 0 as default value
          callback(0);
        }
      })
    },
    /**
     * [ASYNC] Sets the current like count of the day in storage.
     * @param  callback should be of the form function(likes) {...}
     *                  where likes is the like count
     */
    saveLikes: function (likes, callback) {
      var value = {};
      value[currentDate() + '-likes'] = likes;
      chrome.storage.local.set(value, function() {
        console.log("Save Likes: ", likes);
        callback(likes);
      })
    },
    getTimeSpent: function () {
      var timeSpent = parseInt(localStorage.getItem(currentDate() + '-time-spent'));
      return isNaN(timeSpent) ? 0 : timeSpent;
    },
    saveTimeSpent: function (time) {
      localStorage.setItem(currentDate() + '-time-spent', time);
    }
  };


  var timer = {
    clock: null,
    currentTimeSpent: storage.getTimeSpent(),
    timeFormat: function (totalSeconds) {
      function formatForTen (value) {
        return value < 10 ? '0' + value.toString() : value.toString();
      }
      var hours =  Math.floor(totalSeconds / 3600).toString();
      var totalSeconds = totalSeconds % 3600;<commit_msg>No need to save likes from content script<commit_after>(function () {

  var template = chrome.extension.getURL('box.html');
  var currentDate = function() {
    return new Date().toLocaleDateString('en-US');
  };
  // TODO: Refactor into options
  var LIKES_LIMIT = 10;

  var storage = {
    /**
     * [ASYNC] Retrieve the current like count of the day from storage.
     * @param  callback should be of the form function(likes) {...}
     *                  where likes is the retrieved like count
     */
    getLikes: function (callback) {
      chrome.storage.local.get(currentDate() + '-likes', function(items) {
        console.log("Get Likes: ", items[currentDate() + '-likes']);
        if (items[currentDate() + '-likes']) {
          callback(items[currentDate() + '-likes']);
        } else {
          // return 0 as default value
          callback(0);
        }
      })
    },
    getTimeSpent: function () {
      var timeSpent = parseInt(localStorage.getItem(currentDate() + '-time-spent'));
      return isNaN(timeSpent) ? 0 : timeSpent;
    },
    saveTimeSpent: function (time) {
      localStorage.setItem(currentDate() + '-time-spent', time);
    }
  };


  var timer = {
    clock: null,
    currentTimeSpent: storage.getTimeSpent(),
    timeFormat: function (totalSeconds) {
      function formatForTen (value) {
        return value < 10 ? '0' + value.toString() : value.toString();
      }
      var hours =  Math.floor(totalSeconds / 3600).toString();
      var totalSeconds = totalSeconds % 3600;
{'fraction_non_alphanumeric': 0.13883299798792756, 'fraction_numerical': 0.009198045415349238, 'mean_word_length': 2.438735177865613, 'pattern_counts': {'":': 0, '<': 5, '<?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': '570174', 'n_tokens_mistral': 1063, 'n_tokens_neox': 1023, 'n_words': 264}