<commit_before>if (Meteor.isClient) {

	var getSortedKeys = function (obj) {
    var keys = [];
    for (var key in obj) {
			keys.push(key);
  	}
    return keys.sort(function (a,b) {
			return obj[a] - obj[b];
    }).reverse();
	}

	var getSortedValues = function (obj) {
		return _.values(obj).sort(function (a, b) {
			return b - a;
		});
	}

	var getCategoriesCountData = function () {
		var tagCounts = {};
		var contacts = Contacts.find({}).fetch();
		contacts.forEach(function (c) {
			c.tags.forEach(function (t) {
				if (tagCounts[t]) {
					var curCount = tagCounts[t];
					tagCounts[t] = curCount + 1;
				}
				else {
					tagCounts[t] = 1;
				}
			});
		});
		var sortedKeys = getSortedKeys(tagCounts);
		var sortedValues = getSortedValues(tagCounts);
		var rgbaFill = "rgba(123, 45, 131, 1.0)";
		var rgbaHighlight = "rgba(123, 45, 131, 0.75)";
		var data = {
		  labels: sortedKeys,
		  datasets: [
		    {
		      label: "Total Categories",
		      fillColor: rgbaFill,
		      strokeColor: rgbaFill,
		      highlightFill: rgbaHighlight,
		      highlightStroke: rgbaFill,
		      data: sortedValues
		    }
		  ]
		};
		return data;
	}

	var getMonthlyTrendData = function () {
		var rollingMonths = {};
		// Get all contacts that were created withing the last six months
		var endDate = new Date();
		var startDate = new Date(endDate);
		startDate.setMonth(startDate.getMonth() - 6);
		startDate.setDate(1);

		// Initialize values for the past six months
		var dateRange = getDateRange(startDate, endDate);
		dateRange.forEach(function (d) {
			var currentMonth = parseMonth(d);
			if (!rollingMonths[currentMonth]) {
				rollingMonths[currentMonth] = 0;
			}
		});

		var contacts = Contacts.find({
			createdDate: {
				$gte: startDate,
				$lte: endDate
			}
		}, { sort: { createdDate: 1 } }).fetch();
		contacts.forEach(function (c) {
			var createdDate = new Date(c.createdDate);
			var monthName = parseMonth(createdDate);
			if (rollingMonths[monthName]) {
				var curCount = rollingMonths[monthName];
				rollingMonths[monthName] = curCount + 1;
			}
			else {
				rollingMonths[monthName] = 1;
			}
		});

		var rgbaFill = "rgba(123, 45, 131, 0.2)";
		var rgbaHighlight = "rgba(123, 45, 131, 1.0)";
		var data = {
	    labels: _.keys(rollingMonths),
	    datasets: [
        {
          label: "My dataset",
          fillColor: rgbaFill,
          strokeColor: rgbaHighlight,
          pointColor: rgbaHighlight,
          pointStrokeColor: "#fff",
          pointHighlightFill: "#fff",
          pointHighlightStroke: rgbaHighlight,
          data: _.values(rollingMonths)
        }
	    ]
		};
		return data;
	}

	var getMonthlyParticipantCount = function (startDate, endDate) {
		var participants = {
			alex: 0,
			alma: 0,
			eric: 0,
			harrison: 0,
			heidi: 0,
			holly: 0,
			john: 0,
			ryan: 0
		};
		var contacts = Contacts.find({
			createdDate: {
				$gte: startDate,
				$lte: endDate
			}
		}).fetch();
		contacts.forEach(function (c) {
			var email = c.ownerUsername;
			var userName = email.match(/^([^@]*)@/)[1];
			var firstName = userName.split(".")[0];
			if (participants[firstName]) {
				var curCount = participants[firstName];
				participants[firstName] = curCount + 1;
			}
			else {
				participants[firstName] = 1;
			}
		});
		return participants;
	}

	var getPreviousMonthParticipantCount = function (){
		var endDate = new Date();
		var startDate = new Date(endDate);
		startDate.setMonth(startDate.getMonth() - 1);
		startDate.setDate(1);
		return getMonthlyParticipantCount(startDate, endDate);
	}

	var getCurrentMonthParticipantCount = function () {
		var endDate = new Date();
		var startDate = new Date(endDate);
		startDate.setDate(1);
		return getMonthlyParticipantCount(startDate, endDate);
	}

	var getMonthlyParticipantData = function () {
		var currentMonthData = getCurrentMonthParticipantCount();
		var previousMonthData = getPreviousMonthParticipantCount();
		var combinedKeys = _.union(_.keys(previousMonthData), _.keys(currentMonthData));

		var currentRgbaFill = "rgba(123, 45, 131, 1.0)";
		var currentRgbaHighlight = "rgba(123, 45, 131, 0.75)";
		var previousRgbaFill = "rgba(59, 85, 216, 1.0)";
		var previousRgbaHighlight = "rgba(59, 85, 216, 0.75)";

		var endDate = new Date();
		var startDate = new Date(endDate);
		startDate.setMonth(startDate.getMonth() - 1);
		var currentMonthName = parseMonth(endDate);
		var previousMonthName = parseMonth(startDate);

		var data = {
	    labels: combinedKeys,
	    datasets: [
        {
          label: previousMonthName + " " + "participation",
		      fillColor: previousRgbaFill,
		      strokeColor: previousRgbaFill,
		      highlightFill: previousRgbaHighlight,
		      highlightStroke: previousRgbaFill,
          data: _.values(previousMonthData)
        },
        {
          label: currentMonthName + " " + "participation",
		      fillColor: currentRgbaFill,
		      strokeColor: currentRgbaFill,
		      highlightFill: currentRgbaHighlight,
		      highlightStroke: currentRgbaFill,
          data: _.values(currentMonthData)
        }<commit_msg>Fixed another bug issue<commit_after>if (Meteor.isClient) {

	var getSortedKeys = function (obj) {
    var keys = [];
    for (var key in obj) {
			keys.push(key);
  	}
    return keys.sort(function (a,b) {
			return obj[a] - obj[b];
    }).reverse();
	}

	var getSortedValues = function (obj) {
		return _.values(obj).sort(function (a, b) {
			return b - a;
		});
	}

	var getCategoriesCountData = function () {
		var tagCounts = {};
		var contacts = Contacts.find({}).fetch();
		contacts.forEach(function (c) {
			c.tags.forEach(function (t) {
				if (tagCounts[t]) {
					var curCount = tagCounts[t];
					tagCounts[t] = curCount + 1;
				}
				else {
					tagCounts[t] = 1;
				}
			});
		});
		var sortedKeys = getSortedKeys(tagCounts);
		var sortedValues = getSortedValues(tagCounts);
		var rgbaFill = "rgba(123, 45, 131, 1.0)";
		var rgbaHighlight = "rgba(123, 45, 131, 0.75)";
		var data = {
		  labels: sortedKeys,
		  datasets: [
		    {
		      label: "Total Categories",
		      fillColor: rgbaFill,
		      strokeColor: rgbaFill,
		      highlightFill: rgbaHighlight,
		      highlightStroke: rgbaFill,
		      data: sortedValues
		    }
		  ]
		};
		return data;
	}

	var getMonthlyTrendData = function () {
		var rollingMonths = {};
		// Get all contacts that were created withing the last six months
		var endDate = new Date();
		var startDate = new Date(endDate);
		startDate.setMonth(startDate.getMonth() - 6);
		startDate.setDate(1);

		// Initialize values for the past six months
		var dateRange = getDateRange(startDate, endDate);
		dateRange.forEach(function (d) {
			var currentMonth = parseMonth(d);
			if (!rollingMonths[currentMonth]) {
				rollingMonths[currentMonth] = 0;
			}
		});

		var contacts = Contacts.find({
			createdDate: {
				$gte: startDate,
				$lte: endDate
			}
		}, { sort: { createdDate: 1 } }).fetch();
		contacts.forEach(function (c) {
			var createdDate = new Date(c.createdDate);
			var monthName = parseMonth(createdDate);
			if (rollingMonths[monthName]) {
				var curCount = rollingMonths[monthName];
				rollingMonths[monthName] = curCount + 1;
			}
			else {
				rollingMonths[monthName] = 1;
			}
		});

		var rgbaFill = "rgba(123, 45, 131, 0.2)";
		var rgbaHighlight = "rgba(123, 45, 131, 1.0)";
		var data = {
	    labels: _.keys(rollingMonths),
	    datasets: [
        {
          label: "My dataset",
          fillColor: rgbaFill,
          strokeColor: rgbaHighlight,
          pointColor: rgbaHighlight,
          pointStrokeColor: "#fff",
          pointHighlightFill: "#fff",
          pointHighlightStroke: rgbaHighlight,
          data: _.values(rollingMonths)
        }
	    ]
		};
		return data;
	}

	var getMonthlyParticipantCount = function (startDate, endDate) {
		var participants = {
			alex: 0,
			alma: 0,
			eric: 0,
			harrison: 0,
			heidi: 0,
			holly: 0,
			john: 0,
			ryan: 0
		};
		var contacts = Contacts.find({
			createdDate: {
				$gte: startDate.toDate(),
				$lte: endDate.toDate()
			}
		}).fetch();
		contacts.forEach(function (c) {
			var email = c.ownerUsername;
			var userName = email.match(/^([^@]*)@/)[1];
			var firstName = userName.split(".")[0];
			if (_.has(participants, firstName)) {
				var curCount = participants[firstName];
				participants[firstName] = curCount + 1;
			}
		});
		return participants;
	}

	var getPreviousMonthParticipantCount = function (){
		var startDate = moment({hour: 0, minute: 0, seconds: 0, milliseconds: 0}).date(1).subtract(1, "months");
		var endDate = moment().subtract(1, "months").endOf("month");
		return getMonthlyParticipantCount(startDate, endDate);
	}

	var getCurrentMonthParticipantCount = function () {
		var endDate = moment();
		var startDate = moment({hour: 0, minute: 0, seconds: 0, milliseconds: 0}).date(1);
		return getMonthlyParticipantCount(startDate, endDate);
	}

	var getMonthlyParticipantData = function () {
		var currentMonthData = getCurrentMonthParticipantCount();
		var previousMonthData = getPreviousMonthParticipantCount();
		var combinedKeys = _.union(_.keys(previousMonthData), _.keys(currentMonthData));

		var currentRgbaFill = "rgba(123, 45, 131, 1.0)";
		var currentRgbaHighlight = "rgba(123, 45, 131, 0.75)";
		var previousRgbaFill = "rgba(59, 85, 216, 1.0)";
		var previousRgbaHighlight = "rgba(59, 85, 216, 0.75)";

		var endDate = moment();
		var startDate = moment().subtract(1, "months");
		var currentMonthName = parseMonth(endDate);
		var previousMonthName = parseMonth(startDate);

		var data = {
	    labels: combinedKeys,
	    datasets: [
        {
          label: previousMonthName + " " + "participation",
		      fillColor: previousRgbaFill,
		      strokeColor: previousRgbaFill,
		      highlightFill: previousRgbaHighlight,
		      highlightStroke: previousRgbaFill,
          data: _.values(previousMonthData)
        },
        {
          label: currentMonthName + " " + "participation",
		      fillColor: currentRgbaFill,
		      strokeColor: currentRgbaFill,
		      highlightFill: currentRgbaHighlight,
		      highlightStroke: currentRgbaFill,
          data: _.values(currentMonthData)
        }
{'fraction_non_alphanumeric': 0.12979495732365348, 'fraction_numerical': 0.02138722652800942, 'mean_word_length': 3.0500595947556617, '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': '2220717', 'n_tokens_mistral': 4096, 'n_tokens_neox': 3342, 'n_words': 766}