<commit_before>(function($){
	
	var patt = new RegExp(".*web","g");
	var $host = patt.exec(window.location.pathname) + "/data/popup_cordova_plugin_contacts.json";
	
	var Flows = new function() {
		
		var contents=$("#contents");
		
		
		var margins={left:170,top:10,right:170,bottom:0,padding:{left:0,right:0}},
			box_w=10,
			step=10;
		
		var canvas={},
			ctx={};
		
		var processing=false;
		
		var datamovin={};
		var vertical=true;
		var colors=new Colors();
		
		var last=null,
			previous=null;
		
		this.init=function(){
			initDOM();
			if(support_canvas()){
				var ua = navigator.userAgent;
				var isiOS = /iPad/i.test(ua) || /iPhone/i.test(ua) || /iPhone OS 3_1_2/i.test(ua) || /iPhone OS 3_2_2/i.test(ua);
				
				step=($.browser.msie||isiOS)?8:4;
				(function getMigration(){
					$.ajax({
						url:$host,
						data:{
							i:isiOS?1:0,
							ie:$.browser.msie && (typeof WebSocket == "undefined")?1:0
						},
						type:'GET',
						dataType: 'json',
						success: function(json) {
							//----------------------------------------------------------------------------------------
							var k = 1;
							var htmltopdev = "";
							var htmltopmod = "";
							var topDev = new Array();
							var topMod = new Array();

							for (var entity in json) {
								if (entity.substring(0,1) == "D") {
									topDev.push( [entity, json[entity]["properties"]["NBC"]] );
								}
								else if (entity.substring(0,1) == "M") {
									topMod.push( [entity, json[entity]["properties"]["NBC"]] );
								}
							}

							topDev = topDev.sort(function(a,b){return b[1]-a[1]});
							topMod = topMod.sort(function(a,b){return b[1]-a[1]});
							for (var key in topDev) {
								if (k==11) {
									htmltopdev += '</ul><ul class="hidden">';
								}
								if (typeof topDev[key][0] != 'undefined') {
									htmltopdev += '<li class="p' + k%2 + '">'
									    + '<a class="clickable" href="#t_' + topDev[key][0] + '" id="to_' + topDev[key][0] + '" class="il">'
									    + '<span class="name">' + mapping[topDev[key][0]] + '</span>'
										+ '<span class="val">' + topDev[key][1] + '</span>'
										+ '</a>'
										+ '</li>';
									k++;
								}
							}

							k=1;
							for (var key in topMod) {
								if (k==11) {
									htmltopmod += '</ul><ul class="hidden">';
								}
								if (typeof topMod[key][0] != 'undefined') {
									htmltopmod += '<li class="p' + k%2 + '">'
									    + '<a class="clickable" href="#f_' + topMod[key][0] + '" id="from_' + topMod[key][0] + '" class="il">'
									    + '<span class="name">' + mapping[topMod[key][0]] + '</span>'
										+ '<span class="val">' + topMod[key][1] + '</span>'
										+ '</a>'
										+ '</li>';
									k++;
								}
							}

							$('#topdev').html(htmltopdev);
							$('#topmod').html(htmltopmod);
							//----------------------------------------------------------------------------------------

							flowsJson = new Object();
							for (var dev in json) {
								if (dev.substring(0,1) == "M") {
									var flows = new Object();
									flows["flows"] = json[dev]["properties"]["relations"];
									for (var val in flows["flows"]) {
										flows["flows"][val] = Math.round(flows["flows"][val]/10);
									}
									flowsJson[dev] = flows;
								}
							}
							json = flowsJson;
							

                        	datamovin=new DataMovin();
                        	if(datamovin.init("flows",{flows:json,margins:margins,orientation:'vertical',labels:mapping})) {<commit_msg>Fixed links actions in global infos<commit_after>(function($){
	
	var patt = new RegExp(".*web","g");
	var $host = patt.exec(window.location.pathname) + "/data/popup_cordova_plugin_contacts.json";
	
	var Flows = new function() {
		
		var contents=$("#contents");
		
		
		var margins={left:170,top:10,right:170,bottom:0,padding:{left:0,right:0}},
			box_w=10,
			step=10;
		
		var canvas={},
			ctx={};
		
		var processing=false;
		
		var datamovin={};
		var vertical=true;
		var colors=new Colors();
		
		var last=null,
			previous=null;
		
		this.init=function(){
			initDOM();
			if(support_canvas()){
				var ua = navigator.userAgent;
				var isiOS = /iPad/i.test(ua) || /iPhone/i.test(ua) || /iPhone OS 3_1_2/i.test(ua) || /iPhone OS 3_2_2/i.test(ua);
				
				step=($.browser.msie||isiOS)?8:4;
				(function getMigration(){
					$.ajax({
						url:$host,
						data:{
							i:isiOS?1:0,
							ie:$.browser.msie && (typeof WebSocket == "undefined")?1:0
						},
						type:'GET',
						dataType: 'json',
						success: function(json) {
							//----------------------------------------------------------------------------------------
							var k = 1;
							var htmltopdev = "";
							var htmltopmod = "";
							var topDev = new Array();
							var topMod = new Array();

							for (var entity in json) {
								if (entity.substring(0,1) == "D") {
									topDev.push( [entity, json[entity]["properties"]["NBC"]] );
								}
								else if (entity.substring(0,1) == "M") {
									topMod.push( [entity, json[entity]["properties"]["NBC"]] );
								}
							}

							topDev = topDev.sort(function(a,b){return b[1]-a[1]});
							topMod = topMod.sort(function(a,b){return b[1]-a[1]});
							for (var key in topDev) {
								if (k==11) {
									htmltopdev += '</ul><ul class="hidden">';
								}
								if (typeof topDev[key][0] != 'undefined') {
									htmltopdev += '<li class="p' + k%2 + '">'
									    + '<a class="clickable" href="#t_' + topDev[key][0] + '" id="to_' + topDev[key][0] + '" class="il">'
									    + '<span class="name">' + mapping[topDev[key][0]] + '</span>'
										+ '<span class="val">' + topDev[key][1] + '</span>'
										+ '</a>'
										+ '</li>';
									k++;
								}
							}

							k=1;
							for (var key in topMod) {
								if (k==11) {
									htmltopmod += '</ul><ul class="hidden">';
								}
								if (typeof topMod[key][0] != 'undefined') {
									htmltopmod += '<li class="p' + k%2 + '">'
									    + '<a class="clickable" href="#f_' + topMod[key][0] + '" id="from_' + topMod[key][0] + '" class="il">'
									    + '<span class="name">' + mapping[topMod[key][0]] + '</span>'
										+ '<span class="val">' + topMod[key][1] + '</span>'
										+ '</a>'
										+ '</li>';
									k++;
								}
							}

							$('#topdev').html(htmltopdev);
							$('#topmod').html(htmltopmod);

							$(".par ul li a").click(function(e){
								e.preventDefault();
								if($("#contents").css("opacity")==1) {
									var entity=this.id.split("_");
									
									if(entity[0]=='from') {
										datamovin.drawOutFlow(entity[1],true);
										showEntityInfo(datamovin.getPointInfo(entity[1],'src'),null,true);
									} else if(entity[0]=='to') {
										datamovin.drawInFlow(entity[1],true);
										showEntityInfo(datamovin.getPointInfo(entity[1],'dst'),null,true);
									} else {
										datamovin.drawFlowFromTo(entity[1],entity[2],true);
										showEntityInfo(datamovin.getPointInfo(entity[1],'src'),entity[2],true);
									}
														
									window.location.hash=this.href.split("#")[1];

								} else {
									$("#contents").click();
								}
								return false;
							});
							//----------------------------------------------------------------------------------------

							flowsJson = new Object();
							for (var dev in json) {
								if (dev.substring(0,1) == "M") {
									var flows = new Object();
									flows["flows"] = json[dev]["properties"]["relations"];
									for (var val in flows["flows"]) {
										flows["flows"][val] = Math.round(flows["flows"][val]/10);
									}
									flowsJson[dev] = flows;
								}
							}
							json = flowsJson;
							

                        	datamovin=new DataMovin();
                        	if(datamovin.init("flows",{flows:json,margins:margins,orientation:'vertical',labels:mapping})) {
{'fraction_non_alphanumeric': 0.2409486564904756, 'fraction_numerical': 0.015895042260628232, 'mean_word_length': 1.861060988812703, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 43, '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': '4149446', 'n_tokens_mistral': 3933, 'n_tokens_neox': 2611, 'n_words': 450}