<commit_before>var Pmdr = Pmdr || {};


Pmdr.App = (function(Models, Views, utils) {
    var createTimer = function() {
        var data = JSON.parse(localStorage.getItem('timer'));
        var timer = new Models.Timer(data);
        var startedAt = timer.get('startedAt');
        if (timer.get('isStarted')) {
            var delta = (Date.now() - startedAt) / 1000;
            if (delta > 0) {
                var newDuration = parseInt(timer.get('duration') - delta, 10);
                timer.start({duration: newDuration});
            }
        }
        return timer;
    };

    var run = function() {
        var pomodoros = new Models.Pomodoros();
        var pomodorosView = new Views.PomodorosView({collection: pomodoros});
        pomodoros.fetch();

        var timer = createTimer();

        var countdownView = new Views.CountdownView({<commit_msg>parsing json catching exception<commit_after>var Pmdr = Pmdr || {};


Pmdr.App = (function(Models, Views, utils) {
    var createTimer = function() {
        var data;
        try {
            data = JSON.parse(localStorage.getItem('timer'));
        } catch(SyntaxError) {
            data = null;
            localStorage.removeItem('timer');
        }

        var timer = new Models.Timer(data);
        var startedAt = timer.get('startedAt');
        if (timer.get('isStarted')) {
            var delta = (Date.now() - startedAt) / 1000;
            if (delta > 0) {
                var newDuration = parseInt(timer.get('duration') - delta, 10);
                timer.start({duration: newDuration});
            }
        }
        return timer;
    };

    var run = function() {
        var pomodoros = new Models.Pomodoros();
        var pomodorosView = new Views.PomodorosView({collection: pomodoros});
        pomodoros.fetch();

        var timer = createTimer();

        var countdownView = new Views.CountdownView({
{'fraction_non_alphanumeric': 0.13020558777016342, 'fraction_numerical': 0.007380073800738007, 'mean_word_length': 2.0368, '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': '863332', 'n_tokens_mistral': 582, 'n_tokens_neox': 538, 'n_words': 126}