<commit_before>window.Cily = window.Cily || {};
Cily.View = Cily.View || {};

(function($) {
	Cily.View.Overview = Backbone.View.extend({

		events: {},

		initialize: function(options) 
		{
			
		},

		render: function() 
		{
			return this;
		}

	});
})(jQuery);<commit_msg>overview view<commit_after>window.Cily = window.Cily || {};
Cily.View = Cily.View || {};

(function($) {
	Cily.View.Overview = Backbone.View.extend({

		events: {},
		template: Tpl.overview.index,
		project: null,

		initialize: function(options)
		{
			var self = this;

			if(typeof Cily.App.Data.Projects == 'undefined' || !Cily.App.Data.Projects.get(this.id))
				this.project = new Cily.Model.Project({ id: 1 });
			else
			{
				this.project = Cily.App.Data.Projects.get(this.id);
				this.render();
			}

			this.project.fetch({ beforeSend: _setHeaders, reset: true });
			this.listenTo(this.project, 'change', this.render);

			this.builds = new Cily.Model.Builds({ project_id: this.project.get('id') });
			this.listenTo(this.builds, 'reset', this.renderBuilds);
			this.builds.fetch({ beforeSend: _setHeaders, reset: true });

			Cily.App.Data.Header.set('projectId', this.project.get('id'));

			setInterval(function() {
				self.builds.fetch({ beforeSend: _setHeaders, reset: true });
			}, 5000);
		},

		renderBuilds: function(data)
		{
			var buildsList = this.$el.find('.overview-project-builds');
			buildsList.empty();
			
			data.each(function(build) {
				var bld = build.toJSON();
				bld.msg = bld.msg || 'Failed';

				if(bld.hash)
					bld.rev = bld.hash.substring(0, 6);

				buildsList.append(new Cily.View.BuildItem({ model: bld }).render().el);
			});
		},

		render: function(project)
		{
			$('.project-title').text(this.project.toJSON().name);
			this.$el.html(this.template( this.project.toJSON() ));
			return this;
		}

	});
})(jQuery);
{'fraction_non_alphanumeric': 0.19014084507042253, 'fraction_numerical': 0.003791982665222102, 'mean_word_length': 3.4292565947242206, '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': '5879102', 'n_tokens_mistral': 781, 'n_tokens_neox': 654, 'n_words': 105}