<commit_before>var jira = null;
yasoon.app.load("com.yasoon.jira", new function () { //jshint ignore:line
	var self = this;
	jira = this;
	jira.CONST_PULL_RESULTS = 25;
	jira.CONST_LIVE_PAGE_SIZE = 10;

	jira.data = {
		ownUser: null,
		projects: null,
		issueTypes: null
	};

	jira.firstTime = true;
	jira.restartRequired = false;
	var startSync = new Date();
	var ignoreEntriesAtSync = 0;
	var oAuthSuccess = false;
	var liveModeCurrentPageSize = jira.CONST_LIVE_PAGE_SIZE;

	this.lifecycle = function (action, oldVersion, newVersion) {
		if (action === yasoon.lifecycle.Upgrade && newVersion === '1.0.4' && oldVersion[0] !== '1') { //Only to 1.0.4 if we are coming from an really old version (e.g. 0.9.3)
			yasoon.setting.setAppParameter('recentIssues', '[]');
			jira.restartRequired = true;

		}
		if (action === yasoon.lifecycle.Upgrade && newVersion === '1.1.6') {
			var templatesString = yasoon.setting.getAppParameter('createTemplates');
			if (templatesString) {
				var templates = JSON.parse(templatesString);
				templates.forEach(function (t) {
					var proj = t.project;
					t.project = { id: proj.id, name: proj.name, key: proj.key };
				});

				yasoon.setting.setAppParameter('createTemplates', JSON.stringify(templates));
			}

			//Set new initial settings (not strictly nessecary, as extend should add them but we want to have consistent settings)
			var settingsString = yasoon.setting.getAppParameter('settings');
			var settings = null;
			if (settingsString) {
				//Load Settings
				settings = JSON.parse(settingsString);
				settings.syncFeed = true;
				yasoon.setting.setAppParameter('settings', JSON.stringify(settings));
			}
		}

		if (action === yasoon.lifecycle.Upgrade && newVersion === '1.2.3') {
			var settingsString = yasoon.setting.getAppParameter('settings');
			var settings = null;
			if (settingsString) {
				//Load Settings
				settings = JSON.parse(settingsString);
				settings.syncFeed = 'auto';
				yasoon.setting.setAppParameter('settings', JSON.stringify(settings));
			}
		}

		if (action === yasoon.lifecycle.Upgrade && newVersion === '1.5.6') {
			yasoon.setting.setAppParameter('createTemplates', '{}');
			yasoon.setting.setAppParameter('recentIssues', '[]');
		}

		if (action === yasoon.lifecycle.Upgrade && newVersion === '1.7.13') {
			var settingsString = yasoon.setting.getAppParameter('settings');
			var settings = null;
			if (settingsString) {
				//Load Settings
				settings = JSON.parse(settingsString);
				settings.syncFeed = 'off';
				settings.syncTasks = false;
				yasoon.setting.setAppParameter('settings', JSON.stringify(settings));
			}
		}

		jira.downloadScript = true;
	};

	this.init = function init() {
		jira.settings = new JiraSettingController();
		jira.notifications = new JiraNotificationController();
		jira.tasks = new JiraTaskController();
		jira.ribbons = new JiraRibbonController();
		jira.contacts = new JiraContactController();
		jira.icons = new JiraIconController();
		jira.queue = new jiraSyncQueue();
		jira.filter = new JiraFilterController();
		jira.issues = new JiraIssueController();
		jira.cache = {};

		yasoon.addHook(yasoon.setting.HookCreateRibbon, jira.ribbons.createRibbon);
		yasoon.addHook(yasoon.notification.HookRenderNotificationAsync, jira.notifications.renderNotification);
		yasoon.addHook(yasoon.feed.HookCreateUserComment, jira.notifications.addComment);
		yasoon.addHook(yasoon.setting.HookRenderSettingsContainer, jira.settings.renderSettingsContainer);
		yasoon.addHook(yasoon.setting.HookSaveSettings, jira.settings.saveSettings);<commit_msg>Revert custom Migration for FCC<commit_after>var jira = null;
yasoon.app.load("com.yasoon.jira", new function () { //jshint ignore:line
	var self = this;
	jira = this;
	jira.CONST_PULL_RESULTS = 25;
	jira.CONST_LIVE_PAGE_SIZE = 10;

	jira.data = {
		ownUser: null,
		projects: null,
		issueTypes: null
	};

	jira.firstTime = true;
	jira.restartRequired = false;
	var startSync = new Date();
	var ignoreEntriesAtSync = 0;
	var oAuthSuccess = false;
	var liveModeCurrentPageSize = jira.CONST_LIVE_PAGE_SIZE;

	this.lifecycle = function (action, oldVersion, newVersion) {
		if (action === yasoon.lifecycle.Upgrade && newVersion === '1.0.4' && oldVersion[0] !== '1') { //Only to 1.0.4 if we are coming from an really old version (e.g. 0.9.3)
			yasoon.setting.setAppParameter('recentIssues', '[]');
			jira.restartRequired = true;

		}
		if (action === yasoon.lifecycle.Upgrade && newVersion === '1.1.6') {
			var templatesString = yasoon.setting.getAppParameter('createTemplates');
			if (templatesString) {
				var templates = JSON.parse(templatesString);
				templates.forEach(function (t) {
					var proj = t.project;
					t.project = { id: proj.id, name: proj.name, key: proj.key };
				});

				yasoon.setting.setAppParameter('createTemplates', JSON.stringify(templates));
			}

			//Set new initial settings (not strictly nessecary, as extend should add them but we want to have consistent settings)
			var settingsString = yasoon.setting.getAppParameter('settings');
			var settings = null;
			if (settingsString) {
				//Load Settings
				settings = JSON.parse(settingsString);
				settings.syncFeed = true;
				yasoon.setting.setAppParameter('settings', JSON.stringify(settings));
			}
		}

		if (action === yasoon.lifecycle.Upgrade && newVersion === '1.2.3') {
			var settingsString = yasoon.setting.getAppParameter('settings');
			var settings = null;
			if (settingsString) {
				//Load Settings
				settings = JSON.parse(settingsString);
				settings.syncFeed = 'auto';
				yasoon.setting.setAppParameter('settings', JSON.stringify(settings));
			}
		}

		if (action === yasoon.lifecycle.Upgrade && newVersion === '1.5.6') {
			yasoon.setting.setAppParameter('createTemplates', '{}');
			yasoon.setting.setAppParameter('recentIssues', '[]');
		}

		jira.downloadScript = true;
	};

	this.init = function init() {
		jira.settings = new JiraSettingController();
		jira.notifications = new JiraNotificationController();
		jira.tasks = new JiraTaskController();
		jira.ribbons = new JiraRibbonController();
		jira.contacts = new JiraContactController();
		jira.icons = new JiraIconController();
		jira.queue = new jiraSyncQueue();
		jira.filter = new JiraFilterController();
		jira.issues = new JiraIssueController();
		jira.cache = {};

		yasoon.addHook(yasoon.setting.HookCreateRibbon, jira.ribbons.createRibbon);
		yasoon.addHook(yasoon.notification.HookRenderNotificationAsync, jira.notifications.renderNotification);
		yasoon.addHook(yasoon.feed.HookCreateUserComment, jira.notifications.addComment);
		yasoon.addHook(yasoon.setting.HookRenderSettingsContainer, jira.settings.renderSettingsContainer);
		yasoon.addHook(yasoon.setting.HookSaveSettings, jira.settings.saveSettings);
{'fraction_non_alphanumeric': 0.1348513973088866, 'fraction_numerical': 0.007984622209078812, 'mean_word_length': 4.389641434262948, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '201796', 'n_tokens_mistral': 2487, 'n_tokens_neox': 2203, 'n_words': 432}