<commit_before>var gpaCalc = angular.module('gpaCalc', []);


gpaCalc.controller('CalculatorController', function($scope) {
	// scope object for each additionally entered credit
	$scope.credits = credits = [{
		grade: 0,
		credits: 0,
		name: ''
	}];

	// scope object for the starting information
	$scope.start = start = {};
	start.gpa = 0;
	start.credits = 0;

	// object holding computable values for new cumulative GPA
	$scope.cumu = cumu = {};
	cumu.gpa = function() {
		var result;
		result = start.gpa;
		return result || 0;
	};
	cumu.credits = function() {
		var result, newCredits = 0;
		credits.forEach(function(credit) {
			newCredits += credit.credits;
		});
		result = parseFloat(start.credits) + newCredits;
		return result || 0;
	};

	$scope.deltaGPA = function() {
		return cumu.gpa() - start.gpa;
	};<commit_msg>app is now test compliant<commit_after>var gpaCalc = angular.module('gpaCalc', []);


gpaCalc.controller('CalculatorController', function($scope) {
	// scope object for each additionally entered credit
	$scope.credits = credits = [];

	// scope object for the starting information
	$scope.start = start = {};
	start.gpa = 0;
	start.credits = 0;

	// object holding computable values for new cumulative GPA
	$scope.cumu = cumu = {};
	cumu.gpa = function() {
		var result;
		var newGradePoints = 0, numCredits = start.credits;
		credits.forEach(function(credit) {
			newGradePoints += credit.grade * credit.credits;
			numCredits += credit.credits;
		});
		var startGradePoints = start.gpa * start.credits;
		result = (startGradePoints + newGradePoints) / numCredits;
		return result || 0;
	};
	cumu.credits = function() {
		var result, newCredits = 0;
		credits.forEach(function(credit) {
			newCredits += credit.credits;
		});
		result = start.credits + newCredits;
		return result || 0;
	};

	$scope.deltaGPA = function() {
		return cumu.gpa() - start.gpa;
	};

	$scope.addCredit = function() {
		credits.push({
			grade: 0,
			credits: 0.5,
			name: ''
		});
	};
{'fraction_non_alphanumeric': 0.1445057701956849, 'fraction_numerical': 0.008028098344204716, 'mean_word_length': 3.68075117370892, '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': '279207', 'n_tokens_mistral': 769, 'n_tokens_neox': 683, 'n_words': 164}